opencastle 0.32.12 → 0.32.13

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 (110) hide show
  1. package/README.md +5 -3
  2. package/package.json +1 -1
  3. package/src/dashboard/dist/data/convoys/demo-api-v2.json +3 -3
  4. package/src/dashboard/dist/data/convoys/demo-auth-revamp.json +4 -4
  5. package/src/dashboard/dist/data/convoys/demo-dashboard-ui.json +6 -6
  6. package/src/dashboard/dist/data/convoys/demo-data-pipeline.json +3 -3
  7. package/src/dashboard/dist/data/convoys/demo-deploy-ci.json +1 -1
  8. package/src/dashboard/dist/data/convoys/demo-docs-update.json +7 -7
  9. package/src/dashboard/dist/data/convoys/demo-perf-opt.json +4 -4
  10. package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
  11. package/src/dashboard/public/data/convoys/demo-api-v2.json +3 -3
  12. package/src/dashboard/public/data/convoys/demo-auth-revamp.json +4 -4
  13. package/src/dashboard/public/data/convoys/demo-dashboard-ui.json +6 -6
  14. package/src/dashboard/public/data/convoys/demo-data-pipeline.json +3 -3
  15. package/src/dashboard/public/data/convoys/demo-deploy-ci.json +1 -1
  16. package/src/dashboard/public/data/convoys/demo-docs-update.json +7 -7
  17. package/src/dashboard/public/data/convoys/demo-perf-opt.json +4 -4
  18. package/src/orchestrator/customizations/stack/sanity-config.md +43 -0
  19. package/src/orchestrator/customizations/stack/supabase-config.md +53 -0
  20. package/src/orchestrator/plugins/astro/REFERENCE.md +5 -0
  21. package/src/orchestrator/plugins/astro/SKILL.md +22 -29
  22. package/src/orchestrator/plugins/chrome-devtools/REFERENCE.md +9 -0
  23. package/src/orchestrator/plugins/chrome-devtools/SKILL.md +10 -55
  24. package/src/orchestrator/plugins/contentful/REFERENCE.md +16 -0
  25. package/src/orchestrator/plugins/contentful/SKILL.md +69 -29
  26. package/src/orchestrator/plugins/convex/REFERENCE.md +9 -0
  27. package/src/orchestrator/plugins/convex/SKILL.md +13 -1
  28. package/src/orchestrator/plugins/cypress/REFERENCE.md +5 -0
  29. package/src/orchestrator/plugins/cypress/SKILL.md +29 -93
  30. package/src/orchestrator/plugins/figma/REFERENCE.md +18 -0
  31. package/src/orchestrator/plugins/figma/SKILL.md +41 -66
  32. package/src/orchestrator/plugins/jira/REFERENCE.md +9 -0
  33. package/src/orchestrator/plugins/jira/SKILL.md +26 -114
  34. package/src/orchestrator/plugins/linear/SKILL.md +42 -109
  35. package/src/orchestrator/plugins/netlify/REFERENCE.md +33 -0
  36. package/src/orchestrator/plugins/netlify/SKILL.md +34 -64
  37. package/src/orchestrator/plugins/nextjs/REFERENCE.md +73 -0
  38. package/src/orchestrator/plugins/nextjs/SKILL.md +49 -138
  39. package/src/orchestrator/plugins/notion/SKILL.md +26 -168
  40. package/src/orchestrator/plugins/notion/TEMPLATES.md +88 -0
  41. package/src/orchestrator/plugins/nx/REFERENCE.md +10 -0
  42. package/src/orchestrator/plugins/nx/SKILL.md +12 -12
  43. package/src/orchestrator/plugins/playwright/REFERENCE.md +12 -0
  44. package/src/orchestrator/plugins/playwright/SKILL.md +33 -98
  45. package/src/orchestrator/plugins/prisma/REFERENCE.md +42 -0
  46. package/src/orchestrator/plugins/prisma/SKILL.md +18 -68
  47. package/src/orchestrator/plugins/resend/REFERENCE.md +61 -0
  48. package/src/orchestrator/plugins/resend/SKILL.md +23 -137
  49. package/src/orchestrator/plugins/sanity/SKILL.md +50 -3
  50. package/src/orchestrator/plugins/slack/REFERENCE.md +24 -0
  51. package/src/orchestrator/plugins/slack/SKILL.md +36 -111
  52. package/src/orchestrator/plugins/strapi/REFERENCE.md +35 -0
  53. package/src/orchestrator/plugins/strapi/SKILL.md +60 -24
  54. package/src/orchestrator/plugins/supabase/REFERENCE.md +9 -0
  55. package/src/orchestrator/plugins/supabase/SKILL.md +44 -16
  56. package/src/orchestrator/plugins/teams/REFERENCE.md +36 -0
  57. package/src/orchestrator/plugins/teams/SKILL.md +35 -85
  58. package/src/orchestrator/plugins/trello/REFERENCE.md +9 -0
  59. package/src/orchestrator/plugins/trello/SKILL.md +25 -97
  60. package/src/orchestrator/plugins/turborepo/REFERENCE.md +9 -0
  61. package/src/orchestrator/plugins/turborepo/SKILL.md +13 -1
  62. package/src/orchestrator/plugins/vercel/SKILL.md +45 -52
  63. package/src/orchestrator/plugins/vitest/SKILL.md +10 -14
  64. package/src/orchestrator/prompts/create-skill.prompt.md +62 -20
  65. package/src/orchestrator/skills/accessibility-standards/REFERENCE.md +34 -0
  66. package/src/orchestrator/skills/accessibility-standards/SKILL.md +6 -3
  67. package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +48 -0
  68. package/src/orchestrator/skills/agent-hooks/SKILL.md +41 -65
  69. package/src/orchestrator/skills/agent-memory/KNOWLEDGE-GRAPH.md +49 -0
  70. package/src/orchestrator/skills/agent-memory/SKILL.md +30 -67
  71. package/src/orchestrator/skills/api-patterns/SKILL.md +29 -1
  72. package/src/orchestrator/skills/code-commenting/SKILL.md +1 -1
  73. package/src/orchestrator/skills/context-map/REFERENCE.md +70 -0
  74. package/src/orchestrator/skills/context-map/SKILL.md +28 -55
  75. package/src/orchestrator/skills/data-engineering/REFERENCE.md +55 -0
  76. package/src/orchestrator/skills/data-engineering/SKILL.md +40 -34
  77. package/src/orchestrator/skills/decomposition/REFERENCE.md +28 -0
  78. package/src/orchestrator/skills/decomposition/SKILL.md +15 -30
  79. package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +31 -65
  80. package/src/orchestrator/skills/documentation-standards/SKILL.md +31 -50
  81. package/src/orchestrator/skills/documentation-standards/WRITING-GUIDE.md +39 -0
  82. package/src/orchestrator/skills/fast-review/REFERENCE.md +30 -0
  83. package/src/orchestrator/skills/fast-review/SKILL.md +11 -31
  84. package/src/orchestrator/skills/frontend-design/COMPONENTS.md +113 -0
  85. package/src/orchestrator/skills/frontend-design/REFERENCE.md +36 -0
  86. package/src/orchestrator/skills/frontend-design/SKILL.md +36 -85
  87. package/src/orchestrator/skills/git-workflow/SKILL.md +1 -1
  88. package/src/orchestrator/skills/memory-merger/REFERENCE.md +20 -0
  89. package/src/orchestrator/skills/memory-merger/SKILL.md +29 -38
  90. package/src/orchestrator/skills/observability-logging/SKILL.md +5 -12
  91. package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +42 -0
  92. package/src/orchestrator/skills/orchestration-protocols/SKILL.md +54 -41
  93. package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +55 -0
  94. package/src/orchestrator/skills/panel-majority-vote/SKILL.md +30 -75
  95. package/src/orchestrator/skills/performance-optimization/SKILL.md +41 -1
  96. package/src/orchestrator/skills/project-consistency/SKILL.md +50 -89
  97. package/src/orchestrator/skills/project-consistency/TEMPLATES.md +39 -0
  98. package/src/orchestrator/skills/react-development/REFERENCE.md +7 -0
  99. package/src/orchestrator/skills/react-development/SKILL.md +50 -42
  100. package/src/orchestrator/skills/security-hardening/SKILL.md +88 -1
  101. package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +36 -0
  102. package/src/orchestrator/skills/self-improvement/SKILL.md +19 -25
  103. package/src/orchestrator/skills/seo-patterns/REFERENCE.md +54 -0
  104. package/src/orchestrator/skills/seo-patterns/SKILL.md +20 -88
  105. package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +58 -0
  106. package/src/orchestrator/skills/session-checkpoints/SKILL.md +34 -58
  107. package/src/orchestrator/skills/team-lead-reference/SKILL.md +37 -30
  108. package/src/orchestrator/skills/testing-workflow/SKILL.md +55 -2
  109. package/src/orchestrator/skills/validation-gates/REFERENCE.md +50 -0
  110. package/src/orchestrator/skills/validation-gates/SKILL.md +39 -35
@@ -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
 
@@ -0,0 +1,39 @@
1
+ > Parent: [SKILL.md](./SKILL.md)
2
+
3
+ ## Prompt Templates — Foundation & Page Tasks
4
+
5
+ ### Foundation Setup — Prompt (copy-paste)
6
+
7
+ ````markdown
8
+ ## Foundation Setup — [project description]
9
+
10
+ **Aesthetic:** [2-3 word direction] — [one sentence]
11
+
12
+ Create `[path]/tokens.css`: palette (intent-named), fluid typography (clamp()), spacing (4px base), motion, shadows, radius, breakpoints.
13
+ Create `[path]/Layout.[tsx|astro|vue]`: responsive container, site header (nav: [labels]), footer, document head.
14
+ Create `[path]/ui/`: Button, Card, Heading, Text, Link, Section, Container, Grid — tokens only, zero hardcoded values; `variant`/`size`/`className` API.
15
+
16
+ **Style Guide:** Tone: [formal/casual]. Terminology: [key terms]. Page structure: [hero → ... → CTA].
17
+
18
+ **Acceptance Criteria:** Zero hardcoded hex/px · Layout responsive at 320/768/1280px · Fluid typography via clamp() · Fonts loaded efficiently
19
+ ````
20
+
21
+ ### Page Task — Prompt (copy-paste)
22
+
23
+ ````markdown
24
+ ## Build [Page Name] Page — [purpose, audience, primary action]
25
+
26
+ **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]
27
+
28
+ **Content:** [sections, copy direction, media] **Structure:** [hero → ... → CTA]
29
+
30
+ **Acceptance Criteria:** Shared Layout used · Zero hardcoded values · UI components imported · Tone/terminology match · Responsive 320/768/1280px · [page-specific]
31
+ ````
32
+
33
+ ### How to use
34
+
35
+ - Copy the appropriate template into the foundation or page task tracker issue.
36
+ - Replace bracketed placeholders (`[path]`, `[Aesthetic]`) with exact values from the foundation task outputs.
37
+ - Attach paths to tokens, Layout, and UI component library explicitly in the prompt.
38
+
39
+ Last Updated: 2026-03-31
@@ -0,0 +1,7 @@
1
+ > Parent: [SKILL.md](./SKILL.md)
2
+
3
+ Reference materials for React development guidance.
4
+
5
+ - See `src/orchestrator/skills/react-development/SKILL.md` for concise rules and quick examples.
6
+
7
+ Examples, deep-dive topics, and extended patterns (performance, forms, advanced typing) live here when needed.
@@ -1,71 +1,79 @@
1
1
  ---
2
2
  name: react-development
3
- description: "React development standards for functional components, hooks, TypeScript integration, state management, styling, and testing patterns. Use when creating or modifying React components, custom hooks, or component tests."
3
+ description: "Enforces naming conventions, prop typing patterns, file structure, and test coverage standards. Use when creating or modifying React components, custom hooks, or component tests. Trigger terms: React app, .tsx files, testing library, custom hooks, functional components"
4
4
  ---
5
5
 
6
6
  # React Development Standards
7
7
 
8
- Modern React patterns https://react.dev.
8
+ <!-- Concrete actions moved into description and workflows; trigger terms are in frontmatter -->
9
9
 
10
- ## Architecture & Components
10
+ ## New Component Workflow
11
11
 
12
- - Functional components + hooks; composition over inheritance.
13
- - Feature/domain folders; separate presentational and container components.
14
- - PascalCase names; single responsibility; destructure props; never mutate props/state.
15
- - `<>...</>` to avoid extra DOM nodes; props validated via TypeScript.
12
+ 1. **Create file** `ComponentName.tsx` in the feature folder; co-locate `ComponentName.module.scss` and `ComponentName.test.tsx`
13
+ 2. **Define interface** — export `ComponentNameProps` with TypeScript; destructure in function signature
14
+ 3. **Implement** functional component with hooks; use CSS Modules for styling
15
+ 4. **Test** RTL behavioral tests; cover render, interaction, edge cases, accessibility
16
+ 5. **Verify** — lint + type-check + test pass; visually confirm in browser if UI
16
17
 
17
- ## TypeScript
18
+ ## Architecture & Components (concise)
18
19
 
19
- - Interfaces for props, state, event handlers, refs, and API responses.
20
- - Generic components where appropriate; union types for variants.
21
- - Built-ins: `React.FC`, `React.ComponentProps`, etc.
22
- - Strict mode in `tsconfig.json`; shared types in `interfaces/`.
20
+ - Functional components with hooks. Follow domain/feature folder structure and co-locate tests/styles with components.
21
+ - PascalCase names; destructure props; use TypeScript interfaces for props.
23
22
 
24
- ## State & Hooks
23
+ ```tsx
24
+ interface UserCardProps { name: string; role: string }
25
+ export function UserCard({ name, role }: UserCardProps) {
26
+ return (
27
+ <div data-testid="user-card">
28
+ <h3>{name}</h3>
29
+ <span>{role}</span>
30
+ </div>
31
+ );
32
+ }
33
+ ```
25
34
 
26
- | Concern | Tool |
27
- |---------|------|
28
- | Local state | `useState` |
29
- | Complex state | `useReducer` |
30
- | Cross-tree state | `useContext` |
31
- | Server state | React Query |
32
- | DOM / mutable ref | `useRef` |
33
- | Perf optimization | `useMemo` / `useCallback` |
35
+ ## TypeScript
34
36
 
35
- - `useEffect`: proper deps, cleanup to prevent leaks.
36
- - Hooks only at top level; extract reusable logic to custom hooks.
37
+ - Use interfaces for props and shared types; keep strict mode enabled in `tsconfig.json`. See [REFERENCE.md](REFERENCE.md) for detailed TypeScript patterns.
37
38
 
38
39
  ## Styling
39
40
 
40
41
  - **CSS Modules** (`.module.scss`) co-located with components.
41
42
  - Sass for advanced features; variables/mixins from shared libraries.
42
- - Mobile-first responsive; CSS custom properties for theming.
43
+ - CSS custom properties for theming.
43
44
 
44
- ## Performance
45
+ <!-- Performance guidance trimmed; follow project-specific conventions and benchmark when needed. -->
45
46
 
46
- - Stable `key` props; `React.memo` where warranted.
47
- - Code-split with `React.lazy` + `Suspense`; dynamic imports.
48
- - Avoid anonymous functions in render; virtual scrolling for large lists.
49
- - `ErrorBoundary` for graceful degradation.
47
+ ## Testing
50
48
 
51
- ## Data Fetching
49
+ - React Testing Library (behavior, not implementation); Jest runner.
50
+ - Co-locate tests next to components; mock external deps and API calls.
51
+ - Test accessibility and keyboard navigation; verify component public surface via unit tests.
52
52
 
53
- - Libraries: React Query, SWR, or Apollo Client.
54
- - Always handle loading/error/success; cancel on unmount; optimistic updates.
53
+ ```tsx
54
+ import { render, screen } from '@testing-library/react';
55
+ import { UserCard } from './UserCard';
55
56
 
56
- ## Forms
57
+ test('renders user info', () => {
58
+ render(<UserCard name="Alice" role="Admin" />);
59
+ expect(screen.getByText('Alice')).toBeInTheDocument();
60
+ expect(screen.getByTestId('user-card')).toBeInTheDocument();
61
+ });
62
+ ```
57
63
 
58
- - Controlled components; React Hook Form + Zod for validation.
59
- - Accessibility: labels, ARIA attributes; debounced validation.
64
+ ## Verification commands + error recovery
60
65
 
61
- ## Testing
66
+ Run these as part of your PR validation pipeline or locally:
62
67
 
63
- - React Testing Library (behavior, not implementation); Jest runner.
64
- - Co-locate tests in `__tests__`; mock external deps and API calls.
65
- - Test accessibility and keyboard navigation.
66
- - **CRITICAL**: Never mix static imports and `require()` for lazy-loaded libs in tests — use `jest.requireMock()` / `jest.requireActual()`.
68
+ ```bash
69
+ pnpm lint # fixable issues: pnpm lint --fix
70
+ pnpm typecheck # run `pnpm tsc --noEmit` if alias not present
71
+ pnpm test # rerun failing tests with `pnpm test -- -t <name>`
72
+ pnpm build # ensure production build succeeds
73
+ ```
74
+
75
+ If `lint` fails: run `pnpm lint --fix` and re-run. If `typecheck` fails: inspect reported files; add missing types. If tests fail: run with `--runInBand` to collect stack traces and reproduce locally.
67
76
 
68
77
  ## Security
69
78
 
70
- - Sanitize inputs (XSS); validate/escape before rendering.
71
- - HTTPS for external APIs; no sensitive data in localStorage/sessionStorage; CSP headers.
79
+ - Follow project conventions for input sanitization, secret handling, and CSP. See **api-patterns** for validation patterns.