Imported from xuelin-wang/xagent-p (
AGENTS.md). Install upstream withnpx skills add xuelin-wang/xagent-p. Copyright stays with the author.
Agent Instructions
Project Orientation
Before major design, refactoring, or implementation work:
- Read
mementum/state.md. - Search
mementum/knowledge/for relevant design context. - Search
mementum/memories/for known pitfalls or prior lessons. - Inspect the actual code before making changes.
- Prefer small, testable changes over broad rewrites.
For trivial edits, reading all memory is not required. For architectural, cross-cutting, or ambiguous work, project memory should be consulted first.
Project Memory
This repository uses a Mementum-style project memory layer under mementum/.
Project memory is organized in three tiers:
| Location | What goes here |
|---|---|
mementum/drafts/ |
Raw thinking, meeting notes, AI-human back-and-forth, working drafts, proposals under review |
mementum/knowledge/ |
Approved, final, maintained design documents |
mementum/memories/ |
Short durable lessons and pitfalls (one insight per file) |
Project memory is not for:
- secrets
- credentials
- personal data
- customer data
- production data
- raw logs
- runtime application records
- large generated artifacts
Memory Update Rule
When a durable project lesson is learned, propose an update to mementum/.
Good candidates:
- a design decision was made
- a previous assumption was corrected
- a bug revealed a reusable lesson
- a convention became important
- a workflow should be repeated
- an implementation pitfall should be avoided
- an open question was resolved
Do not add memory for routine edits, temporary details, obvious facts, or sensitive data.
Reusable Workflow Prompts
Reusable prompts for common coding-agent workflows live under prompts/.
Project-memory maintenance workflows live under the repo-local skills/mementum-memory/ skill.
Use them when appropriate:
prompts/workflows/orient-repo.mdprompts/workflows/implement-feature.mdprompts/workflows/fix-bug.mdprompts/workflows/refactor-code.mdprompts/workflows/generate-changelog.mdprompts/reviews/review-current-branch.mdprompts/reviews/review-pr-risk.mdprompts/reviews/compare-branches.mdprompts/reviews/security-review.mdprompts/reviews/test-coverage-review.md
If a workflow prompt proves useful and reusable, update it in prompts/ rather than leaving it only in chat history.
If a project-memory maintenance workflow changes, update skills/mementum-memory/ rather than duplicating it under prompts/.
Implementation Principles
- Understand existing code before changing it.
- Preserve existing behavior unless explicitly asked to change it.
- Keep changes minimal and focused.
- Add or update tests when behavior changes.
- Separate facts from assumptions.
- Record important design rationale in project memory.
- Do not treat project memory as a substitute for tests, schemas, or enforceable configuration.
If Instructions Conflict
Follow this priority order:
- Explicit user request
- Safety/security constraints
- More specific repository instructions
mementum/project memory- General best practices
If conflict remains, explain the conflict and choose the safest minimal path.
Skill Improvement Feedback
When using a project skill, notice whether the skill instructions helped or caused friction.
After completing the main task, briefly mention any evidence-based skill improvement only if it would prevent repeated future issues.
Do not automatically edit skills.
When suggesting a skill update, provide:
- The observed issue
- The proposed change
- The file to update
- A concise patch
- Any risk of overfitting
Only update the skill after explicit user approval.
