opencastle 0.32.12 → 0.33.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 (115) hide show
  1. package/LICENSE +21 -93
  2. package/README.md +5 -3
  3. package/package.json +2 -2
  4. package/src/dashboard/dist/data/convoys/demo-api-v2.json +3 -3
  5. package/src/dashboard/dist/data/convoys/demo-auth-revamp.json +4 -4
  6. package/src/dashboard/dist/data/convoys/demo-dashboard-ui.json +12 -12
  7. package/src/dashboard/dist/data/convoys/demo-data-pipeline.json +3 -3
  8. package/src/dashboard/dist/data/convoys/demo-deploy-ci.json +1 -1
  9. package/src/dashboard/dist/data/convoys/demo-docs-update.json +7 -7
  10. package/src/dashboard/dist/data/convoys/demo-perf-opt.json +4 -4
  11. package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
  12. package/src/dashboard/public/data/convoys/demo-api-v2.json +3 -3
  13. package/src/dashboard/public/data/convoys/demo-auth-revamp.json +4 -4
  14. package/src/dashboard/public/data/convoys/demo-dashboard-ui.json +12 -12
  15. package/src/dashboard/public/data/convoys/demo-data-pipeline.json +3 -3
  16. package/src/dashboard/public/data/convoys/demo-deploy-ci.json +1 -1
  17. package/src/dashboard/public/data/convoys/demo-docs-update.json +7 -7
  18. package/src/dashboard/public/data/convoys/demo-perf-opt.json +4 -4
  19. package/src/orchestrator/customizations/stack/sanity-config.md +43 -0
  20. package/src/orchestrator/customizations/stack/supabase-config.md +53 -0
  21. package/src/orchestrator/plugins/astro/REFERENCE.md +5 -0
  22. package/src/orchestrator/plugins/astro/SKILL.md +22 -29
  23. package/src/orchestrator/plugins/chrome-devtools/REFERENCE.md +9 -0
  24. package/src/orchestrator/plugins/chrome-devtools/SKILL.md +10 -55
  25. package/src/orchestrator/plugins/contentful/REFERENCE.md +16 -0
  26. package/src/orchestrator/plugins/contentful/SKILL.md +69 -29
  27. package/src/orchestrator/plugins/convex/REFERENCE.md +9 -0
  28. package/src/orchestrator/plugins/convex/SKILL.md +13 -1
  29. package/src/orchestrator/plugins/cypress/REFERENCE.md +5 -0
  30. package/src/orchestrator/plugins/cypress/SKILL.md +29 -93
  31. package/src/orchestrator/plugins/figma/REFERENCE.md +18 -0
  32. package/src/orchestrator/plugins/figma/SKILL.md +41 -66
  33. package/src/orchestrator/plugins/jira/REFERENCE.md +9 -0
  34. package/src/orchestrator/plugins/jira/SKILL.md +26 -114
  35. package/src/orchestrator/plugins/linear/SKILL.md +42 -109
  36. package/src/orchestrator/plugins/netlify/REFERENCE.md +33 -0
  37. package/src/orchestrator/plugins/netlify/SKILL.md +34 -64
  38. package/src/orchestrator/plugins/nextjs/REFERENCE.md +73 -0
  39. package/src/orchestrator/plugins/nextjs/SKILL.md +49 -138
  40. package/src/orchestrator/plugins/notion/SKILL.md +26 -168
  41. package/src/orchestrator/plugins/notion/TEMPLATES.md +88 -0
  42. package/src/orchestrator/plugins/nx/REFERENCE.md +10 -0
  43. package/src/orchestrator/plugins/nx/SKILL.md +12 -12
  44. package/src/orchestrator/plugins/playwright/REFERENCE.md +12 -0
  45. package/src/orchestrator/plugins/playwright/SKILL.md +33 -98
  46. package/src/orchestrator/plugins/prisma/REFERENCE.md +42 -0
  47. package/src/orchestrator/plugins/prisma/SKILL.md +18 -68
  48. package/src/orchestrator/plugins/resend/REFERENCE.md +61 -0
  49. package/src/orchestrator/plugins/resend/SKILL.md +23 -137
  50. package/src/orchestrator/plugins/sanity/SKILL.md +50 -3
  51. package/src/orchestrator/plugins/slack/REFERENCE.md +24 -0
  52. package/src/orchestrator/plugins/slack/SKILL.md +36 -111
  53. package/src/orchestrator/plugins/strapi/REFERENCE.md +35 -0
  54. package/src/orchestrator/plugins/strapi/SKILL.md +60 -24
  55. package/src/orchestrator/plugins/supabase/REFERENCE.md +9 -0
  56. package/src/orchestrator/plugins/supabase/SKILL.md +44 -16
  57. package/src/orchestrator/plugins/teams/REFERENCE.md +36 -0
  58. package/src/orchestrator/plugins/teams/SKILL.md +35 -85
  59. package/src/orchestrator/plugins/trello/REFERENCE.md +9 -0
  60. package/src/orchestrator/plugins/trello/SKILL.md +25 -97
  61. package/src/orchestrator/plugins/turborepo/REFERENCE.md +9 -0
  62. package/src/orchestrator/plugins/turborepo/SKILL.md +13 -1
  63. package/src/orchestrator/plugins/vercel/SKILL.md +45 -52
  64. package/src/orchestrator/plugins/vitest/SKILL.md +10 -14
  65. package/src/orchestrator/prompts/create-skill.prompt.md +62 -20
  66. package/src/orchestrator/prompts/generate-convoy.prompt.md +6 -0
  67. package/src/orchestrator/prompts/generate-prd.prompt.md +4 -0
  68. package/src/orchestrator/skills/accessibility-standards/REFERENCE.md +34 -0
  69. package/src/orchestrator/skills/accessibility-standards/SKILL.md +6 -3
  70. package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +48 -0
  71. package/src/orchestrator/skills/agent-hooks/SKILL.md +41 -65
  72. package/src/orchestrator/skills/agent-memory/KNOWLEDGE-GRAPH.md +49 -0
  73. package/src/orchestrator/skills/agent-memory/SKILL.md +30 -67
  74. package/src/orchestrator/skills/api-patterns/SKILL.md +29 -1
  75. package/src/orchestrator/skills/backbone-scaffolding/EXAMPLES.md +16 -0
  76. package/src/orchestrator/skills/backbone-scaffolding/SKILL.md +99 -0
  77. package/src/orchestrator/skills/code-commenting/SKILL.md +1 -1
  78. package/src/orchestrator/skills/context-map/REFERENCE.md +70 -0
  79. package/src/orchestrator/skills/context-map/SKILL.md +28 -55
  80. package/src/orchestrator/skills/data-engineering/REFERENCE.md +55 -0
  81. package/src/orchestrator/skills/data-engineering/SKILL.md +40 -34
  82. package/src/orchestrator/skills/decomposition/REFERENCE.md +28 -0
  83. package/src/orchestrator/skills/decomposition/SKILL.md +15 -30
  84. package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +31 -65
  85. package/src/orchestrator/skills/documentation-standards/SKILL.md +31 -50
  86. package/src/orchestrator/skills/documentation-standards/WRITING-GUIDE.md +39 -0
  87. package/src/orchestrator/skills/fast-review/REFERENCE.md +30 -0
  88. package/src/orchestrator/skills/fast-review/SKILL.md +11 -31
  89. package/src/orchestrator/skills/frontend-design/COMPONENTS.md +113 -0
  90. package/src/orchestrator/skills/frontend-design/REFERENCE.md +36 -0
  91. package/src/orchestrator/skills/frontend-design/SKILL.md +36 -85
  92. package/src/orchestrator/skills/git-workflow/SKILL.md +13 -2
  93. package/src/orchestrator/skills/memory-merger/REFERENCE.md +20 -0
  94. package/src/orchestrator/skills/memory-merger/SKILL.md +29 -38
  95. package/src/orchestrator/skills/observability-logging/SKILL.md +5 -12
  96. package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +42 -0
  97. package/src/orchestrator/skills/orchestration-protocols/SKILL.md +54 -41
  98. package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +55 -0
  99. package/src/orchestrator/skills/panel-majority-vote/SKILL.md +30 -75
  100. package/src/orchestrator/skills/performance-optimization/SKILL.md +41 -1
  101. package/src/orchestrator/skills/project-consistency/SKILL.md +50 -89
  102. package/src/orchestrator/skills/project-consistency/TEMPLATES.md +39 -0
  103. package/src/orchestrator/skills/react-development/REFERENCE.md +7 -0
  104. package/src/orchestrator/skills/react-development/SKILL.md +50 -42
  105. package/src/orchestrator/skills/security-hardening/SKILL.md +88 -1
  106. package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +36 -0
  107. package/src/orchestrator/skills/self-improvement/SKILL.md +19 -25
  108. package/src/orchestrator/skills/seo-patterns/REFERENCE.md +54 -0
  109. package/src/orchestrator/skills/seo-patterns/SKILL.md +20 -88
  110. package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +58 -0
  111. package/src/orchestrator/skills/session-checkpoints/SKILL.md +34 -58
  112. package/src/orchestrator/skills/team-lead-reference/SKILL.md +37 -30
  113. package/src/orchestrator/skills/testing-workflow/SKILL.md +55 -2
  114. package/src/orchestrator/skills/validation-gates/REFERENCE.md +50 -0
  115. package/src/orchestrator/skills/validation-gates/SKILL.md +39 -35
