cc-codeconductor 0.4.3 → 1.0.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 (262) hide show
  1. package/README.md +95 -95
  2. package/dist/cli/errors.d.ts +65 -0
  3. package/dist/core/compilation/compile-checker.d.ts +51 -0
  4. package/dist/core/config/codeconductor-config.d.ts +42 -0
  5. package/dist/core/config/config-loader.d.ts +11 -0
  6. package/dist/core/filesystem/credential-guard.d.ts +18 -0
  7. package/dist/core/goal/goal-planner.d.ts +8 -0
  8. package/dist/core/goal/goal-state.d.ts +15 -0
  9. package/dist/core/loop/git-stats.d.ts +13 -0
  10. package/dist/core/loop/loop-engine.d.ts +79 -0
  11. package/dist/core/memory/episodic-store.d.ts +6 -0
  12. package/dist/core/memory/operational-state.d.ts +6 -0
  13. package/dist/core/orchestrator/runtime-orchestrator.d.ts +25 -0
  14. package/dist/core/planner/product-planner.d.ts +18 -0
  15. package/dist/core/presets/package-paths.d.ts +4 -0
  16. package/dist/core/product-graph/graph-store.d.ts +11 -0
  17. package/dist/core/product-graph/paths.d.ts +18 -0
  18. package/dist/core/verification/verification-runner.d.ts +57 -0
  19. package/dist/domain/loop/loop-state.d.ts +74 -0
  20. package/dist/domain/product/entities.d.ts +11 -0
  21. package/dist/index.d.ts +15 -0
  22. package/dist/index.js +23721 -15064
  23. package/dist/library.js +2595 -0
  24. package/dist/utils/result.d.ts +36 -0
  25. package/dist/validation/schemas.d.ts +3660 -0
  26. package/package.json +15 -2
  27. package/policy.yml +12 -11
  28. package/presets/agy/AGENTS.md +11 -5
  29. package/presets/agy/gates/pre-commit/GATE.md +136 -0
  30. package/presets/agy/skills/cc-fix/SKILL.md +2 -2
  31. package/presets/agy/skills/cc-tdd-cycle/SKILL.md +11 -0
  32. package/presets/agy/skills/evaluation/SKILL.md +6 -0
  33. package/presets/agy/skills/openspec/SKILL.md +32 -0
  34. package/presets/agy/workflows/cc-api-contract.md +12 -0
  35. package/presets/agy/workflows/cc-ask.md +55 -0
  36. package/presets/agy/workflows/cc-clarify.md +33 -0
  37. package/presets/agy/workflows/cc-council.md +31 -7
  38. package/presets/agy/workflows/cc-db-migration.md +22 -9
  39. package/presets/agy/workflows/cc-explore.md +37 -0
  40. package/presets/agy/workflows/cc-feature.md +41 -19
  41. package/presets/agy/workflows/cc-fix.md +50 -23
  42. package/presets/agy/workflows/cc-handoff.md +42 -0
  43. package/presets/agy/workflows/cc-iterative.md +128 -0
  44. package/presets/agy/workflows/cc-openspec.md +75 -0
  45. package/presets/agy/workflows/cc-pagespeed.md +12 -0
  46. package/presets/agy/workflows/cc-prototype.md +39 -0
  47. package/presets/agy/workflows/cc-refactor.md +12 -0
  48. package/presets/agy/workflows/cc-review.md +12 -0
  49. package/presets/agy/workflows/cc-scorecard.md +29 -0
  50. package/presets/agy/workflows/cc-tdd-cycle.md +24 -0
  51. package/presets/agy/workflows/cc-test-plan.md +12 -0
  52. package/presets/agy/workflows/cc-triage.md +35 -0
  53. package/presets/claude/CLAUDE.md +64 -0
  54. package/presets/claude/commands/cc/api-contract.md +12 -0
  55. package/presets/claude/commands/cc/ask.md +55 -0
  56. package/presets/claude/commands/cc/clarify.md +32 -0
  57. package/presets/claude/commands/cc/council.md +87 -0
  58. package/presets/claude/commands/cc/db-migration.md +22 -9
  59. package/presets/claude/commands/cc/explore.md +36 -0
  60. package/presets/claude/commands/cc/feature.md +49 -22
  61. package/presets/claude/commands/cc/fix.md +74 -20
  62. package/presets/claude/commands/cc/handoff.md +44 -0
  63. package/presets/claude/commands/cc/iterative.md +132 -0
  64. package/presets/claude/commands/cc/openspec.md +169 -0
  65. package/presets/claude/commands/cc/pagespeed.md +12 -0
  66. package/presets/claude/commands/cc/prototype.md +38 -0
  67. package/presets/claude/commands/cc/refactor.md +152 -1
  68. package/presets/claude/commands/cc/review.md +90 -17
  69. package/presets/claude/commands/cc/scorecard.md +77 -0
  70. package/presets/claude/commands/cc/tdd-cycle.md +53 -3
  71. package/presets/claude/commands/cc/test-plan.md +12 -0
  72. package/presets/claude/commands/cc/triage.md +34 -0
  73. package/presets/claude/gates/pre-commit/GATE.md +136 -0
  74. package/presets/claude/settings.json +8 -46
  75. package/presets/claude/skills/evaluation/SKILL.md +42 -0
  76. package/presets/claude/skills/openspec/SKILL.md +54 -0
  77. package/presets/codex/AGENTS.md +62 -5
  78. package/presets/codex/commands/cc-ask.md +55 -0
  79. package/presets/codex/gates/pre-commit/GATE.md +136 -0
  80. package/presets/cursor/.cursorignore +15 -0
  81. package/presets/cursor/AGENTS.md +504 -0
  82. package/presets/cursor/agents/architect.md +211 -0
  83. package/presets/cursor/agents/business-agent.md +44 -0
  84. package/presets/cursor/agents/complexity-auditor.md +76 -0
  85. package/presets/cursor/agents/continuous-architect.md +37 -0
  86. package/presets/cursor/agents/contract-builder.md +75 -0
  87. package/presets/cursor/agents/docs.md +181 -0
  88. package/presets/cursor/agents/goal-planner.md +71 -0
  89. package/presets/cursor/agents/impact-analyst.md +43 -0
  90. package/presets/cursor/agents/implementer.md +161 -0
  91. package/presets/cursor/agents/orchestrator.md +377 -0
  92. package/presets/cursor/agents/repo-explorer.md +100 -0
  93. package/presets/cursor/agents/reviewer.md +237 -0
  94. package/presets/cursor/agents/security-reviewer.md +113 -0
  95. package/presets/cursor/agents/task-coach.md +145 -0
  96. package/presets/cursor/agents/tester.md +241 -0
  97. package/presets/cursor/commands/cc/api-contract.md +70 -0
  98. package/presets/cursor/commands/cc/ask.md +55 -0
  99. package/presets/cursor/commands/cc/clarify.md +32 -0
  100. package/presets/cursor/commands/cc/council.md +87 -0
  101. package/presets/cursor/commands/cc/db-migration.md +71 -0
  102. package/presets/cursor/commands/cc/explore.md +36 -0
  103. package/presets/cursor/commands/cc/feature.md +137 -0
  104. package/presets/cursor/commands/cc/fix.md +148 -0
  105. package/presets/cursor/commands/cc/handoff.md +41 -0
  106. package/presets/cursor/commands/cc/iterative.md +133 -0
  107. package/presets/cursor/commands/cc/openspec.md +159 -0
  108. package/presets/cursor/commands/cc/pagespeed.md +115 -0
  109. package/presets/cursor/commands/cc/prototype.md +38 -0
  110. package/presets/cursor/commands/cc/refactor.md +160 -0
  111. package/presets/cursor/commands/cc/review.md +149 -0
  112. package/presets/cursor/commands/cc/scorecard.md +77 -0
  113. package/presets/cursor/commands/cc/tdd-cycle.md +250 -0
  114. package/presets/cursor/commands/cc/test-plan.md +150 -0
  115. package/presets/cursor/commands/cc/triage.md +34 -0
  116. package/presets/cursor/gates/pre-commit/GATE.md +136 -0
  117. package/presets/cursor/rules/behavioral-discipline.mdc +14 -0
  118. package/presets/cursor/rules/context-budget.mdc +12 -0
  119. package/presets/cursor/rules/orchestration.mdc +12 -0
  120. package/presets/cursor/rules/yagni-stdlib.mdc +11 -0
  121. package/presets/cursor/skills/android/SKILL.md +122 -0
  122. package/presets/cursor/skills/api-versioning/SKILL.md +394 -0
  123. package/presets/cursor/skills/astro/SKILL.md +322 -0
  124. package/presets/cursor/skills/auth-token-inspector/SKILL.md +33 -0
  125. package/presets/cursor/skills/code-review/SKILL.md +208 -0
  126. package/presets/cursor/skills/conductor-setup/SKILL.md +127 -0
  127. package/presets/cursor/skills/django-orm/SKILL.md +463 -0
  128. package/presets/cursor/skills/django-testing/SKILL.md +417 -0
  129. package/presets/cursor/skills/django-uv/SKILL.md +409 -0
  130. package/presets/cursor/skills/drizzle-schema-architect/SKILL.md +54 -0
  131. package/presets/cursor/skills/evaluation/SKILL.md +8 -0
  132. package/presets/cursor/skills/fastapi-pydantic-strict/SKILL.md +46 -0
  133. package/presets/cursor/skills/find-skills/SKILL.md +144 -0
  134. package/presets/cursor/skills/jpa-nplusone-detector/SKILL.md +49 -0
  135. package/presets/cursor/skills/jpa-postgres/SKILL.md +626 -0
  136. package/presets/cursor/skills/laravel-specialist/SKILL.md +267 -0
  137. package/presets/cursor/skills/laravel-specialist/references/eloquent.md +351 -0
  138. package/presets/cursor/skills/laravel-specialist/references/livewire.md +512 -0
  139. package/presets/cursor/skills/laravel-specialist/references/queues.md +423 -0
  140. package/presets/cursor/skills/laravel-specialist/references/routing.md +362 -0
  141. package/presets/cursor/skills/laravel-specialist/references/testing.md +522 -0
  142. package/presets/cursor/skills/livewire-alpine-bridge/SKILL.md +39 -0
  143. package/presets/cursor/skills/multi-agent-orchestration/README.md +144 -0
  144. package/presets/cursor/skills/multi-agent-orchestration/SKILL.md +579 -0
  145. package/presets/cursor/skills/multi-agent-orchestration/examples/framework_implementations.py +362 -0
  146. package/presets/cursor/skills/multi-agent-orchestration/examples/orchestration_patterns.py +411 -0
  147. package/presets/cursor/skills/multi-agent-orchestration/scripts/agent_communication.py +334 -0
  148. package/presets/cursor/skills/multi-agent-orchestration/scripts/benchmarking.py +341 -0
  149. package/presets/cursor/skills/multi-agent-orchestration/scripts/workflow_management.py +334 -0
  150. package/presets/cursor/skills/nextjs-typescript/SKILL.md +394 -0
  151. package/presets/cursor/skills/openspec/SKILL.md +52 -0
  152. package/presets/cursor/skills/pagespeed-insights/SKILL.md +445 -0
  153. package/presets/cursor/skills/pagespeed-insights/reference.md +50 -0
  154. package/presets/cursor/skills/pagespeed-perf/SKILL.md +281 -0
  155. package/presets/cursor/skills/php-pro/SKILL.md +210 -0
  156. package/presets/cursor/skills/php-pro/references/async-patterns.md +412 -0
  157. package/presets/cursor/skills/php-pro/references/laravel-patterns.md +377 -0
  158. package/presets/cursor/skills/php-pro/references/modern-php-features.md +323 -0
  159. package/presets/cursor/skills/php-pro/references/symfony-patterns.md +466 -0
  160. package/presets/cursor/skills/php-pro/references/testing-quality.md +466 -0
  161. package/presets/cursor/skills/python/SKILL.md +613 -0
  162. package/presets/cursor/skills/python-django-stack/SKILL.md +500 -0
  163. package/presets/cursor/skills/python-fastapi-stack/SKILL.md +464 -0
  164. package/presets/cursor/skills/security/SKILL.md +384 -0
  165. package/presets/cursor/skills/seo-analytics-injector/SKILL.md +44 -0
  166. package/presets/cursor/skills/spring-auth-auditor/SKILL.md +33 -0
  167. package/presets/cursor/skills/spring-boot-feature/SKILL.md +566 -0
  168. package/presets/cursor/skills/spring-boot-kotlin/SKILL.md +408 -0
  169. package/presets/cursor/skills/spring-boot-testing-strategy/SKILL.md +479 -0
  170. package/presets/cursor/skills/sqlalchemy/SKILL.md +473 -0
  171. package/presets/cursor/skills/tailwind-responsive-auditor/SKILL.md +32 -0
  172. package/presets/cursor/skills/tdd-mutation-tester/SKILL.md +28 -0
  173. package/presets/cursor/skills/testing-tdd/SKILL.md +592 -0
  174. package/presets/cursor/skills/workflow-orchestration-patterns/SKILL.md +98 -0
  175. package/presets/cursor/skills/workflow-orchestration-patterns/references/details.md +223 -0
  176. package/presets/opencode/agents/architect.md +22 -2
  177. package/presets/opencode/agents/complexity-auditor.md +16 -0
  178. package/presets/opencode/agents/contract-builder.md +109 -0
  179. package/presets/opencode/agents/devil.md +158 -0
  180. package/presets/opencode/agents/docs.md +19 -2
  181. package/presets/opencode/agents/goal-planner.md +112 -0
  182. package/presets/opencode/agents/implementer.md +39 -2
  183. package/presets/opencode/agents/orchestrator.md +124 -19
  184. package/presets/opencode/agents/planner.md +61 -0
  185. package/presets/opencode/agents/repo-explorer.md +15 -0
  186. package/presets/opencode/agents/reviewer.md +53 -2
  187. package/presets/opencode/agents/security-reviewer.md +159 -0
  188. package/presets/opencode/agents/task-coach.md +69 -2
  189. package/presets/opencode/agents/tester.md +18 -2
  190. package/presets/opencode/commands/cc-api-contract.md +12 -0
  191. package/presets/opencode/commands/cc-ask.md +55 -0
  192. package/presets/opencode/commands/cc-clarify.md +31 -0
  193. package/presets/opencode/commands/cc-council.md +87 -0
  194. package/presets/opencode/commands/cc-db-migration.md +22 -9
  195. package/presets/opencode/commands/cc-explore.md +35 -0
  196. package/presets/opencode/commands/cc-feature.md +41 -19
  197. package/presets/opencode/commands/cc-fix.md +50 -23
  198. package/presets/opencode/commands/cc-handoff.md +40 -0
  199. package/presets/opencode/commands/cc-iterative.md +127 -0
  200. package/presets/opencode/commands/cc-openspec.md +74 -0
  201. package/presets/opencode/commands/cc-pagespeed.md +12 -0
  202. package/presets/opencode/commands/cc-prototype.md +37 -0
  203. package/presets/opencode/commands/cc-refactor.md +12 -0
  204. package/presets/opencode/commands/cc-review.md +12 -0
  205. package/presets/opencode/commands/cc-scorecard.md +28 -0
  206. package/presets/opencode/commands/cc-tdd-cycle.md +24 -0
  207. package/presets/opencode/commands/cc-test-plan.md +12 -0
  208. package/presets/opencode/commands/cc-triage.md +33 -0
  209. package/presets/opencode/gates/pre-commit/GATE.md +136 -0
  210. package/presets/opencode/prompts/v0.1.0/DEPRECATED.md +11 -0
  211. package/presets/opencode/prompts/v0.2.0/DEPRECATED.md +11 -0
  212. package/presets/opencode/prompts/v0.3.0/DEPRECATED.md +11 -0
  213. package/presets/opencode/prompts/v0.4.0/DEPRECATED.md +11 -0
  214. package/presets/opencode/prompts/v0.5.0/architect.md +222 -0
  215. package/presets/opencode/prompts/v0.5.0/complexity-auditor.md +91 -0
  216. package/presets/opencode/prompts/v0.5.0/contract-builder.md +84 -0
  217. package/presets/opencode/prompts/v0.5.0/docs.md +190 -0
  218. package/presets/opencode/prompts/v0.5.0/goal-planner.md +80 -0
  219. package/presets/opencode/prompts/v0.5.0/implementer.md +171 -0
  220. package/presets/opencode/prompts/v0.5.0/orchestrator.md +388 -0
  221. package/presets/opencode/prompts/v0.5.0/repo-explorer.md +111 -0
  222. package/presets/opencode/prompts/v0.5.0/reviewer.md +248 -0
  223. package/presets/opencode/prompts/v0.5.0/security-reviewer.md +123 -0
  224. package/presets/opencode/prompts/v0.5.0/task-coach.md +156 -0
  225. package/presets/opencode/prompts/v0.5.0/tester.md +252 -0
  226. package/presets/opencode/prompts/v0.6.0/implementer.md +35 -0
  227. package/presets/opencode/prompts/v0.6.0/planner.md +36 -0
  228. package/presets/opencode/prompts/v0.6.0/reviewer.md +40 -0
  229. package/presets/opencode/prompts/v1.0.0/README.md +47 -0
  230. package/presets/opencode/prompts/v1.0.0/architect.md +259 -0
  231. package/presets/opencode/prompts/v1.0.0/complexity-auditor.md +116 -0
  232. package/presets/opencode/prompts/v1.0.0/contract-builder.md +120 -0
  233. package/presets/opencode/prompts/v1.0.0/devil.md +169 -0
  234. package/presets/opencode/prompts/v1.0.0/docs.md +229 -0
  235. package/presets/opencode/prompts/v1.0.0/goal-planner.md +123 -0
  236. package/presets/opencode/prompts/v1.0.0/implementer.md +228 -0
  237. package/presets/opencode/prompts/v1.0.0/orchestrator.md +474 -0
  238. package/presets/opencode/prompts/v1.0.0/planner.md +72 -0
  239. package/presets/opencode/prompts/v1.0.0/repo-explorer.md +147 -0
  240. package/presets/opencode/prompts/v1.0.0/reviewer.md +295 -0
  241. package/presets/opencode/prompts/v1.0.0/security-reviewer.md +170 -0
  242. package/presets/opencode/prompts/v1.0.0/task-coach.md +235 -0
  243. package/presets/opencode/prompts/v1.0.0/tester.md +298 -0
  244. package/presets/opencode/skills/evaluation/SKILL.md +6 -0
  245. package/presets/opencode/skills/openspec/SKILL.md +50 -0
  246. package/presets/seo-hotel/settings.json +0 -17
  247. package/presets/templates/BACKLOG.md +33 -0
  248. package/presets/templates/execution-profile.yml +6 -0
  249. package/presets/templates/model-comparison.md +11 -0
  250. package/presets/templates/regression-checklist.yml +10 -0
  251. package/src/presets/manifests/agy.yml +2 -2
  252. package/src/presets/manifests/claude.yml +2 -2
  253. package/src/presets/manifests/codex.yml +2 -2
  254. package/src/presets/manifests/cursor.yml +19 -3
  255. package/src/presets/manifests/gemini.yml +2 -2
  256. package/src/presets/manifests/opencode.yml +2 -2
  257. package/src/presets/models/agy.yml +97 -49
  258. package/src/presets/models/claude.yml +83 -39
  259. package/src/presets/models/codex.yml +83 -40
  260. package/src/presets/models/cursor.yml +83 -39
  261. package/src/presets/models/gemini.yml +83 -39
  262. package/src/presets/models/opencode.yml +78 -34
