-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Open
omgbwa-yasse
wants to merge
7
commits into
github:main
Choose a base branch
from
omgbwa-yasse:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,765
−0
Open
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e77c3cf
feat: add /speckit.fix command and fix-template
omgbwa-yasse 342b74e
feat(fix): add Phase 0 pre-flight, scope guard, third-party guard, ma…
omgbwa-yasse e3b4fc6
feat: add /speckit.ask command — grounded Q&A with workflow routing
omgbwa-yasse 3fb7d36
fix(ask): wire speckit.ask into ecosystem — command map, routing, 30 …
omgbwa-yasse cf21fe5
fix(ask): make Phase 3 routing conditional, add direct question category
omgbwa-yasse 21bd0ec
fix(ask): resolve 5 structural anomalies in ask.md
omgbwa-yasse dcbb48b
feat: enhance /speckit.fix with smart diagnosis, 5-Whys causal chain,…
omgbwa-yasse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| --- | ||
| 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: Write a Spec | ||
| agent: speckit.specify | ||
| prompt: "Specify the following feature: " | ||
| - label: Clarify the Spec | ||
| agent: speckit.clarify | ||
| prompt: Clarify the current spec | ||
| send: true | ||
| - label: Build a Plan | ||
| agent: speckit.plan | ||
| prompt: Create a plan for the spec | ||
| send: true | ||
| - label: Fix an Error | ||
| agent: speckit.fix | ||
| prompt: "Fix this error: " | ||
| - label: Analyze Consistency | ||
| agent: speckit.analyze | ||
| prompt: Analyze the current feature artifacts | ||
| send: true | ||
| 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 | ||
|
|
||
| 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 | | ||
| |---|---|---| | ||
| | **workflow** | "What command do I run next?", "What is the order of commands?" | none — answer from knowledge | | ||
| | **spec** | "Does my spec cover X?", "Is this user story complete?" | `spec.md` (relevant section only) | | ||
| | **plan** | "Is this architecture decision correct?", "Should I use X or Y?" | `plan.md` (relevant section only) | | ||
| | **constitution** | "Does this violate a project principle?", "Is X allowed?" | `constitution.md` | | ||
| | **error** | "Why is X failing?", "What is wrong with my code?" | redirect → `/speckit.fix` immediately | | ||
| | **feature-gap** | "How do I add X?", "We need a new behavior" | redirect → `/speckit.specify` immediately | | ||
| | **consistency** | "Are spec and plan aligned?", "Is tasks.md up to date?" | `spec.md` + `plan.md` + `tasks.md` | | ||
| | **open** | General question not fitting above | `constitution.md` + closest artifact | | ||
|
|
||
| **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. | ||
|
|
||
| **Always read `constitution.md` when:** | ||
| - The question touches a project principle, constraint, or architectural decision | ||
| - The answer would suggest a change to an existing artifact | ||
| - The question category is `constitution` or `consistency` | ||
|
|
||
| **Never read `constitution.md` proactively** for pure workflow questions. | ||
|
|
||
| --- | ||
|
|
||
| ## Phase 2 — Answer | ||
|
|
||
| Produce a structured response: | ||
|
|
||
| ``` | ||
| QUESTION : [restate the question in one line] | ||
| CATEGORY : [workflow | spec | plan | constitution | consistency | open] | ||
| GROUNDED IN : [knowledge | constitution.md | spec.md | plan.md | tasks.md | multiple] | ||
| CONFIDENCE : [high — answer is unambiguous | medium — interpretation required | low — insufficient context] | ||
|
|
||
| ANSWER | ||
| ────── | ||
| [Direct, precise answer. Reference file:section when quoting a spec or plan. | ||
| If CONFIDENCE = low, state clearly what additional context is needed and why. | ||
| Do not hedge unnecessarily — if you know, say it directly.] | ||
| ``` | ||
|
|
||
| ### Rules for the answer | ||
|
|
||
| 1. **Base every answer on evidence** — quote the relevant section of the artifact when possible. | ||
| 2. **Separate fact from recommendation** — clearly distinguish "the spec says X" from "best practice suggests Y". | ||
| 3. **Respect the constitution** — if the answer would conflict with a principle, say so explicitly. Do not suggest actions that violate it. | ||
| 4. **Acknowledge gaps honestly** — if the information needed to answer is absent from all artifacts, say so. Do not invent an answer. | ||
| 5. **One question at a time** — if the input contains multiple questions, answer them in order, each with its own block. Do not merge unrelated answers. | ||
|
|
||
| --- | ||
|
|
||
| ## Phase 3 — Route | ||
|
|
||
| After the answer, produce a routing suggestion based on what the question revealed: | ||
|
|
||
| ``` | ||
| SUGGESTED NEXT | ||
| ────────────── | ||
| [command] [reason — what this command would do given what was just answered] | ||
| ``` | ||
|
|
||
| Use this routing table: | ||
|
|
||
| | What the answer revealed | Suggested command | | ||
| |---|---| | ||
| | The spec has a gap or ambiguity | `/speckit.clarify "[the unresolved point]"` | | ||
| | A new behavior needs to be defined | `/speckit.specify "[what the system must do]"` | | ||
| | A technical decision needs to be made or revisited | `/speckit.plan` | | ||
| | Artifacts are inconsistent with each other | `/speckit.analyze` | | ||
| | A task is missing or mis-ordered | `/speckit.tasks` | | ||
| | An error or broken behavior was surfaced | `/speckit.fix "[the error]"` | | ||
| | Everything looks correct | No action needed — state this explicitly | | ||
| | Cross-feature impact is possible | `/speckit.analyze` (after the fix or change) | | ||
|
|
||
| **Multiple suggestions are allowed** — rank them by urgency (most blocking first). | ||
|
|
||
| **Never suggest a command without a reason.** Each suggestion must say *why* that command is warranted given the answer. | ||
|
|
||
| --- | ||
|
|
||
| ## Phase 4 — Confidence check | ||
|
|
||
| If `CONFIDENCE = low` was set in Phase 2, append: | ||
|
|
||
| ``` | ||
| BEFORE PROCEEDING | ||
| ───────────────── | ||
| To answer this confidently, I need: | ||
| 1. [specific missing piece — e.g., "the full stack trace", "the spec.md of feature X", "which architecture was chosen in plan.md"] | ||
| 2. [optional second missing piece] | ||
|
|
||
| You can provide this directly in the next message, or run the suggested command above to generate it. | ||
| ``` | ||
|
|
||
| Do not ask more than 2 clarifying questions. Do not ask for information that can be inferred from the artifacts already loaded. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This PR adds a new
/speckit.askcommand template (templates/commands/ask.md), but the PR title/description only mention/speckit.fixand 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.