# The SDD Workflow (The 6 Steps)

The core of Spec-Kit is a sequential pipeline. Skipping steps leads to unpredictable AI behavior; following them ensures robust, scalable software.

#### Visualizing the Process

The SDD pipeline flows sequentially, transforming human intent into verified code:

Plaintext

```
[ Intent ] -> (1) Constitution -> (2) Specification -> (3) Planning
                                                           |
[ Verified Code ] <- (6) Review <- (5) Implementation <- (4) Tasks
```

#### Step 1: Constitution (Establishing Principles)

* Purpose: Defines the non-negotiable rules of your codebase. This includes coding standards, architectural patterns, and error-handling strategies.
* Inputs: Team discussions, existing style guides.
* Outputs: `constitution.md`
* Example Command: `/speckit.constitution`
* Best Practice: Keep it concise. Agents lose focus if the constitution is too long. Focus on strict "Do's and Don'ts."

#### Step 2: Specification (The "What" and "Why")

* Purpose: Details the exact features, user flows, and business logic the application must support. It answers what is being built without dictating how to build it.
* Inputs: Product requirements, user stories.
* Outputs: `spec.md`
* Example Command: `/speckit.specify`
* Best Practice: Use Given-When-Then formats for behavior descriptions to give the AI agent precise logical boundaries.

#### Step 3: Planning (Technical Implementation)

* Purpose: Translates the Specification into a technical blueprint. This defines the tech stack, database schemas, API routes, and folder structure.
* Inputs: `constitution.md`, `spec.md`
* Outputs: `plan.md`
* Example Command: `/speckit.plan`
* Best Practice: Review the plan manually before proceeding. If the AI suggests a library or pattern you do not want, correct the plan file directly.

#### Step 4: Task Breakdown

* Purpose: Converts the overarching Plan into granular, independent execution steps. This creates a checklist the AI can follow iteratively.
* Inputs: `plan.md`
* Outputs: `tasks.md`
* Example Command: `/speckit.tasks`
* Best Practice: Ensure tasks are strictly isolated. Task 3 should not implicitly require unstated output from Task 2.

#### Step 5: Implementation (Execution)

* Purpose: The AI agent writes the actual source code, referencing the Constitution for style, the Plan for architecture, and ticking off items from the Tasks list.
* Inputs: All previous markdown artifacts.
* Outputs: Source code files.
* Example Command: `/speckit.implement`
* Best Practice: Run implementation in chunks. Execute a few tasks, test the application, and then proceed.

#### Step 6: Verification & Review

* Purpose: Validates that the generated code fulfills the promises made in `spec.md` without violating the rules in `constitution.md`.
* Inputs: Source code, `spec.md`.
* Outputs: Test suites, PR review comments.
* Best Practice: Treat the AI as a junior developer. Always run automated tests and perform a manual code review.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shankar-lab.gitbook.io/mylearning/github-spec-kit/the-sdd-workflow-the-6-steps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
