cc-codeconductor 0.4.2 → 0.5.0

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 (172) hide show
  1. package/README.md +75 -4
  2. package/dist/index.js +2698 -230
  3. package/package.json +1 -1
  4. package/presets/agy/skills/evaluation/SKILL.md +6 -0
  5. package/presets/agy/skills/openspec/SKILL.md +32 -0
  6. package/presets/agy/workflows/cc-openspec.md +62 -0
  7. package/presets/agy/workflows/cc-pipeline.md +69 -0
  8. package/presets/agy/workflows/cc-scorecard.md +17 -0
  9. package/presets/claude/commands/cc/openspec.md +144 -0
  10. package/presets/claude/commands/cc/review.md +13 -2
  11. package/presets/claude/commands/cc/scorecard.md +65 -0
  12. package/presets/claude/skills/evaluation/SKILL.md +42 -0
  13. package/presets/claude/skills/openspec/SKILL.md +54 -0
  14. package/presets/codex/AGENTS.md +57 -0
  15. package/presets/cursor/.cursorignore +15 -0
  16. package/presets/cursor/AGENTS.md +504 -0
  17. package/presets/cursor/agents/architect.md +211 -0
  18. package/presets/cursor/agents/complexity-auditor.md +76 -0
  19. package/presets/cursor/agents/contract-builder.md +75 -0
  20. package/presets/cursor/agents/docs.md +180 -0
  21. package/presets/cursor/agents/goal-planner.md +71 -0
  22. package/presets/cursor/agents/implementer.md +161 -0
  23. package/presets/cursor/agents/orchestrator.md +377 -0
  24. package/presets/cursor/agents/repo-explorer.md +100 -0
  25. package/presets/cursor/agents/reviewer.md +237 -0
  26. package/presets/cursor/agents/security-reviewer.md +113 -0
  27. package/presets/cursor/agents/task-coach.md +145 -0
  28. package/presets/cursor/agents/tester.md +241 -0
  29. package/presets/cursor/commands/cc/api-contract.md +58 -0
  30. package/presets/cursor/commands/cc/db-migration.md +58 -0
  31. package/presets/cursor/commands/cc/feature.md +115 -0
  32. package/presets/cursor/commands/cc/fix.md +121 -0
  33. package/presets/cursor/commands/cc/openspec.md +144 -0
  34. package/presets/cursor/commands/cc/pagespeed.md +103 -0
  35. package/presets/cursor/commands/cc/refactor.md +148 -0
  36. package/presets/cursor/commands/cc/review.md +137 -0
  37. package/presets/cursor/commands/cc/scorecard.md +65 -0
  38. package/presets/cursor/commands/cc/tdd-cycle.md +226 -0
  39. package/presets/cursor/commands/cc/test-plan.md +138 -0
  40. package/presets/cursor/rules/behavioral-discipline.mdc +14 -0
  41. package/presets/cursor/rules/context-budget.mdc +12 -0
  42. package/presets/cursor/rules/orchestration.mdc +12 -0
  43. package/presets/cursor/rules/yagni-stdlib.mdc +11 -0
  44. package/presets/cursor/skills/android/SKILL.md +122 -0
  45. package/presets/cursor/skills/api-versioning/SKILL.md +394 -0
  46. package/presets/cursor/skills/astro/SKILL.md +322 -0
  47. package/presets/cursor/skills/auth-token-inspector/SKILL.md +33 -0
  48. package/presets/cursor/skills/code-review/SKILL.md +208 -0
  49. package/presets/cursor/skills/conductor-setup/SKILL.md +127 -0
  50. package/presets/cursor/skills/django-orm/SKILL.md +463 -0
  51. package/presets/cursor/skills/django-testing/SKILL.md +417 -0
  52. package/presets/cursor/skills/django-uv/SKILL.md +409 -0
  53. package/presets/cursor/skills/drizzle-schema-architect/SKILL.md +54 -0
  54. package/presets/cursor/skills/evaluation/SKILL.md +8 -0
  55. package/presets/cursor/skills/fastapi-pydantic-strict/SKILL.md +46 -0
  56. package/presets/cursor/skills/find-skills/SKILL.md +144 -0
  57. package/presets/cursor/skills/jpa-nplusone-detector/SKILL.md +49 -0
  58. package/presets/cursor/skills/jpa-postgres/SKILL.md +626 -0
  59. package/presets/cursor/skills/laravel-specialist/SKILL.md +267 -0
  60. package/presets/cursor/skills/laravel-specialist/references/eloquent.md +351 -0
  61. package/presets/cursor/skills/laravel-specialist/references/livewire.md +512 -0
  62. package/presets/cursor/skills/laravel-specialist/references/queues.md +423 -0
  63. package/presets/cursor/skills/laravel-specialist/references/routing.md +362 -0
  64. package/presets/cursor/skills/laravel-specialist/references/testing.md +522 -0
  65. package/presets/cursor/skills/livewire-alpine-bridge/SKILL.md +39 -0
  66. package/presets/cursor/skills/multi-agent-orchestration/README.md +144 -0
  67. package/presets/cursor/skills/multi-agent-orchestration/SKILL.md +579 -0
  68. package/presets/cursor/skills/multi-agent-orchestration/examples/framework_implementations.py +362 -0
  69. package/presets/cursor/skills/multi-agent-orchestration/examples/orchestration_patterns.py +411 -0
  70. package/presets/cursor/skills/multi-agent-orchestration/scripts/agent_communication.py +334 -0
  71. package/presets/cursor/skills/multi-agent-orchestration/scripts/benchmarking.py +341 -0
  72. package/presets/cursor/skills/multi-agent-orchestration/scripts/workflow_management.py +334 -0
  73. package/presets/cursor/skills/nextjs-typescript/SKILL.md +394 -0
  74. package/presets/cursor/skills/openspec/SKILL.md +52 -0
  75. package/presets/cursor/skills/pagespeed-insights/SKILL.md +445 -0
  76. package/presets/cursor/skills/pagespeed-insights/reference.md +50 -0
  77. package/presets/cursor/skills/pagespeed-perf/SKILL.md +281 -0
  78. package/presets/cursor/skills/php-pro/SKILL.md +210 -0
  79. package/presets/cursor/skills/php-pro/references/async-patterns.md +412 -0
  80. package/presets/cursor/skills/php-pro/references/laravel-patterns.md +377 -0
  81. package/presets/cursor/skills/php-pro/references/modern-php-features.md +323 -0
  82. package/presets/cursor/skills/php-pro/references/symfony-patterns.md +466 -0
  83. package/presets/cursor/skills/php-pro/references/testing-quality.md +466 -0
  84. package/presets/cursor/skills/python/SKILL.md +613 -0
  85. package/presets/cursor/skills/python-django-stack/SKILL.md +500 -0
  86. package/presets/cursor/skills/python-fastapi-stack/SKILL.md +464 -0
  87. package/presets/cursor/skills/security/SKILL.md +384 -0
  88. package/presets/cursor/skills/seo-analytics-injector/SKILL.md +44 -0
  89. package/presets/cursor/skills/spring-auth-auditor/SKILL.md +33 -0
  90. package/presets/cursor/skills/spring-boot-feature/SKILL.md +566 -0
  91. package/presets/cursor/skills/spring-boot-kotlin/SKILL.md +408 -0
  92. package/presets/cursor/skills/spring-boot-testing-strategy/SKILL.md +479 -0
  93. package/presets/cursor/skills/sqlalchemy/SKILL.md +473 -0
  94. package/presets/cursor/skills/tailwind-responsive-auditor/SKILL.md +32 -0
  95. package/presets/cursor/skills/tdd-mutation-tester/SKILL.md +28 -0
  96. package/presets/cursor/skills/testing-tdd/SKILL.md +592 -0
  97. package/presets/cursor/skills/workflow-orchestration-patterns/SKILL.md +98 -0
  98. package/presets/cursor/skills/workflow-orchestration-patterns/references/details.md +223 -0
  99. package/presets/laravel-tall/agents/architect.md +8 -0
  100. package/presets/laravel-tall/agents/implementer.md +12 -0
  101. package/presets/laravel-tall/laravel-tall.yml +38 -0
  102. package/presets/opencode/agents/architect.md +153 -61
  103. package/presets/opencode/agents/complexity-auditor.md +1 -0
  104. package/presets/opencode/agents/contract-builder.md +93 -0
  105. package/presets/opencode/agents/docs.md +125 -40
  106. package/presets/opencode/agents/goal-planner.md +82 -0
  107. package/presets/opencode/agents/implementer.md +107 -38
  108. package/presets/opencode/agents/orchestrator.md +90 -71
  109. package/presets/opencode/agents/repo-explorer.md +1 -2
  110. package/presets/opencode/agents/reviewer.md +164 -75
  111. package/presets/opencode/agents/security-reviewer.md +129 -0
  112. package/presets/opencode/agents/task-coach.md +110 -59
  113. package/presets/opencode/agents/tester.md +1 -2
  114. package/presets/opencode/commands/cc-openspec.md +61 -0
  115. package/presets/opencode/commands/cc-scorecard.md +16 -0
  116. package/presets/opencode/prompts/v0.4.0/architect.md +221 -0
  117. package/presets/opencode/prompts/v0.4.0/complexity-auditor.md +89 -0
  118. package/presets/opencode/prompts/v0.4.0/docs.md +189 -0
  119. package/presets/opencode/prompts/v0.4.0/implementer.md +162 -0
  120. package/presets/opencode/prompts/v0.4.0/orchestrator.md +348 -0
  121. package/presets/opencode/prompts/v0.4.0/repo-explorer.md +110 -0
  122. package/presets/opencode/prompts/v0.4.0/reviewer.md +225 -0
  123. package/presets/opencode/prompts/v0.4.0/task-coach.md +155 -0
  124. package/presets/opencode/prompts/v0.4.0/tester.md +251 -0
  125. package/presets/opencode/prompts/v0.5.0/architect.md +222 -0
  126. package/presets/opencode/prompts/v0.5.0/complexity-auditor.md +91 -0
  127. package/presets/opencode/prompts/v0.5.0/contract-builder.md +84 -0
  128. package/presets/opencode/prompts/v0.5.0/docs.md +190 -0
  129. package/presets/opencode/prompts/v0.5.0/goal-planner.md +80 -0
  130. package/presets/opencode/prompts/v0.5.0/implementer.md +171 -0
  131. package/presets/opencode/prompts/v0.5.0/orchestrator.md +388 -0
  132. package/presets/opencode/prompts/v0.5.0/repo-explorer.md +111 -0
  133. package/presets/opencode/prompts/v0.5.0/reviewer.md +248 -0
  134. package/presets/opencode/prompts/v0.5.0/security-reviewer.md +123 -0
  135. package/presets/opencode/prompts/v0.5.0/task-coach.md +156 -0
  136. package/presets/opencode/prompts/v0.5.0/tester.md +252 -0
  137. package/presets/opencode/skills/auth-token-inspector/SKILL.md +31 -0
  138. package/presets/opencode/skills/drizzle-schema-architect/SKILL.md +51 -0
  139. package/presets/opencode/skills/evaluation/SKILL.md +6 -0
  140. package/presets/opencode/skills/fastapi-pydantic-strict/SKILL.md +44 -0
  141. package/presets/opencode/skills/jpa-nplusone-detector/SKILL.md +46 -0
  142. package/presets/opencode/skills/livewire-alpine-bridge/SKILL.md +36 -0
  143. package/presets/opencode/skills/openspec/SKILL.md +50 -0
  144. package/presets/opencode/skills/seo-analytics-injector/SKILL.md +44 -0
  145. package/presets/opencode/skills/spring-auth-auditor/SKILL.md +30 -0
  146. package/presets/opencode/skills/tailwind-responsive-auditor/SKILL.md +30 -0
  147. package/presets/opencode/skills/tdd-mutation-tester/SKILL.md +28 -0
  148. package/presets/python-data-api/agents/architect.md +8 -0
  149. package/presets/python-data-api/agents/implementer.md +9 -0
  150. package/presets/python-data-api/python-data-api.yml +37 -0
  151. package/presets/spring-kotlin-jpa/agents/architect.md +8 -0
  152. package/presets/spring-kotlin-jpa/agents/implementer.md +9 -0
  153. package/presets/spring-kotlin-jpa/spring-kotlin-jpa.yml +38 -0
  154. package/presets/templates/BACKLOG.md +33 -0
  155. package/presets/templates/execution-profile.yml +6 -0
  156. package/presets/templates/model-comparison.md +11 -0
  157. package/presets/templates/regression-checklist.yml +10 -0
  158. package/presets/ts-next-drizzle/agents/architect.md +8 -0
  159. package/presets/ts-next-drizzle/agents/implementer.md +10 -0
  160. package/presets/ts-next-drizzle/ts-next-drizzle.yml +41 -0
  161. package/src/presets/manifests/agy.yml +2 -2
  162. package/src/presets/manifests/claude.yml +2 -2
  163. package/src/presets/manifests/codex.yml +2 -2
  164. package/src/presets/manifests/cursor.yml +19 -3
  165. package/src/presets/manifests/gemini.yml +2 -2
  166. package/src/presets/manifests/opencode.yml +2 -2
  167. package/src/presets/models/agy.yml +21 -0
  168. package/src/presets/models/claude.yml +18 -0
  169. package/src/presets/models/codex.yml +18 -0
  170. package/src/presets/models/cursor.yml +39 -9
  171. package/src/presets/models/gemini.yml +18 -0
  172. package/src/presets/models/opencode.yml +18 -0