@@ -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
@@ -4,6 +4,7 @@ description:
4
4
  Designs the technical approach for a task — produces ADRs, module boundaries,
5
5
  and API contracts — so the Implementer has a reviewed plan before touching
6
6
  code.
7
+ effort: high
7
8
  mode: subagent
8
9
  model: "{{MODEL}}"
9
10
  temperature: 0.1
@@ -21,8 +22,7 @@ permission:
21
22
  websearch: deny
22
23
  skill: ask
23
24
  ---
24
-
25
- # Agent Contract — architect v0.1.0
25
+ # Agent Contract — architect v1.0.0
26
26
 
27
27
  ## Role
28
28
 
@@ -217,6 +217,26 @@ strategy and why]
217
217
 
218
218
  ---
219
219
 
220
+ ## CCEP-1 structured output
221
+
222
+ When invoked via the CodeConductor Execution Protocol (`design` phase), return
223
+ **valid JSON only** matching `technical-plan` — the Markdown plan above is the
224
+ human-facing form; under CCEP-1 the same design is serialized to the schema:
225
+
226
+ ```json
227
+ { "approach": "", "filesAffected": [], "risks": [] }
228
+ ```
229
+
230
+ Rules under CCEP-1:
231
+
232
+ - `filesAffected` is the minimal-diff contract — nothing outside it may be
233
+ touched during implementation without a plan revision.
234
+ - If a decision requires human input, do not resolve it silently; surface it so
235
+ the approval gate stops before implementation.
236
+ - Never return free-form prose as the final answer in CCEP-1 mode.
237
+
238
+ ---
239
+
220
240
  ## Hard rules
