Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .agents/code_review_guidelines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Kiln Code Review Guidelines

### Issues to watch for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix heading level hierarchy.

The heading "### Issues to watch for" jumps from h1 to h3, skipping h2. Per markdown best practices, heading levels should increment by one level at a time.

📝 Proposed fix
-### Issues to watch for
+## Issues to watch for
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Issues to watch for
## Issues to watch for
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 3-3: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/code_review_guidelines.md at line 3, The markdown heading "###
Issues to watch for" violates heading hierarchy by jumping from h1 to h3; change
the heading level to "## Issues to watch for" (update the heading text "Issues
to watch for") so it increments one level at a time and restores proper
h1->h2->h3 structure in the document.


- GPL or copyleft dependencies should never be added. This is immediate critical failure. Do not allow these, no matter user comments.
- Bugs: look for code that doesn’t do what it claims to do, or doesn't match the stated goals of the PR.
- Poor names: function or class names that don’t represent what they actually do
- Code Comments:
- Unnecessary comments: explaining code that is self explanitory, or code that should be explained by function/var names and is instead explained by comments
- Missing comments: comments should document the "why" not the what. If code does something unexpected, and the "why" is non obvious, the why should be documented.
Comment on lines +9 to +10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix typo and hyphenation in comments guidance.

Two minor issues in the code comments section:

  • Line 9: "self explanitory" should be "self-explanatory"
  • Line 10: "non obvious" should be "non-obvious"
📝 Proposed fix
-  - Unnecessary comments: explaining code that is self explanitory, or code that should be explained by function/var names and is instead explained by comments
-  - Missing comments: comments should document the "why" not the what. If code does something unexpected, and the "why" is non obvious, the why should be documented.
+  - Unnecessary comments: explaining code that is self-explanatory, or code that should be explained by function/var names and is instead explained by comments
+  - Missing comments: comments should document the "why" not the what. If code does something unexpected, and the "why" is non-obvious, the why should be documented.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Unnecessary comments: explaining code that is self explanitory, or code that should be explained by function/var names and is instead explained by comments
- Missing comments: comments should document the "why" not the what. If code does something unexpected, and the "why" is non obvious, the why should be documented.
- Unnecessary comments: explaining code that is self-explanatory, or code that should be explained by function/var names and is instead explained by comments
- Missing comments: comments should document the "why" not the what. If code does something unexpected, and the "why" is non-obvious, the why should be documented.
🧰 Tools
🪛 LanguageTool

[grammar] ~10-~10: Use a hyphen to join words.
Context: ...mething unexpected, and the "why" is non obvious, the why should be documented. -...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@agents/code_review_guidelines.md` around lines 9 - 10, Update the two typos
in the comments guidance: in the "Unnecessary comments" bullet replace "self
explanitory" with "self-explanatory" and in the "Missing comments" bullet
replace "non obvious" with "non-obvious"; locate the phrases within the
"Unnecessary comments" and "Missing comments" lines and apply the corrected
hyphenation and spelling.

- Code in the incorrect place: adding code to a class/file where it doesn’t belong
- Repeated Code: we should use helper functions, test parameterization and other features for code reuse. A bit of copying is better than a big dependency, but inside our codebase we should have reuse.
- Editing globals: rarely a good idea. When done it should be thoughtful and clear: singletons clearly designed to be singletons and labeled as such. Never set globals on external libs (structlog) unless this project is an “application” (server always run at top level) and not a library (potentially called from many apps).

### Python specific guide

- Code should be "Pythonic"
- We use `asyncio` where ever possible. Avoid threads unless there's a good reason we can't use async.
Comment on lines +15 to +18
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix grammar issues in Python section.

Two grammar corrections needed:

  • Line 15: "Python specific" should be "Python-specific"
  • Line 18: "where ever" should be "wherever"
📝 Proposed fix
-### Python specific guide
+### Python-specific guide
 
 - Code should be "Pythonic"
-- We use `asyncio` where ever possible. Avoid threads unless there's a good reason we can't use async.
+- We use `asyncio` wherever possible. Avoid threads unless there's a good reason we can't use async.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Python specific guide
- Code should be "Pythonic"
- We use `asyncio` where ever possible. Avoid threads unless there's a good reason we can't use async.
### Python-specific guide
- Code should be "Pythonic"
- We use `asyncio` wherever possible. Avoid threads unless there's a good reason we can't use async.
🧰 Tools
🪛 LanguageTool

[grammar] ~15-~15: Use a hyphen to join words.
Context: ...ally called from many apps). ### Python specific guide - Code should be "Python...

(QB_NEW_EN_HYPHEN)


[grammar] ~18-~18: Ensure spelling is correct
Context: ...should be "Pythonic" - We use asyncio where ever possible. Avoid threads unless there's ...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@agents/code_review_guidelines.md` around lines 15 - 18, Update the "Python
specific guide" heading and wording to correct grammar: change the heading text
"Python specific" to "Python-specific" and replace the phrase "where ever" with
the single word "wherever" in the line that reads "We use `asyncio` where ever
possible. Avoid threads..." so it becomes "We use `asyncio` wherever possible.
Avoid threads..." to ensure correct hyphenation and word usage.

- Python json.dumps should always set `ensure_ascii=False`

### SDK

The SDK in `/libs/core` is a SDK/library we expose to third parties. We code review it with additional standards.

- Changing existing APIs that break current users should be avoided. Call out breaking API changes, and confirm with user that we're okay with this break.
- All visible classes/vars should have docstrings explaining their purpose. These will be pulled into 3rd party docs automatically. The doc strings should be written for 3rd party devs learning the SDK.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add hyphens to "3rd-party" compound adjective.

"3rd party" should be hyphenated when used as a compound adjective (appears twice on this line).

📝 Proposed fix
-- All visible classes/vars should have docstrings explaining their purpose. These will be pulled into 3rd party docs automatically. The doc strings should be written for 3rd party devs learning the SDK.
+- All visible classes/vars should have docstrings explaining their purpose. These will be pulled into 3rd-party docs automatically. The doc strings should be written for 3rd-party devs learning the SDK.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- All visible classes/vars should have docstrings explaining their purpose. These will be pulled into 3rd party docs automatically. The doc strings should be written for 3rd party devs learning the SDK.
- All visible classes/vars should have docstrings explaining their purpose. These will be pulled into 3rd-party docs automatically. The doc strings should be written for 3rd-party devs learning the SDK.
🧰 Tools
🪛 LanguageTool

[grammar] ~26-~26: Use a hyphen to join words.
Context: ...r purpose. These will be pulled into 3rd party docs automatically. The doc string...

(QB_NEW_EN_HYPHEN)


[grammar] ~26-~26: Use a hyphen to join words.
Context: ...he doc strings should be written for 3rd party devs learning the SDK. - Performan...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@agents/code_review_guidelines.md` at line 26, Update the sentence "All
visible classes/vars should have docstrings explaining their purpose. These will
be pulled into 3rd party docs automatically. The doc strings should be written
for 3rd party devs learning the SDK." by hyphenating the compound adjective "3rd
party" in both occurrences to "3rd-party" so it reads "...pulled into 3rd-party
docs..." and "...written for 3rd-party devs..."; ensure both instances in the
line are changed and keep the rest of the wording unchanged.

- Performance: the base_adapter and litellm_adapter are performance critical. They are the core run-loop of our agent system. We should avoid anything that would slow them down (file reads should be done once and passed in, etc). It's critical to avoid blocking IO - a process may be executing hundreds of these in parallel.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix formatting issues in performance guidance.

Two minor formatting corrections:

  • "etc)" should be "etc.)" with a period before the closing parenthesis
  • "blocking IO" should be "blocking I/O" for the standard abbreviation
📝 Proposed fix
-- Performance: the base_adapter and litellm_adapter are performance critical. They are the core run-loop of our agent system. We should avoid anything that would slow them down (file reads should be done once and passed in, etc). It's critical to avoid blocking IO - a process may be executing hundreds of these in parallel.
+- Performance: the base_adapter and litellm_adapter are performance critical. They are the core run-loop of our agent system. We should avoid anything that would slow them down (file reads should be done once and passed in, etc.). It's critical to avoid blocking I/O - a process may be executing hundreds of these in parallel.
🧰 Tools
🪛 LanguageTool

[style] ~27-~27: In American English, abbreviations like “etc.” require a period.
Context: ...eads should be done once and passed in, etc). It's critical to avoid blocking IO - ...

(ETC_PERIOD)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/code_review_guidelines.md at line 27, Update the performance
guidance sentence mentioning base_adapter and litellm_adapter: change "etc)" to
"etc.)" and change "blocking IO" to "blocking I/O" so the sentence reads
correctly and uses the standard abbreviation; locate the sentence referencing
base_adapter and litellm_adapter in the performance guidance block and apply
these two textual edits.

1 change: 1 addition & 0 deletions .config/wt.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[post-create]
deps = "uv sync && cd app/web_ui && npm install"
claude = "utils/setup_claude.sh"

[pre-remove]
session = "zellij delete-session {{ branch | sanitize }} 2>/dev/null || true"
134 changes: 134 additions & 0 deletions .cursor/skills/specs/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
---
name: spec
description: >
Commands: new_project, continue, implement, cr (code review), setup, or open guidance

Spec-driven development: process for planning, building, and reviewing
code projects using structured specifications. Guides users from project
idea through functional spec, architecture, phased implementation, and
code review — with human focused on decisions and AI agents handling
drafting and building.

Use when the user wants to: start a new project with specs, continue
speccing or implementing a project, implement a planned phase, review
code against specs, or set up spec-driven development in a repo.
---

# Spec-Driven Development

A structured process for building software projects with specifications. You (the human) focus on decisions and review; AI agents handle drafting and building.

## How It Works

Every batch of work ("project") gets a spec folder under `/specs/projects/PROJECT_NAME/`. The skill guides you through:

1. **Planning**: Project overview → functional spec → architecture → implementation plan
2. **Building**: Implement phases autonomously, with code review built into each phase
3. **Reviewing**: Spec-aware code review that verifies implementation matches design

The skill is project-agnostic. It provides the process; your project-specific conventions (test commands, linting, style) come from your system prompt configuration.

## Command Reference

### `/spec setup`

One-time (or incremental) setup for using the skill in a repo. Adds `.specs_skill_state/` to gitignore, creates `/specs/projects/` directories, detects monorepo layout, and checks for commonly-needed configuration.

→ Read [setup command reference](references/cmd_setup.md)

### `/spec new_project` or `/spec new`

Create a new project from scratch. Walks through planning steps: project overview, functional spec, architecture (with optional component designs), and implementation plan. Sets this as your active project.

→ Read [new project command reference](references/cmd_new_project.md)

### `/spec continue` or `/spec cont`

Resume work on the active project. Shows current state and routes to the next logical action — continue speccing, implement next phase, or review code.

→ Read [continue command reference](references/cmd_continue.md)

### `/spec implement` or `/spec impl`

Implement the active project. Routes to phase-specific or full implementation. Use `/spec implement next` for one phase, `/spec implement all` for all remaining, or `/spec implement phase N` for a specific phase.

→ Read [implement command reference](references/cmd_implement.md)

### `/spec cr` or `/spec code_review`

Structured, spec-aware code review. Reviews `git diff` by default, or a specified scope. Always runs as a sub-agent with clean context.

→ Read [code review command reference](references/cmd_code_review.md)

### Bare `/spec` — Router

Reads current state (active project, artifact statuses) and presents relevant options. Never requires routing — direct commands always work. Can also interpret open-ended requests.

To check state: read `.specs_skill_state/current_project.md` and scan artifact frontmatter. If no project exists, suggest `new_project` or `setup`. If project in progress, show state and suggest the next action.

## Project Structure

Every project lives under `/specs/projects/PROJECT_NAME/`:

| File | Created During | Purpose |
|------|---------------|---------|
| `project_overview.md` | new_project Step 1 | Your description of what to build |
| `functional_spec.md` | new_project Step 2 | Features, behaviors, edge cases, contracts |
| `ui_design.md` | new_project Step 3 | UI structure, screens, navigation (conditional) |
| `architecture.md` | new_project Step 4 | Technical design, deep enough for coding |
| `/components/NAME.md` | new_project Step 5 | Per-component detailed design (conditional) |
| `implementation_plan.md` | new_project Step 6 | Phased build order as checklist |
| `/phase_plans/phase_N.md` | Implementation | Per-phase plan written by coding agent |

## Artifact Conventions

All spec files use YAML frontmatter with a `status` field:

```yaml
---
status: draft
---
```

Valid statuses: `draft`, `complete`.

- Artifacts start as `draft` when created
- Mark `complete` after user confirmation
- If a completed artifact is edited, downstream artifacts cascade to `draft` (if they may be affected)

Dependency chain: `project_overview → functional_spec → architecture → components → implementation_plan`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The dependency chain described here is missing the ui_design step, which is mentioned in other parts of the documentation (e.g., cmd_continue.md and cmd_new_project.md) as a conditional step between functional_spec and architecture. To maintain consistency, it should be included here.

Suggested change
Dependency chain: `project_overview → functional_spec → architecture → components → implementation_plan`
Dependency chain: `project_overview → functional_spec → ui_design → architecture → components → implementation_plan`


Phase plans are outside the cascade — generated fresh during implementation.

## State Management

The file `.specs_skill_state/current_project.md` (git-ignored) tracks your active project:

```
Current Project: /specs/projects/project_name
```
Comment on lines +107 to +109
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add a language tag to the state-file example block.

The fenced block is unlabeled; use text for markdownlint compatibility and consistency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.cursor/skills/specs/SKILL.md around lines 107 - 109, The fenced code block
showing "Current Project: /specs/projects/project_name" is unlabeled; update
that triple-backtick fence to specify the language tag `text` so the block
becomes ```text — locate the code block containing the string "Current Project:
/specs/projects/project_name" in SKILL.md and add the `text` tag to the opening
fence for markdownlint compatibility and consistency.


This file is per-worktree (git-ignored), so you can have parallel worktrees with different active projects.

## Monorepo Support

For monorepos (multiple sub-projects in one repo):

- `/spec setup` discovers sub-projects by scanning for root markers (`pyproject.toml`, `package.json`, etc.)
- Each sub-project gets its own `/specs/projects/` directory
- `/specs/monorepo.md` at repo root describes the layout
- Cross-project work lives at root `/specs/projects/`

→ See `/spec setup` for discovery and setup.

## Extensibility

The skill provides the process. Project-specific details come from your environment:

**From the skill:** The workflow, general guidance ("run automated checks"), persona-driven quality standards

**From your system prompt:** Test commands, lint/format commands, code style, CR standards, project-specific constraints

The skill references these generically: "run the project's automated checks" not "run `uv run ./checks.sh`."

→ See `/spec setup` for help configuring external knowledge.
69 changes: 69 additions & 0 deletions .cursor/skills/specs/references/cmd_code_review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# `/spec cr` — Code Review

Structured, spec-aware code review. Aliases: `/spec cr`, `/spec code_review`.

## Key Principle

The CR agent never has the coding agent's context. Decisions must be captured in code and specs, not in context windows.

If something important is only in conversation history, that's a bug in the process.

## Determine Scope

- **No arguments**: Review `git diff` (unstaged + staged changes)
- **Given scope**: Review that scope (e.g., "review file X", "review phase 3", "review src/main.rs")

## Execution

Always run as a sub-agent — spawned fresh, no prior context from coding.

→ Read [references/spawning_subagents.md](references/spawning_subagents.md) for how to spawn sub-agents.

Pass the prompt from [references/cr_agent_prompt.md](references/cr_agent_prompt.md), plus scope description.

Comment on lines +20 to +23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix broken relative reference links in this file.

Because this file already lives in references/, links like references/spawning_subagents.md and references/cr_agent_prompt.md point to references/references/... and won’t resolve correctly. Use sibling-relative paths.

Proposed fix
-→ Read [references/spawning_subagents.md](references/spawning_subagents.md) for how to spawn sub-agents.
+→ Read [spawning_subagents.md](spawning_subagents.md) for how to spawn sub-agents.

-Pass the prompt from [references/cr_agent_prompt.md](references/cr_agent_prompt.md), plus scope description.
+Pass the prompt from [cr_agent_prompt.md](cr_agent_prompt.md), plus scope description.

-- [references/spawning_subagents.md](references/spawning_subagents.md) — How to spawn sub-agents
-- [references/cr_agent_prompt.md](references/cr_agent_prompt.md) — Prompt passed to CR sub-agent
+- [spawning_subagents.md](spawning_subagents.md) — How to spawn sub-agents
+- [cr_agent_prompt.md](cr_agent_prompt.md) — Prompt passed to CR sub-agent

Also applies to: 68-69

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.cursor/skills/specs/references/cmd_code_review.md around lines 20 - 23, The
markdown contains incorrect sibling links like
"references/spawning_subagents.md" and "references/cr_agent_prompt.md" which
resolve to references/references/...; change them to sibling-relative paths
"./spawning_subagents.md" and "./cr_agent_prompt.md" (and update any other
occurrences of those same link strings elsewhere in the file, e.g., the
occurrences near the bottom that mirror lines 68-69) so the links point
correctly to the files in the same directory.

### Example invocation

> Spawn a code review sub-agent with the following task:
>
> "Review the git diff using the spec-driven development code review guidelines. The project is at [path]. Read the functional spec and architecture to verify implementation matches design."

## Re-Review

If the user provides prior CR feedback (or this is called from a loop), pass it as `<prior_cr_feedback>` to the CR sub-agent:

```
<prior_cr_feedback>
[Prior CR content here]
</prior_cr_feedback>
```
Comment on lines +34 to +38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add a language tag to the fenced example block.

Line 34 starts a fenced block without a language. Tagging it (e.g., xml) keeps markdown lint clean and improves readability.

🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 34-34: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.cursor/skills/specs/references/cmd_code_review.md around lines 34 - 38, The
fenced example block beginning with the triple backticks that contains the
<prior_cr_feedback> element lacks a language tag; update the opening fence (the
``` that starts the block) to include a language identifier such as xml (e.g.,
change ``` to ```xml) so the block is properly syntax-tagged and markdown lint
warnings are resolved.


The CR prompt handles verification of prior issues.

## Post-Review

Present findings to the user:

> Code review complete:
>
> ### Critical (must fix)
> - [file:line] [description]
>
> ### Moderate (should fix)
> - [file:line] [description]
>
> ### Mild (consider fixing)
> - [file:line] [description]
>
> [Or: No issues found — implementation looks good!]

If issues exist and user wants fixes:

- User can fix themselves, then re-run `/spec cr` with prior feedback
- Or coding agent can address them, then re-run CR with prior feedback

The loop continues until clean.

## References

- [references/spawning_subagents.md](references/spawning_subagents.md) — How to spawn sub-agents
- [references/cr_agent_prompt.md](references/cr_agent_prompt.md) — Prompt passed to CR sub-agent
90 changes: 90 additions & 0 deletions .cursor/skills/specs/references/cmd_continue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# `/spec continue` — Resume Work

Resume work on the active project. The "what should I do next?" command.

## Process

### 1. Read State

Load `.specs_skill_state/current_project.md` to find the active project:

```
Current Project: /specs/projects/PROJECT_NAME
```

### 2. No Active Project

If no active project (file doesn't exist or is empty):

List available project directories under `/specs/projects/`:

> No active project found. Available projects:
> - [project1]
> - [project2]
> - [...]
>
> Which project would you like to work on?

Set the selected project as active and proceed to step 3.

### 3. Determine Current State

Check the frontmatter `status` on each artifact in dependency order:

```
project_overview.md → functional_spec.md → ui_design.md (if exists)
→ architecture.md → components/ (if exists) → implementation_plan.md
```
Comment on lines +34 to +37
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Specify a language for the dependency-order fenced block.

Add text to the fence starting at Line 34 to satisfy markdownlint and keep formatting consistent.

🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 34-34: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.cursor/skills/specs/references/cmd_continue.md around lines 34 - 37, The
fenced code block that currently contains the dependency order list (the block
showing "project_overview.md → functional_spec.md → ui_design.md (if exists) →
architecture.md → components/ (if exists) → implementation_plan.md") should have
a language specified to satisfy markdownlint; change the opening fence from ```
to ```text so the block is marked as plain text and formatting/linting pass for
the fence starting at that dependency-order block.


- **If any spec artifact is missing or `status: draft`**: Resume the `new_project` flow at the next incomplete step
- **If all specs are `complete`**: Implementation time

### 4. Routing Logic

**If in speccing phase (artifacts incomplete):**

> Project [PROJECT_NAME] — continuing with [next step name]:
>
> - [artifact_name.md] is [draft/missing]
> - [next steps]
>
> Proceeding with [step name]...

Load the corresponding step reference file (step_functional_spec.md, step_architecture.md, etc.) and proceed with that step.

**If all specs complete but phases remain:**

> Project [PROJECT_NAME] — all specs complete. Ready to implement:
>
> - [ ] Phase 1: [description]
> - [ ] Phase 2: [description]
> - [ ]
>
> Implement next phase only, or all remaining phases?

This routes to `/spec implement` behavior.

**If all phases complete:**

> Project [PROJECT_NAME] — all phases implemented!
>
> What would you like to do?
> - Start a new project: `/spec new_project`
> - Review code: `/spec cr`
> - Something else

### 5. Confirm

Always confirm before taking action:

> About to: [action description]
>
> Proceed?

Wait for user confirmation before executing.

## Notes

- This command is a router — it doesn't do the work itself, it determines what to do next and loads the appropriate reference
- State is read from artifact frontmatter, not from a separate tracking file
- If user manually edited files and states are inconsistent, surface that and ask how to resolve
Loading
Loading