codd-dev 1.2.0__tar.gz → 1.3.0__tar.gz

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.
Files changed (83) hide show
  1. {codd_dev-1.2.0 → codd_dev-1.3.0}/PKG-INFO +124 -51
  2. {codd_dev-1.2.0 → codd_dev-1.3.0}/README.md +123 -50
  3. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/__init__.py +1 -1
  4. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/cli.py +65 -12
  5. codd_dev-1.2.0/codd/hooks.py → codd_dev-1.3.0/codd/hooks/__init__.py +1 -1
  6. codd_dev-1.3.0/codd/require.py +417 -0
  7. {codd_dev-1.2.0 → codd_dev-1.3.0}/pyproject.toml +2 -2
  8. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/iniconfig-2.3.0.dist-info/licenses/LICENSE +0 -21
  9. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/packaging-26.0.dist-info/licenses/LICENSE +0 -3
  10. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip/_vendor/certifi/LICENSE +0 -20
  11. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip/_vendor/distro/LICENSE +0 -202
  12. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip/_vendor/packaging/LICENSE +0 -3
  13. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip/_vendor/pkg_resources/LICENSE +0 -17
  14. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip/_vendor/platformdirs/LICENSE +0 -21
  15. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip/_vendor/pygments/LICENSE +0 -25
  16. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/LICENSE +0 -21
  17. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip/_vendor/requests/LICENSE +0 -175
  18. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip/_vendor/resolvelib/LICENSE +0 -13
  19. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip/_vendor/rich/LICENSE +0 -19
  20. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip/_vendor/tomli/LICENSE +0 -21
  21. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip/_vendor/tomli_w/LICENSE +0 -21
  22. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip/_vendor/truststore/LICENSE +0 -21
  23. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip-26.0.1.dist-info/licenses/src/pip/_vendor/certifi/LICENSE +0 -20
  24. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip-26.0.1.dist-info/licenses/src/pip/_vendor/distro/LICENSE +0 -202
  25. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip-26.0.1.dist-info/licenses/src/pip/_vendor/packaging/LICENSE +0 -3
  26. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip-26.0.1.dist-info/licenses/src/pip/_vendor/pkg_resources/LICENSE +0 -17
  27. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip-26.0.1.dist-info/licenses/src/pip/_vendor/platformdirs/LICENSE +0 -21
  28. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip-26.0.1.dist-info/licenses/src/pip/_vendor/pygments/LICENSE +0 -25
  29. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip-26.0.1.dist-info/licenses/src/pip/_vendor/pyproject_hooks/LICENSE +0 -21
  30. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip-26.0.1.dist-info/licenses/src/pip/_vendor/requests/LICENSE +0 -175
  31. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip-26.0.1.dist-info/licenses/src/pip/_vendor/resolvelib/LICENSE +0 -13
  32. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip-26.0.1.dist-info/licenses/src/pip/_vendor/rich/LICENSE +0 -19
  33. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip-26.0.1.dist-info/licenses/src/pip/_vendor/tomli/LICENSE +0 -21
  34. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip-26.0.1.dist-info/licenses/src/pip/_vendor/tomli_w/LICENSE +0 -21
  35. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pip-26.0.1.dist-info/licenses/src/pip/_vendor/truststore/LICENSE +0 -21
  36. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pluggy-1.6.0.dist-info/licenses/LICENSE +0 -21
  37. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pygments-2.20.0.dist-info/licenses/LICENSE +0 -25
  38. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pytest-9.0.2.dist-info/licenses/LICENSE +0 -21
  39. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/pyyaml-6.0.3.dist-info/licenses/LICENSE +0 -20
  40. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/tree_sitter-0.25.2.dist-info/licenses/LICENSE +0 -21
  41. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/tree_sitter_java-0.23.5.dist-info/LICENSE +0 -21
  42. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/tree_sitter_python-0.25.0.dist-info/licenses/LICENSE +0 -21
  43. codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/tree_sitter_typescript-0.23.2.dist-info/LICENSE +0 -21
  44. codd_dev-1.2.0/LICENSE +0 -21
  45. {codd_dev-1.2.0 → codd_dev-1.3.0}/.gitignore +0 -0
  46. {codd_dev-1.2.0/.venv-scanonly-209d2/lib/python3.12/site-packages/codd_dev-0.2.0a5.dist-info/licenses → codd_dev-1.3.0}/LICENSE +0 -0
  47. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/assembler.py +0 -0
  48. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/clustering.py +0 -0
  49. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/config.py +0 -0
  50. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/contracts.py +0 -0
  51. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/defaults.yaml +0 -0
  52. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/env_refs.py +0 -0
  53. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/extractor.py +0 -0
  54. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/generator.py +0 -0
  55. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/graph.py +0 -0
  56. {codd_dev-1.2.0 → codd_dev-1.3.0/codd}/hooks/pre-commit +0 -0
  57. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/implementer.py +0 -0
  58. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/inheritance.py +0 -0
  59. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/parsing.py +0 -0
  60. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/planner.py +0 -0
  61. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/propagate.py +0 -0
  62. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/propagator.py +0 -0
  63. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/restore.py +0 -0
  64. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/reviewer.py +0 -0
  65. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/risk.py +0 -0
  66. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/scanner.py +0 -0
  67. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/schema_refs.py +0 -0
  68. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/synth.py +0 -0
  69. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/templates/codd.yaml.tmpl +0 -0
  70. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/templates/conventions.yaml.tmpl +0 -0
  71. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/templates/data_dependencies.yaml.tmpl +0 -0
  72. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/templates/doc_links.yaml.tmpl +0 -0
  73. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/templates/extracted/api-contract.md.j2 +0 -0
  74. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/templates/extracted/architecture-overview.md.j2 +0 -0
  75. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/templates/extracted/module-detail.md.j2 +0 -0
  76. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/templates/extracted/schema-design.md.j2 +0 -0
  77. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/templates/extracted/system-context.md.j2 +0 -0
  78. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/templates/gitignore.tmpl +0 -0
  79. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/templates/overrides.yaml.tmpl +0 -0
  80. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/traceability.py +0 -0
  81. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/validator.py +0 -0
  82. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/verifier.py +0 -0
  83. {codd_dev-1.2.0 → codd_dev-1.3.0}/codd/wiring.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codd-dev
