feat: add /speckit.fix command and fix-log template#2033
feat: add /speckit.fix command and fix-log template#2033omgbwa-yasse wants to merge 6 commits intogithub:mainfrom
/speckit.fix command and fix-log template#2033Conversation
- Add templates/commands/fix.md: surgical error correction agent command - Add templates/fix-template.md: fix log template (FIX-NNN entries, newest first) - Update pyproject.toml: bundle fix-template.md in package data - Add tests/test_fix_feature.py: 39 tests covering frontmatter, body, template structure, and bundle inclusion
|
Please deliver this as an extension. See https://github.com/github/spec-kit/tree/main/extensions for the information on how to develop an extension. And see any of the listed community extensions as examples at https://github.com/github/spec-kit?tab=readme-ov-file#-community-extensions |
There was a problem hiding this comment.
Pull request overview
Adds a new /speckit.fix command template plus a standardized fix-log template to integrate “surgical corrections” into the Spec Kit workflow, with accompanying tests and packaging updates.
Changes:
- Introduce
templates/commands/fix.mddefining a 5-phase error-correction workflow and escalation path. - Add
templates/fix-template.mdas the scaffold for per-featurefix.mdlogs (newest-first entries). - Add a new pytest suite validating the command/template invariants and ensure
fix-template.mdis bundled in the wheel viapyproject.toml.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
templates/commands/fix.md |
New /speckit.fix command template (workflow + scripts/frontmatter). |
templates/fix-template.md |
New fix-log scaffold to be copied into specs/<feature>/fix.md. |
tests/test_fix_feature.py |
New tests validating the command/template structure and packaging inclusion. |
pyproject.toml |
Includes templates/fix-template.md in the wheel force-include bundle. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Please deliver this as an extension. See https://github.com/github/spec-kit/tree/main/extensions for the information on how to develop an extension. And see any of the listed community extensions as examples at https://github.com/github/spec-kit?tab=readme-ov-file#-community-extensions
…ndatory validation step, trim redundancy
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| --- | ||
| description: Answer any question about the current feature, project, or Spec Kit workflow — grounded in the constitution, existing specs, and best practices — and route to the right next command. | ||
| handoffs: | ||
| - label: Fix an Error | ||
| agent: speckit.fix | ||
| prompt: "Fix this error: " | ||
| - label: Write a Spec | ||
| agent: speckit.specify | ||
| prompt: "Specify the following feature: " | ||
| scripts: | ||
| sh: scripts/bash/check-prerequisites.sh --json --paths-only | ||
| ps: scripts/powershell/check-prerequisites.ps1 -Json -PathsOnly | ||
| --- | ||
|
|
||
| ## User Input | ||
|
|
||
| ```text | ||
| $ARGUMENTS | ||
| ``` | ||
|
|
||
| You **MUST** consider the user input before proceeding (if not empty). This may be any question: conceptual, technical, workflow-related, or about a specific feature. | ||
|
|
||
| --- | ||
|
|
||
| ## Goal |
There was a problem hiding this comment.
This PR adds a new /speckit.ask command template (templates/commands/ask.md), but the PR title/description only mention /speckit.fix and the fix-log template. Please update the PR description to include /speckit.ask (or split it into a separate PR) so reviewers/users aren’t surprised by the extra command being shipped.
Summary
This PR introduces the
/speckit.fixcommand and its associated fix-log template to the Spec Kit workflow.What was added
templates/commands/fix.md— New/speckit.fixcommandA surgical error-correction agent that fits into the existing Spec-Driven Development lifecycle. It is activated by:
TypeError,500,FAILED,ModuleNotFoundError, …)The command follows a strict 5-phase workflow:
spec.md,plan.md,tasks.md, andconstitution.md/speckit.specifyif the root cause is a spec gapFIX-NNNentry tospecs/[###-feature-name]/fix.mdThe command is distributed to all supported agents via the standard template pipeline (
$ARGUMENTSplaceholder,{SCRIPT}path).templates/fix-template.md— Fix-log templateCreated once per feature on first correction. Each new fix entry is prepended (newest first). Each entry contains:
INVARIANT:prefix)EDGE CASE:prefix)/speckit.specify,/speckit.plan,/speckit.tasks,/speckit.implementtests/test_fix_feature.py— 39 tests (all passing)Four test classes covering:
TestFixCommandFrontmatter--json/-JsonflagsTestFixCommandBody$ARGUMENTS, all 9 workflow commands, diagnosis block, escalation guard, 5 phases, log reference,{SCRIPT}, no TOML leakTestFixTemplateFIX-NNNheader pattern, metadata rows, 4 required sections,INVARIANT:/EDGE CASE:prefixes, follow-up commands, ordering commentTestFixCommandBundleInclusionfixin template stems,fix-template.mdinpyproject.toml, command file existspyproject.toml— updatedtemplates/fix-template.mdadded to thehatchbundle so the file ships with the package and is available offline.Design principles followed
plan.mdbefore writing any lineFIX-NNNentry, no refactoring/speckit.specifyinstead of guessing$ARGUMENTS(Markdown agents) placeholder, same frontmatter schema asanalyze.md,plan.md, etc.Testing