opencastle 1.6.3 → 1.6.4
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 +9 -9
- package/bin/cli.mjs +6 -4
- package/dist/cli/adapters/adapter-contract.test.js +1 -1
- package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
- package/dist/cli/adapters/single-file-base.js +2 -12
- package/dist/cli/adapters/single-file-base.js.map +1 -1
- package/dist/cli/bootstrap.js +1 -1
- package/dist/cli/bootstrap.js.map +1 -1
- package/dist/cli/command-namespace.test.js +4 -21
- package/dist/cli/command-namespace.test.js.map +1 -1
- package/dist/cli/convoy/engine.js +2 -2
- package/dist/cli/convoy/engine.js.map +1 -1
- package/dist/cli/convoy/read-model.d.ts +8 -15
- package/dist/cli/convoy/read-model.d.ts.map +1 -1
- package/dist/cli/convoy/read-model.js +9 -68
- package/dist/cli/convoy/read-model.js.map +1 -1
- package/dist/cli/convoy/read-model.test.js +6 -25
- package/dist/cli/convoy/read-model.test.js.map +1 -1
- package/dist/cli/convoy/spec-builder.d.ts +2 -2
- package/dist/cli/convoy/spec-builder.d.ts.map +1 -1
- package/dist/cli/convoy/spec-builder.js +1 -1
- package/dist/cli/dashboard.js +1 -1
- package/dist/cli/dashboard.test.js +10 -2
- package/dist/cli/dashboard.test.js.map +1 -1
- package/dist/cli/dispatcher.test.js +5 -2
- package/dist/cli/dispatcher.test.js.map +1 -1
- package/dist/cli/docs-accuracy.test.js +5 -1
- package/dist/cli/docs-accuracy.test.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +0 -25
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/pipeline.d.ts +1 -1
- package/dist/cli/pipeline.flow.test.js +77 -77
- package/dist/cli/pipeline.flow.test.js.map +1 -1
- package/dist/cli/pipeline.js +24 -24
- package/dist/cli/pipeline.js.map +1 -1
- package/dist/cli/plan.d.ts +8 -2
- package/dist/cli/plan.d.ts.map +1 -1
- package/dist/cli/plan.js +18 -12
- package/dist/cli/plan.js.map +1 -1
- package/dist/cli/plan.test.js +17 -19
- package/dist/cli/plan.test.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +1 -58
- package/dist/cli/update.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/adapters/adapter-contract.test.ts +1 -1
- package/src/cli/adapters/single-file-base.ts +2 -11
- package/src/cli/bootstrap.ts +1 -1
- package/src/cli/command-namespace.test.ts +5 -22
- package/src/cli/convoy/engine.ts +2 -2
- package/src/{orchestrator/prompts/assess-complexity.prompt.md → cli/convoy/prompts/convoy-assess.prompt.md} +0 -3
- package/src/{orchestrator/prompts/fix-convoy.prompt.md → cli/convoy/prompts/convoy-plan-fix.prompt.md} +0 -3
- package/src/{orchestrator/prompts/validate-convoy.prompt.md → cli/convoy/prompts/convoy-plan-review.prompt.md} +0 -3
- package/src/{orchestrator/prompts/generate-convoy.prompt.md → cli/convoy/prompts/convoy-plan.prompt.md} +0 -2
- package/src/{orchestrator/prompts/fix-prd.prompt.md → cli/convoy/prompts/convoy-prd-fix.prompt.md} +0 -3
- package/src/{orchestrator/prompts/validate-prd.prompt.md → cli/convoy/prompts/convoy-prd-review.prompt.md} +0 -3
- package/src/{orchestrator/prompts/generate-prd.prompt.md → cli/convoy/prompts/convoy-prd.prompt.md} +0 -3
- package/src/cli/convoy/read-model.test.ts +5 -29
- package/src/cli/convoy/read-model.ts +11 -71
- package/src/cli/convoy/spec-builder.ts +2 -2
- package/src/cli/dashboard/dashboard.js +2 -4
- package/src/cli/dashboard.test.ts +10 -2
- package/src/cli/dashboard.ts +1 -1
- package/src/cli/dispatcher.test.ts +6 -2
- package/src/cli/docs-accuracy.test.ts +5 -1
- package/src/cli/doctor.ts +0 -26
- package/src/cli/pipeline.flow.test.ts +78 -78
- package/src/cli/pipeline.ts +25 -25
- package/src/cli/plan.test.ts +18 -20
- package/src/cli/plan.ts +18 -12
- package/src/cli/update.ts +1 -66
- package/src/orchestrator/agent-workflows/README.md +10 -18
- package/src/orchestrator/agent-workflows/data-pipeline.md +7 -140
- package/src/orchestrator/agent-workflows/database-migration.md +7 -153
- package/src/orchestrator/agent-workflows/performance-optimization.md +6 -119
- package/src/orchestrator/agent-workflows/refactoring.md +8 -137
- package/src/orchestrator/agent-workflows/schema-changes.md +8 -159
- package/src/orchestrator/agent-workflows/security-audit.md +7 -142
- package/src/orchestrator/agent-workflows/shared-delivery-phase.md +8 -25
- package/src/orchestrator/agents/architect.agent.md +2 -14
- package/src/orchestrator/agents/content-engineer.agent.md +8 -10
- package/src/orchestrator/agents/data-engineer.agent.md +8 -8
- package/src/orchestrator/agents/developer.agent.md +3 -10
- package/src/orchestrator/agents/devops-expert.agent.md +0 -3
- package/src/orchestrator/agents/performance-expert.agent.md +2 -3
- package/src/orchestrator/agents/security-expert.agent.md +10 -12
- package/src/orchestrator/agents/team-lead.agent.md +31 -75
- package/src/orchestrator/agents/testing-expert.agent.md +3 -6
- package/src/orchestrator/agents/ui-ux-expert.agent.md +1 -4
- package/src/orchestrator/agents/writer.agent.md +0 -3
- package/src/orchestrator/customizations/README.md +3 -4
- package/src/orchestrator/customizations/agents/agent-registry.md +3 -3
- package/src/orchestrator/customizations/agents/skill-matrix.json +6 -42
- package/src/orchestrator/instructions/general.instructions.md +10 -37
- package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +4 -6
- package/src/orchestrator/prompts/brainstorm.prompt.md +7 -12
- package/src/orchestrator/prompts/bug-fix.prompt.md +19 -100
- package/src/orchestrator/prompts/convoy.prompt.md +20 -0
- package/src/orchestrator/prompts/create-skill.prompt.md +1 -5
- package/src/orchestrator/prompts/implement-feature.prompt.md +22 -93
- package/src/orchestrator/prompts/resolve-pr-comments.prompt.md +1 -5
- package/src/orchestrator/skills/api-patterns/SKILL.md +21 -18
- package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +1 -1
- package/src/orchestrator/skills/fast-review/SKILL.md +28 -65
- package/src/orchestrator/skills/frontend-design/REFERENCE.md +0 -1
- package/src/orchestrator/skills/frontend-design/SKILL.md +3 -1
- package/src/orchestrator/skills/git-workflow/SKILL.md +18 -34
- package/src/orchestrator/skills/panel-majority-vote/SKILL.md +16 -46
- package/src/orchestrator/skills/security-hardening/SKILL.md +20 -19
- package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +2 -2
- package/src/orchestrator/skills/self-improvement/SKILL.md +21 -46
- package/src/orchestrator/skills/technical-writing/SKILL.md +3 -1
- package/src/orchestrator/skills/technical-writing/TEMPLATES.md +23 -0
- package/src/orchestrator/skills/testing-workflow/SKILL.md +21 -23
- package/src/orchestrator/skills/validation-gates/REFERENCE.md +2 -14
- package/src/orchestrator/skills/validation-gates/SKILL.md +10 -88
- package/dist/cli/log.d.ts +0 -44
- package/dist/cli/log.d.ts.map +0 -1
- package/dist/cli/log.js +0 -336
- package/dist/cli/log.js.map +0 -1
- package/dist/cli/log.test.d.ts +0 -2
- package/dist/cli/log.test.d.ts.map +0 -1
- package/dist/cli/log.test.js +0 -208
- package/dist/cli/log.test.js.map +0 -1
- package/src/cli/log.test.ts +0 -228
- package/src/cli/log.ts +0 -374
- package/src/orchestrator/agent-workflows/bug-fix.md +0 -130
- package/src/orchestrator/agent-workflows/feature-implementation.md +0 -232
- package/src/orchestrator/instructions/ai-optimization.instructions.md +0 -17
- package/src/orchestrator/prompts/quick-refinement.prompt.md +0 -110
- package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +0 -44
- package/src/orchestrator/skills/agent-hooks/SKILL.md +0 -80
- package/src/orchestrator/skills/agent-memory/KNOWLEDGE-GRAPH.md +0 -49
- package/src/orchestrator/skills/agent-memory/SKILL.md +0 -50
- package/src/orchestrator/skills/code-commenting/SKILL.md +0 -18
- package/src/orchestrator/skills/context-map/REFERENCE.md +0 -67
- package/src/orchestrator/skills/context-map/SKILL.md +0 -71
- package/src/orchestrator/skills/decomposition/SKILL.md +0 -103
- package/src/orchestrator/skills/documentation-standards/SKILL.md +0 -33
- package/src/orchestrator/skills/fast-review/REFERENCE.md +0 -28
- package/src/orchestrator/skills/memory-merger/SKILL.md +0 -77
- package/src/orchestrator/skills/observability-logging/LOG-SCHEMA.md +0 -238
- package/src/orchestrator/skills/observability-logging/SKILL.md +0 -73
- package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +0 -38
- package/src/orchestrator/skills/orchestration-protocols/SKILL.md +0 -120
- package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +0 -49
- package/src/orchestrator/skills/panel-majority-vote/panel-report.template.md +0 -38
- package/src/orchestrator/skills/performance-optimization/SKILL.md +0 -23
- package/src/orchestrator/skills/project-consistency/SKILL.md +0 -80
- package/src/orchestrator/skills/project-consistency/TEMPLATES.md +0 -35
- package/src/orchestrator/skills/react-development/SKILL.md +0 -24
- package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +0 -56
- package/src/orchestrator/skills/session-checkpoints/SKILL.md +0 -40
- package/src/orchestrator/skills/team-lead-reference/SKILL.md +0 -126
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
# Agent Session Logs
|
|
2
|
-
|
|
3
|
-
Append-only NDJSON log for agent activity tracking. All events are stored in a single file with a `type` discriminator — one JSON object per line.
|
|
4
|
-
|
|
5
|
-
## File
|
|
6
|
-
|
|
7
|
-
| File | Description |
|
|
8
|
-
|------|-------------|
|
|
9
|
-
| `events.ndjson` | All agent events, in the order they were appended |
|
|
10
|
-
|
|
11
|
-
Convoy runs (experimental) keep their own events in `.opencastle/convoy.db` and
|
|
12
|
-
`convoys/<convoy-id>.ndjson` beside this file.
|
|
13
|
-
|
|
14
|
-
## Type Discriminator
|
|
15
|
-
|
|
16
|
-
Each record includes a `type` field that identifies the event kind:
|
|
17
|
-
|
|
18
|
-
| `type` value | Appended by | Description |
|
|
19
|
-
|-------------|-------------|-------------|
|
|
20
|
-
| `session` | All agents (via self-improvement protocol) | Session record |
|
|
21
|
-
| `delegation` | Team Lead agent | Delegation record |
|
|
22
|
-
| `review` | Team Lead (via fast-review skill) | Fast review record |
|
|
23
|
-
| `panel` | Panel runner (via panel majority vote skill) | Panel record |
|
|
24
|
-
| `dispute` | Team Lead (via dispute protocol) | Dispute record |
|
|
25
|
-
|
|
26
|
-
## CLI Usage
|
|
27
|
-
|
|
28
|
-
Use `opencastle log` to append events. Agents should call this instead of raw `echo` commands. `opencastle log` sets `timestamp` itself.
|
|
29
|
-
|
|
30
|
-
The examples pass `--model "$MODEL"`, which needs `MODEL` set to the model the assistant reported; when it reported none, leave `--model` (or `--reviewer_model`) out — an empty value is refused.
|
|
31
|
-
|
|
32
|
-
```sh
|
|
33
|
-
# Session
|
|
34
|
-
opencastle log --type session --agent Developer --model "$MODEL" \
|
|
35
|
-
--task "PRJ-57: Fix header component" --outcome success --duration_min 12 \
|
|
36
|
-
--files_changed 5 --retries 0
|
|
37
|
-
|
|
38
|
-
# Delegation
|
|
39
|
-
opencastle log --type delegation --session_id feat/prj-57 --agent Developer \
|
|
40
|
-
--model "$MODEL" --tier standard --mechanism sub-agent \
|
|
41
|
-
--outcome success --phase 2 --file_partition "src/components/,src/pages/"
|
|
42
|
-
|
|
43
|
-
# Review
|
|
44
|
-
opencastle log --type review --tracker_issue PRJ-42 --agent Developer \
|
|
45
|
-
--reviewer_model "$MODEL" --verdict pass --attempt 1 \
|
|
46
|
-
--issues_critical 0 --issues_major 0 --issues_minor 2 \
|
|
47
|
-
--confidence high --escalated false
|
|
48
|
-
|
|
49
|
-
# Panel
|
|
50
|
-
opencastle log --type panel --panel_key auth-review --verdict pass \
|
|
51
|
-
--pass_count 3 --block_count 0 --must_fix 0 --should_fix 5 \
|
|
52
|
-
--reviewer_model "$MODEL" --weighted false --attempt 1
|
|
53
|
-
|
|
54
|
-
# Dispute
|
|
55
|
-
opencastle log --type dispute --dispute_id DSP-001 --tracker_issue PRJ-42 \
|
|
56
|
-
--priority high --trigger panel-3x-block --implementing_agent Developer \
|
|
57
|
-
--reviewing_agents "Reviewer,Panel (3x)" --total_attempts 6 --status pending
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Run `opencastle log --help` for full options.
|
|
61
|
-
|
|
62
|
-
## Session Record (`type: "session"`)
|
|
63
|
-
|
|
64
|
-
```json
|
|
65
|
-
{
|
|
66
|
-
"type": "session",
|
|
67
|
-
"timestamp": "2026-02-25T14:30:00.000Z",
|
|
68
|
-
"agent": "Developer",
|
|
69
|
-
"model": "<model reported by the assistant>",
|
|
70
|
-
"task": "PRJ-57: Fix header component",
|
|
71
|
-
"tracker_issue": "PRJ-57",
|
|
72
|
-
"outcome": "success",
|
|
73
|
-
"duration_min": 12,
|
|
74
|
-
"files_changed": 5,
|
|
75
|
-
"retries": 0,
|
|
76
|
-
"lessons_added": [],
|
|
77
|
-
"discoveries": []
|
|
78
|
-
}
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
| Field | Type | Required | Description |
|
|
82
|
-
|-------|------|----------|-------------|
|
|
83
|
-
| `type` | `string` | Yes | Always `"session"` |
|
|
84
|
-
| `timestamp` | `string` | Yes | ISO 8601 UTC with milliseconds, set by `opencastle log` (e.g. `2026-10-03T07:49:09.383Z`) |
|
|
85
|
-
| `agent` | `string` | Yes | Agent name from the registry |
|
|
86
|
-
| `model` | `string` | No — omit when the assistant reports none | Model used — whatever the assistant reported |
|
|
87
|
-
| `task` | `string` | Yes | Short description of the task performed |
|
|
88
|
-
| `tracker_issue` | `string` | No | Issue ID if applicable (e.g., `PRJ-57`) |
|
|
89
|
-
| `outcome` | `string` | Yes | `success`, `partial`, `failed` |
|
|
90
|
-
| `duration_min` | `number` | No | Estimated session duration in minutes |
|
|
91
|
-
| `files_changed` | `number` | No | Number of files created/modified |
|
|
92
|
-
| `retries` | `number` | No | Number of retried operations |
|
|
93
|
-
| `lessons_added` | `string[]` | No | Lesson ids added (e.g., `["2026-10-02-quote-shell-variables"]`) |
|
|
94
|
-
| `discoveries` | `string[]` | No | Issues discovered (issue IDs or KNOWN-ISSUES IDs) |
|
|
95
|
-
|
|
96
|
-
## Delegation Record (`type: "delegation"`)
|
|
97
|
-
|
|
98
|
-
```json
|
|
99
|
-
{
|
|
100
|
-
"type": "delegation",
|
|
101
|
-
"timestamp": "2026-02-25T14:30:00.000Z",
|
|
102
|
-
"session_id": "feat/prj-57",
|
|
103
|
-
"agent": "Developer",
|
|
104
|
-
"model": "<model reported by the assistant>",
|
|
105
|
-
"tier": "standard",
|
|
106
|
-
"mechanism": "sub-agent",
|
|
107
|
-
"tracker_issue": "PRJ-57",
|
|
108
|
-
"outcome": "success",
|
|
109
|
-
"retries": 0,
|
|
110
|
-
"phase": 2,
|
|
111
|
-
"file_partition": ["src/components/", "src/pages/"]
|
|
112
|
-
}
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
| Field | Type | Required | Description |
|
|
116
|
-
|-------|------|----------|-------------|
|
|
117
|
-
| `type` | `string` | Yes | Always `"delegation"` |
|
|
118
|
-
| `timestamp` | `string` | Yes | ISO 8601 UTC with milliseconds, set by `opencastle log` (e.g. `2026-10-03T07:49:09.383Z`) |
|
|
119
|
-
| `session_id` | `string` | Yes | Branch name or feature identifier |
|
|
120
|
-
| `agent` | `string` | Yes | Agent name delegated to |
|
|
121
|
-
| `model` | `string` | No — omit when the assistant reports none | Model used — whatever the assistant reported |
|
|
122
|
-
| `tier` | `string` | Yes | `premium`, `standard`, `economy` — the delegated agent's tier in the registry |
|
|
123
|
-
| `mechanism` | `string` | Yes | `sub-agent` or `background` |
|
|
124
|
-
| `tracker_issue` | `string` | No | Issue ID |
|
|
125
|
-
| `outcome` | `string` | Yes | `success`, `partial`, `failed`, `redirected` |
|
|
126
|
-
| `retries` | `number` | No | Times re-delegated |
|
|
127
|
-
| `phase` | `number` | No | Execution phase number |
|
|
128
|
-
| `file_partition` | `string[]` | No | Directories/files assigned |
|
|
129
|
-
|
|
130
|
-
## Fast Review Record (`type: "review"`)
|
|
131
|
-
|
|
132
|
-
```json
|
|
133
|
-
{
|
|
134
|
-
"type": "review",
|
|
135
|
-
"timestamp": "2026-02-28T14:30:00.000Z",
|
|
136
|
-
"tracker_issue": "PRJ-42",
|
|
137
|
-
"agent": "Developer",
|
|
138
|
-
"reviewer_model": "<model reported by the assistant>",
|
|
139
|
-
"verdict": "pass",
|
|
140
|
-
"attempt": 1,
|
|
141
|
-
"issues_critical": 0,
|
|
142
|
-
"issues_major": 0,
|
|
143
|
-
"issues_minor": 2,
|
|
144
|
-
"confidence": "high",
|
|
145
|
-
"escalated": false,
|
|
146
|
-
"duration_sec": 45
|
|
147
|
-
}
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
| Field | Type | Required | Description |
|
|
151
|
-
|-------|------|----------|-------------|
|
|
152
|
-
| `type` | `string` | Yes | Always `"review"` |
|
|
153
|
-
| `timestamp` | `string` | Yes | ISO 8601 UTC with milliseconds, set by `opencastle log` (e.g. `2026-10-03T07:49:09.383Z`) |
|
|
154
|
-
| `tracker_issue` | `string` | No | Issue ID if applicable |
|
|
155
|
-
| `agent` | `string` | Yes | Agent whose output was reviewed |
|
|
156
|
-
| `reviewer_model` | `string` | No — omit when the assistant reports none | Model used for the reviewer — whatever the assistant reported |
|
|
157
|
-
| `verdict` | `string` | Yes | `pass` or `fail` |
|
|
158
|
-
| `attempt` | `number` | Yes | Review attempt number (1, 2, or 3) |
|
|
159
|
-
| `issues_critical` | `number` | Yes | Count of critical severity issues |
|
|
160
|
-
| `issues_major` | `number` | Yes | Count of major severity issues |
|
|
161
|
-
| `issues_minor` | `number` | Yes | Count of minor severity issues |
|
|
162
|
-
| `confidence` | `string` | Yes | Reviewer self-reported confidence: `low`, `medium`, `high` |
|
|
163
|
-
| `escalated` | `boolean` | Yes | Whether this review triggered escalation to panel |
|
|
164
|
-
| `duration_sec` | `number` | No | Review duration in seconds |
|
|
165
|
-
|
|
166
|
-
## Panel Record (`type: "panel"`)
|
|
167
|
-
|
|
168
|
-
```json
|
|
169
|
-
{
|
|
170
|
-
"type": "panel",
|
|
171
|
-
"timestamp": "2026-02-25T14:30:00.000Z",
|
|
172
|
-
"panel_key": "instruction-refactoring",
|
|
173
|
-
"verdict": "pass",
|
|
174
|
-
"pass_count": 3,
|
|
175
|
-
"block_count": 0,
|
|
176
|
-
"must_fix": 0,
|
|
177
|
-
"should_fix": 5,
|
|
178
|
-
"reviewer_model": "<model reported by the assistant>",
|
|
179
|
-
"weighted": false,
|
|
180
|
-
"attempt": 1,
|
|
181
|
-
"tracker_issue": "PRJ-57",
|
|
182
|
-
"artifacts_count": 14,
|
|
183
|
-
"report_path": ".opencastle/logs/panel/instruction-refactoring.md"
|
|
184
|
-
}
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
| Field | Type | Required | Description |
|
|
188
|
-
|-------|------|----------|-------------|
|
|
189
|
-
| `type` | `string` | Yes | Always `"panel"` |
|
|
190
|
-
| `timestamp` | `string` | Yes | ISO 8601 UTC with milliseconds, set by `opencastle log` (e.g. `2026-10-03T07:49:09.383Z`) |
|
|
191
|
-
| `panel_key` | `string` | Yes | Filesystem-safe panel identifier |
|
|
192
|
-
| `verdict` | `string` | Yes | `pass` or `block` |
|
|
193
|
-
| `pass_count` | `number` | Yes | Number of reviewers who voted PASS |
|
|
194
|
-
| `block_count` | `number` | Yes | Number of reviewers who voted BLOCK |
|
|
195
|
-
| `must_fix` | `number` | Yes | Total MUST-FIX items across all reviewers |
|
|
196
|
-
| `should_fix` | `number` | Yes | Total SHOULD-FIX items across all reviewers |
|
|
197
|
-
| `reviewer_model` | `string` | No — omit when the assistant reports none | Model used for reviewers — whatever the assistant reported |
|
|
198
|
-
| `weighted` | `boolean` | Yes | Whether performance-weighted voting was applied |
|
|
199
|
-
| `attempt` | `number` | Yes | Attempt number (1 = first try) |
|
|
200
|
-
| `tracker_issue` | `string` | No | Issue ID if applicable |
|
|
201
|
-
| `artifacts_count` | `number` | No | Number of artifacts reviewed |
|
|
202
|
-
| `report_path` | `string` | No | Path to the full panel report |
|
|
203
|
-
|
|
204
|
-
## Dispute Record (`type: "dispute"`)
|
|
205
|
-
|
|
206
|
-
```json
|
|
207
|
-
{
|
|
208
|
-
"type": "dispute",
|
|
209
|
-
"timestamp": "2026-02-28T16:00:00.000Z",
|
|
210
|
-
"dispute_id": "DSP-001",
|
|
211
|
-
"tracker_issue": "PRJ-42",
|
|
212
|
-
"priority": "high",
|
|
213
|
-
"trigger": "panel-3x-block",
|
|
214
|
-
"implementing_agent": "Developer",
|
|
215
|
-
"reviewing_agents": ["Reviewer", "Panel (3x)"],
|
|
216
|
-
"total_attempts": 6,
|
|
217
|
-
"est_tokens_spent": 120000,
|
|
218
|
-
"status": "pending",
|
|
219
|
-
"resolution_option_chosen": null,
|
|
220
|
-
"resolved_at": null
|
|
221
|
-
}
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
| Field | Type | Required | Description |
|
|
225
|
-
|-------|------|----------|-------------|
|
|
226
|
-
| `type` | `string` | Yes | Always `"dispute"` |
|
|
227
|
-
| `timestamp` | `string` | Yes | ISO 8601 UTC with milliseconds when the dispute was created, set by `opencastle log` |
|
|
228
|
-
| `dispute_id` | `string` | Yes | Dispute ID (e.g., `DSP-001`) |
|
|
229
|
-
| `tracker_issue` | `string` | No | Issue ID if applicable |
|
|
230
|
-
| `priority` | `string` | Yes | `critical`, `high`, `medium`, `low` |
|
|
231
|
-
| `trigger` | `string` | Yes | `panel-3x-block`, `approach-conflict`, `criteria-conflict`, `architectural-ambiguity`, `external-dependency` |
|
|
232
|
-
| `implementing_agent` | `string` | Yes | Agent that attempted the implementation |
|
|
233
|
-
| `reviewing_agents` | `string[]` | Yes | Agents that reviewed (e.g., `["Reviewer", "Panel (3x)"]`) |
|
|
234
|
-
| `total_attempts` | `number` | Yes | Sum of fast review + panel attempts |
|
|
235
|
-
| `est_tokens_spent` | `number` | No | Estimated tokens spent across all attempts |
|
|
236
|
-
| `status` | `string` | Yes | `pending`, `resolved`, `deferred` |
|
|
237
|
-
| `resolution_option_chosen` | `string` | No | Which option the human chose (null if pending) |
|
|
238
|
-
| `resolved_at` | `string` | No | ISO 8601 datetime when resolved (null if pending) |
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: observability-logging
|
|
3
|
-
description: "Records sessions, delegations, reviews, panels and disputes as NDJSON with opencastle log, plus the pre-response quality gate. Use at the end of every session and after every delegation, review, panel or dispute."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Observability Logging
|
|
7
|
-
|
|
8
|
-
> **⛔ HARD GATE.** Every agent MUST log every session to `events.ndjson` before responding. No exceptions. Session without logs is a failed session.
|
|
9
|
-
|
|
10
|
-
| File | Event types | Who | When |
|
|
11
|
-
|------|------------|-----|------|
|
|
12
|
-
| `events.ndjson` | `session`, `delegation`, `review`, `panel`, `dispute` | All agents / Team Lead / Panel runner | After each applicable event |
|
|
13
|
-
|
|
14
|
-
Full schema: [LOG-SCHEMA.md](./LOG-SCHEMA.md), beside this file; `opencastle log --help` lists the fields too.
|
|
15
|
-
|
|
16
|
-
Use `opencastle log` CLI. One record per task; never batch-log retrospectively.
|
|
17
|
-
|
|
18
|
-
**Session** (ALL agents, EVERY session):
|
|
19
|
-
```sh
|
|
20
|
-
opencastle log --type session --agent Developer --model "$MODEL" \
|
|
21
|
-
--task "Fix login redirect bug" --outcome success --duration_min 15 \
|
|
22
|
-
--files_changed 3 --retries 0
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
**Delegation** (Team Lead, after each delegation — never batched):
|
|
26
|
-
```sh
|
|
27
|
-
opencastle log --type delegation --session_id feat/prj-57 --agent Developer \
|
|
28
|
-
--model "$MODEL" --tier standard --mechanism sub-agent \
|
|
29
|
-
--tracker_issue PRJ-57 --outcome success --retries 0 --phase 2 \
|
|
30
|
-
--file_partition "src/components/"
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
> `tier` must match the delegated agent's tier in the agent registry. `model` is whatever the assistant actually used — leave it out if it did not report one.
|
|
34
|
-
|
|
35
|
-
**Review** (Team Lead, after each fast review):
|
|
36
|
-
```sh
|
|
37
|
-
opencastle log --type review --tracker_issue PRJ-42 --agent Developer \
|
|
38
|
-
--reviewer_model "$MODEL" --verdict pass --attempt 1 \
|
|
39
|
-
--issues_critical 0 --issues_major 0 --issues_minor 2 \
|
|
40
|
-
--confidence high --escalated false --duration_sec 45
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
**Panel** (Panel runner, after each vote):
|
|
44
|
-
```sh
|
|
45
|
-
opencastle log --type panel --panel_key auth-review --verdict pass \
|
|
46
|
-
--pass_count 3 --block_count 0 --must_fix 0 --should_fix 3 \
|
|
47
|
-
--reviewer_model "$MODEL" --weighted false --attempt 1 \
|
|
48
|
-
--tracker_issue PRJ-42 --artifacts_count 5
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
**Dispute** (Team Lead, after each dispute):
|
|
52
|
-
```sh
|
|
53
|
-
opencastle log --type dispute --dispute_id DSP-001 --tracker_issue PRJ-42 \
|
|
54
|
-
--priority high --trigger panel-3x-block --implementing_agent Developer \
|
|
55
|
-
--reviewing_agents "Reviewer,Panel (3x)" --total_attempts 6 --status pending
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Verify any append: `tail -1 .opencastle/logs/events.ndjson`
|
|
59
|
-
|
|
60
|
-
## Pre-Response Checklist
|
|
61
|
-
|
|
62
|
-
**⛔ STOP.** Verify before responding — fix any missing log NOW.
|
|
63
|
-
|
|
64
|
-
- [ ] **Lessons read** — `.opencastle/LESSONS-LEARNED.md` read at session start
|
|
65
|
-
- [ ] **Session logged** — `events.ndjson` has a `session` record (ALWAYS)
|
|
66
|
-
- [ ] **Delegations logged** — `delegation` record per delegation (Team Lead) (if applicable)
|
|
67
|
-
- [ ] **Reviews logged** — `review` record per fast review (if applicable)
|
|
68
|
-
|
|
69
|
-
## Base Output Contract
|
|
70
|
-
|
|
71
|
-
Every agent closes its output contract with: observability logged (the `session`
|
|
72
|
-
record always, plus `delegation`/`review`/`panel`/`dispute` when they happened),
|
|
73
|
-
discovered issues and what was done about them, and lessons applied or added.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
## Agent Health Monitoring
|
|
2
|
-
|
|
3
|
-
### Health Signals
|
|
4
|
-
|
|
5
|
-
| Signal | Observable | Recovery |
|
|
6
|
-
|--------|-----------|----------|
|
|
7
|
-
| **Stuck** — no progress | No new tool call, file change or output between two checks | Nudge; if frozen, abort + re-delegate with simpler scope |
|
|
8
|
-
| **Looping** — same error repeated | The same failing command or error 3 times in a row | Abort; add context; re-delegate with explicit fix path |
|
|
9
|
-
| **Scope creep** — files outside partition | Any | Redirect: "Only modify files in [partition]. Revert [file]." |
|
|
10
|
-
| **Context exhaustion** — confused/repetitive | Visible instruction amnesia | Checkpoint, end session, resume in fresh context |
|
|
11
|
-
| **Permission loop** — waiting for input | 2+ prompts without progress | Auto-approve if safe; abort + re-delegate |
|
|
12
|
-
|
|
13
|
-
**Cadence:** Sub-agents — every tool result. Background agents — whenever the assistant reports progress or completion, and `opencastle convoy` for convoy runs. Always review full diff before accepting.
|
|
14
|
-
|
|
15
|
-
### Escalation Path
|
|
16
|
-
|
|
17
|
-
Review failures (fast-review FAIL, panel BLOCK) follow the **fast-review** Handle Verdict table. Tool or runtime failures (crash, timeout, MCP down, empty output): retry once with more context, downscoped if needed; after the 2nd failed attempt log to `.opencastle/AGENT-FAILURES.md`.
|
|
18
|
-
|
|
19
|
-
## Error Recovery Playbook
|
|
20
|
-
|
|
21
|
-
| Failure | Symptom | Recovery |
|
|
22
|
-
|---------|---------|----------|
|
|
23
|
-
| **Retry loop** | Same command fails 3+ times | Abort; identify root cause; re-delegate with explicit fix; log lesson |
|
|
24
|
-
| **MCP unavailable** | Tool connection/timeout errors | Check server; retry once; fall back to CLI; log to DLQ if critical |
|
|
25
|
-
| **Broken BG output** | Lint/type/test errors on return | Fix inline if small; discard + re-delegate if fundamental; DLQ after 2 fails |
|
|
26
|
-
| **Parallel merge conflict** | Two agents modified overlapping files | Accept complex side first; re-delegate simple side to adapt; log lesson |
|
|
27
|
-
| **Context exhausted** | Confused/repetitive responses | Checkpoint; end session; resume with checkpoint; reduce parallel work |
|
|
28
|
-
| **Post-merge test failure** | Tests pass alone but fail merged | Run affected tests; check import/state conflicts; delegate fix to likely cause |
|
|
29
|
-
|
|
30
|
-
## Agent Circuit Breaker
|
|
31
|
-
|
|
32
|
-
| Threshold | Action |
|
|
33
|
-
|-----------|--------|
|
|
34
|
-
| **2 failures** | Investigate: same error class? Model healthy? Prompt pattern? |
|
|
35
|
-
| **3 failures** | Open circuit — stop delegating; reassign or escalate to user |
|
|
36
|
-
| **Next session** | Half-open — resets; re-open + add lesson if fails again |
|
|
37
|
-
|
|
38
|
-
Judgment-based, not a hard gate — 3 failures sharing one error class outweigh 3 unrelated ones.
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: orchestration-protocols
|
|
3
|
-
description: "Runtime patterns for running agents in parallel: steering, background agents, parallel research, health signals, circuit breakers and convoy runs. Use when agents run in parallel, stall, loop or fail repeatedly."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Orchestration Protocols
|
|
7
|
-
|
|
8
|
-
Runtime patterns for delegated agents.
|
|
9
|
-
|
|
10
|
-
## Active Steering
|
|
11
|
-
|
|
12
|
-
Intervene early on:
|
|
13
|
-
|
|
14
|
-
| Signal | Action |
|
|
15
|
-
|--------|--------|
|
|
16
|
-
| Failing tests/builds | Check dependency resolution; revert if builds break |
|
|
17
|
-
| Unexpected file changes | Revert; enforce partition |
|
|
18
|
-
| Scope creep | Redirect to scoped files only |
|
|
19
|
-
| Circular behavior | Halt; switch approach |
|
|
20
|
-
| Intent misunderstanding | Clarify prompt; re-delegate |
|
|
21
|
-
|
|
22
|
-
When redirecting, state *why* + *how*:
|
|
23
|
-
|
|
24
|
-
> "Don't modify `libs/data/src/lib/product.ts` — shared across features. Add the new query in `libs/data/src/lib/reviews.ts`."
|
|
25
|
-
|
|
26
|
-
**Sub-agents:** steer live, at the first off-course tool call or file edit. **Background agents:** no live steering — front-load prompt specificity, partition constraints, acceptance criteria checklists.
|
|
27
|
-
|
|
28
|
-
## Background Agents
|
|
29
|
-
|
|
30
|
-
Run autonomously in isolated Git worktrees. Reserve for well-scoped tasks with clear acceptance criteria that need no decisions from you mid-run.
|
|
31
|
-
|
|
32
|
-
- **Spawn:** start a background agent with whatever the assistant offers (a background or cloud agent, a worktree session)
|
|
33
|
-
- **Interrupted convoy:** `opencastle convoy resume` picks up where the run stopped
|
|
34
|
-
|
|
35
|
-
## Parallel Research Protocol
|
|
36
|
-
|
|
37
|
-
**Spawn parallel research sub-agents if:** ≥3 independent questions AND answers span multiple codebase areas — else handle sequentially.
|
|
38
|
-
|
|
39
|
-
### Spawn Strategy
|
|
40
|
-
|
|
41
|
-
| Rule | Detail |
|
|
42
|
-
|------|--------|
|
|
43
|
-
| Divide by topic/area | Each researcher owns a coherent domain |
|
|
44
|
-
| Max 3–5 researchers | More: diminishing returns, token waste |
|
|
45
|
-
| Focused scope per agent | Explicit dirs, file patterns, or questions |
|
|
46
|
-
| Economy/Standard tier | Manage cost for research sub-agents |
|
|
47
|
-
|
|
48
|
-
**Prompt template:**
|
|
49
|
-
```
|
|
50
|
-
Research: [specific question]
|
|
51
|
-
Scope: [files/directories to search]
|
|
52
|
-
Return: key findings, relevant file paths (with line numbers), patterns, unanswered questions
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Result Merge Protocol
|
|
56
|
-
|
|
57
|
-
1. Collect all results into single context
|
|
58
|
-
2. **Checkpoint:** verify every researcher returned a result (no timeout/error); re-run failures before proceeding.
|
|
59
|
-
3. Deduplicate (same file/pattern counts once)
|
|
60
|
-
4. Resolve conflicts — specific evidence beats general observations
|
|
61
|
-
5. Synthesize into concise context block for implementation prompts
|
|
62
|
-
6. **Checkpoint:** confirm synthesized block covers every original question; mark unanswered as blockers.
|
|
63
|
-
|
|
64
|
-
## Batch Reviews
|
|
65
|
-
|
|
66
|
-
- Group by domain (UI, data); run fast reviews in parallel for independent outputs
|
|
67
|
-
- Review sequentially when outputs share partition boundary
|
|
68
|
-
- Combine related artifacts into one panel question when sharing acceptance criteria
|
|
69
|
-
|
|
70
|
-
## Context Compaction
|
|
71
|
-
|
|
72
|
-
Summarize prior phase output before passing to next agent. **Extract:** files changed, key decisions, verification (pass/fail), blockers. **Discard:** raw tool output, reasoning traces, failed attempts.
|
|
73
|
-
|
|
74
|
-
**Template:**
|
|
75
|
-
```
|
|
76
|
-
### Prior Phase Output
|
|
77
|
-
**Phase [N] — [Agent Name] — [Task Title]**
|
|
78
|
-
- Files changed: [list]
|
|
79
|
-
- Decisions: [key decisions affecting downstream work]
|
|
80
|
-
- Verification: [lint ✅ | types ✅ | tests ✅]
|
|
81
|
-
- Blockers: [none | list]
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## Health & Recovery Reference
|
|
85
|
-
|
|
86
|
-
Health thresholds, escalation path, Error Recovery Playbook, Circuit Breaker: see [REFERENCE.md](./REFERENCE.md).
|
|
87
|
-
|
|
88
|
-
## CLI (spawn & monitor)
|
|
89
|
-
|
|
90
|
-
Use OpenCastle CLI (`npx opencastle` or `bin/cli.mjs`):
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
opencastle convoy run convoy.yml --dry-run # check the spec, start nothing
|
|
94
|
-
opencastle convoy run convoy.yml --verbose
|
|
95
|
-
opencastle convoy # the last run and the one next step
|
|
96
|
-
opencastle convoy resume # re-run what is not done
|
|
97
|
-
opencastle convoy dashboard # watch it live
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
**Post-run verification (copy-paste checks):**
|
|
101
|
-
|
|
102
|
-
Convoy records to `.opencastle/convoy.db` and `.opencastle/logs/`; there is no
|
|
103
|
-
plain-text run log to tail.
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
opencastle convoy --json # last run's status, machine-readable
|
|
107
|
-
tail -n 50 .opencastle/logs/events.ndjson | jq -c 'select(.outcome != "success")'
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
## Validation & Verification Checkpoints
|
|
111
|
-
|
|
112
|
-
| Phase | Check | Command / Action |
|
|
113
|
-
|-------|-------|-----------------|
|
|
114
|
-
| Pre-spawn | Inputs present (task, scope, ACs) | `test -s convoy.yml \|\| exit 1` |
|
|
115
|
-
| During-run | Watch for failures | `opencastle convoy dashboard` |
|
|
116
|
-
| Pre-merge | No task left failed or gate-failed | `opencastle convoy --json \| jq -e '.failed == 0'` |
|
|
117
|
-
| Unfinished | Nothing failed, skipped or left running | `opencastle convoy --json \| jq -e '.done == .total'` |
|
|
118
|
-
| Post-merge | Lint + smoke tests pass | The project's lint and smoke-test commands (Key Commands in `.opencastle/project.instructions.md`) |
|
|
119
|
-
| Blocker | Any failure | Block merge; reopen to original researcher(s) |
|
|
120
|
-
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
## Panel — Weighted Consensus Variant (Reference)
|
|
2
|
-
|
|
3
|
-
### When to Use
|
|
4
|
-
|
|
5
|
-
| Decision Type | Mode |
|
|
6
|
-
|--------------|------|
|
|
7
|
-
| Security vulnerability, code correctness | Simple majority |
|
|
8
|
-
| UI/UX, architecture tradeoffs, data model, naming | Weighted |
|
|
9
|
-
|
|
10
|
-
### Weight Assignment
|
|
11
|
-
|
|
12
|
-
Base weight: 1. Add bonuses:
|
|
13
|
-
|
|
14
|
-
| Factor | Bonus |
|
|
15
|
-
|--------|-------|
|
|
16
|
-
| Domain expertise (relevant to review) | +2 |
|
|
17
|
-
| Confidence high / med / low | +1 / 0 / -1 |
|
|
18
|
-
| Prior success rate >80% (`opencastle convoy dashboard`, or `review` records in `.opencastle/logs/events.ndjson`) | +1 |
|
|
19
|
-
|
|
20
|
-
Example: Security Expert + high = 4; Architect + med = 2.
|
|
21
|
-
|
|
22
|
-
### Voting Protocol
|
|
23
|
-
|
|
24
|
-
1. Assign weights before spawning.
|
|
25
|
-
2. Spawn with same prompt; collect PASS/BLOCK + confidence.
|
|
26
|
-
3. Score: sum weights by verdict; PASS if PASS score > BLOCK score.
|
|
27
|
-
4. Tie: highest individual weight breaks tie; if equal, default BLOCK.
|
|
28
|
-
|
|
29
|
-
### Conflict Resolution
|
|
30
|
-
|
|
31
|
-
| Scenario | Outcome |
|
|
32
|
-
|----------|---------|
|
|
33
|
-
| Low-weight BLOCKs, high-weight PASSes | PASS; move BLOCK's MUST-FIX → SHOULD-FIX |
|
|
34
|
-
| Domain expert BLOCKs, generalists PASS | BLOCK |
|
|
35
|
-
| All equal weight | Simple majority (2/3 wins) |
|
|
36
|
-
|
|
37
|
-
### Report Extension (template)
|
|
38
|
-
|
|
39
|
-
```markdown
|
|
40
|
-
### Weighting
|
|
41
|
-
| Reviewer | Role | Domain | Confidence | Prior Success | Final Weight |
|
|
42
|
-
|----------|------|--------|------------|---------------|-------------|
|
|
43
|
-
| 1 | [Agent] | +X | +X | +X | X |
|
|
44
|
-
|
|
45
|
-
### Weighted Score
|
|
46
|
-
- PASS: X (reviewers: ...)
|
|
47
|
-
- BLOCK: X (reviewers: ...)
|
|
48
|
-
- **Overall: PASS/BLOCK** (weighted)
|
|
49
|
-
```
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Panel Report
|
|
2
|
-
|
|
3
|
-
## Context
|
|
4
|
-
- Run root (must be a single run):
|
|
5
|
-
- `<runRoot>/`
|
|
6
|
-
- Panel key:
|
|
7
|
-
- Question asked (exact text):
|
|
8
|
-
- Artifacts in scope (must all be under the same run root):
|
|
9
|
-
- `<runRoot>/...`
|
|
10
|
-
- Reviewer runs:
|
|
11
|
-
- N = 3
|
|
12
|
-
- Reviewer outputs source:
|
|
13
|
-
- `<panelDir>/<panelKey>-reviewer-outputs.md`
|
|
14
|
-
|
|
15
|
-
## Panel verdict
|
|
16
|
-
- Overall: PASS | BLOCK
|
|
17
|
-
|
|
18
|
-
## Vote tally
|
|
19
|
-
- PASS: 0
|
|
20
|
-
- BLOCK: 0
|
|
21
|
-
|
|
22
|
-
## Must-fix
|
|
23
|
-
List must-fix issues, and annotate how many panelists flagged each.
|
|
24
|
-
|
|
25
|
-
## Should-fix
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
## Questions / Ambiguities
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
## Disagreements
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
## Determinize next
|
|
35
|
-
Top actions to convert concerns into deterministic verification (tests/checks).
|
|
36
|
-
|
|
37
|
-
## Retry summary (only if Overall = BLOCK)
|
|
38
|
-
What should change before re-verifying.
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: performance-optimization
|
|
3
|
-
description: "Profiles and fixes frontend and backend performance: bundle size, assets, caching and Core Web Vitals. Use when a Lighthouse or CI perf check regresses, a bundle grows, or LCP, INP, CLS or TBT is too high."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Performance Optimization
|
|
7
|
-
|
|
8
|
-
Measure before changing anything. Add `React.memo`/`useMemo`/`useCallback` only after a profile shows the cost — never speculatively. Set budgets (load time, memory, API latency) and enforce them in CI.
|
|
9
|
-
|
|
10
|
-
## Rules
|
|
11
|
-
|
|
12
|
-
- Node: async APIs only — never `readFileSync` or other sync I/O on a request path.
|
|
13
|
-
- Debounce input-driven fetches at 300 ms.
|
|
14
|
-
- INP replaced FID as a Core Web Vital in March 2024: budget it at ≤200 ms, and measure every interaction, not just the first.
|
|
15
|
-
- Profile Node with `clinic.js` or `node --inspect`; profile React with `<Profiler onRender>` or the DevTools Profiler.
|
|
16
|
-
|
|
17
|
-
## Profiling Workflow
|
|
18
|
-
|
|
19
|
-
1. Lighthouse (or the CI perf job) for a baseline; name the failing metric (LCP, CLS, TBT; INP needs field data or a Lighthouse timespan run with real interactions). Lighthouse emulates mobile by default; pass `--preset=desktop` when the regression is desktop-only.
|
|
20
|
-
2. Profile to locate the hotspot call stacks / long tasks.
|
|
21
|
-
3. Apply the minimal fix (code-split, memoize, shrink payloads, defer non-critical work); confirm in the profiler that the measured hotspot actually shrank.
|
|
22
|
-
4. Re-run Lighthouse / the CI perf job. Ship only at ≥10% improvement or once inside budget.
|
|
23
|
-
5. If the regression persists, iterate and record a rollback plan; note fixes in the changelog.
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: project-consistency
|
|
3
|
-
description: "Foundation-first pattern that keeps parallel UI work consistent: shared tokens, layout and UI components built before any page. Use when several agents build UI at once, or a design system or theme is being set up."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Project Consistency
|
|
7
|
-
|
|
8
|
-
Produce shared artifacts and automated checks before parallel work begins.
|
|
9
|
-
|
|
10
|
-
## Foundation-First Principle
|
|
11
|
-
|
|
12
|
-
Phase 1 (sequential): `foundation-setup` creates tokens, Layout, UI library, style guide brief. Phase 2 (parallel): every page task imports from Phase 1 — no new tokens, no duplicated components.
|
|
13
|
-
|
|
14
|
-
### Foundation Artifacts & Page Rules
|
|
15
|
-
|
|
16
|
-
| Artifact | Path | Page Agent Rules |
|
|
17
|
-
|----------|------|------------------|
|
|
18
|
-
| **Design tokens** | `src/styles/tokens.css` | Import only. Never introduce new color/font/spacing values. |
|
|
19
|
-
| **Shared layout** | `src/components/Layout.tsx` / `Layout.astro` | Wrap every page. Never recreate. |
|
|
20
|
-
| **UI components** | `src/components/ui/` | Import from library. PascalCase components, camelCase props. |
|
|
21
|
-
| **Style guide brief** | Inline in prompts | Match tone + terminology exactly. Follow heading hierarchy. |
|
|
22
|
-
|
|
23
|
-
**Validation checkpoints:**
|
|
24
|
-
1. Foundation complete: `tokens.css` has all palette/type/spacing vars, Layout renders, UI components compile.
|
|
25
|
-
2. Per-page: `grep -rF 'style={{' src/pages/` returns 0 hits (no inline styles). All imports resolve.
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Convoy Integration
|
|
30
|
-
|
|
31
|
-
Include these 5 Foundation References in every page prompt:
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
1. Design tokens path 2. Layout path 3. UI components path
|
|
35
|
-
4. Aesthetic direction 5. Content tone
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Prompt templates: see [TEMPLATES.md](./TEMPLATES.md).
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## Example: `src/styles/tokens.css`
|
|
43
|
-
|
|
44
|
-
```css
|
|
45
|
-
:root {
|
|
46
|
-
/* Palette */
|
|
47
|
-
--color-bg: #ffffff;
|
|
48
|
-
--color-foreground: #0f172a;
|
|
49
|
-
--color-primary: #0ea5e9;
|
|
50
|
-
--color-primary-600: #0284c7;
|
|
51
|
-
|
|
52
|
-
/* Typography */
|
|
53
|
-
--font-base: 'Source Sans 3', system-ui, sans-serif; /* the pairing chosen in frontend-design */
|
|
54
|
-
--text-sm: 0.875rem;
|
|
55
|
-
--text-base: 1rem;
|
|
56
|
-
|
|
57
|
-
/* Spacing */
|
|
58
|
-
--space-1: 4px;
|
|
59
|
-
--space-2: 8px;
|
|
60
|
-
--space-3: 16px;
|
|
61
|
-
|
|
62
|
-
/* Radius */
|
|
63
|
-
--radius-sm: 6px;
|
|
64
|
-
--radius-md: 12px;
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
UI components consume these vars only — e.g. `bg-[var(--color-primary)]`, never a literal hex.
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Anti-Patterns
|
|
73
|
-
|
|
74
|
-
| Anti-pattern | Fix |
|
|
75
|
-
|-------------|-----|
|
|
76
|
-
| Agents pick their own fonts/colors | Foundation creates tokens first |
|
|
77
|
-
| Copy-pasting `Button` between pages | Import from shared library |
|
|
78
|
-
| Inline `style={{ color: '#...' }}` | CSS class with token variable |
|
|
79
|
-
| Foundation and page tasks run in parallel | Foundation phase must fully complete first |
|
|
80
|
-
|