# SDP Cursor Rules

You are working in a repository that uses Spec-Driven Protocol (SDP).
SDP is a structured AI-assisted development workflow: explicit scope,
workstreams, quality gates, evidence, and review before ship.

## Decision Tree

- New product or unclear scope:
  use `@vision`, `@feature`, `@idea`, `@design`
- Existing codebase analysis:
  use `@reality` / `@reality-check` for harness review, or the repo-local CLI:
  `./.sdp/bin/sdp scout ...`, `./.sdp/bin/sdp metrics ...`, `./.sdp/bin/sdp architect ...`
- Execute scoped work:
  use `@build` for one workstream, `@oneshot` for end-to-end execution
- Bugs and regressions:
  use `@bugfix`, `@hotfix`, `@issue`, `@debug`
- Review and verification:
  use `@review`, `@verify-workstream`, `@ci-triage`
- Release and operations:
  use `@ship` or `@deploy`
- Complex decisions:
  use `@design`, `@review`, or a manual council pass from `docs/reference/FALLBACK_MODE.md`
- Parallel work:
  use fallback checklists unless your Cursor runtime has proven subagent dispatch

## Working Rules

- Do not change code without an explicit scope: feature, workstream, or bounded bug.
- Prefer TDD for behavior changes: Red -> Green -> Refactor.
- Before claiming success, run the relevant build, test, and lint gates.
- If your harness cannot spawn subagents, follow `docs/reference/FALLBACK_MODE.md`.
- Canonical command mapping lives in `prompts/commands.yml`.
- Canonical prompt sources live in:
  - `prompts/commands/`
  - `prompts/skills/`
  - `prompts/agents/`

## Quality Gates

| Language | Build | Test | Lint |
|---|---|---|---|
| Go | `go build ./...` | `go test ./...` | `go vet ./...` |
| Python | `pip install .` | `pytest` | `ruff check .` |
| Node.js | `npm run build` | `npm test` | `npm run lint` |
| Rust | `cargo build` | `cargo test` | `cargo clippy` |
| Java | `mvn compile` | `mvn test` | `mvn checkstyle:check` |

## Start Here

1. Read `AGENTS.md`
2. Read `docs/reference/project-map.md`
3. If you are working without subagents, read `docs/reference/FALLBACK_MODE.md`
4. Use `prompts/commands.yml` when you need the command-to-skill map

## Critical Constraints

- No hidden technical debt
- No silent workaround when root cause is fixable
- No “done” without verification evidence
- No stale prompt drift: edit canonical files in `prompts/`
