spec-crlp
Skill3 starsChanged 8 months agoMITView on GitHub
Run a spec-driven correction loop for code that already exists by comparing the current implementation against the spec and using linter output, test failures, runtime logs, and review feedback to diagnose and fix gaps. Use this whenever code is failing checks, drifting from acceptance criteria, regressing after changes, or needs a fix-verify-repeat loop after CI, tests, logs, or review comments.
In this repository2 other files it gives its agents.
- spec-indexSkill
- spec-planSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. About 0 are common, 11 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill when implementation already exists and feedback shows a mismatch between expected and actual behavior.
- Very specific: line 14
Before starting the correction loop, look for a SPEC.md in the target repository root.
- Distinctive: line 16
If it exists, treat it as the repository-specific preference layer for:
- Distinctive: line 23
If it is missing, use the built-in defaults for this skill series instead of blocking on the missing file.
- Distinctive: line 25
If it is partial, use the fields it defines and fall back to defaults for the rest.
- Very specific: line 29
When no repository root SPEC.md is available, use these defaults:
- Very specific: line 45
Before starting a correction loop, retrieve relevant memory through spec-index.
- Distinctive: line 58
Use the retrieved memory as diagnostic context, not as proof.
- Distinctive: line 60
If no relevant memory is found, say so briefly and continue.
- Very specific: line 64
If the task is still ambiguous and there is no clear definition of done, switch to spec-plan first.
- Very specific: line 65
If the main need is to store or retrieve prior decisions, fixes, or setup knowledge, use spec-index.
- Very specific: line 66
If the user is asking for greenfield planning rather than debugging or correction, use spec-plan.
- Very specific: line 79
If the expected behavior is missing, derive the minimum workable acceptance criteria from the conversation and say that you are doing so.
- Very specific: line 84
Read the repository root SPEC.md when present and apply the built-in defaults for anything it does not define.
- Distinctive: line 96
Prefer this structure unless the user asks for something lighter:
- Distinctive: line 112
Use the spec as the source of truth whenever possible.
- Distinctive: line 114
Prefer narrow, testable fixes over broad rewrites.
- Distinctive: line 115
Keep cause and effect explicit.
- Very specific: line 117
Prefer validation commands from the repository root SPEC.md when present, otherwise use the built-in default behavior instead of ad hoc …
- Distinctive: line 118
If a failure comes from missing setup or environment assumptions, state that clearly and include the concrete prerequisite.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Spec Correction Loop
Use this skill when implementation already exists and feedback shows a mismatch between expected and actual behavior.
This skill is about converging on correct behavior with evidence. Start from the spec, reproduce the problem, find the root cause, make the smallest coherent fix, and verify the result. Treat lint, tests, logs, CI, and review comments as signals that help narrow the gap between the implementation and the acceptance criteria.
Repository preference override
Before starting the correction loop, look for a SPEC.md in the target repository root.
If it exists, treat it as the repository-specific preference layer for:
- validation commands and validation order
- setup and environment expectations
- knowledge-base location for durable findings
- cross-skill workflow conventions
If it is missing, use the built-in defaults for this skill series instead of blocking on the missing file.
If it is partial, use the fields it defines and fall back to defaults for the rest.
Built-in defaults
When no repository root SPEC.md is available, use these defaults:
- validation behavior: prefer discoverable repository tooling; if no validation commands are discoverable, say validation is not configured yet
- knowledge-base location:
docs/knowledge-base/ - context retrieval: query
spec-indexfor similar symptoms, root causes, fix patterns, setup gotchas, and validation rules before correction work
Core responsibilities
- Reconstruct the expected behavior from the current spec, acceptance criteria, or user request.
- Compare the expected behavior with actual behavior using concrete evidence.
- Trace failures to a root cause instead of patching symptoms.
- Apply focused fixes and re-run the most relevant checks.
- Surface reusable lessons that should be captured by
spec-index.
Context retrieval before correction
Before starting a correction loop, retrieve relevant memory through spec-index.
Look for:
- similar symptoms or error messages
- prior root causes
- reusable fix patterns
- setup or environment gotchas
- validation rules and known flaky checks
- component-specific pitfalls
Build retrieval queries from failing test names, CI output, stack traces, log messages, file paths, tools, frameworks, components, and observed symptoms.
Use the retrieved memory as diagnostic context, not as proof. Confirm the current root cause with local evidence before changing code.
If no relevant memory is found, say so briefly and continue. Do not block correction on an empty knowledge base.
When this skill is not the right fit
- If the task is still ambiguous and there is no clear definition of done, switch to
spec-planfirst. - If the main need is to store or retrieve prior decisions, fixes, or setup knowledge, use
spec-index. - If the user is asking for greenfield planning rather than debugging or correction, use
spec-plan.
Working inputs
Gather as many of these as the task provides:
- The current spec, acceptance criteria, or expected behavior.
- The repository root
SPEC.mdwhen present. - Relevant memory retrieved through
spec-index. - Failing tests, CI output, linter diagnostics, logs, stack traces, or screenshots.
- The current code and the files most likely involved in the failure.
- Review feedback that points to a regression, missing case, or poor implementation choice.
If the expected behavior is missing, derive the minimum workable acceptance criteria from the conversation and say that you are doing so. If that would be risky, hand off to spec-plan.
Correction loop
- Restate the target behavior in observable terms.
- Read the repository root
SPEC.mdwhen present and apply the built-in defaults for anything it does not define. - Retrieve relevant memory through
spec-index. - Reproduce or localize the failure using the strongest available signal.
- Classify the signal: spec mismatch, lint issue, test failure, runtime bug, environment issue, or review concern.
- Inspect the code path that explains the failure.
- Identify the root cause and explain why it produces the observed behavior, using memory only when local evidence supports it.
- Implement the smallest coherent change that fixes the root cause.
- Re-run the most relevant validation steps defined by the repository root
SPEC.mdwhen present, otherwise use the built-in default behavior and discoverable repo tooling. - Summarize the outcome, residual risk, relevant memory used, and any new knowledge worth persisting.
Preferred output structure
Prefer this structure unless the user asks for something lighter:
# Correction Summary
## Expected Behavior
## Observed Behavior
## Relevant Memory
## Root Cause
## Fix
## Validation
## Residual Risk
## Memory To CaptureGood habits
- Use the spec as the source of truth whenever possible.
- Retrieve relevant memory before debugging so prior root causes and setup gotchas are not missed.
- Prefer narrow, testable fixes over broad rewrites.
- Keep cause and effect explicit.
- Validate with the checks most likely to catch the same issue again.
- Prefer validation commands from the repository root
SPEC.mdwhen present, otherwise use the built-in default behavior instead of ad hoc command choices. - If a failure comes from missing setup or environment assumptions, state that clearly and include the concrete prerequisite.
Avoid
- Silent fallbacks that hide the real failure.
- Cosmetic fixes that do not address the root cause.
- Expanding scope into replanning when the real problem is local and diagnosable.
- Treating unverified guesses as confirmed causes.
Handoffs
- Hand off to
spec-planwhen the acceptance criteria are unclear, conflicting, or incomplete. - Hand off to
spec-indexwhen you confirm a reusable root cause, setup rule, fix pattern, or debugging lesson. - Recommend updates to a repository root
SPEC.mdwhen repeated correction work exposes a repository-specific validation or setup convention that should become explicit.
Example requests
- "The feature mostly works, but the tests are failing after the refactor. Please fix it against the original acceptance criteria."
- "CI says the API contract is broken. Compare the implementation with the spec and close the gap."
- "This PR got review comments about a regression. Diagnose the root cause and iterate until the behavior matches the intended flow."
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

