Capture and reuse codebase learnings to avoid repeating implementation and review mistakes.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "harness-learnings" skill from askskill: 1. Download https://raw.githubusercontent.com/microsoft/devsquad-copilot/main/.github/plugins/devsquad/skills/harness-learnings/SKILL.md 2. Save it as ~/.claude/skills/harness-learnings/SKILL.md 3. Reload skills and tell me it's ready
Please turn this integration test prerequisite into a reusable learning: database migrations must run before loading test seed data, otherwise foreign key errors occur. Output one learning record suitable for future implementation and verification checks.
A clear learning record describing when it applies, prerequisite steps, common failure, and how to use it later.
I’m about to change the refund flow in the payments module. First, check for existing codebase learnings related to payment state machines, idempotency handling, and audit logs, then summarize them as a pre-implementation checklist.
A pre-implementation checklist summarizing relevant learnings, cautions, and established patterns to follow.
This code review again found controllers accessing the database directly and bypassing the service layer. Please capture this recurring issue as a codebase learning, including the anti-pattern, recommended approach, and scope.
A reusable review learning that clearly states the anti-pattern, correct implementation approach, and future review checkpoints.
Agent sessions are ephemeral. Codebase knowledge is not. When an agent discovers a pattern through trial and error (failed tests, correction loops, review findings), that knowledge should persist so the next session starts smarter.
This skill has two modes: capture (write a learning) and consult (read learnings relevant to the current task).
Capture is auto-prompted by the lifecycle agents at trigger moments where the agent has likely done something that future sessions should know about. The auto-prompt sites are:
devsquad.implement.execute after self-correction loops (2+ correction
attempts, reverts of own work, max-attempt exhaustion)devsquad.implement.verify after discovering a test or build prerequisite
through a failed rundevsquad.review.code after producing Major or Critical findings that match
a codebase-specific patterndevsquad.implement.finalize after human PR feedback contradicts prior agent
output, or CI fails on a missing prerequisiteAt each trigger, the calling agent surfaces a [Y] / [N] / [E] prompt before
returning its output. Default is [Y] to capture. The user can also invoke
this skill explicitly at any time ("add this as a learning", "capture this as
a learning"); the skill runs in capture mode without a trigger.
Consult is automatic at the start of implement.execute, implement.verify,
and review.code (see "When to Consult" below).
| Trigger | What to capture |
|---|---|
| Self-correction loop needed (test failure, lint failure) | Root cause, fix pattern, affected files |
| Max correction attempts (2) exhausted | What the agent could not self-correct and why |
| Build/lint/test prerequisite missed | Required setup step (seed scripts, env vars, build order) |
| Review finding classified Major or Critical | Anti-pattern detected, correct pattern for this codebase |
| Recurring drift detected by refine.health | What drifts and how to prevent it |
| Successful debugging triage of non-obvious issue | Root cause pattern, diagnostic path |
| Human PR feedback on preventable issue | What the human caught that the agent missed |
coding-guidelines.md or .instructions.md.memory/harness-learnings.md (create from template if it does not exist)Scope (shared file paths or modules) AND similar failure typeOccurrences, update Last seen, upgrade Confidence if warrantedL-NNN IDPhase: the lifecycle phase where this learning is most relevant for consumption (not necessarily where it was captured). A review finding about missing error handling should have Phase = implement if the fix belongs at coding time.Dimension: what it regulates (maintainability, architecture, behaviour)Scope: concrete file paths, directories, or module names. Use glob patterns when appropriate (e.g., src/api/**, *.controller.ts). This is the primary field agents use to match learnings to their current task.Pattern: factual description of what happened (the observation)Guidance: actionable instruction for what to do differently (the prescription). Must include file paths, commands, or specific checks.…
Design and review software architecture diagrams for clearer, documentation-friendly visuals.
Create, switch, and verify Git branches before starting implementation work.
Initialize projects or verify and generate up-to-date SDD documentation templates.
Verify and create standard community and governance files for new projects.
Verify assignee, dependencies, priority, and capacity before starting a work item.
Systematically triage failures and fix broken builds or unexpected runtime issues.
Capture key learnings into reusable repository skills and instructions.
Review code deeply across correctness, tests, security, performance, and product quality.
Review code or branches for correctness, compatibility, architecture, tests, performance, and security.
Document agent decisions and pass structured context during agent handoffs.
Clarify ambiguous changes into testable acceptance criteria and implementation requirements.
Evaluate code review feedback rigorously before deciding whether to implement it.