cc-codeconductor 0.4.3 → 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.
- package/README.md +1 -1
- package/dist/index.js +2642 -226
- package/package.json +1 -1
- package/presets/agy/skills/evaluation/SKILL.md +6 -0
- package/presets/agy/skills/openspec/SKILL.md +32 -0
- package/presets/agy/workflows/cc-openspec.md +62 -0
- package/presets/agy/workflows/cc-scorecard.md +17 -0
- package/presets/claude/commands/cc/openspec.md +144 -0
- package/presets/claude/commands/cc/review.md +13 -2
- package/presets/claude/commands/cc/scorecard.md +65 -0
- package/presets/claude/skills/evaluation/SKILL.md +42 -0
- package/presets/claude/skills/openspec/SKILL.md +54 -0
- package/presets/codex/AGENTS.md +57 -0
- package/presets/cursor/.cursorignore +15 -0
- package/presets/cursor/AGENTS.md +504 -0
- package/presets/cursor/agents/architect.md +211 -0
- package/presets/cursor/agents/complexity-auditor.md +76 -0
- package/presets/cursor/agents/contract-builder.md +75 -0
- package/presets/cursor/agents/docs.md +180 -0
- package/presets/cursor/agents/goal-planner.md +71 -0
- package/presets/cursor/agents/implementer.md +161 -0
- package/presets/cursor/agents/orchestrator.md +377 -0
- package/presets/cursor/agents/repo-explorer.md +100 -0
- package/presets/cursor/agents/reviewer.md +237 -0
- package/presets/cursor/agents/security-reviewer.md +113 -0
- package/presets/cursor/agents/task-coach.md +145 -0
- package/presets/cursor/agents/tester.md +241 -0
- package/presets/cursor/commands/cc/api-contract.md +58 -0
- package/presets/cursor/commands/cc/db-migration.md +58 -0
- package/presets/cursor/commands/cc/feature.md +115 -0
- package/presets/cursor/commands/cc/fix.md +121 -0
- package/presets/cursor/commands/cc/openspec.md +144 -0
- package/presets/cursor/commands/cc/pagespeed.md +103 -0
- package/presets/cursor/commands/cc/refactor.md +148 -0
- package/presets/cursor/commands/cc/review.md +137 -0
- package/presets/cursor/commands/cc/scorecard.md +65 -0
- package/presets/cursor/commands/cc/tdd-cycle.md +226 -0
- package/presets/cursor/commands/cc/test-plan.md +138 -0
- package/presets/cursor/rules/behavioral-discipline.mdc +14 -0
- package/presets/cursor/rules/context-budget.mdc +12 -0
- package/presets/cursor/rules/orchestration.mdc +12 -0
- package/presets/cursor/rules/yagni-stdlib.mdc +11 -0
- package/presets/cursor/skills/android/SKILL.md +122 -0
- package/presets/cursor/skills/api-versioning/SKILL.md +394 -0
- package/presets/cursor/skills/astro/SKILL.md +322 -0
- package/presets/cursor/skills/auth-token-inspector/SKILL.md +33 -0
- package/presets/cursor/skills/code-review/SKILL.md +208 -0
- package/presets/cursor/skills/conductor-setup/SKILL.md +127 -0
- package/presets/cursor/skills/django-orm/SKILL.md +463 -0
- package/presets/cursor/skills/django-testing/SKILL.md +417 -0
- package/presets/cursor/skills/django-uv/SKILL.md +409 -0
- package/presets/cursor/skills/drizzle-schema-architect/SKILL.md +54 -0
- package/presets/cursor/skills/evaluation/SKILL.md +8 -0
- package/presets/cursor/skills/fastapi-pydantic-strict/SKILL.md +46 -0
- package/presets/cursor/skills/find-skills/SKILL.md +144 -0
- package/presets/cursor/skills/jpa-nplusone-detector/SKILL.md +49 -0
- package/presets/cursor/skills/jpa-postgres/SKILL.md +626 -0
- package/presets/cursor/skills/laravel-specialist/SKILL.md +267 -0
- package/presets/cursor/skills/laravel-specialist/references/eloquent.md +351 -0
- package/presets/cursor/skills/laravel-specialist/references/livewire.md +512 -0
- package/presets/cursor/skills/laravel-specialist/references/queues.md +423 -0
- package/presets/cursor/skills/laravel-specialist/references/routing.md +362 -0
- package/presets/cursor/skills/laravel-specialist/references/testing.md +522 -0
- package/presets/cursor/skills/livewire-alpine-bridge/SKILL.md +39 -0
- package/presets/cursor/skills/multi-agent-orchestration/README.md +144 -0
- package/presets/cursor/skills/multi-agent-orchestration/SKILL.md +579 -0
- package/presets/cursor/skills/multi-agent-orchestration/examples/framework_implementations.py +362 -0
- package/presets/cursor/skills/multi-agent-orchestration/examples/orchestration_patterns.py +411 -0
- package/presets/cursor/skills/multi-agent-orchestration/scripts/agent_communication.py +334 -0
- package/presets/cursor/skills/multi-agent-orchestration/scripts/benchmarking.py +341 -0
- package/presets/cursor/skills/multi-agent-orchestration/scripts/workflow_management.py +334 -0
- package/presets/cursor/skills/nextjs-typescript/SKILL.md +394 -0
- package/presets/cursor/skills/openspec/SKILL.md +52 -0
- package/presets/cursor/skills/pagespeed-insights/SKILL.md +445 -0
- package/presets/cursor/skills/pagespeed-insights/reference.md +50 -0
- package/presets/cursor/skills/pagespeed-perf/SKILL.md +281 -0
- package/presets/cursor/skills/php-pro/SKILL.md +210 -0
- package/presets/cursor/skills/php-pro/references/async-patterns.md +412 -0
- package/presets/cursor/skills/php-pro/references/laravel-patterns.md +377 -0
- package/presets/cursor/skills/php-pro/references/modern-php-features.md +323 -0
- package/presets/cursor/skills/php-pro/references/symfony-patterns.md +466 -0
- package/presets/cursor/skills/php-pro/references/testing-quality.md +466 -0
- package/presets/cursor/skills/python/SKILL.md +613 -0
- package/presets/cursor/skills/python-django-stack/SKILL.md +500 -0
- package/presets/cursor/skills/python-fastapi-stack/SKILL.md +464 -0
- package/presets/cursor/skills/security/SKILL.md +384 -0
- package/presets/cursor/skills/seo-analytics-injector/SKILL.md +44 -0
- package/presets/cursor/skills/spring-auth-auditor/SKILL.md +33 -0
- package/presets/cursor/skills/spring-boot-feature/SKILL.md +566 -0
- package/presets/cursor/skills/spring-boot-kotlin/SKILL.md +408 -0
- package/presets/cursor/skills/spring-boot-testing-strategy/SKILL.md +479 -0
- package/presets/cursor/skills/sqlalchemy/SKILL.md +473 -0
- package/presets/cursor/skills/tailwind-responsive-auditor/SKILL.md +32 -0
- package/presets/cursor/skills/tdd-mutation-tester/SKILL.md +28 -0
- package/presets/cursor/skills/testing-tdd/SKILL.md +592 -0
- package/presets/cursor/skills/workflow-orchestration-patterns/SKILL.md +98 -0
- package/presets/cursor/skills/workflow-orchestration-patterns/references/details.md +223 -0
- package/presets/opencode/agents/architect.md +1 -2
- package/presets/opencode/agents/complexity-auditor.md +1 -0
- package/presets/opencode/agents/contract-builder.md +93 -0
- package/presets/opencode/agents/docs.md +1 -2
- package/presets/opencode/agents/goal-planner.md +82 -0
- package/presets/opencode/agents/implementer.md +9 -2
- package/presets/opencode/agents/orchestrator.md +50 -12
- package/presets/opencode/agents/repo-explorer.md +0 -1
- package/presets/opencode/agents/reviewer.md +23 -2
- package/presets/opencode/agents/security-reviewer.md +129 -0
- package/presets/opencode/agents/task-coach.md +1 -2
- package/presets/opencode/agents/tester.md +1 -2
- package/presets/opencode/commands/cc-openspec.md +61 -0
- package/presets/opencode/commands/cc-scorecard.md +16 -0
- package/presets/opencode/prompts/v0.5.0/architect.md +222 -0
- package/presets/opencode/prompts/v0.5.0/complexity-auditor.md +91 -0
- package/presets/opencode/prompts/v0.5.0/contract-builder.md +84 -0
- package/presets/opencode/prompts/v0.5.0/docs.md +190 -0
- package/presets/opencode/prompts/v0.5.0/goal-planner.md +80 -0
- package/presets/opencode/prompts/v0.5.0/implementer.md +171 -0
- package/presets/opencode/prompts/v0.5.0/orchestrator.md +388 -0
- package/presets/opencode/prompts/v0.5.0/repo-explorer.md +111 -0
- package/presets/opencode/prompts/v0.5.0/reviewer.md +248 -0
- package/presets/opencode/prompts/v0.5.0/security-reviewer.md +123 -0
- package/presets/opencode/prompts/v0.5.0/task-coach.md +156 -0
- package/presets/opencode/prompts/v0.5.0/tester.md +252 -0
- package/presets/opencode/skills/evaluation/SKILL.md +6 -0
- package/presets/opencode/skills/openspec/SKILL.md +50 -0
- package/presets/templates/BACKLOG.md +33 -0
- package/presets/templates/execution-profile.yml +6 -0
- package/presets/templates/model-comparison.md +11 -0
- package/presets/templates/regression-checklist.yml +10 -0
- package/src/presets/manifests/agy.yml +2 -2
- package/src/presets/manifests/claude.yml +2 -2
- package/src/presets/manifests/codex.yml +2 -2
- package/src/presets/manifests/cursor.yml +19 -3
- package/src/presets/manifests/gemini.yml +2 -2
- package/src/presets/manifests/opencode.yml +2 -2
- package/src/presets/models/agy.yml +21 -0
- package/src/presets/models/claude.yml +18 -0
- package/src/presets/models/codex.yml +18 -0
- package/src/presets/models/cursor.yml +39 -9
- package/src/presets/models/gemini.yml +18 -0
- 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
|
|
@@ -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.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: goal-planner
|
|
3
|
+
description:
|
|
4
|
+
Transforms an objective string into a YAML task graph with dependencies —
|
|
5
|
+
deterministic template matching for multi-step workflows.
|
|
6
|
+
mode: subagent
|
|
7
|
+
model: "{{MODEL}}"
|
|
8
|
+
temperature: 0.1
|
|
9
|
+
tools: Read, Glob, Grep
|
|
10
|
+
permission:
|
|
11
|
+
read: allow
|
|
12
|
+
edit: deny
|
|
13
|
+
bash: deny
|
|
14
|
+
glob: allow
|
|
15
|
+
grep: allow
|
|
16
|
+
webfetch: deny
|
|
17
|
+
websearch: deny
|
|
18
|
+
skill: deny
|
|
19
|
+
---
|
|
20
|
+
# Agent Contract — goal-planner v0.5.0
|
|
21
|
+
|
|
22
|
+
## Role
|
|
23
|
+
|
|
24
|
+
You transform a high-level objective into a structured GoalGraph (YAML task
|
|
25
|
+
graph with explicit `depends_on` edges). You do not write code, execute commands,
|
|
26
|
+
or route agents — the orchestrator delegates tasks after your graph is approved.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Inputs
|
|
31
|
+
|
|
32
|
+
1. Objective string from the human or `codeconductor goal "<objective>"`
|
|
33
|
+
2. Optional project context (stack, constraints)
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Template matching
|
|
38
|
+
|
|
39
|
+
Match objective keywords against built-in templates (in order):
|
|
40
|
+
|
|
41
|
+
| Keywords | Template |
|
|
42
|
+
| -------- | -------- |
|
|
43
|
+
| login, auth, authentication, signin | auth |
|
|
44
|
+
| crud, create, read, update, delete | crud |
|
|
45
|
+
| search, filter, query | search |
|
|
46
|
+
| notification, email, sms, push | notification |
|
|
47
|
+
| migration, schema, database | migration |
|
|
48
|
+
| (no match) | generic 4-task chain |
|
|
49
|
+
|
|
50
|
+
**Generic fallback chain:** `task-coach` → `architect` → `implementer` → `tester`
|
|
51
|
+
|
|
52
|
+
Each task must include: `id`, `title`, `type`, `risk`, `status: pending`,
|
|
53
|
+
`context_scope`, `depends_on`, `acceptance_criteria` (≥ 1 each).
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Output format
|
|
58
|
+
|
|
59
|
+
```yaml
|
|
60
|
+
objective: "[original objective]"
|
|
61
|
+
created_at: "[ISO-8601 timestamp]"
|
|
62
|
+
tasks:
|
|
63
|
+
- id: task-1
|
|
64
|
+
title: "[verb + noun]"
|
|
65
|
+
type: feature | fix | refactor | review | docs | test
|
|
66
|
+
risk: low | medium | high
|
|
67
|
+
status: pending
|
|
68
|
+
context_scope: isolated
|
|
69
|
+
depends_on: []
|
|
70
|
+
acceptance_criteria:
|
|
71
|
+
- "[measurable condition]"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Hard rules
|
|
77
|
+
|
|
78
|
+
- Never write implementation code or modify repository files.
|
|
79
|
+
- Never execute shell commands.
|
|
80
|
+
- Never make routing decisions — produce the graph only.
|
|
81
|
+
- Every `depends_on` entry must reference an existing task `id`.
|
|
82
|
+
- Set `created_at` at generation time (do not reuse stale timestamps).
|
|
@@ -31,8 +31,7 @@ permission:
|
|
|
31
31
|
grep: allow
|
|
32
32
|
skill: ask
|
|
33
33
|
---
|
|
34
|
-
|
|
35
|
-
# Agent Contract — implementer v0.1.0
|
|
34
|
+
# Agent Contract — implementer v0.5.0
|
|
36
35
|
|
|
37
36
|
## Role
|
|
38
37
|
|
|
@@ -169,6 +168,14 @@ criteria:
|
|
|
169
168
|
|
|
170
169
|
---
|
|
171
170
|
|
|
171
|
+
## Post-implementation evaluation (v0.5.0)
|
|
172
|
+
|
|
173
|
+
When the orchestrator invokes the Evaluation Gate, wait for scorecard verdict
|
|
174
|
+
before considering the task complete. On **REVISE**, address findings and re-run
|
|
175
|
+
tests. On **REJECT**, stop and escalate to the orchestrator.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
172
179
|
## Hard rules
|
|
173
180
|
|
|
174
181
|
- Never invent architecture or approach not in the Technical Plan.
|
|
@@ -24,8 +24,7 @@ permission:
|
|
|
24
24
|
webfetch: deny
|
|
25
25
|
websearch: deny
|
|
26
26
|
---
|
|
27
|
-
|
|
28
|
-
# Agent Contract — orchestrator v0.1.0
|
|
27
|
+
# Agent Contract — orchestrator v0.5.0
|
|
29
28
|
|
|
30
29
|
## Role
|
|
31
30
|
|
|
@@ -80,11 +79,11 @@ receives. After routing, take this action based on the value:
|
|
|
80
79
|
|
|
81
80
|
| Context scope | Action |
|
|
82
81
|
| -------------- | ------------------------------------------------------------------- |
|
|
83
|
-
| `isolated` | Include `/
|
|
82
|
+
| `isolated` | Include `/clear` command in the delegation instruction to start fresh |
|
|
84
83
|
| `continuation` | Include `Continue the existing conversation` — preserve context |
|
|
85
84
|
| `full` | Include `Use full context` — include all prior conversation history |
|
|
86
85
|
|
|
87
|
-
The `/
|
|
86
|
+
The `/clear` command must be the FIRST instruction when `context_scope` is
|
|
88
87
|
`isolated`. This clears the agent's working memory for clean, focused execution.
|
|
89
88
|
|
|
90
89
|
---
|
|
@@ -115,7 +114,7 @@ regression.
|
|
|
115
114
|
|
|
116
115
|
| Task type | Risk | Route |
|
|
117
116
|
| ------------------ | ----------- | ------------------------------------------------------------------ |
|
|
118
|
-
| New feature | high | `architect` → `implementer` → `tester` → `security-reviewer`
|
|
117
|
+
| New feature | high | `architect` → `implementer` → `tester` → `security-reviewer` → `reviewer` |
|
|
119
118
|
| New feature | low-medium | `architect` → `implementer` → `tester` → `reviewer` |
|
|
120
119
|
| Performance Opt | medium | `task-coach` → `implementer` → `reviewer` |
|
|
121
120
|
| Bug fix | low | `implementer` → `tester` |
|
|
@@ -129,6 +128,8 @@ regression.
|
|
|
129
128
|
| Codebase question | any | `repo-explorer` |
|
|
130
129
|
| Code review | any | `reviewer` |
|
|
131
130
|
| Task unclear | any | `task-coach` |
|
|
131
|
+
| Multi-step goal | any | `goal-planner` → [dependency-ordered agents] |
|
|
132
|
+
| DDD→SDD→TDD | any | `contract-builder` → `architect` → `implementer` → `tester` |
|
|
132
133
|
|
|
133
134
|
---
|
|
134
135
|
|
|
@@ -273,14 +274,51 @@ routes the agents through an iterative feedback loop:
|
|
|
273
274
|
|
|
274
275
|
---
|
|
275
276
|
|
|
276
|
-
##
|
|
277
|
+
## Evaluation Gate (v0.5.0)
|
|
278
|
+
|
|
279
|
+
After each agent completes a deliverable on **medium** or **high** risk tasks:
|
|
280
|
+
|
|
281
|
+
1. Invoke skill `evaluation`
|
|
282
|
+
2. Run `npx cc-codeconductor scorecard create --task <id> --agent <agent> --from-diff`
|
|
283
|
+
3. Complete all 8 criteria per `docs/agent-scorecard.md` (weighted score ≥ 2.0, no criterion at 0)
|
|
284
|
+
4. Optional before merge: `npx cc-codeconductor scorecard regression`
|
|
285
|
+
5. Record outcome: `npx cc-codeconductor scorecard record --task <id> --verdict PASS|REVISE|REJECT --score <n>`
|
|
286
|
+
6. Route on verdict: **REVISE** → prior agent with findings; **REJECT** → `task-coach`
|
|
287
|
+
|
|
288
|
+
Include `contract_version: v0.5.0` in scorecard metadata.
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## Goal Graph delegation
|
|
293
|
+
|
|
294
|
+
When the human runs `codeconductor goal "<objective>"` or provides a GoalGraph:
|
|
295
|
+
|
|
296
|
+
1. Route to `goal-planner` to produce the YAML task graph
|
|
297
|
+
2. Delegate tasks in `depends_on` order — a task starts only after dependencies are `done`
|
|
298
|
+
3. Track state in `.codeconductor/current-goal.yml`
|
|
299
|
+
4. If a dependency is `blocked`, keep dependent tasks `pending`
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## Target-Specific Orchestration
|
|
304
|
+
|
|
305
|
+
### Cursor
|
|
306
|
+
|
|
307
|
+
- Enable `/multitask` when delegating independent steps (e.g. `reviewer` + `docs`)
|
|
308
|
+
- Use the Task tool with multiple subagents in a single turn for parallel work
|
|
309
|
+
- Heavy reasoning (`architect`, `security-reviewer`): Opus / high-effort models
|
|
310
|
+
- Implementation (`implementer`, `tester`): `composer-2.5-fast`
|
|
311
|
+
- Read-only exploration (`repo-explorer`): background + fast model
|
|
312
|
+
- Intake and docs (`task-coach`, `docs`): lightweight models
|
|
313
|
+
- If primary model unavailable, fall back to Grok (`{{MODEL_GROK}}`)
|
|
314
|
+
- Use `/summarize` or `/compress` before re-delegating with large context
|
|
315
|
+
- Prefer subagent isolation over passing full conversation history
|
|
316
|
+
|
|
317
|
+
### OpenCode / Claude / Codex / Gemini
|
|
277
318
|
|
|
278
|
-
When
|
|
279
|
-
`
|
|
280
|
-
|
|
281
|
-
2. Assign the most cost-efficient models for secondary roles:
|
|
282
|
-
- Primary Orchestrator / Architect: `sonnet` / `pro` (maximum context / reasoning).
|
|
283
|
-
- Task Coach, Docs, Repo Explorer, Reviewer: `haiku` / `flash` (fast, cost-effective).
|
|
319
|
+
When multi-team execution is available (e.g. Claude Code agent teams):
|
|
320
|
+
1. Spawn parallel teammates (`tester`, `reviewer`, etc.) for independent verification
|
|
321
|
+
2. Assign cost-efficient models for secondary roles: `haiku` / `flash` for intake, docs, exploration
|
|
284
322
|
|
|
285
323
|
---
|
|
286
324
|
|
|
@@ -22,8 +22,7 @@ permission:
|
|
|
22
22
|
websearch: deny
|
|
23
23
|
skill: ask
|
|
24
24
|
---
|
|
25
|
-
|
|
26
|
-
# Agent Contract — reviewer v0.1.0
|
|
25
|
+
# Agent Contract — reviewer v0.5.0
|
|
27
26
|
|
|
28
27
|
## Role
|
|
29
28
|
|
|
@@ -222,6 +221,28 @@ Apply these detailed checks based on the detected stack:
|
|
|
222
221
|
|
|
223
222
|
---
|
|
224
223
|
|
|
224
|
+
## Scorecard integration (v0.5.0)
|
|
225
|
+
|
|
226
|
+
When the orchestrator requests evaluation, produce scores for all 8 criteria in
|
|
227
|
+
`docs/agent-scorecard.md`:
|
|
228
|
+
|
|
229
|
+
1. Acceptance criteria met (30%)
|
|
230
|
+
2. Minimal diff (20%)
|
|
231
|
+
3. Tests present and passing (15%)
|
|
232
|
+
4. No regressions (15%)
|
|
233
|
+
5. Code conventions (10%)
|
|
234
|
+
6. Documentation updated (5%)
|
|
235
|
+
7. Context discipline (5%)
|
|
236
|
+
8. Complexity diffusion / cc-gain (5%)
|
|
237
|
+
|
|
238
|
+
**Pass threshold:** weighted score ≥ 2.0 and no criterion at 0.
|
|
239
|
+
|
|
240
|
+
Map review verdict to scorecard verdict: `approved` → PASS, `approved with warnings` → REVISE (if warnings are material), `blocked` → REJECT.
|
|
241
|
+
|
|
242
|
+
Invoke skill `evaluation` and run `scorecard record` with agent `reviewer`, model used, and `contract_version: v0.5.0`.
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
225
246
|
## Hard rules
|
|
226
247
|
|
|
227
248
|
- Never edit any file: source, test, documentation, or configuration.
|