-
Notifications
You must be signed in to change notification settings - Fork 4.7k
docs: Add missing prompt commands + existing project walkthrough #937
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
0e32149
c69f5d1
75f86ab
83a307a
87b71cd
787340d
2132e7c
0b19492
5a322bc
8202820
c46b0d6
b458ccf
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,175 @@ | ||||||||||
| # Using Spec-Kit in an Existing Project | ||||||||||
|
|
||||||||||
| > You already have a codebase. You want to try Spec-Kit without rearranging the furniture. This is a surgical guide: minimum steps, clear checkpoints, easy rollback. This is a **10‑minute guide**-pick realistic scope; save the grand redesign for later. | ||||||||||
|
|
||||||||||
| --- | ||||||||||
|
|
||||||||||
| ## 1. Prerequisites | ||||||||||
|
|
||||||||||
| Before starting, you need the Spec-Kit CLI tool installed on your machine. | ||||||||||
|
|
||||||||||
| Install the CLI by following the [Installation Guide](installation.md), then jump back here for step 2. | ||||||||||
|
|
||||||||||
| > **Starting a new project?** See the [Quick Start Guide](quickstart.md) instead. | ||||||||||
|
|
||||||||||
| --- | ||||||||||
|
|
||||||||||
| ## 2. Init | ||||||||||
|
|
||||||||||
| > Spec-Kit initializes a **workspace** in your repo and registers **slash commands** with your coding agent. This workspace holds your **specs, plans, and tasks**. | ||||||||||
|
|
||||||||||
| * Substitute any [supported assistant](../README.md#-supported-ai-agents) (`claude`, `gemini`, `copilot`, `cursor-agent`, etc.) for the `--ai` argument in place of `copilot`. | ||||||||||
| * When prompted for script type, **pick your flavor** and continue. | ||||||||||
anchildress1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
|
||||||||||
| ### A) If you installed the CLI globally | ||||||||||
|
|
||||||||||
| ```bash | ||||||||||
| specify init --here --ai copilot | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ### B) If you used uvx one‑shot | ||||||||||
anchildress1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
|
|
||||||||||
| ```bash | ||||||||||
| uvx --from git+https://github.com/github/spec-kit.git specify init --here --ai copilot | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ### Checkpoint | ||||||||||
|
|
||||||||||
| Your agent now recognizes: | ||||||||||
|
|
||||||||||
| - `/speckit.constitution` | ||||||||||
| - `/speckit.specify` | ||||||||||
| - `/speckit.clarify` | ||||||||||
| - `/speckit.plan` | ||||||||||
| - `/speckit.tasks` | ||||||||||
| - `/speckit.analyze` | ||||||||||
| - `/speckit.implement` | ||||||||||
|
|
||||||||||
| --- | ||||||||||
|
|
||||||||||
| ## 3. Constitution | ||||||||||
|
|
||||||||||
| Use the `/speckit.constitution` command to define the project's non‑negotiable rules and constraints that AI must follow. | ||||||||||
anchildress1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
|
|
||||||||||
| > You'll want to spend serious time here later, but for now write the **high‑priority or high‑impact** rules you want AI to always follow in your repo. | ||||||||||
anchildress1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
|
|
||||||||||
| ```markdown | ||||||||||
| /speckit.constitution Create principles for: | ||||||||||
| - Quality: tests for all new endpoints; critical‑path coverage > 80%. | ||||||||||
anchildress1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
| - Performance/UX: totals update within 200 ms of coupon apply. | ||||||||||
| - Security/Compliance: log coupon usage with order ID; no PII in logs. | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| --- | ||||||||||
|
|
||||||||||
| ## 4. Specify | ||||||||||
|
|
||||||||||
| Use `/speckit.specify` inside your coding agent to create a single, focused story. Keep it high‑level—what and why. Don’t worry about technical details yet; those come later. | ||||||||||
|
|
||||||||||
| > 💡 Use a model that can handle systems‑level reasoning. Don’t pick a tiny “mini” model for a brand‑new UI. Things will *not go well*. 😉 | ||||||||||
anchildress1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
| > This is a 10‑minute starter, so pick something achievable—save the joyrides until your constraints file is done! | ||||||||||
anchildress1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
|
|
||||||||||
| ```markdown | ||||||||||
| /speckit.specify Create story “Apply coupon during checkout.” | ||||||||||
| Goal: User can enter a valid coupon and see totals update before payment. | ||||||||||
| Acceptance Criteria: | ||||||||||
| - Valid coupon → discount applied; totals update before payment. | ||||||||||
| - Invalid/expired coupon → show reason; totals unchanged. | ||||||||||
| Constraints: one coupon per order; preserve tax/shipping rules; log coupon usage. | ||||||||||
| Out of scope: stacking, gift cards, loyalty. | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ### Checkpoint | ||||||||||
|
|
||||||||||
| * Spec-Kit automatically creates and checks out a **feature branch**, e.g. `001-checkout-apply-coupon`. | ||||||||||
| * It also creates a `./specs/001-checkout-apply-coupon/` folder and a set of `.md` files. | ||||||||||
| * `spec.md` is the specification derived from your prompt — **review it now for accuracy.** | ||||||||||
|
|
||||||||||
| --- | ||||||||||
|
|
||||||||||
| ## 5. Clarify | ||||||||||
|
|
||||||||||
| If you find any mistakes in your `spec.md` or need to tighten constraints, use the `/speckit.clarify` prompt. | ||||||||||
|
|
||||||||||
| ```markdown | ||||||||||
| /speckit.clarify Tighten ACs: add duplicate‑apply and expired‑coupon edge cases. | ||||||||||
anchildress1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
| ``` | ||||||||||
|
|
||||||||||
| Repeat until you’re satisfied — this shapes **the plan**. | ||||||||||
|
|
||||||||||
| --- | ||||||||||
|
|
||||||||||
| ## 6. Plan | ||||||||||
|
|
||||||||||
| The plan converts your spec into concrete technical decisions—choosing frameworks, databases, and architecture patterns. | ||||||||||
|
|
||||||||||
| You can leave this step blank, or include a **single tech requirement** if one matters; otherwise, AI will make a reasonable attempt. | ||||||||||
|
|
||||||||||
| ```markdown | ||||||||||
| /speckit.plan Tech requirement: preserve existing checkout API contract and return HTTP 422 for invalid coupons. | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| --- | ||||||||||
|
|
||||||||||
| ## 7. Tasks | ||||||||||
|
|
||||||||||
| This breaks down your plan into a step-by-step checklist of individual coding tasks. | ||||||||||
|
|
||||||||||
| **Taskify** once your plan feels right. | ||||||||||
|
||||||||||
| **Taskify** once your plan feels right. | |
| **Generate tasks** once your plan feels right. |
Copilot
AI
Nov 16, 2025
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.
[nitpick] Inconsistent command syntax: The implement command shows --dry-run as a flag option, but this doesn't match the established pattern where other commands in the documentation use natural language after the command. For consistency with other commands like /speckit.specify and /speckit.plan, consider documenting this as /speckit.implement 001-checkout-apply-coupon (show changes without executing) or similar natural language, unless the command actually accepts CLI-style flags.
| /speckit.implement 001-checkout-apply-coupon --dry-run # optional: shows planned changes without executing | |
| /speckit.implement 001-checkout-apply-coupon # execute the implementation | |
| /speckit.implement 001-checkout-apply-coupon (show changes without executing) # optional: shows planned changes without executing | |
| /speckit.implement 001-checkout-apply-coupon # execute the implementation |
Uh oh!
There was an error while loading. Please reload this page.