@@ -0,0 +1,42 @@
1
+ > Parent: [SKILL.md](./SKILL.md)
2
+
3
+ ## Agent Health Monitoring
4
+
5
+ ### Health Signals
6
+
7
+ | Signal | Threshold | Recovery |
8
+ |--------|-----------|----------|
9
+ | **Stuck** — no output/changes | Sub: 5 min / BG: 15 min | Nudge; if frozen, abort + re-delegate with simpler scope |
10
+ | **Looping** — same error repeated | 3 consecutive failures | Abort; add context; re-delegate with explicit fix path |
11
+ | **Scope creep** — files outside partition | Any | Redirect: "Only modify files in [partition]. Revert [file]." |
12
+ | **Context exhaustion** — confused/repetitive | Visible instruction amnesia | Checkpoint, end session, resume in fresh context |
13
+ | **Permission loop** — waiting for input | 2+ prompts without progress | Auto-approve if safe; abort + re-delegate |
14
+
15
+ **Cadence:** Sub-agents — continuous (real-time). Background agents — check at 10 min, then every 10 min. Always review full diff before accepting.
16
+
17
+ ### Escalation Path
18
+
19
+ 1. **Failure 1:** Re-delegate with more specific prompt + error context
20
+ 2. **Failure 2:** Downscope (split into smaller pieces), re-delegate
21
+ 3. **Failure 3:** Log to `.opencastle/AGENT-FAILURES.md`; if 3× panel BLOCK or conflict, create dispute in `.opencastle/DISPUTES.md` (see **team-lead-reference** § Dispute Protocol)
22
+
23
+ ## Error Recovery Playbook
24
+
25
+ | Failure | Symptom | Recovery |
26
+ |---------|---------|----------|
27
+ | **Retry loop** | Same command fails 3+ times | Abort; identify root cause; re-delegate with explicit fix; log lesson |
28
+ | **MCP unavailable** | Tool connection/timeout errors | Check server; retry once; fall back to CLI; log to DLQ if critical |
29
+ | **Broken BG output** | Lint/type/test errors on return | Fix inline if small; discard + re-delegate if fundamental; DLQ after 2 fails |
30
+ | **Parallel merge conflict** | Two agents modified overlapping files | Accept complex side first; re-delegate simple side to adapt; log lesson |
31
+ | **Context exhausted** | Confused/repetitive responses | Checkpoint; end session; resume with checkpoint; reduce parallel work |
32
+ | **Post-merge test failure** | Tests pass alone but fail merged | Run affected tests; check import/state conflicts; delegate fix to likely cause |
33
+
34
+ ## Agent Circuit Breaker
35
+
36
+ | Threshold | Action |
37
+ |-----------|--------|
38
+ | **2 failures** | Investigate: same error class? Model healthy? Prompt pattern? |
39
+ | **3 failures** | Open circuit — stop delegating; reassign or escalate to user |
40
+ | **Next session** | Half-open — resets; re-open + add lesson if fails again |
41
+
42
+ Judgment-based, not a hard gate. 3 similar failures with the same error is more concerning than 3 unrelated failures.
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: orchestration-protocols
3
- description: "Runtime orchestration patterns for the Team Lead: parallel research spawning, agent health monitoring, active steering, background agent management, Context Compaction, Agent Circuit Breaker, and escalation paths."
3
+ description: "Coordinates multiple agents with parallel task spawning, health monitoring, circuit breakers, and escalation paths. Use when managing parallel agents, handling agent timeouts, orchestrate agents, run tasks in parallel, concurrent agent execution, or fan-out tasks. Use when coordinating multi-agent task delegation."
4
4
  ---