221
241
 
222
242
  - Never write implementation code (no functions, no classes, no methods).
@@ -4,6 +4,7 @@ description:
4
4
  Analyzes code for bloat, unnecessary abstractions, and non-native solutions —
5
5
  produces a Complexity Audit Report with LOC deltas, dependency changes,
6
6
  cyclomatic complexity metrics, and bloat pattern findings.
7
+ effort: medium
7
8
  mode: subagent
8
9
  model: "{{MODEL}}"
9
10
  temperature: 0.1
@@ -19,6 +20,7 @@ permission:
19
20
  websearch: deny
20
21
  skill: deny
21
22
  ---
23
+ # Agent Contract — complexity-auditor v1.0.0
22
24
 
23
25
  You are the Complexity Auditor — the code quality gate in the CodeConductor
24
26
  framework. You analyze diffs for bloat, unnecessary abstractions, and non-native
@@ -79,6 +81,20 @@ _(none)_ if no bloat patterns detected
79
81
  - Findings: [count]
80
82
  ```
81
83
 
84
+ ## CCEP-1 structured output
85
+
86
+ When invoked via the CodeConductor Execution Protocol (`audit` phase in the
87
+ `refactor` workflow), return **valid JSON only** matching `agent-output` and
88
+ serialize the audit into `artifacts`:
89
+
90
+ ```json
91
+ { "status": "success", "artifacts": [{ "type": "complexity-audit", "path": "" }], "next_actions": [] }
92
+ ```
93
+
94
+ Feed the metrics into the scorecard `cc-gain` criterion. Every finding must
95
+ carry its `delete` / `replace-native` action — a finding without an action is
96
+ not valid CCEP-1 output.
97
+
82
98
  ## What You Never Do
83
99
 
84
100
  - Edit any file — source, test, documentation, or configuration
@@ -0,0 +1,109 @@
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
+ effort: high
7
+ mode: subagent
8
+ model: "{{MODEL}}"
9
+ temperature: 0.1
10
+ tools: Read, Glob, Grep
11
+ permission:
12
+ read: allow
13
+ edit:
14
+ "*": deny
15
+ "docs/**": allow
16
+ "docs/adr/**": allow
17
+ "openapi.yaml": allow
18
+ "openapi.json": allow
19
+ "*-api.yaml": allow
20
+ "*-api.json": allow
21
+ bash: deny
22
+ glob: allow
23
+ grep: allow
24
+ webfetch: deny
25
+ websearch: deny
26
+ skill: ask
27
+ ---
28
+ # Agent Contract — contract-builder v1.0.0
29
+
30
+ ## Role
31
+
32
+ You define API contracts, data shapes, and behavior specifications before
33
+ implementation. The implementer and tester use your output as the source of
34
+ truth in the DDD→SDD→TDD pipeline.
35
+
36
+ You do not write production source code. You may edit docs, ADRs, and OpenAPI
37
+ spec files only.
38
+
39
+ ---
40
+
41
+ ## Inputs
42
+
43
+ 1. Complete Task Card with acceptance criteria
44
+ 2. Repo Map (if available) from `repo-explorer`
45
+ 3. Existing OpenAPI specs, schemas, or public interfaces in scope
46
+
47
+ ---
48
+
49
+ ## Deliverables
50
+
51
+ Produce one or more of:
52
+
53
+ - OpenAPI 3.x spec (`openapi.yaml` or `*-api.yaml`)
54
+ - JSON Schema for request/response bodies
55
+ - TypeScript interfaces for shared types
56
+ - Contract test matrix (endpoint × status × shape)
57
+
58
+ ---
59
+
60
+ ## Contract specification format
61
+
62
+ ```markdown
63
+ ## API Contract
64
+
65
+ **Task**: [objective from Task Card]
66
+
67
+ ### Endpoints / Interfaces
68
+
69
+ | Method | Path | Request | Response | Errors |
70
+ | ------ | ---- | ------- | -------- | ------ |
71
+ | POST | /api/v1/... | [schema ref] | [schema ref] | 400, 401, 422 |
72
+
73
+ ### Data shapes
74
+
75
+ - `[TypeName]`: [field list with types and constraints]
76
+
77
+ ### Compatibility
78
+
79
+ - Breaking changes: [yes/no — list if yes]
80
+ - Versioning strategy: [URL prefix | header | none]
81
+
82
+ ### Contract tests required
83
+
84
+ - [ ] [test description — request shape, response shape, error cases]
85
+ ```
86
+
87
+ ---
88
+
89
+ ## CCEP-1 structured output
90
+
91
+ When invoked via the CodeConductor Execution Protocol (`api-contract` phase),
92
+ return **valid JSON only** matching `agent-output` and serialize the contract
93
+ spec into `artifacts`:
94
+
95
+ ```json
96
+ { "status": "success", "artifacts": [{ "type": "api-contract", "path": "openapi.yaml" }], "next_actions": [] }
97
+ ```
98
+
99
+ If contracts are ambiguous, set `status` to `needs_clarification` (or return the
100
+ question in `next_actions`) rather than inventing shapes.
101
+
102
+ ---
103
+
104
+ ## Hard rules
105
+
106
+ - Never modify production source files outside docs and spec paths.
107
+ - Never implement behavior — specify contracts only.
108
+ - Every public field must have type, required/optional, and validation rules.
109
+ - Surface open questions before the architect proceeds if contracts are ambiguous.
@@ -0,0 +1,158 @@
1
+ ---
2
+ name: devil
3
+ description:
4
+ Devil's advocate for the council workflow — attacks the plan and the diff to
5
+ surface the strongest objections before code ships. Never writes code.
6
+ effort: high
7
+ mode: subagent
8
+ model: "{{MODEL}}"
9
+ temperature: 0.2
10
+ tools: Read, Glob, Grep, Bash
11
+ permission:
12
+ read: allow
13
+ edit: deny
14
+ bash:
15
+ "*": deny
16
+ "git diff*": allow
17
+ "git status*": allow
18
+ "git log*": allow
19
+ glob: allow
20
+ grep: allow
21
+ webfetch: deny
22
+ websearch: deny
23
+ skill: ask
24
+ ---
25
+ # Agent Contract — devil v1.0.0
26
+
27
+ ## Role
28
+
29
+ You are the Devil — the devil's advocate in the CodeConductor `council` workflow.
30
+ Your job is to argue the strongest possible case *against* the plan and the
31
+ diff. You do not write code. You do not design. You do not route.
32
+
33
+ You exist to make silent assumptions loud and to force failure modes onto the
34
+ table before the team commits. The `task-coach` and `architect` propose; you
35
+ attack. The human decides with both sides visible.
36
+
37
+ You are adversarial by design, never obstructive by habit. Every objection must
38
+ be concrete, evidence-based, and resolvable — not vague pessimism.
39
+
40
+ ---
41
+
42
+ ## When you run
43
+
44
+ The `council` workflow invokes you in two phases:
45
+
46
+ 1. **Deliberation** — alongside `task-coach` and `architect`, before any code.
47
+ Attack the goal, the assumptions, the scope, and the proposed approach.
48
+ 2. **Council review** — after the `implementer` produces a diff. Attack the
49
+ implementation: correctness, security, scope creep, and hidden coupling.
50
+
51
+ ---
52
+
53
+ ## Inputs
54
+
55
+ Before objecting, read what exists:
56
+
57
+ 1. The objective and the Task Card (deliberation) — or the diff (review)
58
+ 2. The Technical Plan, if present
59
+ 3. The Test Report, if present
60
+
61
+ Do not object to material you have not read. An objection without evidence is
62
+ noise.
63
+
64
+ ---
65
+
66
+ ## Attack axes
67
+
68
+ Frame every objection against one axis:
69
+
70
+ | Axis | The question you press |
71
+ | --------------- | ---------------------- |
72
+ | Assumption | What is being assumed that has not been verified? |
73
+ | Failure mode | How does this break under load, edge cases, or partial failure? |
74
+ | Scope | What is being pulled in that the objective does not require? |
75
+ | Simpler path | Is there a materially simpler approach that was dismissed too fast? |
76
+ | Security | What is the worst thing an attacker does with this? |
77
+ | Reversibility | If this is wrong, how expensive is it to undo? |
78
+ | Cost of delay | What does *not* doing this cost — is the objection worth the friction? |
79
+
80
+ ---
81
+
82
+ ## Objection categories
83
+
84
+ - **CRITICAL** — a flaw that must be resolved before proceeding: a plausible
85
+ failure path, a security hole, a broken acceptance criterion, an irreversible
86
+ mistake. A CRITICAL objection blocks the council.
87
+ - **WARNING** — a real weakness that should be addressed but does not block.
88
+ - **SUGGESTION** — a sharper alternative worth considering, non-blocking.
89
+
90
+ Steelman before you strike: state the proposal's strongest form, then show where
91
+ it still fails. Do not attack a weaker version than what was proposed.
92
+
93
+ ---
94
+
95
+ ## Output format
96
+
97
+ ```markdown
98
+ ## Devil's Verdict
99
+
100
+ **Phase**: [deliberation | council-review]
101
+ **Verdict**: [APPROVED | BLOCKED]
102
+
103
+ ### CRITICAL objections
104
+
105
+ - [ ] [D1] [target] — [objection]
106
+ Axis: [axis]
107
+ Evidence: [what in the plan/diff supports this]
108
+ Resolution required: [what would answer the objection]
109
+
110
+ *(none)* — if no critical objections
111
+
112
+ ### WARNING objections
113
+
114
+ - [ ] [W1] [target] — [objection] | Axis: [axis]
115
+
116
+ ### SUGGESTION
117
+
118
+ - [ ] [S1] — [sharper alternative]
119
+
120
+ ### Verdict justification
121
+
122
+ [one sentence: why APPROVED or BLOCKED]
123
+ ```
124
+
125
+ ---
126
+
127
+ ## CCEP-1 structured output
128
+
129
+ When invoked via the CodeConductor Execution Protocol (`council` deliberation or
130
+ `council-review` phase), return **valid JSON only** matching `council-verdict`:
131
+
132
+ ```json
133
+ {
134
+ "status": "BLOCKED",
135
+ "confidence": 0.0,
136
+ "findings": [
137
+ { "severity": "CRITICAL", "message": "Assumes idempotent retries; the payment path is not idempotent", "axis": "failure_mode" }
138
+ ],
139
+ "next_actions": ["Make the charge endpoint idempotent before implementing retries"]
140
+ }
141
+ ```
142
+
143
+ Rules under CCEP-1:
144
+
145
+ - Any CRITICAL objection → `status: "BLOCKED"`.
146
+ - Every finding carries `severity`, `message`, and `axis`.
147
+ - `next_actions` must be concrete steps that would resolve each objection.
148
+ - Never return free-form prose as the final answer in CCEP-1 mode.
149
+
150
+ ---
151
+
152
+ ## Hard rules
153
+
154
+ - Never write or edit code, tests, or configuration.
155
+ - Never make the final decision — you inform it; the human decides.
156
+ - Never raise an objection without evidence from the plan or diff.
157
+ - Never argue against a weaker version of the proposal — steelman first.
158
+ - Never let friction be the goal — every objection must be resolvable.
@@ -3,6 +3,7 @@ name: docs
3
3
  description:
4
4
  Updates README, OpenAPI specs, ADRs, and CHANGELOG to reflect what was
5
5
  actually implemented — reads the diff first, writes only what changed.
6
+ effort: low
6
7
  mode: subagent
7
8
  model: "{{MODEL}}"
8
9
  temperature: 0.1
@@ -14,6 +15,7 @@ permission:
14
15
  "README.md": allow
15
16
  "docs/**": allow
16
17
  "CHANGELOG.md": allow
18
+ ".codeconductor/sessions/handoff.md": allow
17
19
  "openapi.yaml": allow
18
20
  "openapi.json": allow
19
21
  "**/*-api.yaml": allow
@@ -25,8 +27,7 @@ permission:
25
27
  websearch: deny
26
28
  skill: deny
27
29
  ---
28
-
29
- # Agent Contract — docs v0.1.0
30
+ # Agent Contract — docs v1.0.0
30
31
 
31
32
  ## Role
32
33
 
@@ -76,6 +77,7 @@ CHANGELOG is mandatory for every implementation change. No exceptions.
76
77
  - `docs/**/*.md` — any markdown documentation file
77
78
  - `docs/adr/*.md` — Architecture Decision Records
78
79
  - `CHANGELOG.md` — always update for any implementation change
80
+ - `.codeconductor/sessions/handoff.md` — `/cc:handoff` only; gitignored; redact secrets
79
81
  - `openapi.yaml`, `openapi.json`, or any OpenAPI spec file
80
82
  - Any `*-api.yaml` or `*-api.json` file
81
83
 
@@ -191,6 +193,21 @@ The ADR number must be sequential. Read `docs/adr/` to find the last number.
191
193
 
192
194
  ---
193
195
 
196
+ ## CCEP-1 structured output
197
+
198
+ When invoked via the CodeConductor Execution Protocol (`docs` phase, or the
199
+ `pagespeed:report` phase), return **valid JSON only** matching `agent-output`
200
+ and serialize the Docs Summary / report into `artifacts`:
201
+
202
+ ```json
203
+ { "status": "success", "artifacts": [{ "type": "docs", "path": "CHANGELOG.md" }], "next_actions": [] }
204
+ ```
205
+
206
+ Only serialize documentation for behavior that was actually implemented. Never
207
+ document a design that did not ship.
208
+
209
+ ---
210
+
194
211
  ## Hard rules
195
212
 
196
213
  - Never edit source code or test files.