Agent skill
project-learnings
Captures project-specific patterns and anti-patterns into the project's CLAUDE.md. Loaded by other skills (bug-killer, feature-dev, etc.) when they discover project-specific knowledge worth encoding for future sessions.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/project-learnings-sequenzia-agent-alchemy-5
SKILL.md
Project Learnings
Capture project-specific patterns and anti-patterns into the project's configuration file (e.g., CLAUDE.md or equivalent). This creates a self-improving feedback loop where discoveries from debugging, development, and review make future sessions smarter.
Only project-specific knowledge qualifies. Generic programming advice does not belong in the project configuration.
Step 1: Evaluate Discovery
Determine if the finding qualifies as project-specific. The finding must pass at least ONE of these criteria:
| Criteria | Example That Qualifies | Example That Doesn't |
|---|---|---|
| Would a developer unfamiliar with this project likely hit this issue? | "The processOrder() function expects amounts in cents, not dollars" |
"Always validate function inputs" |
| Is this pattern specific to this codebase's architecture, APIs, or conventions? | "The UserProfile type has an optional metadata field that is always present at runtime" |
"Use TypeScript strict mode" |
| Is it something training data wouldn't cover? | "Never call db.query() without the timeout option -- the default is infinite" |
"Use async/await instead of callbacks" |
If NO to all criteria, STOP. Do not add generic programming knowledge. Return to the calling skill and report that no project-specific learning was found.
If YES to any, proceed to Step 2.
Step 2: Read Existing Configuration
-
Find the project's configuration file:
- Check the repository root first for CLAUDE.md or equivalent
- If not found, check if there is a project-level
.agents/directory
-
Parse existing content:
- Understand the existing structure, headings, and conventions
- Look for sections where this learning would fit (e.g., "Known Gotchas", "Bug Patterns", "Conventions", "Known Challenges")
- Check for duplicate or similar entries already present
-
If a similar entry already exists, STOP. Report to the calling skill that this knowledge is already captured. Do not create duplicates.
-
Identify placement:
- If an appropriate section exists, plan to add the entry there
- If no appropriate section exists, plan to propose a new section (e.g.,
## Known Gotchasor## Project-Specific Patterns) - New sections should be placed after the main documentation sections but before appendices or settings
Step 3: Format the Learning
Write a concise, actionable instruction following these rules:
Format:
- Use imperative form: "Always validate X before calling Y"
- Include the WHY: "...because the API returns dates as strings, not Date objects"
- Keep it to 1-3 lines
- Follow the existing configuration file style and conventions
Templates:
For bug patterns:
- **[Area/Component]**: [What to do/avoid] -- [why, with specific details]
For API gotchas:
- `functionName()` in `path/to/file`: [What's surprising about it] -- [consequence if ignored]
For architectural constraints:
- [Constraint description] -- [why it exists and what breaks if violated]
Examples of well-formatted learnings:
- Order processing: Always multiply amounts by 100 before passing to
processOrder()-- it expects cents, not dollars db.query()insrc/database.ts: Always pass thetimeoutoption -- the default is infinite and has caused production hangs (30 second timeout recommended)- Never import from
internal/directories insrc/api/-- the build system treats these as separate compilation units and circular dependencies will silently break HMR
Step 4: Confirm with User
Prompt the user to review the proposed addition.
Show:
- The exact text to be added
- Where it will be placed in the configuration file (section name, after which line/entry)
- Why this qualifies as project-specific
Prompt the user to choose:
- Add this -- Write the entry as proposed
- Edit before adding -- User provides modified text, then write that instead
- Skip -- Do not add anything, return to calling skill
Step 5: Write Update
If the user confirmed (or provided edited text):
- Modify the configuration file to add the entry at the identified location
- If a new section was needed, create the section heading first
- Verify the edit was applied correctly by reading the modified area
- Report success to the calling skill with a summary of what was added
If the user chose "Skip":
- Report to the calling skill that the learning was declined
- Do not modify any files
Integration Notes
This skill requires the following capabilities:
- File reading: Reading the project configuration file and checking for existing entries
- File editing: Adding entries to the configuration file
- User interaction: Confirming proposed additions before writing
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?