@@ -0,0 +1,223 @@
1
+ # workflow-orchestration-patterns — detailed patterns and worked examples
2
+
3
+ ## Critical Design Decision: Workflows vs Activities
4
+
5
+ **The Fundamental Rule** (Source: temporal.io/blog/workflow-engine-principles):
6
+
7
+ - **Workflows** = Orchestration logic and decision-making
8
+ - **Activities** = External interactions (APIs, databases, network calls)
9
+
10
+ ### Workflows (Orchestration)
11
+
12
+ **Characteristics:**
13
+
14
+ - Contain business logic and coordination
15
+ - **MUST be deterministic** (same inputs → same outputs)
16
+ - **Cannot** perform direct external calls
17
+ - State automatically preserved across failures
18
+ - Can run for years despite infrastructure failures
19
+
20
+ **Example workflow tasks:**
21
+
22
+ - Decide which steps to execute
23
+ - Handle compensation logic
24
+ - Manage timeouts and retries
25
+ - Coordinate child workflows
26
+
27
+ ### Activities (External Interactions)
28
+
29
+ **Characteristics:**
30
+
31
+ - Handle all external system interactions
32
+ - Can be non-deterministic (API calls, DB writes)
33
+ - Include built-in timeouts and retry logic
34
+ - **Must be idempotent** (calling N times = calling once)
35
+ - Short-lived (seconds to minutes typically)
36
+
37
+ **Example activity tasks:**
38
+
39
+ - Call payment gateway API
40
+ - Write to database
41
+ - Send emails or notifications
42
+ - Query external services
43
+
44
+ ### Design Decision Framework
45
+
46
+ ```
47
+ Does it touch external systems? → Activity
48
+ Is it orchestration/decision logic? → Workflow
49
+ ```
50
+
51
+ ## Core Workflow Patterns
52
+
53
+ ### 1. Saga Pattern with Compensation
54
+
55
+ **Purpose**: Implement distributed transactions with rollback capability
56
+
57
+ **Pattern** (Source: temporal.io/blog/compensating-actions-part-of-a-complete-breakfast-with-sagas):
58
+
59
+ ```
60
+ For each step:
61
+ 1. Register compensation BEFORE executing
62
+ 2. Execute the step (via activity)
63
+ 3. On failure, run all compensations in reverse order (LIFO)
64
+ ```
65
+
66
+ **Example: Payment Workflow**
67
+
68
+ 1. Reserve inventory (compensation: release inventory)
69
+ 2. Charge payment (compensation: refund payment)
70
+ 3. Fulfill order (compensation: cancel fulfillment)
71
+
72
+ **Critical Requirements:**
73
+
74
+ - Compensations must be idempotent
75
+ - Register compensation BEFORE executing step
76
+ - Run compensations in reverse order
77
+ - Handle partial failures gracefully
78
+
79
+ ### 2. Entity Workflows (Actor Model)
80
+
81
+ **Purpose**: Long-lived workflow representing single entity instance
82
+
83
+ **Pattern** (Source: docs.temporal.io/evaluate/use-cases-design-patterns):
84
+
85
+ - One workflow execution = one entity (cart, account, inventory item)
86
+ - Workflow persists for entity lifetime
87
+ - Receives signals for state changes
88
+ - Supports queries for current state
89
+
90
+ **Example Use Cases:**
91
+
92
+ - Shopping cart (add items, checkout, expiration)
93
+ - Bank account (deposits, withdrawals, balance checks)
94
+ - Product inventory (stock updates, reservations)
95
+
96
+ **Benefits:**
97
+
98
+ - Encapsulates entity behavior
99
+ - Guarantees consistency per entity
100
+ - Natural event sourcing
101
+
102
+ ### 3. Fan-Out/Fan-In (Parallel Execution)
103
+
104
+ **Purpose**: Execute multiple tasks in parallel, aggregate results
105
+
106
+ **Pattern:**
107
+
108
+ - Spawn child workflows or parallel activities
109
+ - Wait for all to complete
110
+ - Aggregate results
111
+ - Handle partial failures
112
+
113
+ **Scaling Rule** (Source: temporal.io/blog/workflow-engine-principles):
114
+
115
+ - Don't scale individual workflows
116
+ - For 1M tasks: spawn 1K child workflows × 1K tasks each
117
+ - Keep each workflow bounded
118
+
119
+ ### 4. Async Callback Pattern
120
+
121
+ **Purpose**: Wait for external event or human approval
122
+
123
+ **Pattern:**
124
+
125
+ - Workflow sends request and waits for signal
126
+ - External system processes asynchronously
127
+ - Sends signal to resume workflow
128
+ - Workflow continues with response
129
+
130
+ **Use Cases:**
131
+
132
+ - Human approval workflows
133
+ - Webhook callbacks
134
+ - Long-running external processes
135
+
136
+ ## State Management and Determinism
137
+
138
+ ### Automatic State Preservation
139
+
140
+ **How Temporal Works** (Source: docs.temporal.io/workflows):
141
+
142
+ - Complete program state preserved automatically
143
+ - Event History records every command and event
144
+ - Seamless recovery from crashes
145
+ - Applications restore pre-failure state
146
+
147
+ ### Determinism Constraints
148
+
149
+ **Workflows Execute as State Machines**:
150
+
151
+ - Replay behavior must be consistent
152
+ - Same inputs → identical outputs every time
153
+
154
+ **Prohibited in Workflows** (Source: docs.temporal.io/workflows):
155
+
156
+ - ❌ Threading, locks, synchronization primitives
157
+ - ❌ Random number generation (`random()`)
158
+ - ❌ Global state or static variables
159
+ - ❌ System time (`datetime.now()`)
160
+ - ❌ Direct file I/O or network calls
161
+ - ❌ Non-deterministic libraries
162
+
163
+ **Allowed in Workflows**:
164
+
165
+ - ✅ `workflow.now()` (deterministic time)
166
+ - ✅ `workflow.random()` (deterministic random)
167
+ - ✅ Pure functions and calculations
168
+ - ✅ Calling activities (non-deterministic operations)
169
+
170
+ ### Versioning Strategies
171
+
172
+ **Challenge**: Changing workflow code while old executions still running
173
+
174
+ **Solutions**:
175
+
176
+ 1. **Versioning API**: Use `workflow.get_version()` for safe changes
177
+ 2. **New Workflow Type**: Create new workflow, route new executions to it
178
+ 3. **Backward Compatibility**: Ensure old events replay correctly
179
+
180
+ ## Resilience and Error Handling
181
+
182
+ ### Retry Policies
183
+
184
+ **Default Behavior**: Temporal retries activities forever
185
+
186
+ **Configure Retry**:
187
+
188
+ - Initial retry interval
189
+ - Backoff coefficient (exponential backoff)
190
+ - Maximum interval (cap retry delay)
191
+ - Maximum attempts (eventually fail)
192
+
193
+ **Non-Retryable Errors**:
194
+
195
+ - Invalid input (validation failures)
196
+ - Business rule violations
197
+ - Permanent failures (resource not found)
198
+
199
+ ### Idempotency Requirements
200
+
201
+ **Why Critical** (Source: docs.temporal.io/activities):
202
+
203
+ - Activities may execute multiple times
204
+ - Network failures trigger retries
205
+ - Duplicate execution must be safe
206
+
207
+ **Implementation Strategies**:
208
+
209
+ - Idempotency keys (deduplication)
210
+ - Check-then-act with unique constraints
211
+ - Upsert operations instead of insert
212
+ - Track processed request IDs
213
+
214
+ ### Activity Heartbeats
215
+
216
+ **Purpose**: Detect stalled long-running activities
217
+
218
+ **Pattern**:
219
+
220
+ - Activity sends periodic heartbeat
221
+ - Includes progress information
222
+ - Timeout if no heartbeat received
223
+ - Enables progress-based retry
@@ -0,0 +1,8 @@
1
+ # Agent Contract: Laravel/Livewire Architect (v1.2.0)
2
+
3
+ ## Misión
4
+ Eres el agente arquitecto especializado en el stack TALL. Diseñas las soluciones y los DTOs, e invocas la skill `livewire-alpine-bridge` para estructurar la separación limpia entre PHP y JS.
5
+
6
+ ## Reglas
7
+ 1. **Estricto**: Diseña los componentes de Blade pensando en reutilización y modularidad.
8
+ 2. **Estricto**: No inventes dependencias externas; prefiere la librería estándar o las oficiales de Laravel (como Jetstream, Livewire).
@@ -0,0 +1,12 @@
1
+ # Agent Contract: Laravel/Livewire Implementer (v1.2.0)
2
+
3
+ ## Misión
4
+ Eres el agente implementador especializado en el stack TALL.
5
+ Tu única tarea es escribir el código que satisfaga el diseño (SDD) proveído por el Architect.
6
+ No debes proponer nuevas arquitecturas ni instalar dependencias sin escalar la petición.
7
+
8
+ ## Reglas y Restricciones (Hard Constraints)
9
+ 1. **Estricto:** Todo el estado reactivo del frontend DEBE manejarse mediante Alpine.js. Solo usa Livewire para mutaciones que requieran interacción con el backend o la base de datos de Postgres.
10
+ 2. **Estricto:** Las vistas de Blade deben usar el sistema de componentes anónimos y utilidades estandarizadas de Tailwind. Invocación obligatoria de la skill `tailwind-responsive-auditor` antes de terminar.
11
+ 3. **Boundary:** NO modifiques los archivos `.env` o la configuración de `Auth0` bajo ninguna circunstancia. Si necesitas variables de entorno, repórtalo en el Scorecard de salida.
12
+ 4. **TDD Obligatorio:** Si la Task Card tiene el tipo `feature`, debes asegurarte de compilar tu código junto a la suite de tests Pest de PHP.
@@ -0,0 +1,38 @@
1
+ name: laravel-tall
2
+ version: 0.4.0
3
+ description: Laravel TALL stack preset (Laravel, Blade, Livewire, Alpine.js)
4
+ outputContract: v1
5
+
6
+ agents:
7
+ - id: architect
8
+ role: Laravel/Livewire Architect
9
+ context: repo-readonly
10
+ modelHint: strong-reasoning
11
+ focus:
12
+ - laravel-tall
13
+ - livewire-alpine-bridge
14
+
15
+ - id: implementer
16
+ role: Laravel/Livewire Implementer
17
+ context: repo-write
18
+ modelHint: practical-coding
19
+ focus:
20
+ - laravel-tall
21
+ - livewire-alpine-bridge
22
+ - tailwind-responsive-auditor
23
+
24
+ - id: tester
25
+ role: Laravel Tester
26
+ context: repo-write
27
+ modelHint: practical-coding
28
+ focus:
29
+ - laravel-tall
30
+ - tdd-mutation-tester
31
+
32
+ - id: reviewer
33
+ role: Laravel Reviewer
34
+ context: repo-readonly
35
+ modelHint: analytical
36
+ focus:
37
+ - tailwind-responsive-auditor
38
+ - auth-token-inspector
@@ -21,101 +21,145 @@ permission:
21
21
  websearch: deny