5
5
 
6
6
  # Orchestration Protocols
7
7
 
8
- Runtime patterns for managing delegated agents. **Load at:** Execution phase (Step 4+), when monitoring active agents or spawning parallel work.
8
+ Runtime patterns for managing delegated agents.
9
9
 
10
10
  ## Active Steering
11
11
 
@@ -13,11 +13,11 @@ Intervene early when you spot:
13
13
 
14
14
  | Signal | Action |
15
15
  |--------|--------|
16
- | Failing tests/builds | Can't resolve dependency or breaks existing code |
17
- | Unexpected file changes | Files outside partition in diff |
18
- | Scope creep | Refactors code not in scope |
19
- | Circular behavior | Same failing approach retried without change |
20
- | Intent misunderstanding | Session log shows wrong prompt interpretation |
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
21
 
22
22
  When redirecting, explain *why* and *how*:
23
23
 
@@ -35,7 +35,7 @@ Run autonomously in isolated Git worktrees. Reserve for well-scoped tasks >5 min
35
35
 
36
36
  ## Parallel Research Protocol
37
37
 
38
- Spawn multiple research sub-agents in parallel when 3+ independent questions must be answered before implementation. **Use when:** 3+ independent research questions, broad codebase exploration, or multi-area analysis (frontend/backend/CMS). **Skip when:** single-file investigation, answer in one known location, sequential results, or fewer than 3 questions.
38
+ Spawn multiple research sub-agents in parallel when 3+ independent questions must be answered before implementation. **Spawn if:** 3 independent questions AND answers span multiple codebase areas otherwise handle sequentially.
39
39
 
40
40
  ### Spawn Strategy
41
41
 
@@ -56,9 +56,11 @@ Return: key findings, relevant file paths (with line numbers), patterns, unanswe
56
56
  ### Result Merge Protocol
57
57
 
58
58
  1. Collect all results into single context
59
- 2. Deduplicate (same file/pattern counts once)
60
- 3. Resolve conflicts specific evidence beats general observations
61
- 4. Synthesize into concise context block for implementation prompts
59
+ 2. **Checkpoint:** verify every researcher returned a result (no timeout or error); re-run any that failed before proceeding.
60
+ 3. Deduplicate (same file/pattern counts once)
61
+ 4. Resolve conflicts specific evidence beats general observations
62
+ 5. Synthesize into concise context block for implementation prompts
63
+ 6. **Checkpoint:** confirm synthesized block covers every original question; mark any unanswered questions as blockers.
62
64
 
63
65
  ## Batch Reviews
64
66
 
@@ -80,43 +82,54 @@ Summarize prior phase output before passing to the next agent. **Extract:** file
80
82
  - Blockers: [none | list]
81
83
  ```
82
84
 
83
- ## Agent Health Monitoring
85
+ **Concrete example:**
86
+ ```
87
+ ### Prior Phase Output
88
+ **Phase 2 — Researcher A — Find usages of `calculateTotal()`**
89
+ - Files changed: none (read-only research)
90
+ - Decisions: `calculateTotal` lives in `libs/cart/src/lib/total.ts`; new logic should live in `libs/cart/src/lib/discounts.ts`
91
+ - Verification: lint ✅ | types ✅ | unit smoke test (cart total) ✅
92
+ - Blockers: design question on rounding behavior (see `docs/rounding.md`)
93
+ ```
94
+
95
+ ## Health & Recovery Reference
84
96
 
85
- ### Health Signals
97
+ Detailed Agent Health Monitoring, Error Recovery Playbook, and Agent Circuit Breaker tables have been moved to REFERENCE.md to keep this skill concise. See REFERENCE.md in this directory for thresholds, recovery steps, and escalation flows.
86
98
 
87
- | Signal | Threshold | Recovery |
88
- |--------|-----------|----------|
89
- | **Stuck** — no output/changes | Sub: 5 min / BG: 15 min | Nudge; if frozen, abort + re-delegate with simpler scope |
90
- | **Looping** — same error repeated | 3 consecutive failures | Abort; add context; re-delegate with explicit fix path |
91
- | **Scope creep** — files outside partition | Any | Redirect: "Only modify files in [partition]. Revert [file]." |
92
- | **Context exhaustion** — confused/repetitive | Visible instruction amnesia | Checkpoint, end session, resume in fresh context |
93
- | **Permission loop** — waiting for input | 2+ prompts without progress | Auto-approve if safe; abort + re-delegate |
94
99
 
95
- **Cadence:** Sub-agents continuous (real-time). Background agents — check at 10 min, then every 10 min. Always review full diff before accepting.
100
+ ### CLI examples (spawn & monitor)
96
101
 
97
- ### Escalation Path
102
+ These use the OpenCastle CLI (`npx opencastle` or `bin/cli.mjs`):
98
103
 
99
- 1. **Failure 1:** Re-delegate with more specific prompt + error context
100
- 2. **Failure 2:** Downscope (split into smaller pieces), re-delegate
101
- 3. **Failure 3:** Log to `.opencastle/AGENT-FAILURES.md`; if panel BLOCK or conflict, create dispute in `.opencastle/DISPUTES.md` (see **team-lead-reference** § Dispute Protocol)
104
+ ```bash
105
+ opencastle run --file convoy.yml --dry-run
106
+ opencastle run --file convoy.yml --verbose
107
+ opencastle run --resume
108
+ opencastle run --status
109
+ opencastle run --retry-failed
110
+ ```
111
+
112
+ **Post-run verification (copy-paste checks):**
102
113
 
103
- ## Error Recovery Playbook
114
+ ```bash
115
+ if [ $? -ne 0 ]; then
116
+ echo "opencastle run failed — inspect .opencastle/convoy.log" \
117
+ && tail -n 200 .opencastle/convoy.log && exit 1
118
+ fi
104
119
 
