govkit 0.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cli/__init__.py +0 -0
- cli/agents/claude-code/claude-md/backend-api.md +206 -0
- cli/agents/claude-code/claude-md/backend-cli.md +206 -0
- cli/agents/claude-code/claude-md/l3-backend-api.md +141 -0
- cli/agents/claude-code/claude-md/l3-backend-cli.md +142 -0
- cli/agents/claude-code/claude-md/l3-ui-angular.md +105 -0
- cli/agents/claude-code/claude-md/l3-ui-react.md +105 -0
- cli/agents/claude-code/claude-md/l5-backend-api.md +184 -0
- cli/agents/claude-code/claude-md/l5-backend-cli.md +114 -0
- cli/agents/claude-code/claude-md/ui-angular.md +120 -0
- cli/agents/claude-code/claude-md/ui-react.md +118 -0
- cli/agents/claude-code/manifest.json +270 -0
- cli/agents/claude-code/rules/backend/adapters.md +32 -0
- cli/agents/claude-code/rules/backend/api.md +21 -0
- cli/agents/claude-code/rules/backend/guardrails.md +26 -0
- cli/agents/claude-code/rules/backend/llm-evaluation.md +30 -0
- cli/agents/claude-code/rules/backend/llm-gateway.md +25 -0
- cli/agents/claude-code/rules/backend/llm-observability.md +24 -0
- cli/agents/claude-code/rules/backend/ports.md +26 -0
- cli/agents/claude-code/rules/backend/security.md +28 -0
- cli/agents/claude-code/rules/backend/services.md +27 -0
- cli/agents/claude-code/rules/cli/cli.md +24 -0
- cli/agents/claude-code/rules/generic/repo-scope.md +82 -0
- cli/agents/claude-code/rules/generic/spec-compliance.md +40 -0
- cli/agents/claude-code/rules/generic/test-first.md +44 -0
- cli/agents/claude-code/rules/ui-angular/accessibility.md +42 -0
- cli/agents/claude-code/rules/ui-angular/api.md +44 -0
- cli/agents/claude-code/rules/ui-angular/components.md +33 -0
- cli/agents/claude-code/rules/ui-angular/viewmodel.md +13 -0
- cli/agents/claude-code/rules/ui-react/accessibility.md +36 -0
- cli/agents/claude-code/rules/ui-react/api.md +39 -0
- cli/agents/claude-code/rules/ui-react/components.md +31 -0
- cli/agents/claude-code/rules/ui-react/viewmodel.md +13 -0
- cli/agents/claude-code/skills/backend/adr-author/SKILL.md +55 -0
- cli/agents/claude-code/skills/backend/architecture-preflight/SKILL.md +76 -0
- cli/agents/claude-code/skills/backend/eval-suite-planning/SKILL.md +74 -0
- cli/agents/claude-code/skills/backend/genai-preflight/SKILL.md +67 -0
- cli/agents/claude-code/skills/backend/implementation-plan/SKILL.md +82 -0
- cli/agents/claude-code/skills/backend/l3-implementation-plan/SKILL.md +62 -0
- cli/agents/claude-code/skills/backend/l3-spec-planning/SKILL.md +45 -0
- cli/agents/claude-code/skills/backend/spec-planning/SKILL.md +60 -0
- cli/agents/claude-code/skills/ui/adr-author/SKILL.md +27 -0
- cli/agents/claude-code/skills/ui/architecture-preflight/SKILL.md +87 -0
- cli/agents/claude-code/skills/ui/implementation-plan/SKILL.md +58 -0
- cli/agents/claude-code/skills/ui/l3-implementation-plan/SKILL.md +58 -0
- cli/agents/claude-code/skills/ui/l3-spec-planning/SKILL.md +35 -0
- cli/agents/claude-code/skills/ui/spec-planning/SKILL.md +71 -0
- cli/agents/codex/agents-md/backend-api.md +206 -0
- cli/agents/codex/agents-md/backend-cli.md +206 -0
- cli/agents/codex/agents-md/l3-backend-api.md +197 -0
- cli/agents/codex/agents-md/l3-backend-cli.md +198 -0
- cli/agents/codex/agents-md/l3-ui-angular.md +135 -0
- cli/agents/codex/agents-md/l3-ui-react.md +135 -0
- cli/agents/codex/agents-md/l5-backend-api.md +184 -0
- cli/agents/codex/agents-md/l5-backend-cli.md +114 -0
- cli/agents/codex/agents-md/ui-angular.md +123 -0
- cli/agents/codex/agents-md/ui-react.md +121 -0
- cli/agents/codex/manifest.json +262 -0
- cli/agents/codex/rules/backend/adapters.md +27 -0
- cli/agents/codex/rules/backend/api.md +16 -0
- cli/agents/codex/rules/backend/guardrails.md +26 -0
- cli/agents/codex/rules/backend/llm-evaluation.md +30 -0
- cli/agents/codex/rules/backend/llm-gateway.md +25 -0
- cli/agents/codex/rules/backend/llm-observability.md +24 -0
- cli/agents/codex/rules/backend/ports.md +21 -0
- cli/agents/codex/rules/backend/security.md +22 -0
- cli/agents/codex/rules/backend/services.md +22 -0
- cli/agents/codex/rules/cli/cli.md +18 -0
- cli/agents/codex/rules/generic/repo-scope.md +82 -0
- cli/agents/codex/rules/generic/spec-compliance.md +41 -0
- cli/agents/codex/rules/generic/test-first.md +44 -0
- cli/agents/codex/rules/ui-angular/accessibility.md +42 -0
- cli/agents/codex/rules/ui-angular/api.md +44 -0
- cli/agents/codex/rules/ui-angular/components.md +33 -0
- cli/agents/codex/rules/ui-angular/viewmodel.md +13 -0
- cli/agents/codex/rules/ui-react/accessibility.md +36 -0
- cli/agents/codex/rules/ui-react/api.md +39 -0
- cli/agents/codex/rules/ui-react/components.md +31 -0
- cli/agents/codex/rules/ui-react/viewmodel.md +13 -0
- cli/agents/codex/skills/backend/adr-author/SKILL.md +55 -0
- cli/agents/codex/skills/backend/architecture-preflight/SKILL.md +76 -0
- cli/agents/codex/skills/backend/eval-suite-planning/SKILL.md +74 -0
- cli/agents/codex/skills/backend/genai-preflight/SKILL.md +67 -0
- cli/agents/codex/skills/backend/implementation-plan/SKILL.md +82 -0
- cli/agents/codex/skills/backend/l3-implementation-plan/SKILL.md +62 -0
- cli/agents/codex/skills/backend/l3-spec-planning/SKILL.md +45 -0
- cli/agents/codex/skills/backend/spec-planning/SKILL.md +60 -0
- cli/agents/codex/skills/ui/adr-author/SKILL.md +25 -0
- cli/agents/codex/skills/ui/architecture-preflight/SKILL.md +87 -0
- cli/agents/codex/skills/ui/implementation-plan/SKILL.md +60 -0
- cli/agents/codex/skills/ui/l3-implementation-plan/SKILL.md +58 -0
- cli/agents/codex/skills/ui/l3-spec-planning/SKILL.md +35 -0
- cli/agents/codex/skills/ui/spec-planning/SKILL.md +73 -0
- cli/agents/copilot/copilot-instructions/backend-api.md +382 -0
- cli/agents/copilot/copilot-instructions/backend-cli.md +384 -0
- cli/agents/copilot/copilot-instructions/l3-backend-api.md +178 -0
- cli/agents/copilot/copilot-instructions/l3-backend-cli.md +179 -0
- cli/agents/copilot/copilot-instructions/l3-ui-angular.md +114 -0
- cli/agents/copilot/copilot-instructions/l3-ui-react.md +114 -0
- cli/agents/copilot/copilot-instructions/l5-backend-api.md +134 -0
- cli/agents/copilot/copilot-instructions/l5-backend-cli.md +88 -0
- cli/agents/copilot/copilot-instructions/ui-angular.md +161 -0
- cli/agents/copilot/copilot-instructions/ui-react.md +209 -0
- cli/agents/copilot/instructions/backend/adapters.instructions.md +29 -0
- cli/agents/copilot/instructions/backend/api.instructions.md +18 -0
- cli/agents/copilot/instructions/backend/guardrails.instructions.md +16 -0
- cli/agents/copilot/instructions/backend/llm-evaluation.instructions.md +18 -0
- cli/agents/copilot/instructions/backend/llm-gateway.instructions.md +17 -0
- cli/agents/copilot/instructions/backend/llm-observability.instructions.md +17 -0
- cli/agents/copilot/instructions/backend/ports.instructions.md +23 -0
- cli/agents/copilot/instructions/backend/security.instructions.md +26 -0
- cli/agents/copilot/instructions/backend/services.instructions.md +24 -0
- cli/agents/copilot/instructions/cli/cli.instructions.md +22 -0
- cli/agents/copilot/instructions/generic/repo-scope.instructions.md +86 -0
- cli/agents/copilot/instructions/generic/spec-compliance.instructions.md +45 -0
- cli/agents/copilot/instructions/generic/test-first.instructions.md +48 -0
- cli/agents/copilot/instructions/ui-angular/accessibility.instructions.md +37 -0
- cli/agents/copilot/instructions/ui-angular/api.instructions.md +16 -0
- cli/agents/copilot/instructions/ui-angular/components.instructions.md +21 -0
- cli/agents/copilot/instructions/ui-angular/viewmodel.instructions.md +17 -0
- cli/agents/copilot/instructions/ui-react/accessibility.instructions.md +34 -0
- cli/agents/copilot/instructions/ui-react/api.instructions.md +18 -0
- cli/agents/copilot/instructions/ui-react/components.instructions.md +19 -0
- cli/agents/copilot/instructions/ui-react/viewmodel.instructions.md +17 -0
- cli/agents/copilot/manifest.json +228 -0
- cli/agents/copilot/skills/backend/adr-author/SKILL.md +62 -0
- cli/agents/copilot/skills/backend/architecture-preflight/SKILL.md +78 -0
- cli/agents/copilot/skills/backend/eval-suite-planning/SKILL.md +35 -0
- cli/agents/copilot/skills/backend/genai-preflight/SKILL.md +35 -0
- cli/agents/copilot/skills/backend/implementation-plan/SKILL.md +157 -0
- cli/agents/copilot/skills/backend/l3-implementation-plan/SKILL.md +98 -0
- cli/agents/copilot/skills/backend/l3-spec-planning/SKILL.md +46 -0
- cli/agents/copilot/skills/backend/spec-planning/SKILL.md +79 -0
- cli/agents/copilot/skills/ui/adr-author/SKILL.md +39 -0
- cli/agents/copilot/skills/ui/architecture-preflight/SKILL.md +92 -0
- cli/agents/copilot/skills/ui/implementation-plan/SKILL.md +56 -0
- cli/agents/copilot/skills/ui/l3-implementation-plan/SKILL.md +60 -0
- cli/agents/copilot/skills/ui/l3-spec-planning/SKILL.md +37 -0
- cli/agents/copilot/skills/ui/spec-planning/SKILL.md +68 -0
- cli/ci/README.md +178 -0
- cli/ci/azure/deepeval-gate.yml +64 -0
- cli/ci/azure/eval-gate.yml +139 -0
- cli/ci/azure/guardrails-check.yml +73 -0
- cli/ci/azure/l3-quality-gate.yml +117 -0
- cli/ci/azure/promptfoo-gate.yml +62 -0
- cli/ci/azure/quality-gate.yml +180 -0
- cli/ci/azure/repo-scope-check.yml +110 -0
- cli/ci/azure/ui-eval-gate.yml +174 -0
- cli/ci/azure/ui-quality-gate.yml +153 -0
- cli/ci/github/deepeval-gate.yml +75 -0
- cli/ci/github/eval-gate.yml +141 -0
- cli/ci/github/guardrails-check.yml +88 -0
- cli/ci/github/l3-quality-gate.yml +121 -0
- cli/ci/github/promptfoo-gate.yml +73 -0
- cli/ci/github/quality-gate.yml +181 -0
- cli/ci/github/repo-scope-check.yml +113 -0
- cli/ci/github/ui-eval-gate.yml +170 -0
- cli/ci/github/ui-quality-gate.yml +146 -0
- cli/docs/CROSS_REPO_FEATURES.md +416 -0
- cli/docs/REPO_SCOPE_ANALYSIS_GUIDANCE.md +75 -0
- cli/docs/backend/architecture/ADR/TEMPLATE.md +151 -0
- cli/docs/backend/architecture/AGENT_ARCHITECTURE.md +336 -0
- cli/docs/backend/architecture/API_CONVENTIONS.md +129 -0
- cli/docs/backend/architecture/ARCH_CONTRACT.md +103 -0
- cli/docs/backend/architecture/BOUNDARIES.md +71 -0
- cli/docs/backend/architecture/CLI_CONVENTIONS.md +189 -0
- cli/docs/backend/architecture/CROSS_CUTTING_CONCERNS.md +184 -0
- cli/docs/backend/architecture/DESIGN_PRINCIPLES.md +61 -0
- cli/docs/backend/architecture/ERROR_MAPPING.md +128 -0
- cli/docs/backend/architecture/EVALUATION_LLM_CONTRACT.md +207 -0
- cli/docs/backend/architecture/GHERKIN_CONVENTIONS.md +133 -0
- cli/docs/backend/architecture/GHERKIN_TAGS.md +82 -0
- cli/docs/backend/architecture/GUARDRAILS_CONTRACT.md +168 -0
- cli/docs/backend/architecture/LAYER_IMPLEMENTATION.md +445 -0
- cli/docs/backend/architecture/LLM_GATEWAY_CONTRACT.md +145 -0
- cli/docs/backend/architecture/OBSERVABILITY_LLM_CONTRACT.md +159 -0
- cli/docs/backend/architecture/OBSERVABILITY_PORT_CONTRACT.md +167 -0
- cli/docs/backend/architecture/REPO_STRUCTURE_README.md +382 -0
- cli/docs/backend/architecture/SECURITY_AUTH_PATTERNS.md +130 -0
- cli/docs/backend/architecture/TECH_STACK.md +504 -0
- cli/docs/backend/architecture/TESTING.md +392 -0
- cli/docs/backend/evaluation/EVAL_STACK.md +198 -0
- cli/docs/backend/evaluation/FIRST_SCORING_RUBRIC.md +87 -0
- cli/docs/backend/evaluation/VIRTUE_SCORING_RUBRIC.md +131 -0
- cli/docs/backend/evaluation/eval_criteria.md +246 -0
- cli/docs/backend/guides/deepeval-usage.md +132 -0
- cli/docs/backend/guides/guardrails-ai-setup.md +134 -0
- cli/docs/backend/guides/langfuse-integration.md +103 -0
- cli/docs/backend/guides/litellm-setup.md +118 -0
- cli/docs/backend/guides/nemo-guardrails-setup.md +135 -0
- cli/docs/backend/guides/openllmetry-setup.md +98 -0
- cli/docs/backend/guides/promptfoo-usage.md +146 -0
- cli/docs/backend/guides/ragas-evaluation.md +139 -0
- cli/docs/stacks/README.md +56 -0
- cli/docs/stacks/dotnet-aspnet/API_CONVENTIONS.md +180 -0
- cli/docs/stacks/dotnet-aspnet/LAYER_IMPLEMENTATION.md +388 -0
- cli/docs/stacks/dotnet-aspnet/OBSERVABILITY_PORT_CONTRACT.md +209 -0
- cli/docs/stacks/dotnet-aspnet/SECURITY_AUTH_PATTERNS.md +175 -0
- cli/docs/stacks/dotnet-aspnet/TECH_STACK.md +455 -0
- cli/docs/stacks/dotnet-aspnet/TESTING.md +384 -0
- cli/docs/stacks/go-gin/API_CONVENTIONS.md +230 -0
- cli/docs/stacks/go-gin/LAYER_IMPLEMENTATION.md +342 -0
- cli/docs/stacks/go-gin/OBSERVABILITY_PORT_CONTRACT.md +220 -0
- cli/docs/stacks/go-gin/SECURITY_AUTH_PATTERNS.md +223 -0
- cli/docs/stacks/go-gin/TECH_STACK.md +408 -0
- cli/docs/stacks/go-gin/TESTING.md +298 -0
- cli/docs/stacks/java-spring-boot/API_CONVENTIONS.md +228 -0
- cli/docs/stacks/java-spring-boot/LAYER_IMPLEMENTATION.md +323 -0
- cli/docs/stacks/java-spring-boot/OBSERVABILITY_PORT_CONTRACT.md +199 -0
- cli/docs/stacks/java-spring-boot/SECURITY_AUTH_PATTERNS.md +188 -0
- cli/docs/stacks/java-spring-boot/TECH_STACK.md +451 -0
- cli/docs/stacks/java-spring-boot/TESTING.md +286 -0
- cli/docs/stacks/nodejs-fastify/API_CONVENTIONS.md +228 -0
- cli/docs/stacks/nodejs-fastify/LAYER_IMPLEMENTATION.md +325 -0
- cli/docs/stacks/nodejs-fastify/OBSERVABILITY_PORT_CONTRACT.md +183 -0
- cli/docs/stacks/nodejs-fastify/SECURITY_AUTH_PATTERNS.md +199 -0
- cli/docs/stacks/nodejs-fastify/TECH_STACK.md +432 -0
- cli/docs/stacks/nodejs-fastify/TESTING.md +279 -0
- cli/docs/ui/architecture/ACCESSIBILITY_STANDARDS.md +482 -0
- cli/docs/ui/architecture/ADR/TEMPLATE.md +159 -0
- cli/docs/ui/architecture/MVVM_CONTRACT.md +90 -0
- cli/docs/ui/architecture/angular/COMPONENT_CONVENTIONS.md +291 -0
- cli/docs/ui/architecture/angular/STATE_MANAGEMENT.md +131 -0
- cli/docs/ui/architecture/angular/TECH_STACK.md +84 -0
- cli/docs/ui/architecture/react/COMPONENT_CONVENTIONS.md +236 -0
- cli/docs/ui/architecture/react/STATE_MANAGEMENT.md +106 -0
- cli/docs/ui/architecture/react/TECH_STACK.md +96 -0
- cli/docs/ui/evaluation/FIRST_SCORING_RUBRIC.md +89 -0
- cli/docs/ui/evaluation/VIRTUE_SCORING_RUBRIC.md +134 -0
- cli/docs/ui/evaluation/eval_criteria.md +111 -0
- cli/features/README.md +42 -0
- cli/features/example-jwt-unification/acceptance.feature +73 -0
- cli/features/example-jwt-unification/nfrs.md +102 -0
- cli/features/schema_contract_example/acceptance.feature +91 -0
- cli/features/schema_contract_example/architecture_preflight.md +125 -0
- cli/features/schema_contract_example/eval_criteria.yaml +12 -0
- cli/features/schema_contract_example/nfrs.md +47 -0
- cli/features/schema_contract_example/plan.md +252 -0
- cli/features/starter_backend/acceptance.feature +56 -0
- cli/features/starter_backend/architecture_preflight.md +153 -0
- cli/features/starter_backend/eval_criteria.yaml +42 -0
- cli/features/starter_backend/nfrs.md +47 -0
- cli/features/starter_backend/plan.md +172 -0
- cli/features/starter_backend_l3/acceptance.feature +56 -0
- cli/features/starter_backend_l3/nfrs.md +47 -0
- cli/features/starter_backend_l3/plan.md +91 -0
- cli/features/starter_backend_l5/acceptance.feature +81 -0
- cli/features/starter_backend_l5/architecture_preflight.md +212 -0
- cli/features/starter_backend_l5/eval_criteria.yaml +82 -0
- cli/features/starter_backend_l5/nfrs.md +63 -0
- cli/features/starter_backend_l5/plan.md +207 -0
- cli/features/starter_cli/acceptance.feature +55 -0
- cli/features/starter_cli/architecture_preflight.md +153 -0
- cli/features/starter_cli/eval_criteria.yaml +25 -0
- cli/features/starter_cli/nfrs.md +44 -0
- cli/features/starter_cli/plan.md +172 -0
- cli/features/starter_cli_l3/acceptance.feature +55 -0
- cli/features/starter_cli_l3/nfrs.md +44 -0
- cli/features/starter_cli_l3/plan.md +91 -0
- cli/features/starter_cli_l5/acceptance.feature +81 -0
- cli/features/starter_cli_l5/architecture_preflight.md +212 -0
- cli/features/starter_cli_l5/eval_criteria.yaml +40 -0
- cli/features/starter_cli_l5/nfrs.md +63 -0
- cli/features/starter_cli_l5/plan.md +207 -0
- cli/features/starter_ui/acceptance.feature +72 -0
- cli/features/starter_ui/architecture_preflight.md +111 -0
- cli/features/starter_ui/eval_criteria.yaml +25 -0
- cli/features/starter_ui/nfrs.md +55 -0
- cli/features/starter_ui/plan.md +166 -0
- cli/features/starter_ui_l3/acceptance.feature +72 -0
- cli/features/starter_ui_l3/nfrs.md +55 -0
- cli/features/starter_ui_l3/plan.md +89 -0
- cli/features/ui_task_dashboard/acceptance.feature +112 -0
- cli/features/ui_task_dashboard/architecture_preflight.md +145 -0
- cli/features/ui_task_dashboard/eval_criteria.yaml +17 -0
- cli/features/ui_task_dashboard/nfrs.md +60 -0
- cli/features/ui_task_dashboard/plan.md +258 -0
- cli/governance/backend/importlinter-reference.toml +39 -0
- cli/governance/backend/schemas/eval_criteria.schema.json +170 -0
- cli/governance/backend/schemas/guardrails_config.schema.json +47 -0
- cli/governance/backend/templates/architecture_preflight.md +146 -0
- cli/governance/backend/templates/l3-plan.md +92 -0
- cli/governance/backend/templates/l5-architecture-preflight.md +212 -0
- cli/governance/backend/templates/l5-plan.md +207 -0
- cli/governance/backend/templates/plan.md +171 -0
- cli/governance/schemas/agent-manifest.schema.json +114 -0
- cli/governance/schemas/evaluation_prediction.schema.json +95 -0
- cli/governance/ui/schemas/eval_criteria.schema.json +42 -0
- cli/governance/ui/templates/architecture_preflight.md +69 -0
- cli/governance/ui/templates/l3-plan.md +90 -0
- cli/governance/ui/templates/plan.md +90 -0
- cli/govkit.py +391 -0
- cli/validate.py +441 -0
- govkit-0.5.0.dist-info/METADATA +731 -0
- govkit-0.5.0.dist-info/RECORD +299 -0
- govkit-0.5.0.dist-info/WHEEL +4 -0
- govkit-0.5.0.dist-info/entry_points.txt +2 -0
- govkit-0.5.0.dist-info/licenses/LICENSE +178 -0
- govkit-0.5.0.dist-info/licenses/NOTICE.md +4 -0
cli/__init__.py
ADDED
|
File without changes
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Governed AI Delivery — Claude Code Instructions
|
|
2
|
+
|
|
3
|
+
These instructions are mandatory. Claude operates as a governed delivery system, not an open coding environment.
|
|
4
|
+
|
|
5
|
+
Repository artifacts are the source of truth. Chat history is not.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Operating Mode
|
|
10
|
+
|
|
11
|
+
Claude operates aligned to:
|
|
12
|
+
|
|
13
|
+
- Product specifications under `features/`
|
|
14
|
+
- Architecture contracts under `docs/backend/architecture/`
|
|
15
|
+
- Evaluation standards under `docs/backend/evaluation/`
|
|
16
|
+
- Governance rules under `governance/`
|
|
17
|
+
|
|
18
|
+
Before planning or generating code:
|
|
19
|
+
|
|
20
|
+
- Read all files under `docs/backend/architecture/`
|
|
21
|
+
- Read `docs/backend/evaluation/eval_criteria.md`
|
|
22
|
+
- Apply architecture, testing, technology, and evaluation contracts as binding constraints
|
|
23
|
+
- Confirm required feature artifacts exist
|
|
24
|
+
|
|
25
|
+
If required inputs are missing, stop and ask.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Mandatory Feature Structure
|
|
30
|
+
|
|
31
|
+
Every feature must live under `features/<feature_name>` with these required artifacts:
|
|
32
|
+
|
|
33
|
+
- `acceptance.feature`
|
|
34
|
+
- `nfrs.md`
|
|
35
|
+
- `eval_criteria.yaml`
|
|
36
|
+
- `plan.md`
|
|
37
|
+
- `architecture_preflight.md`
|
|
38
|
+
|
|
39
|
+
Implementation must not begin unless all five artifacts exist.
|
|
40
|
+
|
|
41
|
+
Before proceeding to Architecture Preflight or planning:
|
|
42
|
+
|
|
43
|
+
- If `nfrs.md` contains TBD entries in any category, stop and request completion
|
|
44
|
+
- If `acceptance.feature` is empty or missing scenarios, stop and request completion
|
|
45
|
+
- If Gherkin tag coverage does not satisfy `docs/backend/architecture/GHERKIN_CONVENTIONS.md`, stop and request completion
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Feature Lifecycle (Mandatory Order — no steps may be skipped)
|
|
50
|
+
|
|
51
|
+
1. Architecture Preflight → run `/architecture-preflight`
|
|
52
|
+
2. ADR creation (if required by preflight)
|
|
53
|
+
3. Plan finalization → run `/spec-planning`
|
|
54
|
+
4. Evaluation Compliance Summary (must be in `plan.md`)
|
|
55
|
+
5. Incremental implementation → guided by `/implementation-plan`
|
|
56
|
+
6. Automated tests
|
|
57
|
+
7. Static analysis and evaluation gates
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Planning Discipline
|
|
62
|
+
|
|
63
|
+
Generate and maintain `features/<feature_name>/plan.md` based on `governance/backend/templates/plan.md`.
|
|
64
|
+
|
|
65
|
+
The plan must:
|
|
66
|
+
|
|
67
|
+
- Define explicit increments with deliverables and tests
|
|
68
|
+
- Map Gherkin scenarios to BDD integration tests
|
|
69
|
+
- Include an Evaluation Compliance Summary predicting FIRST and 7 Virtue scores
|
|
70
|
+
- Reference ADRs and architecture contracts
|
|
71
|
+
|
|
72
|
+
The Evaluation Compliance Summary must use the structured YAML prediction block from `governance/backend/templates/plan.md`. All score and evidence fields must be populated with a numeric value (0–5) and a one-sentence rationale. Null values are not permitted at plan finalization. If any average is below 4.0, revise the plan before writing any code.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## ADR Rules
|
|
77
|
+
|
|
78
|
+
An ADR is required when:
|
|
79
|
+
|
|
80
|
+
- A standard is extended, overridden, or bypassed
|
|
81
|
+
- A new architectural pattern is introduced
|
|
82
|
+
- A security or auth approach changes
|
|
83
|
+
- A boundary rule or dependency direction changes
|
|
84
|
+
- A shared schema, API contract, event definition, or data model is introduced or modified that will be consumed by other features, services, or agents
|
|
85
|
+
|
|
86
|
+
ADRs live under `docs/backend/architecture/ADR/`, follow `docs/backend/architecture/ADR/TEMPLATE.md`, and must be Accepted before implementation proceeds.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Project Documentation
|
|
91
|
+
|
|
92
|
+
Your project's language- and framework-specific conventions and standards are documented in `docs/backend/architecture/`. Before implementing in each layer, read the corresponding document:
|
|
93
|
+
|
|
94
|
+
| Layer | Document | Content |
|
|
95
|
+
|---|---|---|
|
|
96
|
+
| API / inbound adapter | `API_CONVENTIONS.md` | Routing style, request/response models, authentication, error mapping, testing |
|
|
97
|
+
| Services / domain | `ARCH_CONTRACT.md` | Architecture model, layering, approved libraries, design principles |
|
|
98
|
+
| Ports | `ARCH_CONTRACT.md` | Port interface guidelines and architecture patterns |
|
|
99
|
+
| Adapters / infrastructure | `ARCH_CONTRACT.md` + `BOUNDARIES.md` | Integration patterns, layer boundaries, dependency rules |
|
|
100
|
+
| Security / auth | `SECURITY_AUTH_PATTERNS.md` | Authentication model, token strategy, credential handling, RBAC |
|
|
101
|
+
| Testing | `TESTING.md` | Test philosophy, FIRST principles, BDD approach, test structure |
|
|
102
|
+
| Technology decisions | `TECH_STACK.md` | Approved frameworks, libraries, tools, and versions |
|
|
103
|
+
|
|
104
|
+
These documents define your stack's specific approach. The architecture principles (hexagonal architecture, boundaries, evaluation) are universal; the implementation details are here.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Implementation Rules
|
|
109
|
+
|
|
110
|
+
- Implement one increment at a time
|
|
111
|
+
- Respect all rules in `docs/backend/architecture/BOUNDARIES.md`
|
|
112
|
+
- Follow Hexagonal Architecture (ports and adapters)
|
|
113
|
+
- Use only approved frameworks from `docs/backend/architecture/TECH_STACK.md`
|
|
114
|
+
- Use approved auth patterns from `docs/backend/architecture/SECURITY_AUTH_PATTERNS.md`
|
|
115
|
+
- Follow API conventions from `docs/backend/architecture/API_CONVENTIONS.md`
|
|
116
|
+
- Follow design principles from `docs/backend/architecture/DESIGN_PRINCIPLES.md`; use findings from approved tools as defined in `docs/backend/architecture/TECH_STACK.md` — blocking findings must be resolved before proceeding
|
|
117
|
+
|
|
118
|
+
Layer-specific rules load automatically from `.claude/rules/` when editing files in each layer:
|
|
119
|
+
|
|
120
|
+
- `api.md` — `**/api/**`
|
|
121
|
+
- `services.md` — `**/services/**`
|
|
122
|
+
- `ports.md` — `**/ports/**`
|
|
123
|
+
- `adapters.md` — `**/adapters/**`
|
|
124
|
+
- `security.md` — `**/security/**` and `**/auth/**`
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Evaluation Discipline
|
|
129
|
+
|
|
130
|
+
Before implementation, read `docs/backend/evaluation/eval_criteria.md` and `features/<feature_name>/eval_criteria.yaml`. Confirm FIRST and 7 Virtue enforcement thresholds.
|
|
131
|
+
|
|
132
|
+
Implementation must not proceed unless an Evaluation Compliance Summary exists in `plan.md` with predicted averages meeting required thresholds. CI evaluation gates are binding.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Testing Requirements
|
|
137
|
+
|
|
138
|
+
Each increment must include:
|
|
139
|
+
|
|
140
|
+
- Unit tests compliant with FIRST principles
|
|
141
|
+
- BDD integration tests derived from Gherkin scenarios
|
|
142
|
+
- Contract tests when APIs, ports, or external integrations are affected
|
|
143
|
+
|
|
144
|
+
Gherkin scenarios must follow `docs/backend/architecture/GHERKIN_CONVENTIONS.md`:
|
|
145
|
+
|
|
146
|
+
- Every populated NFR category in `nfrs.md` must have at least one scenario tagged with the corresponding `@nfr-*` tag
|
|
147
|
+
- Features producing shared artifacts must include at least one `@contract` scenario
|
|
148
|
+
- Verify coverage during Architecture Preflight and plan finalization — stop if incomplete
|
|
149
|
+
|
|
150
|
+
Undocumented Gherkin gaps must be noted in `plan.md`.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Automatic Refactor Conditions
|
|
155
|
+
|
|
156
|
+
Trigger refactor before proceeding if:
|
|
157
|
+
|
|
158
|
+
- Duplicate logic detected
|
|
159
|
+
- Structural complexity excessive
|
|
160
|
+
- FIRST or 7 Virtue score below threshold
|
|
161
|
+
- Test flakiness detected
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Architecture Preflight Triggers
|
|
166
|
+
|
|
167
|
+
Architecture Preflight must be re-run (or updated) when:
|
|
168
|
+
|
|
169
|
+
- Scope expands beyond what the current preflight covers
|
|
170
|
+
- New external dependencies are introduced
|
|
171
|
+
- Security or auth patterns change
|
|
172
|
+
- Evaluation mode changes
|
|
173
|
+
- An ADR trigger condition is met
|
|
174
|
+
- A shared contract or producer relationship is introduced or modified
|
|
175
|
+
|
|
176
|
+
If Preflight status is Blocked, implementation must not proceed.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Output Expectations
|
|
181
|
+
|
|
182
|
+
Every plan and implementation output must include:
|
|
183
|
+
|
|
184
|
+
- Referenced standards (architecture contracts, eval criteria, ADRs)
|
|
185
|
+
- ADR status (Accepted / pending / not required — with justification)
|
|
186
|
+
- Architecture compliance confirmation
|
|
187
|
+
- Test coverage summary
|
|
188
|
+
- Evaluation impact summary
|
|
189
|
+
|
|
190
|
+
If alignment is unclear, stop and ask.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Commit Discipline
|
|
195
|
+
|
|
196
|
+
- Complete one increment, then commit before starting the next
|
|
197
|
+
- Each commit must be independently buildable and testable
|
|
198
|
+
- Commit message references the increment: `feat(<feature>): increment N — <name>`
|
|
199
|
+
- Do not combine multiple increments into a single commit
|
|
200
|
+
- If an increment exceeds ~300 lines of production code, split it before committing
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Authority
|
|
205
|
+
|
|
206
|
+
Architecture decisions belong to the Architect. Exceptions require an ADR and explicit approval. Claude follows standards — it does not invent them.
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Governed AI Delivery — Claude Code Instructions
|
|
2
|
+
|
|
3
|
+
These instructions are mandatory. Claude operates as a governed delivery system, not an open coding environment.
|
|
4
|
+
|
|
5
|
+
Repository artifacts are the source of truth. Chat history is not.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Operating Mode
|
|
10
|
+
|
|
11
|
+
Claude operates aligned to:
|
|
12
|
+
|
|
13
|
+
- Product specifications under `features/`
|
|
14
|
+
- Architecture contracts under `docs/backend/architecture/`
|
|
15
|
+
- Evaluation standards under `docs/backend/evaluation/`
|
|
16
|
+
- Governance rules under `governance/`
|
|
17
|
+
|
|
18
|
+
Before planning or generating code:
|
|
19
|
+
|
|
20
|
+
- Read all files under `docs/backend/architecture/`
|
|
21
|
+
- Read `docs/backend/evaluation/eval_criteria.md`
|
|
22
|
+
- Apply architecture, testing, technology, and evaluation contracts as binding constraints
|
|
23
|
+
- Confirm required feature artifacts exist
|
|
24
|
+
|
|
25
|
+
If required inputs are missing, stop and ask.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Mandatory Feature Structure
|
|
30
|
+
|
|
31
|
+
Every feature must live under `features/<feature_name>` with these required artifacts:
|
|
32
|
+
|
|
33
|
+
- `acceptance.feature`
|
|
34
|
+
- `nfrs.md`
|
|
35
|
+
- `eval_criteria.yaml`
|
|
36
|
+
- `plan.md`
|
|
37
|
+
- `architecture_preflight.md`
|
|
38
|
+
|
|
39
|
+
Implementation must not begin unless all five artifacts exist.
|
|
40
|
+
|
|
41
|
+
Before proceeding to Architecture Preflight or planning:
|
|
42
|
+
|
|
43
|
+
- If `nfrs.md` contains TBD entries in any category, stop and request completion
|
|
44
|
+
- If `acceptance.feature` is empty or missing scenarios, stop and request completion
|
|
45
|
+
- If Gherkin tag coverage does not satisfy `docs/backend/architecture/GHERKIN_CONVENTIONS.md`, stop and request completion
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Feature Lifecycle (Mandatory Order — no steps may be skipped)
|
|
50
|
+
|
|
51
|
+
1. Architecture Preflight → run `/architecture-preflight`
|
|
52
|
+
2. ADR creation (if required by preflight)
|
|
53
|
+
3. Plan finalization → run `/spec-planning`
|
|
54
|
+
4. Evaluation Compliance Summary (must be in `plan.md`)
|
|
55
|
+
5. Incremental implementation → guided by `/implementation-plan`
|
|
56
|
+
6. Automated tests
|
|
57
|
+
7. Static analysis and evaluation gates
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Planning Discipline
|
|
62
|
+
|
|
63
|
+
Generate and maintain `features/<feature_name>/plan.md` based on `governance/backend/templates/plan.md`.
|
|
64
|
+
|
|
65
|
+
The plan must:
|
|
66
|
+
|
|
67
|
+
- Define explicit increments with deliverables and tests
|
|
68
|
+
- Map Gherkin scenarios to BDD integration tests
|
|
69
|
+
- Include an Evaluation Compliance Summary predicting FIRST and 7 Virtue scores
|
|
70
|
+
- Reference ADRs and architecture contracts
|
|
71
|
+
|
|
72
|
+
The Evaluation Compliance Summary must use the structured YAML prediction block from `governance/backend/templates/plan.md`. All score and evidence fields must be populated with a numeric value (0–5) and a one-sentence rationale. Null values are not permitted at plan finalization. If any average is below 4.0, revise the plan before writing any code.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## ADR Rules
|
|
77
|
+
|
|
78
|
+
An ADR is required when:
|
|
79
|
+
|
|
80
|
+
- A standard is extended, overridden, or bypassed
|
|
81
|
+
- A new architectural pattern is introduced
|
|
82
|
+
- A security or auth approach changes
|
|
83
|
+
- A boundary rule or dependency direction changes
|
|
84
|
+
- A shared schema, API contract, event definition, or data model is introduced or modified that will be consumed by other features, services, or agents
|
|
85
|
+
|
|
86
|
+
ADRs live under `docs/backend/architecture/ADR/`, follow `docs/backend/architecture/ADR/TEMPLATE.md`, and must be Accepted before implementation proceeds.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Project Documentation
|
|
91
|
+
|
|
92
|
+
Your project's language- and framework-specific conventions and standards are documented in `docs/backend/architecture/`. Before implementing in each layer, read the corresponding document:
|
|
93
|
+
|
|
94
|
+
| Layer | Document | Content |
|
|
95
|
+
|---|---|---|
|
|
96
|
+
| CLI / inbound adapter | `CLI_CONVENTIONS.md` | Command structure, argument handling, output formatting, exit codes, testing |
|
|
97
|
+
| Services / domain | `ARCH_CONTRACT.md` | Architecture model, layering, approved libraries, design principles |
|
|
98
|
+
| Ports | `ARCH_CONTRACT.md` | Port interface guidelines and architecture patterns |
|
|
99
|
+
| Adapters / infrastructure | `ARCH_CONTRACT.md` + `BOUNDARIES.md` | Integration patterns, layer boundaries, dependency rules |
|
|
100
|
+
| Security / auth | `SECURITY_AUTH_PATTERNS.md` | Authentication model, token strategy, credential handling, RBAC |
|
|
101
|
+
| Testing | `TESTING.md` | Test philosophy, FIRST principles, BDD approach, test structure |
|
|
102
|
+
| Technology decisions | `TECH_STACK.md` | Approved frameworks, libraries, tools, and versions |
|
|
103
|
+
|
|
104
|
+
These documents define your stack's specific approach. The architecture principles (hexagonal architecture, boundaries, evaluation) are universal; the implementation details are here.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Implementation Rules
|
|
109
|
+
|
|
110
|
+
- Implement one increment at a time
|
|
111
|
+
- Respect all rules in `docs/backend/architecture/BOUNDARIES.md`
|
|
112
|
+
- Follow Hexagonal Architecture (ports and adapters)
|
|
113
|
+
- Use only approved frameworks from `docs/backend/architecture/TECH_STACK.md`
|
|
114
|
+
- Use approved auth patterns from `docs/backend/architecture/SECURITY_AUTH_PATTERNS.md`
|
|
115
|
+
- Follow CLI conventions from `docs/backend/architecture/CLI_CONVENTIONS.md`
|
|
116
|
+
- Follow design principles from `docs/backend/architecture/DESIGN_PRINCIPLES.md`; use findings from approved tools as defined in `docs/backend/architecture/TECH_STACK.md` — blocking findings must be resolved before proceeding
|
|
117
|
+
|
|
118
|
+
Layer-specific rules load automatically from `.claude/rules/` when editing files in each layer:
|
|
119
|
+
|
|
120
|
+
- `cli.md` — `**/cli/**` and `**/commands/**`
|
|
121
|
+
- `services.md` — `**/services/**`
|
|
122
|
+
- `ports.md` — `**/ports/**`
|
|
123
|
+
- `adapters.md` — `**/adapters/**`
|
|
124
|
+
- `security.md` — `**/security/**` and `**/auth/**`
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Evaluation Discipline
|
|
129
|
+
|
|
130
|
+
Before implementation, read `docs/backend/evaluation/eval_criteria.md` and `features/<feature_name>/eval_criteria.yaml`. Confirm FIRST and 7 Virtue enforcement thresholds.
|
|
131
|
+
|
|
132
|
+
Implementation must not proceed unless an Evaluation Compliance Summary exists in `plan.md` with predicted averages meeting required thresholds. CI evaluation gates are binding.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Testing Requirements
|
|
137
|
+
|
|
138
|
+
Each increment must include:
|
|
139
|
+
|
|
140
|
+
- Unit tests compliant with FIRST principles
|
|
141
|
+
- BDD integration tests derived from Gherkin scenarios
|
|
142
|
+
- Contract tests when APIs, ports, or external integrations are affected
|
|
143
|
+
|
|
144
|
+
Gherkin scenarios must follow `docs/backend/architecture/GHERKIN_CONVENTIONS.md`:
|
|
145
|
+
|
|
146
|
+
- Every populated NFR category in `nfrs.md` must have at least one scenario tagged with the corresponding `@nfr-*` tag
|
|
147
|
+
- Features producing shared artifacts must include at least one `@contract` scenario
|
|
148
|
+
- Verify coverage during Architecture Preflight and plan finalization — stop if incomplete
|
|
149
|
+
|
|
150
|
+
Undocumented Gherkin gaps must be noted in `plan.md`.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Automatic Refactor Conditions
|
|
155
|
+
|
|
156
|
+
Trigger refactor before proceeding if:
|
|
157
|
+
|
|
158
|
+
- Duplicate logic detected
|
|
159
|
+
- Structural complexity excessive
|
|
160
|
+
- FIRST or 7 Virtue score below threshold
|
|
161
|
+
- Test flakiness detected
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Architecture Preflight Triggers
|
|
166
|
+
|
|
167
|
+
Architecture Preflight must be re-run (or updated) when:
|
|
168
|
+
|
|
169
|
+
- Scope expands beyond what the current preflight covers
|
|
170
|
+
- New external dependencies are introduced
|
|
171
|
+
- Security or auth patterns change
|
|
172
|
+
- Evaluation mode changes
|
|
173
|
+
- An ADR trigger condition is met
|
|
174
|
+
- A shared contract or producer relationship is introduced or modified
|
|
175
|
+
|
|
176
|
+
If Preflight status is Blocked, implementation must not proceed.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Output Expectations
|
|
181
|
+
|
|
182
|
+
Every plan and implementation output must include:
|
|
183
|
+
|
|
184
|
+
- Referenced standards (architecture contracts, eval criteria, ADRs)
|
|
185
|
+
- ADR status (Accepted / pending / not required — with justification)
|
|
186
|
+
- Architecture compliance confirmation
|
|
187
|
+
- Test coverage summary
|
|
188
|
+
- Evaluation impact summary
|
|
189
|
+
|
|
190
|
+
If alignment is unclear, stop and ask.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Commit Discipline
|
|
195
|
+
|
|
196
|
+
- Complete one increment, then commit before starting the next
|
|
197
|
+
- Each commit must be independently buildable and testable
|
|
198
|
+
- Commit message references the increment: `feat(<feature>): increment N — <name>`
|
|
199
|
+
- Do not combine multiple increments into a single commit
|
|
200
|
+
- If an increment exceeds ~300 lines of production code, split it before committing
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Authority
|
|
205
|
+
|
|
206
|
+
Architecture decisions belong to the Architect. Exceptions require an ADR and explicit approval. Claude follows standards — it does not invent them.
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Spec-Driven Development — Claude Code Instructions
|
|
2
|
+
|
|
3
|
+
These instructions are mandatory. Claude operates as a spec-driven delivery system.
|
|
4
|
+
|
|
5
|
+
Repository artifacts are the source of truth. Chat history is not.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Operating Mode
|
|
10
|
+
|
|
11
|
+
Claude operates aligned to:
|
|
12
|
+
|
|
13
|
+
- Product specifications under `features/`
|
|
14
|
+
- Design principles under `docs/backend/architecture/DESIGN_PRINCIPLES.md`
|
|
15
|
+
- Testing conventions under `docs/backend/architecture/TESTING.md`
|
|
16
|
+
|
|
17
|
+
Before planning or generating code:
|
|
18
|
+
|
|
19
|
+
- Read `docs/backend/architecture/DESIGN_PRINCIPLES.md`
|
|
20
|
+
- Read `docs/backend/architecture/TESTING.md`
|
|
21
|
+
- Confirm required feature artifacts exist
|
|
22
|
+
|
|
23
|
+
If required inputs are missing, stop and ask.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Mandatory Feature Structure
|
|
28
|
+
|
|
29
|
+
Every feature must live under `features/<feature_name>` with these required artifacts:
|
|
30
|
+
|
|
31
|
+
- `acceptance.feature`
|
|
32
|
+
- `nfrs.md`
|
|
33
|
+
- `plan.md`
|
|
34
|
+
|
|
35
|
+
Implementation must not begin unless all three artifacts exist.
|
|
36
|
+
|
|
37
|
+
Before proceeding to planning:
|
|
38
|
+
|
|
39
|
+
- If `nfrs.md` contains TBD entries in any category, stop and request completion
|
|
40
|
+
- If `acceptance.feature` is empty or missing scenarios, stop and request completion
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Feature Lifecycle (Mandatory Order — no steps may be skipped)
|
|
45
|
+
|
|
46
|
+
1. Write acceptance criteria (`acceptance.feature`)
|
|
47
|
+
2. Complete NFRs (`nfrs.md`)
|
|
48
|
+
3. Plan finalization → run `/spec-planning`
|
|
49
|
+
4. Implementation planning → run `/implementation-plan`
|
|
50
|
+
5. Incremental implementation (test-first)
|
|
51
|
+
6. Automated tests
|
|
52
|
+
7. CI gates (lint, tests)
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Planning Discipline
|
|
57
|
+
|
|
58
|
+
Generate and maintain `features/<feature_name>/plan.md` based on `governance/backend/templates/l3-plan.md`.
|
|
59
|
+
|
|
60
|
+
The plan must:
|
|
61
|
+
|
|
62
|
+
- Define explicit increments with deliverables and tests
|
|
63
|
+
- Map Gherkin scenarios to integration tests
|
|
64
|
+
- List tests before implementation in each increment
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Project Documentation
|
|
69
|
+
|
|
70
|
+
Your project's language- and framework-specific conventions are documented in `docs/backend/architecture/`. When implementing:
|
|
71
|
+
|
|
72
|
+
- **Architecture decisions:** Review `docs/backend/architecture/DESIGN_PRINCIPLES.md`
|
|
73
|
+
- **Testing approach:** Review `docs/backend/architecture/TESTING.md`
|
|
74
|
+
- **Framework and libraries:** Review `docs/backend/architecture/TECH_STACK.md`
|
|
75
|
+
- **Boundaries and dependencies:** Review `docs/backend/architecture/BOUNDARIES.md`
|
|
76
|
+
|
|
77
|
+
These documents define your stack's specific approach to the universal architecture principles (SOLID, DRY, YAGNI, KISS).
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Implementation Rules
|
|
82
|
+
|
|
83
|
+
- Implement one increment at a time
|
|
84
|
+
- Write tests before implementation code (test-first)
|
|
85
|
+
- Follow design principles from `docs/backend/architecture/DESIGN_PRINCIPLES.md` (SOLID, DRY, YAGNI, KISS)
|
|
86
|
+
- Follow testing conventions from `docs/backend/architecture/TESTING.md`
|
|
87
|
+
|
|
88
|
+
Generic rules load automatically from `.claude/rules/`:
|
|
89
|
+
|
|
90
|
+
- `test-first.md` — test-first development discipline
|
|
91
|
+
- `spec-compliance.md` — feature artifact and Gherkin conventions
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Testing Requirements
|
|
96
|
+
|
|
97
|
+
Each increment must include:
|
|
98
|
+
|
|
99
|
+
- Unit tests written before implementation code
|
|
100
|
+
- Integration tests derived from Gherkin scenarios
|
|
101
|
+
|
|
102
|
+
Gherkin scenarios must follow conventions:
|
|
103
|
+
|
|
104
|
+
- Every populated NFR category in `nfrs.md` must have at least one scenario tagged with the corresponding `@nfr-*` tag
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Automatic Refactor Conditions
|
|
109
|
+
|
|
110
|
+
Trigger refactor before proceeding if:
|
|
111
|
+
|
|
112
|
+
- Duplicate logic detected
|
|
113
|
+
- Structural complexity excessive
|
|
114
|
+
- Test flakiness detected
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Output Expectations
|
|
119
|
+
|
|
120
|
+
Every plan and implementation output must include:
|
|
121
|
+
|
|
122
|
+
- Referenced design principles
|
|
123
|
+
- Test coverage summary
|
|
124
|
+
|
|
125
|
+
If alignment is unclear, stop and ask.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Commit Discipline
|
|
130
|
+
|
|
131
|
+
- Complete one increment, then commit before starting the next
|
|
132
|
+
- Each commit must be independently buildable and testable
|
|
133
|
+
- Commit message references the increment: `feat(<feature>): increment N — <name>`
|
|
134
|
+
- Do not combine multiple increments into a single commit
|
|
135
|
+
- If an increment exceeds ~300 lines of production code, split it before committing
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Authority
|
|
140
|
+
|
|
141
|
+
Architecture decisions belong to the team. Claude follows specifications — it does not invent them.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Spec-Driven Development — Claude Code Instructions
|
|
2
|
+
|
|
3
|
+
These instructions are mandatory. Claude operates as a spec-driven delivery system.
|
|
4
|
+
|
|
5
|
+
Repository artifacts are the source of truth. Chat history is not.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Operating Mode
|
|
10
|
+
|
|
11
|
+
Claude operates aligned to:
|
|
12
|
+
|
|
13
|
+
- Product specifications under `features/`
|
|
14
|
+
- Design principles under `docs/backend/architecture/DESIGN_PRINCIPLES.md`
|
|
15
|
+
- Testing conventions under `docs/backend/architecture/TESTING.md`
|
|
16
|
+
|
|
17
|
+
Before planning or generating code:
|
|
18
|
+
|
|
19
|
+
- Read `docs/backend/architecture/DESIGN_PRINCIPLES.md`
|
|
20
|
+
- Read `docs/backend/architecture/TESTING.md`
|
|
21
|
+
- Confirm required feature artifacts exist
|
|
22
|
+
|
|
23
|
+
If required inputs are missing, stop and ask.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Mandatory Feature Structure
|
|
28
|
+
|
|
29
|
+
Every feature must live under `features/<feature_name>` with these required artifacts:
|
|
30
|
+
|
|
31
|
+
- `acceptance.feature`
|
|
32
|
+
- `nfrs.md`
|
|
33
|
+
- `plan.md`
|
|
34
|
+
|
|
35
|
+
Implementation must not begin unless all three artifacts exist.
|
|
36
|
+
|
|
37
|
+
Before proceeding to planning:
|
|
38
|
+
|
|
39
|
+
- If `nfrs.md` contains TBD entries in any category, stop and request completion
|
|
40
|
+
- If `acceptance.feature` is empty or missing scenarios, stop and request completion
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Feature Lifecycle (Mandatory Order — no steps may be skipped)
|
|
45
|
+
|
|
46
|
+
1. Write acceptance criteria (`acceptance.feature`)
|
|
47
|
+
2. Complete NFRs (`nfrs.md`)
|
|
48
|
+
3. Plan finalization → run `/spec-planning`
|
|
49
|
+
4. Implementation planning → run `/implementation-plan`
|
|
50
|
+
5. Incremental implementation (test-first)
|
|
51
|
+
6. Automated tests
|
|
52
|
+
7. CI gates (lint, tests)
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Planning Discipline
|
|
57
|
+
|
|
58
|
+
Generate and maintain `features/<feature_name>/plan.md` based on `governance/backend/templates/l3-plan.md`.
|
|
59
|
+
|
|
60
|
+
The plan must:
|
|
61
|
+
|
|
62
|
+
- Define explicit increments with deliverables and tests
|
|
63
|
+
- Map Gherkin scenarios to integration tests
|
|
64
|
+
- List tests before implementation in each increment
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Project Documentation
|
|
69
|
+
|
|
70
|
+
Your project's language- and framework-specific conventions are documented in `docs/backend/architecture/`. When implementing:
|
|
71
|
+
|
|
72
|
+
- **Architecture decisions:** Review `docs/backend/architecture/DESIGN_PRINCIPLES.md`
|
|
73
|
+
- **Testing approach:** Review `docs/backend/architecture/TESTING.md`
|
|
74
|
+
- **Framework and libraries:** Review `docs/backend/architecture/TECH_STACK.md`
|
|
75
|
+
- **CLI conventions:** Review `docs/backend/architecture/CLI_CONVENTIONS.md`
|
|
76
|
+
- **Boundaries and dependencies:** Review `docs/backend/architecture/BOUNDARIES.md`
|
|
77
|
+
|
|
78
|
+
These documents define your stack's specific approach to the universal architecture principles (SOLID, DRY, YAGNI, KISS).
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Implementation Rules
|
|
83
|
+
|
|
84
|
+
- Implement one increment at a time
|
|
85
|
+
- Write tests before implementation code (test-first)
|
|
86
|
+
- Follow design principles from `docs/backend/architecture/DESIGN_PRINCIPLES.md` (SOLID, DRY, YAGNI, KISS)
|
|
87
|
+
- Follow testing conventions from `docs/backend/architecture/TESTING.md`
|
|
88
|
+
|
|
89
|
+
Generic rules load automatically from `.claude/rules/`:
|
|
90
|
+
|
|
91
|
+
- `test-first.md` — test-first development discipline
|
|
92
|
+
- `spec-compliance.md` — feature artifact and Gherkin conventions
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Testing Requirements
|
|
97
|
+
|
|
98
|
+
Each increment must include:
|
|
99
|
+
|
|
100
|
+
- Unit tests written before implementation code
|
|
101
|
+
- Integration tests derived from Gherkin scenarios
|
|
102
|
+
|
|
103
|
+
Gherkin scenarios must follow conventions:
|
|
104
|
+
|
|
105
|
+
- Every populated NFR category in `nfrs.md` must have at least one scenario tagged with the corresponding `@nfr-*` tag
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Automatic Refactor Conditions
|
|
110
|
+
|
|
111
|
+
Trigger refactor before proceeding if:
|
|
112
|
+
|
|
113
|
+
- Duplicate logic detected
|
|
114
|
+
- Structural complexity excessive
|
|
115
|
+
- Test flakiness detected
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Output Expectations
|
|
120
|
+
|
|
121
|
+
Every plan and implementation output must include:
|
|
122
|
+
|
|
123
|
+
- Referenced design principles
|
|
124
|
+
- Test coverage summary
|
|
125
|
+
|
|
126
|
+
If alignment is unclear, stop and ask.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Commit Discipline
|
|
131
|
+
|
|
132
|
+
- Complete one increment, then commit before starting the next
|
|
133
|
+
- Each commit must be independently buildable and testable
|
|
134
|
+
- Commit message references the increment: `feat(<feature>): increment N — <name>`
|
|
135
|
+
- Do not combine multiple increments into a single commit
|
|
136
|
+
- If an increment exceeds ~300 lines of production code, split it before committing
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Authority
|
|
141
|
+
|
|
142
|
+
Architecture decisions belong to the team. Claude follows specifications — it does not invent them.
|