22
22
  skill: ask
23
23
  ---
24
+ # Agent Contract — architect v0.5.0
24
25
 
25
- You are the Architect — the technical design agent in the CodeConductor
26
- framework. You design. You do not implement.
26
+ ## Role
27
27
 
28
- No code is written until you have produced a Technical Plan and that plan has
29
- been accepted. If the Implementer touches code without a plan, the workflow is
30
- broken escalate to the Orchestrator.
28
+ You are the architect for CodeConductor. You design the technical approach for a
29
+ task before any implementation begins. You produce Technical Plans, ADRs, and
30
+ design documentation. You do not write implementation code.
31
31
 
32
- ## Responsibilities
32
+ Your output is the authoritative reference that `implementer` follows. If the
33
+ plan is ambiguous or incomplete, the implementation will be wrong. Precision and
34
+ completeness in your output directly determine implementation quality.
33
35
 
34
- 1. Read and understand the Task Card fully before producing anything.
35
- 2. Explore the relevant codebase areas to understand existing structure.
36
- 3. Identify the correct technical approach and its tradeoffs.
37
- 4. Define module boundaries, API contracts, and data shapes.
38
- 5. Identify risks and mitigation strategies.
39
- 6. Produce a Technical Plan as your Deliverable.
36
+ ---
37
+
38
+ ## Inputs
39
+
40
+ Before producing a Technical Plan, read and validate the Task Card.
41
+
42
+ A Task Card is valid as input when:
40
43
 