3
- Version: 1.2.0
3
+ Version: 1.3.0
4
4
  Summary: CoDD: Coherence-Driven Development — cross-artifact change impact analysis
5
5
  Project-URL: Homepage, https://github.com/yohey-w/codd-dev
6
6
  Project-URL: Repository, https://github.com/yohey-w/codd-dev
@@ -59,7 +59,7 @@ Description-Content-Type: text/markdown
59
59
  pip install codd-dev
60
60
  ```
61
61
 
62
- **Public Alpha** — `init` / `scan` / `impact` are stable; `validate` is alpha.
62
+ **v1.2.0** — `init` / `scan` / `impact` are stable. `generate` / `implement` / `assemble` / `validate` / `extract` are alpha.
63
63
 
64
64
  ---
65
65
 
@@ -109,6 +109,8 @@ CoDD is **harness-agnostic** — works with Claude Code, Copilot, Cursor, or any
109
109
 
110
110
  ## Quick Start
111
111
 
112
+ ### Greenfield (new project)
113
+
112
114
  ```bash
113
115
  pip install codd-dev
114
116
  mkdir my-project && cd my-project && git init
@@ -117,79 +119,142 @@ mkdir my-project && cd my-project && git init
117
119
  codd init --project-name "my-project" --language "typescript" \
118
120
  --requirements spec.txt
119
121
 
120
- # AI generates design docs (wave_config auto-generated)
121
- codd generate --wave 2
122
+ # AI designs the document dependency graph
123
+ codd plan --init
122
124
 
123
- # Build dependency graph analyze impact
124
- codd scan
125
- codd impact
125
+ # Generate design docs wave by wave
126
+ waves=$(codd plan --waves)
127
+ for wave in $(seq 1 $waves); do
128
+ codd generate --wave $wave
129
+ done
130
+
131
+ # Quality gate — catch AI laziness (TODOs, placeholders)
132
+ codd validate
133
+
134
+ # Generate code from design docs
135
+ sprints=$(codd plan --sprints)
136
+ for sprint in $(seq 1 $sprints); do
137
+ codd implement --sprint $sprint
138
+ done
139
+
140
+ # Assemble code fragments into a buildable project
141
+ codd assemble
126
142
  ```
127
143
 
128
- ## 5-Minute Demo — See CoDD in Action
144
+ ### Brownfield (existing project)
129
145
 
130
- We'll build **TaskFlow**, a task management app. Write **requirements in plain text**, let CoDD + AI handle everything else.
146
+ ```bash
147
+ codd extract # Reverse-engineer design docs from code
148
+ codd plan --init # Generate wave_config from extracted docs
149
+ codd scan # Build dependency graph
150
+ codd impact # Change impact analysis
151
+ ```
152
+
153
+ ## 5-Minute Greenfield Demo — Spec to Working App
131
154
 
132
- ### Step 1: Write your requirements (any format txt, md, doc)
155
+ 37 lines of spec 6 design docs (1,353 lines) 102 code files (6,445 lines) → TypeScript strict build passes.
156
+
157
+ ### Step 1: Write your requirements
133
158
 
134
159
  ```text