105
- | Failure | Symptom | Recovery |
106
- |---------|---------|----------|
107
- | **Retry loop** | Same command fails 3+ times | Abort; identify root cause; re-delegate with explicit fix; log lesson |
108
- | **MCP unavailable** | Tool connection/timeout errors | Check server; retry once; fall back to CLI; log to DLQ if critical |
109
- | **Broken BG output** | Lint/type/test errors on return | Fix inline if small; discard + re-delegate if fundamental; DLQ after 2 fails |
110
- | **Parallel merge conflict** | Two agents modified overlapping files | Accept complex side first; re-delegate simple side to adapt; log lesson |
111
- | **Context exhausted** | Confused/repetitive responses | Checkpoint; end session; resume with checkpoint; reduce parallel work |
112
- | **Post-merge test failure** | Tests pass alone but fail merged | Run affected tests; check import/state conflicts; delegate fix to likely cause |
120
+ npx opencastle run --status
121
+
122
+ grep -i "error\|failed" .opencastle/convoy.log || echo "no obvious errors in logs"
123
+ ```
113
124
 
114
- ## Agent Circuit Breaker
125
+ ## Validation & Verification Checkpoints
115
126
 
116
- | Threshold | Action |
117
- |-----------|--------|
118
- | **2 failures** | Investigate: same error class? Model healthy? Prompt pattern? |
119
- | **3 failures** | Open circuit stop delegating; reassign or escalate to user |
120
- | **Next session** | Half-open resets; re-open + add lesson if fails again |
127
+ | Phase | Check | Command / Action |
128
+ |-------|-------|-----------------|
129
+ | Pre-spawn | Inputs present (task, scope, ACs) | `test -s convoy.yml \|\| exit 1` |
130
+ | During-run | Tail for fatal errors | `tail -F .opencastle/convoy.log \| grep -i "fatal\|error"` |
131
+ | Pre-merge | All agents exited 0 | `jq -e '.agents[] \| .exit_code == 0' .opencastle/results.json` |
132
+ | Output schema | Required fields present | `jq -e '.agents[] \| (.findings and .file_paths)' .opencastle/results.json` |
133
+ | Post-merge | Lint + smoke tests pass | `npm run lint && npm test -- -t "smoke"` |
134
+ | Blocker | Any failure | Block merge; reopen to original researcher(s) |
121
135
 
122
- Judgment-based, not a hard gate. 3 similar failures with the same error is more concerning than 3 unrelated failures.
@@ -0,0 +1,55 @@
1
+ > Parent: [SKILL.md](./SKILL.md)
2
+
3
+ ## Panel — Weighted Consensus Variant (Reference)
4
+
5
+ Use this reference when a simple head-count majority is insufficient and domain expertise must influence the verdict.
6
+
7
+ ### When to Use
8
+
9
+ | Decision Type | Mode |
10
+ |--------------|------|
11
+ | Security vulnerability, code correctness | Simple majority |
12
+ | UI/UX, architecture tradeoffs, data model, naming | Weighted |
13
+
14
+ ### Weight Assignment
15
+
16
+ Base weight: 1. Add bonuses:
17
+
18
+ | Factor | Bonus |
19
+ |--------|-------|
20
+ | Domain expertise (relevant to review) | +2 |
21
+ | Confidence high / med / low | +1 / 0 / -1 |
22
+ | Prior success rate >80% (AGENT-PERFORMANCE.md) | +1 |
23
+
24
+ Example: Security Expert + high = 4; Architect + med = 2.
25
+
26
+ ### Voting Protocol
27
+
28
+ 1. Assign weights before spawning.
29
+ 2. Spawn with same prompt; collect PASS/BLOCK + confidence.
30
+ 3. Score: sum weights by verdict; PASS if PASS score > BLOCK score.
31
+ 4. Tie: highest individual weight breaks tie; if equal, default BLOCK.
32
+
33
+ ### Conflict Resolution
34
+
35
+ | Scenario | Outcome |
36
+ |----------|---------|
37
+ | Low-weight BLOCKs, high-weight PASSes | PASS; move BLOCK's MUST-FIX → SHOULD-FIX |
38
+ | Domain expert BLOCKs, generalists PASS | BLOCK |
39
+ | All equal weight | Simple majority (2/3 wins) |
40
+
41
+ ### Report Extension (template)
42
+
43
+ ```markdown
44
+ ### Weighting
45
+ | Reviewer | Role | Domain | Confidence | Prior Success | Final Weight |
46
+ |----------|------|--------|------------|---------------|-------------|
47
+ | 1 | [Agent] | +X | +X | +X | X |
48
+
49
+ ### Weighted Score
50
+ - PASS: X (reviewers: ...)
51
+ - BLOCK: X (reviewers: ...)
52
+ - **Overall: PASS/BLOCK** (weighted)
53
+ ```
54
+
55
+ Last Updated: 2026-03-31
@@ -1,20 +1,10 @@
1
1
  ---
2
2
  name: panel-majority-vote
3
- description: "Run 3 isolated reviewer sub-agents against the same question and decide PASS/BLOCK by majority vote (2/3 wins). Use when deterministic verification is insufficient."
3
+ description: "Runs 3 isolated reviewer sub-agents and consolidates a PASS/BLOCK verdict by majority. Use when the user requests an independent review of code changes, pull requests, design documents, or release notes."
4
4
  ---
5
5
 
6
6
  # Skill: Panel majority vote
7
7
 
8
- ## Contract
9
-
10
- | Rule | Detail |
11
- |------|--------|
12
- | Scope | One run root, one panel key |
13
- | Artifacts | Reviewers use only declared in-scope artifacts |
14
- | Runners | Exactly 3 isolated reviewer runs |
15
- | Verdict | Majority (2/3 wins) |
16
- | On BLOCK | Consolidated report must include retry summary |
17
-
18
8
  ## Inputs / Outputs
19
9
 
20
10
  **Inputs:** `<runRoot>`, `<panelKey>` (filesystem-safe), question text, artifact list. Panel dir default: `<runRoot>/panel/`.
@@ -25,84 +15,49 @@ description: "Run 3 isolated reviewer sub-agents against the same question and d
25
15
  | Raw reviewer outputs | `<panelDir>/<panelKey>-reviewer-outputs.md` |
26
16
  | Consolidated report | `<panelDir>/<panelKey>.md` |
27
17
 
28
- ## Procedure
29
-
30
- 1. **Validate scope** — every artifact path is under `<runRoot>`; list is sufficient to answer the question.
31
- 2. **Spawn 3 reviewers in parallel** — identical prompt to 3 isolated subagents. Optionally write payload to `<panelDir>/<panelKey>-panel-prompt.md`. Required output sections (no others): `VERDICT: PASS | BLOCK`, `MUST-FIX:`, `SHOULD-FIX:`, `QUESTIONS:`, `TEST IDEAS:`, `CONFIDENCE: low | med | high`.
32
- 3. **Persist outputs** — write `<panelDir>/<panelKey>-reviewer-outputs.md` with header (run root, panel key, question, artifacts) and each reviewer output verbatim, separated.
33
- 4. **Consolidate** — count PASS/BLOCK; overall PASS if ≥ 2. Deduplicate MUST-FIX/SHOULD-FIX with reviewer counts. Record disagreements. Include determinize-next recs. If BLOCK, add retry summary.
34
- 5. **Write report** — create `<panelDir>/<panelKey>.md` using `panel-report.template.md`.
35
- 6. **Print summary** — overall verdict + vote tally + report path.
36
- 7. **Log (⛔ hard gate)** — use **observability-logging** skill panel command. Fields: `panel_key`, `verdict`, `pass_count`, `block_count`, `must_fix`, `should_fix`, `reviewer_model`, `weighted`, `attempt`, `tracker_issue`, `artifacts_count`, `report_path`. Link report as verification evidence.
37
-
38
- ## Notes
39
-
40
- - On BLOCK: change the underlying work and re-run; do not re-word the question.
41
- - After 3 consecutive BLOCKs on the same panel key: create a dispute record per **team-lead-reference** § Dispute Protocol.
42
18
 
43
- ## Model Selection
19
+ ## Procedure
44
20
 
45
- | Domain | Model |
46
- |--------|-------|
47
- | Security, architecture, complex logic | Quality (Claude Sonnet 4.6) × 3 |
48
- | Feature implementation, UI, queries | Standard (Gemini 3.1 Pro) × 3 |
49
- | Mixed-domain | Quality × 1, Standard × 2 |
21
+ 1. **Validate scope** every artifact path is under `<runRoot>` and the list is sufficient to answer the question.
50
22
 
51
- Use same model for all 3 reviewers.
23
+ 2. **Spawn 3 reviewers in parallel** — start three isolated subagents with identical prompts. Spawn 3 reviewers using `runSubagent` with identical prompts; each reviewer receives the same question, artifact list, and constraints but runs in isolation. Required reviewer output sections (no others): `VERDICT: PASS | BLOCK`, `MUST-FIX:`, `SHOULD-FIX:`, `QUESTIONS:`, `TEST IDEAS:`, `CONFIDENCE: low | med | high`.
52
24
 
53
- ## Weighted Consensus Variant
25
+ 3. **Persist outputs** — write `<panelDir>/<panelKey>-reviewer-outputs.md` with a header (run root, panel key, question, artifacts) and each reviewer output verbatim, separated.
54
26
 
55
- For subjective decisions where domain expertise should weight more than head-count.
27
+ 4. **Consolidate** parse each reviewer output for its `VERDICT:` line and count PASS votes. Overall verdict = PASS if pass_count ≥ 2; otherwise BLOCK. Deduplicate `MUST-FIX:` and `SHOULD-FIX:` items and annotate each item with `(N/3 reviewers)`.
56
28
 
57
- ### When to Use
29
+ ```bash
30
+ # count PASS/BLOCK from combined outputs
31
+ pass_count=$(grep -o "VERDICT: PASS" panel/run123-reviewer-outputs.md | wc -l)
32
+ block_count=$(grep -o "VERDICT: BLOCK" panel/run123-reviewer-outputs.md | wc -l)
33
+ verdict=$([ "$pass_count" -ge 2 ] && echo PASS || echo BLOCK)
58
34
 
59
- | Decision Type | Mode |
60
- |--------------|------|
61
- | Security vulnerability, code correctness | Simple majority |
62
- | UI/UX, architecture tradeoffs, data model, naming | Weighted |
35
+ # emit a minimal JSON summary using jq (install jq if needed)
36
+ jq -n --arg panel_key "run123-panel" --arg verdict "$verdict" --argjson pass_count $pass_count --argjson block_count $block_count '{panel_key:$panel_key, verdict:$verdict, pass_count:$pass_count, block_count:$block_count}' > panel/run123-summary.json
37
+ ```
63
38
 
64
- ### Weight Assignment
39
+ 5. **Write report** — create `<panelDir>/<panelKey>.md` with the minimal structure below and reference the generated summary.
65
40
 
66
- Base weight: 1. Add bonuses:
41
+ - Title: Panel `<panelKey>` — Verdict: `PASS | BLOCK` (pass_count/block_count)
42
+ - Highlights: top deduplicated `MUST-FIX` and `SHOULD-FIX` items
43
+ - Evidence: paths to reviewer outputs and `panel/run123-summary.json`
67
44
 
68
- | Factor | Bonus |
69
- |--------|-------|
70
- | Domain expertise (relevant to review) | +2 |
71
- | Confidence high / med / low | +1 / 0 / -1 |
72
- | Prior success rate >80% (AGENT-PERFORMANCE.md) | +1 |
45
+ 6. **Print summary** overall verdict + vote tally + report path.
73
46
 
74
- Example: Security Expert + high = **4**; Architect + med = **2**.
47
+ 7. **Log (⛔ hard gate)** call the **observability-logging** skill with `panel_key`, `verdict`, `pass_count`, `block_count`, `must_fix`, `should_fix`, `reviewer_model`, `weighted`, `attempt`, `tracker_issue`, `artifacts_count`, `report_path` for verification.
75
48
 
76
- ### Voting Protocol
49
+ ## Notes
77
50
 
78
- 1. Assign weights before spawning.
79
- 2. Spawn with same prompt; collect PASS/BLOCK + confidence.
80
- 3. Score: sum weights by verdict; PASS if PASS score > BLOCK score.
81
- 4. Tie: highest individual weight breaks tie; if equal, default BLOCK.
51
+ - On BLOCK: change the underlying work and re-run; do not re-word the question.
52
+ - After 3 consecutive BLOCKs on the same panel key: create a dispute record per **team-lead-reference** § Dispute Protocol.
53
+ - Model selection: use the same model for all 3 reviewers. See **team-lead-reference** for model routing.
82
54
 
83
- ### Conflict Resolution
55
+ ## Related Resources
84
56
 
85
- | Scenario | Outcome |
57
+ | Resource | Purpose |
86
58
  |----------|---------|
87
- | Low-weight BLOCKs, high-weight PASSes | PASS; move BLOCK's MUST-FIX SHOULD-FIX |
88
- | Domain expert BLOCKs, generalists PASS | BLOCK |
89
- | All equal weight | Simple majority (2/3 wins) |
90
-
91
- ### Report Extension
92
-
93
- ```markdown
94
- ### Weighting
95
- | Reviewer | Role | Domain | Confidence | Prior Success | Final Weight |
96
- |----------|------|--------|------------|---------------|-------------|
97
- | 1 | [Agent] | +X | +X | +X | X |
98
-
99
- ### Weighted Score
100
- - PASS: X (reviewers: 1, 3)
101
- - BLOCK: X (reviewer: 2)
102
- - **Overall: PASS/BLOCK** (weighted)
103
- ```
104
-
105
- ### Integration
106
-
107
- Same steps 1–7 as standard panel. Differences: assign weights in step 2; use weighted calculation in step 4; add weighting table to report. Team Lead decides simple vs. weighted; include rationale in delegation prompt.
59
+ | `panel-report.template.md` | Report template for step 5 |
60
+ | `REFERENCE.md` | Weighted consensus variant and weighting details |
61
+ | **observability-logging** skill | Panel logging command (step 7) |
62
+ | **team-lead-reference** skill | Model routing and dispute protocol |
108
63
 
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  name: performance-optimization
3
- description: "Frontend and backend performance optimization patterns including rendering, asset optimization, JavaScript performance, caching, profiling, and code review checklist. Use when optimizing components, reviewing code for performance, or analyzing bundle size and Core Web Vitals."
3
+ description: "Profiles and reduces frontend/backend costs: split bundles, optimize assets, apply caching, and fix Core Web Vitals regressions. Use when profiling Lighthouse/CI regressions, reducing bundle size, or fixing high CLS/LCP/TTI metrics."
4
4
  ---
5
5
 
6
6
  # Performance Optimization
7
7
 
8
8
  **Rule:** Measure first (`Chrome DevTools`, `Lighthouse`, `Datadog`), optimize second. Set budgets (load time, memory, API latency). Automate in CI/CD.
9
9
 
10
+ Domain-specific patterns (rendering, JS, Node optimizations) are referenced in REFERENCE.md to keep this skill concise.
11
+
10
12
  ## Patterns by Domain
11
13
 
12
14
  | Domain | Key patterns |
@@ -25,6 +27,44 @@ input.addEventListener('input', (e) => fetch(`/search?q=${e.target.value}`));
25
27
  let t; input.addEventListener('input', (e) => { clearTimeout(t); t = setTimeout(() => fetch(`/search?q=${e.target.value}`), 300); });
26
28
  ```
27
29
 
30
+ ## Executable Examples
31
+
32
+ ### Dynamic import splitting (example)
33
+
34
+ ```js
35
+ // Lazy-load a heavy chart only on client
36
+ import dynamic from 'next/dynamic';
37
+ const Chart = dynamic(() => import('../components/Chart'), { ssr: false, loading: () => <div>Loading chart…</div> });
38
+ export default function Page(){ return <Chart />; }
39
+ ```
40
+
41
+ ### React.memo + profiler pattern
42
+
43
+ ```jsx
44
+ import React, { Profiler } from 'react';
45
+ const Item = React.memo(function Item({data}){ return <div>{data.title}</div>; });
46
+ function onRender(id, phase, actualDuration){ console.log(id, phase, actualDuration); }
47
+ export default function List({items}){
48
+ return (
49
+ <Profiler id="List" onRender={onRender}>
50
+ {items.map(i=> <Item key={i.id} data={i} />)}
51
+ </Profiler>
52
+ );
53
+ }
54
+ ```
55
+
56
+ ## Profiling Workflow (step-by-step)
57
+
58
+ 1. Run Lighthouse (or CI perf job) and record baseline.
59
+ - Checkpoint: failing metric(s) identified (LCP/CLS/FID/TTI).
60
+ - Recovery: if noisy, reproduce locally with `--emulated-form-factor=mobile`.
61
+ 2. Profile with DevTools Profiler / React profiler or Node `clinic` for backend.
62
+ - Checkpoint: hotspot call stacks / long tasks located.
63
+ 3. Apply minimal fix (code-split, memoize, reduce payloads, defer non-critical work).
64
+ - Checkpoint: targeted change reduces measured hotspot time in profiler.
65
+ 4. Re-run Lighthouse/CI perf job and compare; set threshold (e.g., 10% improvement or within budget).
66
+ 5. If regression persists, iterate and create a rollback plan; note fixes in changelog.
67
+
28
68
  ## Review Checklist
29
69
 
30
70
  - [ ] No O(n²)+ algorithms; appropriate data structures
@@ -1,119 +1,83 @@
1
1
  ---
2
2
  name: project-consistency
3
- description: "Enforce cross-agent consistency in multi-page/multi-component projects. Covers visual design, code patterns, content style, and structural conventions. Essential for convoy parallel execution where multiple agents build different parts of the same app."
3
+ description: "Generates shared CSS variables, validates component naming conventions, and creates layout pattern templates. Use when coordinating a design system, theme, consistent styling, CSS variables, or a component library across parallel agents."
4
4
  ---
5
5
 
6
6
  # Project Consistency
7
7
 
8
- Multiple agents building in parallel make independent decisions about colors, fonts, APIs, and tone. **Consistency must be engineered as shared inputs before parallel work begins — not hoped for afterward.**
8
+ Ensure consistency by producing shared artifacts and automated checks before parallel work begins.
9
9
 
10
10
  ## Foundation-First Principle
11
11
 
12
- ```
13
- ❌ Wrong: [A] ─┐ → inconsistent output
14
- [B] ─┤→ build in parallel → inconsistent output
15
- [C] ─┘ → inconsistent output
16
-
17
- ✅ Right: [foundation] → artifacts → [A] ─┐
18
- [B] ─┤→ consistent output
19
- [C] ─┘
20
- ```
21
-
22
- **Phase 1 (sequential):** One task creates all shared artifacts.
23
- **Phase 2 (parallel):** Every page task imports from Phase 1. No new values, no recreated components.
24
-
25
- ### The 4 Consistency Dimensions
26
-
27
- | Dimension | What drifts | Artifact |
28
- |-----------|-------------|----------|
29
- | **Visual** | Color palettes, font choices, spacing units | Design tokens file |
30
- | **Code** | Component APIs, naming conventions, import paths | UI component library |
31
- | **Content** | Tone, terminology, heading hierarchy | Style guide brief |
32
- | **Structural** | Page layout, navigation, responsive breakpoints | Shared layout component |
33
-
34
- ---
35
-
36
- ## Foundation Phase Artifacts
37
-
38
- A foundation task must produce four artifacts. All phase-2 tasks depend on its completion.
39
-
40
- | Artifact | Path | Contents |
41
- |----------|------|----------|
42
- | **Design tokens** | `src/styles/tokens.css` | CSS custom properties: palette, typography, spacing, motion, shadows, radius, breakpoints. **Rule:** no value outside this file. |
43
- | **Shared layout** | `src/components/Layout.tsx` (React) · `src/layouts/Layout.astro` (Astro) | Wraps every page: responsive container, header, nav, footer, document head. Import — never recreate. |
44
- | **UI component library** | `src/components/ui/` | `Button`, `Card`, `Heading`, `Text`, `Link`, `Section`, `Container`, `Grid` — tokens only. API: camelCase props, `variant`/`size`/`className`, no inline `style`. |
45
- | **Style guide brief** | Inline in foundation prompt (quoted verbatim in page prompts) | Aesthetic direction · typography pairing · content tone · nav labels · page structure pattern · terminology glossary |
46
-
47
- ---
12
+ Phase 1 (sequential): create shared artifacts (tokens, Layout, UI components). Phase 2 (parallel): every page imports from Phase 1; no new tokens or duplicated components.
48
13
 
49
- ## Consistency Rules for Page Agents
14
+ ### Foundation Artifacts & Page Rules
50
15
 
51
- Every page agent in a multi-agent convoy MUST follow all rules below.
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. |
52
22
 
53
- | Area | Rules |
54
- |------|-------|
55
- | **Visual** | Import tokens only. Never introduce new color, font-size, or spacing values. Flag missing tokens — don't invent inline values. CSS custom properties exclusively; no raw hex or raw `px`. |
56
- | **Code** | Import `Layout` from shared path — no page-local wrappers. Import UI components from library — don't recreate. PascalCase components, camelCase props, kebab-case CSS classes. Co-locate component files. |
57
- | **Content** | Match tone from style guide exactly. Use terminology glossary verbatim. Follow heading hierarchy pattern. |
58
- | **Structural** | Every page uses shared Layout — no exceptions. Follow page structure from brief. Nav labels match brief exactly. Breakpoints from tokens only. |
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 -r 'style={{' src/pages/` returns 0 hits (no inline styles). All imports resolve.
59
26
 
60
27
  ---
61
28
 
62
29
  ## Convoy Integration
63
30
 
64
- ```
65
- Phase 1: foundation-setup (1 task, blocks Phase 2)
66
- ├── Agent: UI-UX Expert or Developer
67
- ├── Creates: tokens.css, Layout, UI component library
68
- ├── Defines: style guide brief (aesthetic, tone, nav labels, terminology)
69
- └── Output: all paths documented for Phase 2 prompts
70
-
71
- Phase 2: page-building (N tasks, all parallel)
72
- ├── home-page · about-page · projects-page · contact-page · ...
73
- └── [every prompt contains the 5 mandatory references below]
74
- ```
75
-
76
- ### 5 Mandatory References in Every Page Task Prompt
31
+ Phase 1 (sequential): foundation-setup creates tokens, Layout, UI library, and style guide brief. Phase 2 (parallel): every page task imports from Phase 1. Include these 5 references in every page prompt:
77
32
 
78
33
  ```
79
- 1. Design tokens: `[path/tokens.css]` use ONLY these tokens. No new values.
80
- 2. Layout: `[path/Layout]` wrap all page content in this component.
81
- 3. UI components: `[path/src/components/ui/]` — import; do not recreate.
82
- 4. Aesthetic: [2-3 word direction from foundation]
83
- 5. Content tone: [tone description from foundation]
34
+ 1. Design tokens path 2. Layout path 3. UI components path
35
+ 4. Aesthetic direction 5. Content tone
84
36
  ```
85
37
 
86
- ---
87
-
88
- ## Prompt Template: Foundation Task
38
+ Prompt templates: see [TEMPLATES.md](./TEMPLATES.md).
89
39
 
90
- ````markdown
91
- ## Foundation Setup — [project description]
92
-
93
- **Aesthetic:** [2-3 word direction] — [one sentence]
94
-
95
- Create `[path]/tokens.css`: palette (intent-named), fluid typography (clamp()), spacing (4px base), motion, shadows, radius, breakpoints.
96
- Create `[path]/Layout.[tsx|astro|vue]`: responsive container, site header (nav: [labels]), footer, document head.
97
- Create `[path]/ui/`: Button, Card, Heading, Text, Link, Section, Container, Grid — tokens only, zero hardcoded values; `variant`/`size`/`className` API.
40
+ ---
98
41
 
99
- **Style Guide:** Tone: [formal/casual]. Terminology: [key terms]. Page structure: [hero → ... → CTA].
42
+ ## Executable Examples
100
43
 
101
- **Acceptance Criteria:** Zero hardcoded hex/px · Layout responsive at 320/768/1280px · Fluid typography via clamp() · Fonts loaded efficiently
102
- ````
44
+ ### Example: `src/styles/tokens.css`
103
45
 
104
- ---
46
+ ```css
47
+ :root {
48
+ /* Palette */
49
+ --color-bg: #ffffff;
50
+ --color-foreground: #0f172a;
51
+ --color-primary: #0ea5e9;
52
+ --color-primary-600: #0284c7;
105
53
 
106
- ## Prompt Template: Page Task
54
+ /* Typography */
55
+ --font-base: 'Inter, system-ui, -apple-system, sans-serif';
56
+ --text-sm: 0.875rem;
57
+ --text-base: 1rem;
107
58
 
108
- ````markdown
109
- ## Build [Page Name] Page — [purpose, audience, primary action]
59
+ /* Spacing */
60
+ --space-1: 4px;
61
+ --space-2: 8px;
62
+ --space-3: 16px;
110
63
 
111
- **MANDATORY refs:** tokens: `[path]/tokens.css` (no new values) · Layout: `[path]/Layout.[ext]` (wrap all content) · UI: `[path]/ui/` (import, don't recreate) · Aesthetic: [2-3 words] · Tone: [tone] · Terms: [glossary]
64
+ /* Radius */
65
+ --radius-sm: 6px;
66
+ --radius-md: 12px;
67
+ }
68
+ ```
112
69
 
113
- **Content:** [sections, copy direction, media] **Structure:** [hero → ... → CTA]
70
+ ### Minimal Button component example (React)
114
71
 
115
- **Acceptance Criteria:** Shared Layout used · Zero hardcoded values · UI components imported · Tone/terminology match · Responsive 320/768/1280px · [page-specific]
116
- ````
72
+ ```tsx
73
+ import './tokens.css';
74
+ type ButtonProps = { children: React.ReactNode; variant?: 'primary' | 'ghost'; className?: string };
75
+ export function Button({ children, variant = 'primary', className = '' }: ButtonProps) {
76
+ const base = 'px-4 py-2 rounded';
77
+ const variantCls = variant === 'primary' ? 'bg-[var(--color-primary)] text-white' : 'bg-transparent';
78
+ return <button className={`${base} ${variantCls} ${className}`}>{children}</button>;
79
+ }
80
+ ```
117
81
 
118
82
  ---
119
83
 
@@ -122,10 +86,7 @@ Create `[path]/ui/`: Button, Card, Heading, Text, Link, Section, Container, Grid
122
86
  | Anti-pattern | Fix |
123
87
  |-------------|-----|
124
88
  | Agents pick their own fonts/colors | Foundation creates tokens first |
125
- | Page-local `styles/global.css` | One shared tokens file, imported once |
126
89
  | Copy-pasting `Button` between pages | Import from shared library |
127
90
  | Inline `style={{ color: '#...' }}` | CSS class with token variable |
128
- | Skipping foundation "for a simple site" | Foundation takes 1 task, saves N fixes |
129
- | Different terminology per page | Terminology glossary in style guide brief |
130
91
  | Foundation and page tasks run in parallel | Foundation phase must fully complete first |
131
92