41
- ## Exploration Before Design
44
+ - Title, type, risk, scope, context, and acceptance criteria are present
45
+ - Scope names specific files, modules, or API endpoints
46
+ - At least one acceptance criterion is measurable
47
+
48
+ If the Task Card is missing required fields, stop and return it to `task-coach`.
49
+ Do not design against an incomplete specification.
50
+
51
+ ---
42
52
 
43
- Before designing anything:
53
+ ## Exploration before design
44
54
 
45
- - Locate the files and modules affected by the task
46
- - Understand existing patterns (naming, layering, error handling)
47
- - Identify what must not change (public API contracts, database schema)
48
- - Check for existing abstractions that the solution should extend — not replace
55
+ Before producing the Technical Plan, read the files and modules listed in the
56
+ Task Card scope. Understand:
57
+
58
+ - Existing patterns: naming conventions, layering, error handling, module
59
+ structure
60
+ - What must not change: public API contracts, database schema, behavioral
61
+ invariants
62
+ - Existing abstractions that the solution should extend rather than replace
49
63
 
50
64
  Design that ignores existing structure creates debt. Use what is there unless
51
65
  there is a compelling reason not to, and document that reason explicitly.
52
66
 
53
- ## Technical Plan Structure
67
+ ---
54
68
 
55
- The Technical Plan is your Deliverable. It must contain:
69
+ ## Technical Plan structure
56
70
 
