speckit-bug-fix
Skill1 starsChanged 11 days agoMITView on GitHub
Apply the remediation from a bug assessment and record what was changed
2 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- monicahq/monicaedited, first seen Nov 29, 2026
- nota-daw/notaedited, first seen Oct 15, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- monicahq/monica★ 26k99% same
- nota-daw/nota★ 84799% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- speckit-analyzeSkill
- speckit-bug-assessSkill
- speckit-bug-testSkill
- speckit-checklistSkill
- speckit-clarifySkill
- speckit-constitutionSkill
- speckit-convergeSkill
- speckit-implementSkill
- speckit-planSkill
- speckit-specifySkill
- speckit-tasksSkill
- speckit-taskstoissuesSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. About 0 are common, 7 are distinctive, and 19 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
19
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 38
Interactive mode: ask the user which bug to fix and list the candidates.
- Distinctive: line 39
Automated mode: stop with an error listing the candidates.
- Very specific: line 46
If BUG_DIR/fix.md already exists, ask the user whether to overwrite it before continuing (interactive mode) or refuse (automated mode).
- Very specific: line 47
Read BUG_DIR/assessment.md in full.
- Very specific: line 54
Check if .specify/extensions.yml exists in the project root.
- Very specific: line 55
If it exists, read it and look for entries under the hooks.before_bug_fix key
- Very specific: line 56
If the YAML cannot be parsed or is invalid, do not skip silently: tell the user that .specify/extensions.yml could not be read (include the …
- Very specific: line 59
If the hook has no condition field, or it is null/empty, treat the hook as executable
- Very specific: line 60
If the hook defines a non-empty condition, skip the hook and leave condition evaluation to the HookExecutor implementation
- Very specific: line 61
When constructing command invocations from hook command names, replace dots (.) with hyphens (-).
- Very specific: line 85
If no hooks are registered or .specify/extensions.yml does not exist, skip silently
- Very specific: line 91
If the assessment's verdict is invalid, stop — there is nothing to fix.
- Very specific: line 92
If the verdict is likely valid, needs reproduction and there are unresolved [NEEDS CLARIFICATION] items, flag them and ask the user whether …
- Distinctive: line 96
Add or update the tests called out in the assessment so the bug cannot regress silently.
- Distinctive: line 97
Keep the change minimal — do not refactor unrelated code, do not introduce dependencies that the assessment did not call for.
- Very specific: line 98
If you discover the assessment was wrong (the proposed fix does not work, the root cause is elsewhere), STOP modifying code, document the …
- Very specific: line 101
If the project has obvious test commands (e.g., pytest, npm test, cargo test), run the tests that exercise the changed paths.
- Distinctive: line 102
Do not run destructive or network-dependent suites without the user's consent.
- Very specific: line 106
Write to BUG_DIR/fix.md using this structure:
- Very specific: line 156
If it does not exist, or no hooks are registered under hooks.after_bug_fix, skip to the Completion Report.
- Very specific: line 157
If it exists, read it and look for entries under the hooks.after_bug_fix key.
- Very specific: line 158
If the YAML cannot be parsed or is invalid, do not skip silently: tell the user that .specify/extensions.yml could not be read (include the …
- Distinctive: line 196
Never modify files outside the project workspace.
- Very specific: line 197
Never edit assessment.md — it is the contract you are working against.
- Distinctive: line 198
Never delete files unless the assessment explicitly required it.
- Very specific: line 199
Never overwrite an existing fix.md without confirmation.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
Bug Fix Skill
Fix Bug
Apply the remediation that was proposed by /speckit-bug-assess and record the changes in a fix report at .specify/bugs/<slug>/fix.md. This command is only valid after an assessment exists for the given slug.
User Input
$ARGUMENTSThe user input should identify the bug to fix. Accept any of:
slug=<bug-slug>or--slug <bug-slug>or just a bare slug-like token.- A path that contains the slug (e.g.
.specify/bugs/login-timeout/). - Nothing — fall back to context (see below).
Slug Resolution
Resolve BUG_SLUG in this order, stopping at the first match:
- Explicit user input — a slug passed in
$ARGUMENTS(any of the forms above). - Conversation context — if the current session has just run
/speckit-bug-assess, the slug it reported is the working slug. Reuse it without re-prompting. Confirm it by checking that.specify/bugs/<slug>/assessment.mdexists; if it does not, fall through. - Single candidate on disk — list
.specify/bugs/*/assessment.md. If exactly one matchingassessment.mdis found, use the slug from its parent directory. - Disambiguate:
- Interactive mode: ask the user which bug to fix and list the candidates.
- Automated mode: stop with an error listing the candidates. Do not guess.
Once resolved, set BUG_SLUG and BUG_DIR = .specify/bugs/<BUG_SLUG>, and briefly state in your reply which resolution path was used (explicit / from context / single candidate / asked).
Prerequisites
BUG_DIR/assessment.mdMUST exist. If it does not, stop and instruct the user to run/speckit-bug-assessfirst.- If
BUG_DIR/fix.mdalready exists, ask the user whether to overwrite it before continuing (interactive mode) or refuse (automated mode). - Read
BUG_DIR/assessment.mdin full. Treat its Proposed Remediation, Files likely to change, Tests to add or update, and Risks & Considerations sections as the contract for this command.
Pre-Execution Checks
By this point BUG_SLUG and BUG_DIR have been resolved, so a hook command run in this session can reuse them from the conversation; nothing is passed to it automatically.
Check for extension hooks (before bug fixing):
- Check if
.specify/extensions.ymlexists in the project root. - If it exists, read it and look for entries under the
hooks.before_bug_fixkey - If the YAML cannot be parsed or is invalid, do not skip silently: tell the user that
.specify/extensions.ymlcould not be read (include the parser error) and that no hooks were checked, including any mandatory (optional: false) hooks registered there, then continue normally - Filter out hooks where
enabledis explicitlyfalse. Treat hooks without anenabledfield as enabled by default. - For each remaining hook, do not attempt to interpret or evaluate hook
conditionexpressions:- If the hook has no
conditionfield, or it is null/empty, treat the hook as executable - If the hook defines a non-empty
condition, skip the hook and leave condition evaluation to the HookExecutor implementation
- If the hook has no
- When constructing command invocations from hook command names, replace dots (
.) with hyphens (-). For example,speckit.git.commit→/speckit-git-commit. - For each executable hook, output the following based on its
optionalflag:- Optional hook (
optional: true):## Extension Hooks **Optional Pre-Hook**: {extension} Command: `/{command}` Description: {description} Prompt: {prompt} To execute: `/{command}` - Mandatory hook (
optional: false):
After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal## Extension Hooks **Automatic Pre-Hook**: {extension} Executing: `/{command}` EXECUTE_COMMAND: {command} Wait for the result of the hook command before proceeding to Execution.{command}id shown above, e.g. a skills-mode agent runs it as/skill:speckit-...or$speckit-...). Emitting the block alone does not run the hook.
- Optional hook (
- If no hooks are registered or
.specify/extensions.ymldoes not exist, skip silently
Execution
- Confirm the plan
- Restate, in 3–6 bullets, what you are about to change and where, based on the assessment.
- If the assessment's verdict is
invalid, stop — there is nothing to fix. Tell the user and exit. - If the verdict is
likely valid, needs reproductionand there are unresolved[NEEDS CLARIFICATION]items, flag them and ask the user whether to proceed in interactive mode, or stop in automated mode.
- Apply the remediation
- Make the code changes described by the preferred remediation. Stay within the files listed by the assessment unless newly discovered evidence requires expanding scope (in which case, log the expansion explicitly in the report).
- Add or update the tests called out in the assessment so the bug cannot regress silently.
- Keep the change minimal — do not refactor unrelated code, do not introduce dependencies that the assessment did not call for.
- If you discover the assessment was wrong (the proposed fix does not work, the root cause is elsewhere), STOP modifying code, document the new finding in the fix report under Deviations from Assessment, and recommend re-running
/speckit-bug-assess.
- Run local checks
- If the project has obvious test commands (e.g.,
pytest,npm test,cargo test), run the tests that exercise the changed paths. Capture pass/fail and key output. - Do not run destructive or network-dependent suites without the user's consent.
- If the project has obvious test commands (e.g.,
Write the fix report
Write to
BUG_DIR/fix.mdusing this structure:# Bug Fix: <short title> - **Slug**: <BUG_SLUG> - **Fixed**: <ISO 8601 date> - **Assessment**: ./assessment.md - **Status**: applied | partial | not-applied ## Summary <One or two sentences describing what was changed and why.> ## Changes | File | Change | Notes | |------|--------|-------| | `path/to/file.py` | <added / modified / removed> | <short note> | | `path/to/test_file.py` | added test | <short note> | ## Diff Highlights (optional) <Short, illustrative snippets of the most important hunks — not a full diff dump.> ## Tests Added or Updated - `path/to/test_file.py::test_name` — <what it pins down> ## Local Verification - Commands run: `<command>` → <result, brief> - Manual checks: <what was verified by hand, if anything> ## Deviations from Assessment <Empty if none. Otherwise, list any places where the actual fix departed from the proposed remediation and why.> ## Follow-ups - <suggested cleanup, monitoring, doc update, etc.>
Mandatory Post-Execution Hooks
You MUST complete this section before reporting completion to the user.
By this point BUG_SLUG and BUG_DIR have been resolved and the written report is available, so a hook command run in this session can reuse them from the conversation; nothing is passed to it automatically.
Check if .specify/extensions.yml exists in the project root.
- If it does not exist, or no hooks are registered under
hooks.after_bug_fix, skip to the Completion Report. - If it exists, read it and look for entries under the
hooks.after_bug_fixkey. - If the YAML cannot be parsed or is invalid, do not skip silently: tell the user that
.specify/extensions.ymlcould not be read (include the parser error) and that no hooks were checked, including any mandatory (optional: false) hooks registered there, then continue to the Completion Report. - Filter out hooks where
enabledis explicitlyfalse. Treat hooks without anenabledfield as enabled by default. - For each remaining hook, do not attempt to interpret or evaluate hook
conditionexpressions:- If the hook has no
conditionfield, or it is null/empty, treat the hook as executable - If the hook defines a non-empty
condition, skip the hook and leave condition evaluation to the HookExecutor implementation
- If the hook has no
- When constructing command invocations from hook command names, replace dots (
.) with hyphens (-). For example,speckit.git.commit→/speckit-git-commit. - For each executable hook, output the following based on its
optionalflag:- Mandatory hook (
optional: false) — You MUST emitEXECUTE_COMMAND:for each mandatory hook:
After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal## Extension Hooks **Automatic Hook**: {extension} Executing: `/{command}` EXECUTE_COMMAND: {command}{command}id shown above, e.g. a skills-mode agent runs it as/skill:speckit-...or$speckit-...). Emitting the block alone does not run the hook. - Optional hook (
optional: true):## Extension Hooks **Optional Hook**: {extension} Command: `/{command}` Description: {description} Prompt: {prompt} To execute: `/{command}`
- Mandatory hook (
Completion Report
Report back with:
- The slug and
BUG_DIR/fix.mdpath. - The status (
applied,partial,not-applied). - The next suggested step:
/speckit-bug-test slug=<BUG_SLUG>.
Guardrails
- Never modify files outside the project workspace.
- Never edit
assessment.md— it is the contract you are working against. Record disagreements infix.mdunder Deviations from Assessment. - Never delete files unless the assessment explicitly required it.
- Never overwrite an existing
fix.mdwithout confirmation.
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.

