-
Notifications
You must be signed in to change notification settings - Fork 7.7k
feat: add /speckit.fix command and fix-log template
#2033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
e77c3cf
342b74e
e3b4fc6
3fb7d36
cf21fe5
21bd0ec
dcbb48b
75f0b9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,158 @@ | ||||||||||||||
| --- | ||||||||||||||
| 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 | ||||||||||||||
|
Comment on lines
+1
to
+25
|
||||||||||||||
|
|
||||||||||||||
| Answer questions about the current Spec Kit project with grounded, actionable responses — and route to the right command when further action is needed. You are a knowledgeable guide, not an executor. You read before you answer. You route before you act. | ||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
| ## Phase 0 — Classify the question | ||||||||||||||
|
|
||||||||||||||
| Before reading any file, classify the input into one of these categories (zero file I/O): | ||||||||||||||
|
|
||||||||||||||
| | Category | Examples | Files to read | Format | | ||||||||||||||
| |---|---|---|---| | ||||||||||||||
| | **simple** | "Reformulate this", "Give me a prompt for X", "What command do I run next?", "Explain Y in simple terms", "What is the order of commands?" | none — answer from knowledge | plain reply, no structured block, skip Phase 3 | | ||||||||||||||
| | **spec** | "Does my spec cover X?", "Is this user story complete?" | `spec.md` (relevant section only) | structured block | | ||||||||||||||
| | **plan** | "Is this architecture decision correct?", "Should I use X or Y?" | `plan.md` (relevant section only) | structured block | | ||||||||||||||
| | **constitution** | "Does this violate a project principle?", "Is X allowed?" | `constitution.md` | structured block | | ||||||||||||||
| | **error** | "Why is X failing?", "What is wrong with my code?" | redirect → `/speckit.fix` immediately | redirect only | | ||||||||||||||
| | **feature-gap** | "How do I add X?", "We need a new behavior" | redirect → `/speckit.specify` immediately | redirect only | | ||||||||||||||
| | **consistency** | "Are spec and plan aligned?", "Is tasks.md up to date?" | `spec.md` + `plan.md` + `tasks.md` | structured block | | ||||||||||||||
| | **open** | General question not fitting above | `constitution.md` only | structured block | | ||||||||||||||
|
|
||||||||||||||
| **If category = `simple`:** answer immediately with no structured header block (no QUESTION/CATEGORY/GROUNDED IN/CONFIDENCE labels), no Phase 1 file loading, and no Phase 3 routing. The reply is the answer itself — nothing more. | ||||||||||||||
|
|
||||||||||||||
| **Fast redirects (do not proceed past Phase 0):** | ||||||||||||||
| - If the question describes a broken behavior or an error → output redirect block and stop: | ||||||||||||||
| ``` | ||||||||||||||
| → This is a correction request, not a question. | ||||||||||||||
| Run: /speckit.fix "[paste your error here]" | ||||||||||||||
| ``` | ||||||||||||||
| - If the question requests a new feature or behavior → output redirect block and stop: | ||||||||||||||
| ``` | ||||||||||||||
| → This is a feature request, not a question. | ||||||||||||||
| Run: /speckit.specify "[describe what you need]" | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
| ## Phase 1 — Load context | ||||||||||||||
|
|
||||||||||||||
| Run `{SCRIPT}` from repo root only if the question category requires reading a project file (see table above). Parse `FEATURE_DIR` and `AVAILABLE_DOCS`. | ||||||||||||||
|
|
||||||||||||||
| Load only the files identified in Phase 0 — and only the sections relevant to the question. Do not load artifacts speculatively. | ||||||||||||||
|
Comment on lines
+64
to
+66
|
||||||||||||||
| Run `{SCRIPT}` from repo root only if the question category requires reading a project file (see table above). Parse `FEATURE_DIR` and `AVAILABLE_DOCS`. | |
| Load only the files identified in Phase 0 — and only the sections relevant to the question. Do not load artifacts speculatively. | |
| Run `{SCRIPT}` from repo root only if the question category requires reading a project file (see table above). Parse the paths-only JSON payload, including `FEATURE_DIR` and any returned document path fields such as `FEATURE_SPEC`, `IMPL_PLAN`, `TASKS`, and related artifact paths. | |
| Load only the files identified in Phase 0 using the corresponding paths returned by `{SCRIPT}` — and only the sections relevant to the question. Do not load artifacts speculatively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR title/description focus on adding
/speckit.fix, but this PR also introduces a new/speckit.askcommand (newtemplates/commands/ask.md) and related tests/command-map references. Please update the PR description/title to reflect this additional feature (or split it into a separate PR) so reviewers and release notes match what ships.