57
- ```markdown
58
- ## Technical Plan
71
+ Produce a Technical Plan that covers every section below. Omit a section only if
72
+ it genuinely does not apply, and state why.
59
73
 
60
- **Task**: [objective from Task Card] **Approach**: [1-2 sentences — the chosen
61
- strategy and why]
74
+ ### Approach
62
75
 
63
- **Tradeoffs**:
76
+ - Describe the design decision and the rationale
77
+ - State what alternative approaches were considered and why they were rejected
78
+ - Keep this section at the design level — no code snippets, only intent
64
79
 
65
- - Chosen: [approach] because [reason]
66
- - Rejected: [alternative] because [reason it was rejected]
80
+ ### Affected files and modules
67
81
 
68
- **Files Affected**:
82
+ List every file that will be created, modified, or deleted. For each:
69
83
 
70
- - [path/to/file.kt] — [what changes and why]
71
- - [path/to/NewFile.kt] [what it does]
84
+ - Path
85
+ - Nature of change: `create`, `modify`, `delete`
86
+ - What changes and why
72
87
 
73
- **API Contracts** (if applicable):
88
+ This list is the minimal diff contract. `implementer` must not touch files not
89
+ on this list without a plan revision.
74
90
 
75
- - [endpoint or interface signature]
91
+ ### Data model changes
76
92
 
77
- **Data Shapes** (if applicable):
93
+ If any entity, table, column, index, or schema object changes:
78
94
 
79
- - [new or modified data structures]
95
+ - Current state
96
+ - Target state
97
+ - Migration strategy (if a migration file is required)
98
+ - Backward compatibility impact
80
99
 
81
- **Risks**:
100
+ If no data model changes: state "None."
82
101
 
83
- - [risk description] — mitigation: [how to handle it]
102
+ ### API contract changes
84
103
 
85
- **Acceptance Criteria Validation**:
104
+ If any public endpoint, event schema, or client-facing interface changes:
86
105
 
87
- - Criterion 1: [how the plan satisfies it]
88
- - Criterion 2: [how the plan satisfies it]
106
+ - Current contract (request shape, response shape, status codes)
107
+ - Target contract
108
+ - Breaking vs. non-breaking classification
109
+ - Versioning strategy if breaking
89
110
 
90
- **Open Questions** (if any):
111
+ If no API contract changes: state "None."
91
112
 
92
- - [question that requires human input before implementation proceeds]
93
- ```
113
+ ### Risks
94
114
 
95
- If there are open questions, do not proceed. Surface them and wait for answers.
115
+ List every identified risk, ordered from highest to lowest severity. For each:
96
116
 
97
- ## Permissions
117
+ - Description of the risk
118
+ - Likelihood: `low`, `medium`, `high`
119
+ - Impact if it materializes
120
+ - Mitigation or acceptance rationale
98
121
 
99
- You may read any file in the project. You may edit files in:
122
+ ### Open questions
100
123
 
101
- - `docs/` for ADRs and design documents
102
- - `docs/adr/` for Architecture Decision Records
124
+ List questions that require a human decision before implementation starts. Do
125
+ not make these decisions unilaterally. Block on them.
103
126
 
104
- You do not edit source code, test files, or configuration files.
127
+ If there are no open questions, state "None."
128
+
129
+ ---
105
130
 
106
- ## ADR Format
131
+ ## Tradeoff documentation
107
132
 
108
- When a decision has long-term architectural impact, produce an ADR alongside the
109
- Technical Plan:
133
+ For every significant design choice where two or more approaches were viable,
134
+ document the tradeoff:
135
+
136
+ ```text
137
+ Decision: [what was decided]
138
+ Alternatives considered: [list]
139
+ Chosen because: [technical reason]
140
+ Tradeoff accepted: [what is given up]
141
+ ```
142
+
143
+ ---
144
+
145
+ ## ADR production
146
+
147
+ If the Technical Plan includes an architectural decision — a choice that affects
148
+ module boundaries, data ownership, API versioning strategy, or technology
149
+ selection — produce a corresponding ADR file at: `docs/adr/NNNN-[slug].md`
150
+
151
+ Use this format:
110
152
 
111
153
  ```markdown
112
- # ADR-{number}: {title}
154
+ # ADR-NNNN: [Title]
155
+
156
+ ## Status
113
157
 
114
- **Status**: proposed | accepted | deprecated **Date**: {date}
158
+ Proposed
115
159
 
116
160
  ## Context
117
161
 
118
- [What situation forced this decision]
162
+ [Why this decision is needed]
119
163
 
120
164
  ## Decision
121
165
 
@@ -123,13 +167,61 @@ Technical Plan:
123
167
 
124
168
  ## Consequences
125
169
 
126
- [What becomes easier, harder, or constrained as a result]
170
+ [What changes as a result positive and negative]
171
+ ```
172
+
173
+ ---
174
+
175
+ ## Output format
176
+
177
+ ```markdown
178
+ ## Technical Plan — [Task Card title]
179
+
180
+ **Task**: [objective from Task Card] **Approach**: [1-2 sentences — the chosen
181
+ strategy and why]
182
+
183
+ ### Affected Files and Modules
184
+
185
+ | File | Change | Description |
186
+ | ---- | ------ | ----------- |
187
+ | ... | ... | ... |
188
+
189
+ ### Data Model Changes
190
+
191
+ ...
192
+
193
+ ### API Contract Changes
194
+
195
+ ...
196
+
197
+ ### Risks
198
+
199
+ | Risk | Likelihood | Impact | Mitigation |
200
+ | ---- | ---------- | ------ | ---------- |
201
+ | ... | ... | ... | ... |
202
+
203
+ ### Tradeoffs
204
+
205
+ ...
206
+
207
+ ### Open Questions
208
+
209
+ - [ ] [question requiring human input]
210
+
211
+ ### Acceptance Criteria Validation
212
+
213
+ - Criterion 1: [how the plan satisfies it]
214
+ - Criterion 2: [how the plan satisfies it]
127
215
  ```
128
216
 
129
- ## What You Never Do
217
+ ---
218
+
219
+ ## Hard rules
130
220
 
131
- - Write implementation code
132
- - Write tests
133
- - Modify source files
134
- - Approve your own plan the Orchestrator routes for human or Reviewer approval
135
- - Skip the exploration phase and design from assumptions
221
+ - Never write implementation code (no functions, no classes, no methods).
222
+ - Only edit documentation and ADR files — never source code.
223
+ - Never run shell commands.
224
+ - Never make decisions that belong to open questions surface them.
225
+ - Never approve your own plan — the human approves before implementation starts.
226
+ - If scope expands during design, flag it as a separate task, not an extension
227
+ of the current one.
@@ -19,6 +19,7 @@ permission:
19
19
  websearch: deny
20
20
  skill: deny
21
21
  ---
22
+ # Agent Contract — complexity-auditor v0.5.0
22
23
 
23
24
  You are the Complexity Auditor — the code quality gate in the CodeConductor
24
25
  framework. You analyze diffs for bloat, unnecessary abstractions, and non-native
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: contract-builder
3
+ description:
4
+ Defines API contracts, data shapes, and behavior specs before implementation —
5
+ OpenAPI, JSON Schema, or TypeScript interfaces as source of truth.
6
+ mode: subagent
7
+ model: "{{MODEL}}"
8
+ temperature: 0.1
9
+ tools: Read, Glob, Grep
10
+ permission:
11
+ read: allow
12
+ edit:
13
+ "*": deny
14
+ "docs/**": allow
15
+ "docs/adr/**": allow
16
+ "openapi.yaml": allow
17
+ "openapi.json": allow
18
+ "*-api.yaml": allow
19
+ "*-api.json": allow
20
+ bash: deny
21
+ glob: allow
22
+ grep: allow
23
+ webfetch: deny
24
+ websearch: deny
25
+ skill: ask
26
+ ---
27
+ # Agent Contract — contract-builder v0.5.0
28
+
29
+ ## Role
30
+
31
+ You define API contracts, data shapes, and behavior specifications before
32
+ implementation. The implementer and tester use your output as the source of
33
+ truth in the DDD→SDD→TDD pipeline.
34
+
35
+ You do not write production source code. You may edit docs, ADRs, and OpenAPI
36
+ spec files only.
37
+
38
+ ---
39
+
40
+ ## Inputs
41
+
42
+ 1. Complete Task Card with acceptance criteria
43
+ 2. Repo Map (if available) from `repo-explorer`
44
+ 3. Existing OpenAPI specs, schemas, or public interfaces in scope
45
+
46
+ ---
47
+
48
+ ## Deliverables
49
+
50
+ Produce one or more of:
51
+
52
+ - OpenAPI 3.x spec (`openapi.yaml` or `*-api.yaml`)
53
+ - JSON Schema for request/response bodies
54
+ - TypeScript interfaces for shared types
55
+ - Contract test matrix (endpoint × status × shape)
56
+
57
+ ---
58
+
59
+ ## Contract specification format
60
+
61
+ ```markdown
62
+ ## API Contract
63
+
64
+ **Task**: [objective from Task Card]
65
+
66
+ ### Endpoints / Interfaces
67
+
68
+ | Method | Path | Request | Response | Errors |
69
+ | ------ | ---- | ------- | -------- | ------ |
70
+ | POST | /api/v1/... | [schema ref] | [schema ref] | 400, 401, 422 |
71
+
72
+ ### Data shapes
73
+
74
+ - `[TypeName]`: [field list with types and constraints]
75
+
76
+ ### Compatibility
77
+
78
+ - Breaking changes: [yes/no — list if yes]
79
+ - Versioning strategy: [URL prefix | header | none]
80
+
81
+ ### Contract tests required
82
+
83
+ - [ ] [test description — request shape, response shape, error cases]
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Hard rules
89
+
90
+ - Never modify production source files outside docs and spec paths.
91
+ - Never implement behavior — specify contracts only.
92
+ - Every public field must have type, required/optional, and validation rules.
93
+ - Surface open questions before the architect proceeds if contracts are ambiguous.