135
- # TaskFlow — Requirements
160
+ # TaskFlow — Personal Todo App
136
161
 
137
162
  ## Functional Requirements
138
- - User auth (email + Google OAuth)
139
- - Workspace management (teams, roles, invites)
140
- - Task CRUD with assignees, labels, due dates
141
- - Real-time updates (WebSocket)
142
- - File attachments (S3)
143
- - Notification system (in-app + email)
163
+ - Task CRUD: create, read, update, delete tasks
164
+ - Each task has: title, description (optional), due date (optional),
165
+ priority (low/medium/high), completed status
166
+ - Task list with filtering by: status (all/active/completed), priority
167
+ - Local state management (no backend, localStorage)
168
+
169
+ ## UI Requirements
170
+ - Single-page app with responsive layout (mobile-first)
171
+ - Dark theme with accent color (#3b82f6)
172
+ - Floating action button opens a modal form
173
+ - Toast notifications on create/update/delete
174
+ - Keyboard shortcuts: Enter to submit, Escape to close modal
144
175
 
145
176
  ## Constraints
146
- - Next.js + Prisma + PostgreSQL
147
- - Row-level security for workspace isolation
148
- - All API endpoints rate-limited
177
+ - Next.js 15 App Router with React Server Components
178
+ - Tailwind CSS
179
+ - TypeScript strict mode
180
+ - Deploy-ready as static export
149
181
  ```
150
182
 
151
- Save this as `spec.txt`. That's it — no special formatting needed.
152
-
153
- ### Step 2: Initialize CoDD
183
+ ### Step 2: Run the pipeline
154
184
 
155
185
  ```bash
156
186
  pip install codd-dev
157
- mkdir taskflow && cd taskflow && git init
158
- codd init --project-name "taskflow" --language "typescript" \
159
- --requirements spec.txt
187
+ codd init --requirements spec.md
188
+ codd plan --init # AI designs the wave structure
189
+
190
+ waves=$(codd plan --waves) # → 4
191
+ for wave in $(seq 1 $waves); do
192
+ codd generate --wave $wave # design docs, wave by wave
193
+ done
194
+
195
+ codd validate # quality gate
196
+
197
+ sprints=$(codd plan --sprints) # → 17
198
+ for sprint in $(seq 1 $sprints); do
199
+ codd implement --sprint $sprint # code from design docs
200
+ done
201
+
202
+ codd assemble # integrate into buildable project
203
+ npm run build # TypeScript strict, zero errors
160
204
  ```
161
205
 
162
- CoDD adds frontmatter (`node_id`, `type`, dependency metadata) automatically. You never touch it.
206
+ No interactive AI chat at any step. Every AI call goes through `claude --print` prompt in, text out. **Harness as Code**: the entire workflow is a shell script.
163
207
 
164
- ### Step 3: AI generates design docs
208
+ ### Step 3: Model role separation
165
209
 
166
210
  ```bash
167
- codd generate --wave 2 # System design + API design
168
- codd generate --wave 3 # DB design + Auth design
169
- codd generate --wave 4 # Test strategy
211
+ # Design docs needs judgment, use Opus
212
+ codd generate --wave 1 --ai-cmd 'claude --print --model claude-opus-4-6 --tools ""'
213
+
214
+ # Code generation — needs volume, use Codex (or Sonnet)
215
+ codd implement --sprint 1 --ai-cmd 'codex --full-auto -q'
170
216
  ```
171
217
 
172
- `wave_config` is auto-generated from your requirements. Each design doc gets frontmatter, `depends_on` declarations, and a `modules` field linking it to source code modules all derived, nothing manual.
218
+ ## 5-Minute Brownfield DemoChange Impact Analysis
219
+
220
+ Already have a codebase? CoDD tracks what's affected when requirements change.
173
221
 
174
- ### Step 4: Build the dependency graph
222
+ ### Step 1: Write requirements and generate design docs
223
+
224
+ ```text
225
+ # TaskFlow — Requirements
226
+
227
+ ## Functional Requirements
228
+ - User auth (email + Google OAuth)
229
+ - Workspace management (teams, roles, invites)
230
+ - Task CRUD with assignees, labels, due dates
231
+ - Real-time updates (WebSocket)
232
+ - File attachments (S3)
233
+ - Notification system (in-app + email)
234
+
235
+ ## Constraints
236
+ - Next.js + Prisma + PostgreSQL
237
+ - Row-level security for workspace isolation
238
+ - All API endpoints rate-limited
239
+ ```
175
240
 
176
241
  ```bash
242
+ codd init --requirements spec.txt
243
+ codd plan --init
244
+ waves=$(codd plan --waves)
245
+ for wave in $(seq 1 $waves); do codd generate --wave $wave; done
177
246
  codd scan
178
247
  ```
179
248
 
180
249
  ```
181
- Frontmatter: 7 documents in docs
182
250
  Scan complete:
183
251
  Documents with frontmatter: 7
184
252
  Graph: 7 nodes, 15 edges
185
- Evidence: 15 total (0 human, 15 auto)
186
253
  ```
187
254
 
188
- 7 docs, 15 dependency edges. Zero config written by hand.
255
+ ### Step 2: Change requirements mid-project
189
256
 
190
- ### Step 5: Change requirements mid-project
191
-
192
- Your PM asks for SSO and audit logging. Open `docs/requirements/requirements.md` and add:
257
+ Your PM asks for SSO and audit logging. Add to `docs/requirements/requirements.md`:
193
258
 
194
259
  ```text
195
260
  ## Additional Requirements (v1.1)
@@ -197,16 +262,11 @@ Your PM asks for SSO and audit logging. Open `docs/requirements/requirements.md`
197
262
  - Audit logging (record & export all operations)
198
263
  ```
199
264
 
200
- Save the file and ask CoDD what's affected:
201
-
202
265
  ```bash
203
266
  codd impact # detects uncommitted changes automatically
204
267
  ```
205
268
 
206
269
  ```
207
- Changed files: 1
208
- - docs/requirements/requirements.md → req:taskflow-requirements
209
-
210
270
  # CoDD Impact Report
211
271
 
212
272
  ## Green Band (high confidence, auto-propagate)
@@ -221,14 +281,9 @@ Changed files: 1
221
281
  | Target | Depth | Confidence |
222
282
  |-------------------------|-------|------------|
223
283
  | test:test-strategy | 2 | 0.90 |
224
-
225
- ## Gray Band (informational)
226
- | Target | Depth | Confidence |
227
- |-------------------------|-------|------------|
228
- | plan:implementation | 2 | 0.00 |
229
284
  ```
230
285
 
231
- **2 lines changed → 6 out of 7 docs affected.** Green band: AI auto-updates. Amber: human reviews. Gray: informational. You know exactly what to fix before anything breaks.
286
+ **2 lines changed → 6 out of 7 docs affected.** Green band: AI auto-updates. Amber: human reviews. You know exactly what to fix before anything breaks.
232
287
 
233
288
  ## Wave-Based Generation
234
289
 
@@ -296,6 +351,22 @@ ai_commands:
296
351
 
297
352
  **Resolution priority**: CLI `--ai-cmd` flag > `ai_commands.{command}` > `ai_command` > built-in default (Opus).
298
353
 
354
+ ### Claude Code Context Interference
355
+
356
+ When `claude --print` runs inside a project directory, it auto-discovers `CLAUDE.md` and loads project-level system prompts. These instructions can conflict with CoDD's generation prompts, causing format validation failures like:
357
+
358
+ ```
359
+ Error: AI command returned unstructured summary for 'ADR: ...'; missing section headings
360
+ ```
361
+
362
+ **Fix**: Use `--system-prompt` to override project context with a focused instruction:
363
+
364
+ ```yaml
365
+ ai_command: "claude --print --model claude-opus-4-6 --system-prompt 'You are a technical document generator. Output only the requested Markdown document. Follow section heading instructions exactly.'"
366
+ ```
367
+
368
+ > **Note**: `--bare` strips all context but also disables OAuth authentication. Use `--system-prompt` instead — it overrides `CLAUDE.md` while preserving auth.
369
+
299
370
  ## Config Directory Discovery
300
371
 
301
372
  By default, `codd init` creates a `codd/` directory. If your project already has a `codd/` directory (e.g., it's your source code package), use `--config-dir`:
@@ -569,8 +640,10 @@ If CoDD can't manage itself, it shouldn't manage your project.
569
640
 
570
641
  ## Articles
571
642
 
572
- - [Zenn (Japanese): CoDD deep-dive](https://zenn.dev/shio_shoppaize/articles/shogun-codd-coherence)
643
+ - [dev.to (English): Harness as Code — Treating AI Workflows Like Infrastructure](https://dev.to/yohey-w/harness-as-code-treating-ai-workflows-like-infrastructure-27ni)
573
644
  - [dev.to (English): What Happens After "Spec First"](https://dev.to/yohey-w/codd-coherence-driven-development-what-happens-after-spec-first-514f)
645
+ - [Zenn (Japanese): Harness as Code — CoDD活用ガイド #1 spec → 設計書 → コード](https://zenn.dev/shio_shoppaize/articles/codd-greenfield-guide)
646
+ - [Zenn (Japanese): CoDD deep-dive](https://zenn.dev/shio_shoppaize/articles/shogun-codd-coherence)
574
647
 
575
648
  ## License
576
649
 
@@ -22,7 +22,7 @@
22
22
  pip install codd-dev
23
23
  ```
24
24
 
25
- **Public Alpha** — `init` / `scan` / `impact` are stable; `validate` is alpha.
25
+ **v1.2.0** — `init` / `scan` / `impact` are stable. `generate` / `implement` / `assemble` / `validate` / `extract` are alpha.
26
26
 
27
27
  ---
28
28
 
@@ -72,6 +72,8 @@ CoDD is **harness-agnostic** — works with Claude Code, Copilot, Cursor, or any
72
72
 
73
73
  ## Quick Start
74
74
 
75
+ ### Greenfield (new project)
76
+
75
77
  ```bash
76
78
  pip install codd-dev
77
79
  mkdir my-project && cd my-project && git init
@@ -80,79 +82,142 @@ mkdir my-project && cd my-project && git init
80
82
  codd init --project-name "my-project" --language "typescript" \
81
83
  --requirements spec.txt
82
84
 
83
- # AI generates design docs (wave_config auto-generated)
84
- codd generate --wave 2
85
+ # AI designs the document dependency graph
86
+ codd plan --init
85
87
 
86
- # Build dependency graph analyze impact
87
- codd scan
88
- codd impact
88
+ # Generate design docs wave by wave
89
+ waves=$(codd plan --waves)
90
+ for wave in $(seq 1 $waves); do
91
+ codd generate --wave $wave
92
+ done
93
+
94
+ # Quality gate — catch AI laziness (TODOs, placeholders)
95
+ codd validate
96
+
97
+ # Generate code from design docs
98
+ sprints=$(codd plan --sprints)
99
+ for sprint in $(seq 1 $sprints); do
100
+ codd implement --sprint $sprint
101
+ done
102
+
103
+ # Assemble code fragments into a buildable project
104
+ codd assemble
89
105
  ```
90
106
 
91
- ## 5-Minute Demo — See CoDD in Action
107
+ ### Brownfield (existing project)
92
108
 
93
- We'll build **TaskFlow**, a task management app. Write **requirements in plain text**, let CoDD + AI handle everything else.
109
+ ```bash
110
+ codd extract # Reverse-engineer design docs from code
111
+ codd plan --init # Generate wave_config from extracted docs
112
+ codd scan # Build dependency graph
113
+ codd impact # Change impact analysis
114
+ ```
115
+
116
+ ## 5-Minute Greenfield Demo — Spec to Working App
94
117
 
95
- ### Step 1: Write your requirements (any format txt, md, doc)
118
+ 37 lines of spec 6 design docs (1,353 lines) 102 code files (6,445 lines) → TypeScript strict build passes.
119
+
120
+ ### Step 1: Write your requirements
96
121
 
97
122
  ```text
98
- # TaskFlow — Requirements
123
+ # TaskFlow — Personal Todo App
99
124
 
100
125
  ## Functional Requirements
101
- - User auth (email + Google OAuth)
102
- - Workspace management (teams, roles, invites)
103
- - Task CRUD with assignees, labels, due dates
104
- - Real-time updates (WebSocket)
105
- - File attachments (S3)
106
- - Notification system (in-app + email)
126
+ - Task CRUD: create, read, update, delete tasks
127
+ - Each task has: title, description (optional), due date (optional),
128
+ priority (low/medium/high), completed status
129
+ - Task list with filtering by: status (all/active/completed), priority
130
+ - Local state management (no backend, localStorage)
131
+
132
+ ## UI Requirements
133
+ - Single-page app with responsive layout (mobile-first)
134
+ - Dark theme with accent color (#3b82f6)
135
+ - Floating action button opens a modal form
136
+ - Toast notifications on create/update/delete
137
+ - Keyboard shortcuts: Enter to submit, Escape to close modal
107
138
 
108
139
  ## Constraints
109
- - Next.js + Prisma + PostgreSQL
110
- - Row-level security for workspace isolation
111
- - All API endpoints rate-limited
140
+ - Next.js 15 App Router with React Server Components
141
+ - Tailwind CSS
142
+ - TypeScript strict mode
143
+ - Deploy-ready as static export
112
144
  ```
113
145
 
114
- Save this as `spec.txt`. That's it — no special formatting needed.
115
-
116
- ### Step 2: Initialize CoDD
146
+ ### Step 2: Run the pipeline
117
147
 
118
148
  ```bash
119
149
  pip install codd-dev
120
- mkdir taskflow && cd taskflow && git init
121
- codd init --project-name "taskflow" --language "typescript" \
122
- --requirements spec.txt
150
+ codd init --requirements spec.md
151
+ codd plan --init # AI designs the wave structure
152
+
153
+ waves=$(codd plan --waves) # → 4
154
+ for wave in $(seq 1 $waves); do
155
+ codd generate --wave $wave # design docs, wave by wave
156
+ done
157
+
158
+ codd validate # quality gate
159
+
160
+ sprints=$(codd plan --sprints) # → 17
161
+ for sprint in $(seq 1 $sprints); do
162
+ codd implement --sprint $sprint # code from design docs
163
+ done
164
+
165
+ codd assemble # integrate into buildable project
166
+ npm run build # TypeScript strict, zero errors
123
167
  ```
124
168
 
125
- CoDD adds frontmatter (`node_id`, `type`, dependency metadata) automatically. You never touch it.
169
+ No interactive AI chat at any step. Every AI call goes through `claude --print` prompt in, text out. **Harness as Code**: the entire workflow is a shell script.
126
170
 
127
- ### Step 3: AI generates design docs
171
+ ### Step 3: Model role separation
128
172
 
129
173
  ```bash
130
- codd generate --wave 2 # System design + API design
131
- codd generate --wave 3 # DB design + Auth design
132
- codd generate --wave 4 # Test strategy
174
+ # Design docs needs judgment, use Opus
175
+ codd generate --wave 1 --ai-cmd 'claude --print --model claude-opus-4-6 --tools ""'
176
+
177
+ # Code generation — needs volume, use Codex (or Sonnet)
178
+ codd implement --sprint 1 --ai-cmd 'codex --full-auto -q'
133
179
  ```
134
180
 
135
- `wave_config` is auto-generated from your requirements. Each design doc gets frontmatter, `depends_on` declarations, and a `modules` field linking it to source code modules all derived, nothing manual.
181
+ ## 5-Minute Brownfield DemoChange Impact Analysis
182
+
183
+ Already have a codebase? CoDD tracks what's affected when requirements change.
136
184
 
137
- ### Step 4: Build the dependency graph
185
+ ### Step 1: Write requirements and generate design docs
186
+
187
+ ```text
188
+ # TaskFlow — Requirements
189
+
190
+ ## Functional Requirements
191
+ - User auth (email + Google OAuth)
192
+ - Workspace management (teams, roles, invites)
193
+ - Task CRUD with assignees, labels, due dates
194
+ - Real-time updates (WebSocket)
195
+ - File attachments (S3)
196
+ - Notification system (in-app + email)
197
+
198
+ ## Constraints
199
+ - Next.js + Prisma + PostgreSQL
200
+ - Row-level security for workspace isolation
201
+ - All API endpoints rate-limited
202
+ ```
138
203
 
139
204
  ```bash
205
+ codd init --requirements spec.txt
206
+ codd plan --init
207
+ waves=$(codd plan --waves)
208
+ for wave in $(seq 1 $waves); do codd generate --wave $wave; done
140
209
  codd scan
141
210
  ```
142
211
 
143
212
  ```
144
- Frontmatter: 7 documents in docs
145
213
  Scan complete:
146
214
  Documents with frontmatter: 7
147
215
  Graph: 7 nodes, 15 edges
148
- Evidence: 15 total (0 human, 15 auto)
149
216
  ```
150
217
 
151
- 7 docs, 15 dependency edges. Zero config written by hand.
218
+ ### Step 2: Change requirements mid-project
152
219
 
153
- ### Step 5: Change requirements mid-project
154
-
155
- Your PM asks for SSO and audit logging. Open `docs/requirements/requirements.md` and add:
220
+ Your PM asks for SSO and audit logging. Add to `docs/requirements/requirements.md`:
156
221
 
157
222
  ```text
158
223
  ## Additional Requirements (v1.1)
@@ -160,16 +225,11 @@ Your PM asks for SSO and audit logging. Open `docs/requirements/requirements.md`
160
225
  - Audit logging (record & export all operations)
161
226
  ```
162
227
 
163
- Save the file and ask CoDD what's affected:
164
-
165
228
  ```bash
166
229
  codd impact # detects uncommitted changes automatically
167
230
  ```
168
231
 
169
232
  ```
170
- Changed files: 1
171
- - docs/requirements/requirements.md → req:taskflow-requirements
172
-
173
233
  # CoDD Impact Report
174
234
 
175
235
  ## Green Band (high confidence, auto-propagate)
@@ -184,14 +244,9 @@ Changed files: 1
184
244
  | Target | Depth | Confidence |
185
245
  |-------------------------|-------|------------|
186
246
  | test:test-strategy | 2 | 0.90 |
187
-
188
- ## Gray Band (informational)
189
- | Target | Depth | Confidence |
190
- |-------------------------|-------|------------|
191
- | plan:implementation | 2 | 0.00 |
192
247
  ```
193
248
 
194
- **2 lines changed → 6 out of 7 docs affected.** Green band: AI auto-updates. Amber: human reviews. Gray: informational. You know exactly what to fix before anything breaks.
249
+ **2 lines changed → 6 out of 7 docs affected.** Green band: AI auto-updates. Amber: human reviews. You know exactly what to fix before anything breaks.
195
250
 
196
251
  ## Wave-Based Generation
197
252
 
@@ -259,6 +314,22 @@ ai_commands:
259
314
 
260
315
  **Resolution priority**: CLI `--ai-cmd` flag > `ai_commands.{command}` > `ai_command` > built-in default (Opus).
261
316
 
317
+ ### Claude Code Context Interference
318
+
319
+ When `claude --print` runs inside a project directory, it auto-discovers `CLAUDE.md` and loads project-level system prompts. These instructions can conflict with CoDD's generation prompts, causing format validation failures like:
320
+
321
+ ```
322
+ Error: AI command returned unstructured summary for 'ADR: ...'; missing section headings
323
+ ```
324
+
325
+ **Fix**: Use `--system-prompt` to override project context with a focused instruction:
326
+
327
+ ```yaml
328
+ ai_command: "claude --print --model claude-opus-4-6 --system-prompt 'You are a technical document generator. Output only the requested Markdown document. Follow section heading instructions exactly.'"
329
+ ```
330
+
331
+ > **Note**: `--bare` strips all context but also disables OAuth authentication. Use `--system-prompt` instead — it overrides `CLAUDE.md` while preserving auth.
332
+
262
333
  ## Config Directory Discovery
263
334
 
264
335
  By default, `codd init` creates a `codd/` directory. If your project already has a `codd/` directory (e.g., it's your source code package), use `--config-dir`:
@@ -532,8 +603,10 @@ If CoDD can't manage itself, it shouldn't manage your project.
532
603
 
533
604
  ## Articles
534
605
 
535
- - [Zenn (Japanese): CoDD deep-dive](https://zenn.dev/shio_shoppaize/articles/shogun-codd-coherence)
606
+ - [dev.to (English): Harness as Code — Treating AI Workflows Like Infrastructure](https://dev.to/yohey-w/harness-as-code-treating-ai-workflows-like-infrastructure-27ni)
536
607
  - [dev.to (English): What Happens After "Spec First"](https://dev.to/yohey-w/codd-coherence-driven-development-what-happens-after-spec-first-514f)
608
+ - [Zenn (Japanese): Harness as Code — CoDD活用ガイド #1 spec → 設計書 → コード](https://zenn.dev/shio_shoppaize/articles/codd-greenfield-guide)
609
+ - [Zenn (Japanese): CoDD deep-dive](https://zenn.dev/shio_shoppaize/articles/shogun-codd-coherence)
537
610
 
538
611
  ## License
539
612
 
@@ -1,3 +1,3 @@
1
1
  """CoDD — Coherence-Driven Development."""
2
2
 
3
- __version__ = "0.4.0"
3
+ __version__ = "1.3.0"
@@ -1,4 +1,4 @@
1
- """CoDD CLI — codd init / scan / impact / plan."""
1
+ """CoDD CLI — codd init / scan / impact / require / plan."""
2
2
 
3
3
  import click
4
4
  import json
@@ -175,8 +175,8 @@ def generate(wave: int, path: str, force: bool, ai_cmd: str | None, feedback: st
175
175
  help="Override AI CLI command (defaults to codd.yaml ai_command or 'claude --print')",
176
176
  )
177
177
  @click.option("--feedback", default=None, help="Review feedback to address in this restoration (from codd review)")
178
- def restore(wave: int, path: str, force: bool, ai_cmd: str | None, feedback: str | None):
179
- """Restore design documents from extracted codebase facts (brownfield).
178
+ def restore(wave: int, path: str, force: bool, ai_cmd: str | None, feedback: str | None):
179
+ """Restore design documents from extracted codebase facts (brownfield).
180
180
 
181
181
  Unlike 'generate' which creates design docs from requirements (greenfield),
182
182
  'restore' reconstructs design documents from extracted code analysis.
@@ -206,15 +206,68 @@ def restore(wave: int, path: str, force: bool, ai_cmd: str | None, feedback: str
206
206
  restored += 1
207
207
  else:
208
208
  skipped += 1
209
-
210
- click.echo(f"Wave {wave}: {restored} restored, {skipped} skipped")
211
-
212
-
213
- @main.command()
214
- @click.option("--diff", default="HEAD", help="Git diff target (default: HEAD, shows uncommitted changes)")
215
- @click.option("--path", default=".", help="Project root directory")
216
- @click.option("--update", is_flag=True, help="Actually update affected design docs via AI")
217
- @click.option(
209
+
210
+ click.echo(f"Wave {wave}: {restored} restored, {skipped} skipped")
211
+
212
+
213
+ @main.command()
214
+ @click.option("--path", default=".", help="Project root directory")
215
+ @click.option("--output", default="docs/requirements/", help="Output directory for generated requirements")
216
+ @click.option("--scope", default=None, help="Limit to a specific service boundary")
217
+ @click.option(
218
+ "--ai-cmd",
219
+ default=None,
220
+ help="Override AI CLI command (defaults to codd.yaml ai_command or merged CoDD defaults)",
221
+ )
222
+ @click.option("--force", is_flag=True, help="Overwrite existing files")
223
+ @click.option("--feedback", default=None, help="Review feedback from previous generation")
224
+ def require(path: str, output: str, scope: str | None, ai_cmd: str | None, force: bool, feedback: str | None):
225
+ """Infer requirements from extracted codebase facts (brownfield).
226
+
227
+ Unlike 'restore' which reconstructs design docs from extracted facts,
228
+ 'require' reverse-engineers requirements documents from the same
229
+ extracted code analysis. Run 'codd extract' first.
230
+ """
231
+ from codd.require import run_require
232
+
233
+ project_root = Path(path).resolve()
234
+ _require_codd_dir(project_root)
235
+
236
+ try:
237
+ results = run_require(
238
+ project_root,
239
+ output_dir=output,
240
+ scope=scope,
241
+ ai_command=ai_cmd,
242
+ force=force,
243
+ feedback=feedback,
244
+ )
245
+ except (FileNotFoundError, ValueError) as exc:
246
+ click.echo(f"Error: {exc}")
247
+ raise SystemExit(1)
248
+
249
+ generated = 0
250
+ skipped = 0
251
+
252
+ for result in results:
253
+ try:
254
+ rel_path = result.path.relative_to(project_root).as_posix()
255
+ except ValueError:
256
+ rel_path = result.path.as_posix()
257
+ click.echo(f"{result.status.capitalize()}: {rel_path} ({result.node_id})")
258
+ if result.status == "generated":
259
+ generated += 1
260
+ else:
261
+ skipped += 1
262
+
263
+ click.echo(f"Requirements: {generated} generated, {skipped} skipped")
264
+
265
+
266
+ @main.command()
267
+ @click.option("--diff", default="HEAD", help="Git diff target (default: HEAD, shows uncommitted changes)")
268
+ @click.option("--path", default=".", help="Project root directory")
269
+ @click.option("--update", is_flag=True, help="Actually update affected design docs via AI")
270
+ @click.option(
218
271
  "--ai-cmd",
219
272
  default=None,
220
273
  help="Override AI CLI command (defaults to codd.yaml ai_command)",
@@ -12,7 +12,7 @@ from codd.scanner import _extract_frontmatter
12
12
  from codd.validator import run_validate
13
13
 
14
14
 
15
- HOOK_SOURCE = Path(__file__).parent.parent / "hooks" / "pre-commit"
15
+ HOOK_SOURCE = Path(__file__).parent / "pre-commit"
16
16
 
17
17
 
18
18
  def install_pre_commit_hook(project_root: Path) -> tuple[Path, bool]: