opencastle 0.32.4 → 0.32.6
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 +13 -3
- package/bin/cli.mjs +2 -0
- package/dist/cli/bootstrap.js +1 -1
- package/dist/cli/bootstrap.js.map +1 -1
- package/dist/cli/bootstrap.test.js +16 -0
- package/dist/cli/bootstrap.test.js.map +1 -1
- package/dist/cli/init.test.js +38 -0
- package/dist/cli/init.test.js.map +1 -1
- package/dist/cli/stack-config-update.test.js +18 -0
- package/dist/cli/stack-config-update.test.js.map +1 -1
- package/dist/cli/stack-config.d.ts.map +1 -1
- package/dist/cli/stack-config.js +1 -0
- package/dist/cli/stack-config.js.map +1 -1
- package/dist/cli/types.d.ts +1 -1
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/orchestrator/plugins/index.d.ts.map +1 -1
- package/dist/orchestrator/plugins/index.js +4 -0
- package/dist/orchestrator/plugins/index.js.map +1 -1
- package/dist/orchestrator/plugins/notion/config.d.ts +3 -0
- package/dist/orchestrator/plugins/notion/config.d.ts.map +1 -0
- package/dist/orchestrator/plugins/notion/config.js +46 -0
- package/dist/orchestrator/plugins/notion/config.js.map +1 -0
- package/dist/orchestrator/plugins/trello/config.d.ts +3 -0
- package/dist/orchestrator/plugins/trello/config.d.ts.map +1 -0
- package/dist/orchestrator/plugins/trello/config.js +43 -0
- package/dist/orchestrator/plugins/trello/config.js.map +1 -0
- package/dist/orchestrator/plugins/types.d.ts +1 -1
- package/dist/orchestrator/plugins/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cli/bootstrap.test.ts +21 -0
- package/src/cli/bootstrap.ts +1 -1
- package/src/cli/init.test.ts +46 -0
- package/src/cli/stack-config-update.test.ts +20 -0
- package/src/cli/stack-config.ts +1 -0
- package/src/cli/types.ts +1 -1
- package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
- package/src/orchestrator/agents/api-designer.agent.md +25 -34
- package/src/orchestrator/agents/architect.agent.md +40 -84
- package/src/orchestrator/agents/content-engineer.agent.md +29 -31
- package/src/orchestrator/agents/copywriter.agent.md +35 -60
- package/src/orchestrator/agents/data-expert.agent.md +24 -30
- package/src/orchestrator/agents/database-engineer.agent.md +26 -31
- package/src/orchestrator/agents/developer.agent.md +32 -34
- package/src/orchestrator/agents/devops-expert.agent.md +31 -26
- package/src/orchestrator/agents/documentation-writer.agent.md +29 -29
- package/src/orchestrator/agents/performance-expert.agent.md +36 -33
- package/src/orchestrator/agents/release-manager.agent.md +25 -34
- package/src/orchestrator/agents/researcher.agent.md +41 -95
- package/src/orchestrator/agents/reviewer.agent.md +24 -34
- package/src/orchestrator/agents/security-expert.agent.md +35 -39
- package/src/orchestrator/agents/seo-specialist.agent.md +25 -32
- package/src/orchestrator/agents/session-guard.agent.md +20 -79
- package/src/orchestrator/agents/team-lead.agent.md +50 -254
- package/src/orchestrator/agents/testing-expert.agent.md +37 -49
- package/src/orchestrator/agents/ui-ux-expert.agent.md +33 -39
- package/src/orchestrator/customizations/KNOWN-ISSUES.md +0 -1
- package/src/orchestrator/customizations/agents/skill-matrix.json +20 -4
- package/src/orchestrator/customizations/agents/skill-matrix.md +20 -0
- package/src/orchestrator/instructions/general.instructions.md +24 -84
- package/src/orchestrator/plugins/astro/SKILL.md +23 -179
- package/src/orchestrator/plugins/convex/SKILL.md +38 -12
- package/src/orchestrator/plugins/index.ts +4 -0
- package/src/orchestrator/plugins/netlify/SKILL.md +17 -13
- package/src/orchestrator/plugins/nextjs/SKILL.md +55 -261
- package/src/orchestrator/plugins/notion/SKILL.md +205 -0
- package/src/orchestrator/plugins/notion/config.ts +47 -0
- package/src/orchestrator/plugins/nx/SKILL.md +20 -72
- package/src/orchestrator/plugins/playwright/SKILL.md +5 -17
- package/src/orchestrator/plugins/slack/SKILL.md +28 -190
- package/src/orchestrator/plugins/teams/SKILL.md +10 -140
- package/src/orchestrator/plugins/trello/SKILL.md +151 -0
- package/src/orchestrator/plugins/trello/config.ts +44 -0
- package/src/orchestrator/plugins/types.ts +1 -1
- package/src/orchestrator/plugins/vitest/SKILL.md +2 -2
- package/src/orchestrator/prompts/bug-fix.prompt.md +25 -63
- package/src/orchestrator/prompts/implement-feature.prompt.md +29 -66
- package/src/orchestrator/prompts/quick-refinement.prompt.md +31 -66
- package/src/orchestrator/skills/accessibility-standards/SKILL.md +50 -105
- package/src/orchestrator/skills/agent-hooks/SKILL.md +60 -110
- package/src/orchestrator/skills/agent-memory/SKILL.md +44 -93
- package/src/orchestrator/skills/api-patterns/SKILL.md +20 -68
- package/src/orchestrator/skills/code-commenting/SKILL.md +49 -101
- package/src/orchestrator/skills/context-map/SKILL.md +47 -88
- package/src/orchestrator/skills/data-engineering/SKILL.md +27 -74
- package/src/orchestrator/skills/decomposition/SKILL.md +50 -98
- package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +44 -107
- package/src/orchestrator/skills/documentation-standards/SKILL.md +28 -89
- package/src/orchestrator/skills/fast-review/SKILL.md +51 -276
- package/src/orchestrator/skills/frontend-design/SKILL.md +53 -163
- package/src/orchestrator/skills/git-workflow/SKILL.md +18 -54
- package/src/orchestrator/skills/memory-merger/SKILL.md +51 -88
- package/src/orchestrator/skills/observability-logging/SKILL.md +29 -75
- package/src/orchestrator/skills/orchestration-protocols/SKILL.md +58 -117
- package/src/orchestrator/skills/panel-majority-vote/SKILL.md +65 -140
- package/src/orchestrator/skills/performance-optimization/SKILL.md +21 -85
- package/src/orchestrator/skills/project-consistency/SKILL.md +62 -281
- package/src/orchestrator/skills/react-development/SKILL.md +38 -86
- package/src/orchestrator/skills/security-hardening/SKILL.md +40 -84
- package/src/orchestrator/skills/self-improvement/SKILL.md +26 -60
- package/src/orchestrator/skills/seo-patterns/SKILL.md +40 -105
- package/src/orchestrator/skills/session-checkpoints/SKILL.md +26 -68
- package/src/orchestrator/skills/team-lead-reference/SKILL.md +66 -206
- package/src/orchestrator/skills/testing-workflow/SKILL.md +42 -112
- package/src/orchestrator/skills/validation-gates/SKILL.md +39 -170
- package/src/orchestrator/snippets/base-output-contract.md +14 -0
- package/src/orchestrator/snippets/discovered-issues-policy.md +15 -0
- package/src/orchestrator/snippets/logging-mandatory.md +11 -0
- package/src/orchestrator/snippets/never-expose-secrets.md +22 -0
|
@@ -5,29 +5,27 @@ description: "Enforce cross-agent consistency in multi-page/multi-component proj
|
|
|
5
5
|
|
|
6
6
|
# Project Consistency
|
|
7
7
|
|
|
8
|
-
|
|
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.**
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## The Foundation-First Principle
|
|
10
|
+
## Foundation-First Principle
|
|
13
11
|
|
|
14
12
|
```
|
|
15
|
-
❌ Wrong: [
|
|
16
|
-
[
|
|
17
|
-
[
|
|
13
|
+
❌ Wrong: [A] ─┐ → inconsistent output
|
|
14
|
+
[B] ─┤→ build in parallel → inconsistent output
|
|
15
|
+
[C] ─┘ → inconsistent output
|
|
18
16
|
|
|
19
|
-
✅ Right: [foundation
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
✅ Right: [foundation] → artifacts → [A] ─┐
|
|
18
|
+
[B] ─┤→ consistent output
|
|
19
|
+
[C] ─┘
|
|
22
20
|
```
|
|
23
21
|
|
|
24
|
-
**Phase 1 (sequential):** One task creates all shared artifacts
|
|
25
|
-
**Phase 2 (parallel):** Every page task imports from Phase 1
|
|
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.
|
|
26
24
|
|
|
27
25
|
### The 4 Consistency Dimensions
|
|
28
26
|
|
|
29
|
-
| Dimension | What drifts
|
|
30
|
-
|
|
27
|
+
| Dimension | What drifts | Artifact |
|
|
28
|
+
|-----------|-------------|----------|
|
|
31
29
|
| **Visual** | Color palettes, font choices, spacing units | Design tokens file |
|
|
32
30
|
| **Code** | Component APIs, naming conventions, import paths | UI component library |
|
|
33
31
|
| **Content** | Tone, terminology, heading hierarchy | Style guide brief |
|
|
@@ -37,314 +35,97 @@ When multiple agents build different pages or sections in parallel, each makes i
|
|
|
37
35
|
|
|
38
36
|
## Foundation Phase Artifacts
|
|
39
37
|
|
|
40
|
-
A foundation task must produce four
|
|
41
|
-
|
|
42
|
-
### a. Design Tokens File
|
|
43
|
-
|
|
44
|
-
A single CSS custom properties file — the system's single source of truth. No agent may introduce a color, size, or timing value outside this file.
|
|
45
|
-
|
|
46
|
-
**Path:** `src/styles/tokens.css` (or equivalent for your framework)
|
|
47
|
-
|
|
48
|
-
```css
|
|
49
|
-
/* Palette — name for intent, not appearance */
|
|
50
|
-
:root {
|
|
51
|
-
--color-ink: #1a1614; /* primary text */
|
|
52
|
-
--color-paper: #f5f0e8; /* page background */
|
|
53
|
-
--color-accent: #c8e630; /* the memorable one — use sparingly */
|
|
54
|
-
--color-muted: #9b9083; /* secondary text, labels */
|
|
55
|
-
--color-surface: #eae3d8; /* card backgrounds, elevated surfaces */
|
|
56
|
-
--color-border: rgba(26,22,20,.08);
|
|
57
|
-
|
|
58
|
-
/* Typography scale — fluid with clamp(), modular ratio 1.25 */
|
|
59
|
-
--text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.875rem);
|
|
60
|
-
--text-sm: clamp(0.875rem, 0.83rem + 0.22vw, 1rem);
|
|
61
|
-
--text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
|
|
62
|
-
--text-lg: clamp(1.25rem, 1.1rem + 0.75vw, 1.563rem);
|
|
63
|
-
--text-xl: clamp(1.563rem, 1.35rem + 1.06vw, 2rem);
|
|
64
|
-
--text-2xl: clamp(1.953rem, 1.6rem + 1.77vw, 2.75rem);
|
|
65
|
-
--text-hero: clamp(2.441rem, 1.8rem + 3.2vw, 4.5rem);
|
|
66
|
-
|
|
67
|
-
/* Font families */
|
|
68
|
-
--font-display: 'Playfair Display', 'Georgia', serif;
|
|
69
|
-
--font-body: 'Source Serif 4', 'Georgia', serif;
|
|
70
|
-
--font-mono: 'JetBrains Mono', 'Courier New', monospace;
|
|
71
|
-
|
|
72
|
-
/* Spacing — 4px base, geometric progression */
|
|
73
|
-
--space-1: 0.25rem; --space-2: 0.5rem;
|
|
74
|
-
--space-3: 0.75rem; --space-4: 1rem;
|
|
75
|
-
--space-6: 1.5rem; --space-8: 2rem;
|
|
76
|
-
--space-12: 3rem; --space-16: 4rem;
|
|
77
|
-
--space-24: 6rem; --space-32: 8rem;
|
|
78
|
-
|
|
79
|
-
/* Borders & radius */
|
|
80
|
-
--radius-sm: 4px; --radius-md: 8px; --radius-lg: 16px; --radius-full: 9999px;
|
|
81
|
-
--border-width: 1px; --border-width-thick: 2px;
|
|
82
|
-
|
|
83
|
-
/* Elevation */
|
|
84
|
-
--shadow-sm: 0 1px 4px rgba(26,22,20,.06);
|
|
85
|
-
--shadow-md: 0 4px 16px rgba(26,22,20,.08);
|
|
86
|
-
--shadow-lg: 0 12px 48px rgba(26,22,20,.12);
|
|
87
|
-
|
|
88
|
-
/* Motion — intentional easing, not browser defaults */
|
|
89
|
-
--ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
|
|
90
|
-
--ease-in-out-back: cubic-bezier(0.68, -0.6, 0.32, 1.6);
|
|
91
|
-
--duration-fast: 150ms;
|
|
92
|
-
--duration-normal: 300ms;
|
|
93
|
-
--duration-slow: 600ms;
|
|
94
|
-
|
|
95
|
-
/* Layout */
|
|
96
|
-
--container-sm: 640px;
|
|
97
|
-
--container-md: 768px;
|
|
98
|
-
--container-lg: 1024px;
|
|
99
|
-
--container-xl: 1280px;
|
|
100
|
-
--container-pad: var(--space-6);
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
> **Rule:** If a value isn't a token, it doesn't belong in a component stylesheet. Period.
|
|
105
|
-
|
|
106
|
-
### b. Shared Layout Component
|
|
107
|
-
|
|
108
|
-
Wraps every page. Provides the header, navigation, footer, and responsive container. Every page agent imports this — never creates its own.
|
|
109
|
-
|
|
110
|
-
**Path:** `src/components/Layout.tsx` (React) or `src/layouts/Layout.astro` (Astro)
|
|
111
|
-
|
|
112
|
-
```tsx
|
|
113
|
-
// Layout.tsx — simplified contract; foundation task provides the full implementation
|
|
114
|
-
interface LayoutProps {
|
|
115
|
-
title: string;
|
|
116
|
-
description?: string;
|
|
117
|
-
children: React.ReactNode;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export function Layout({ title, description, children }: LayoutProps) {
|
|
121
|
-
return (
|
|
122
|
-
<>
|
|
123
|
-
<Head title={title} description={description} />
|
|
124
|
-
<div className="site">
|
|
125
|
-
<SiteHeader /> {/* navigation — from tokens and style guide */}
|
|
126
|
-
<main className="site__main">{children}</main>
|
|
127
|
-
<SiteFooter />
|
|
128
|
-
</div>
|
|
129
|
-
</>
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
The layout must handle:
|
|
135
|
-
- Responsive container (`max-width: var(--container-xl)`, centered, padded)
|
|
136
|
-
- Site header with navigation (labels defined in style guide brief)
|
|
137
|
-
- Site footer
|
|
138
|
-
- Consistent page padding using spacing tokens
|
|
139
|
-
- Document head (meta tags, fonts, canonical URL)
|
|
140
|
-
|
|
141
|
-
### c. UI Component Library
|
|
142
|
-
|
|
143
|
-
Shared primitives that every page agent imports. Each component uses only design tokens — zero hardcoded values.
|
|
144
|
-
|
|
145
|
-
**Path:** `src/components/ui/`
|
|
38
|
+
A foundation task must produce four artifacts. All phase-2 tasks depend on its completion.
|
|
146
39
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
|
150
|
-
|
|
151
|
-
| `
|
|
152
|
-
|
|
|
153
|
-
| `Heading` | h1–h6 with token-based sizing | via `level` prop |
|
|
154
|
-
| `Text` | Body copy with consistent sizing | `sm`, `base`, `lg` |
|
|
155
|
-
| `Link` | Anchor with consistent hover treatment | `default`, `subtle` |
|
|
156
|
-
| `Section` | Vertical spacing wrapper | `sm`, `md`, `lg`, `xl` |
|
|
157
|
-
| `Container` | Responsive width constraint | `sm`, `md`, `lg`, `xl` |
|
|
158
|
-
| `Grid` | Consistent column layout | via `cols` prop |
|
|
159
|
-
|
|
160
|
-
Component API rules (defined once, followed by all):
|
|
161
|
-
- Props use camelCase
|
|
162
|
-
- Variant selection via `variant` prop (string union)
|
|
163
|
-
- Size selection via `size` prop (string union)
|
|
164
|
-
- All components accept `className` for one-off overrides
|
|
165
|
-
- No inline `style` props in library components
|
|
166
|
-
|
|
167
|
-
### d. Style Guide Brief
|
|
168
|
-
|
|
169
|
-
Defined inline in the foundation task prompt (not a separate file). Page task prompts must quote it verbatim.
|
|
170
|
-
|
|
171
|
-
Required fields:
|
|
172
|
-
- **Aesthetic direction:** 2–3 words (`warm editorial`, `cold brutalist`, `soft playful`)
|
|
173
|
-
- **Typography pairing:** display font + body font + mono (if used)
|
|
174
|
-
- **Content tone:** formal/casual, active/passive, sentence length preference
|
|
175
|
-
- **Navigation labels:** exact labels for every nav link (prevents terminology drift)
|
|
176
|
-
- **Page structure pattern:** the default sequence (e.g., `hero → intro → features → CTA → footer`)
|
|
177
|
-
- **Terminology glossary:** any project-specific terms that could be said multiple ways (pick one)
|
|
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 |
|
|
178
46
|
|
|
179
47
|
---
|
|
180
48
|
|
|
181
49
|
## Consistency Rules for Page Agents
|
|
182
50
|
|
|
183
|
-
Every agent
|
|
184
|
-
|
|
185
|
-
### Visual
|
|
186
|
-
- Import tokens from the tokens file. **Never introduce a new color value, font size, or spacing value.**
|
|
187
|
-
- If a value you need doesn't exist as a token, stop and flag it — don't invent an inline value and move on.
|
|
188
|
-
- Use CSS custom properties exclusively. No raw hex, no raw `px` values in stylesheets.
|
|
189
|
-
|
|
190
|
-
### Code
|
|
191
|
-
- Import `Layout` from the shared layout path. Do not create a page-local layout wrapper.
|
|
192
|
-
- Import `Button`, `Card`, `Heading`, etc. from the UI library path. Do not recreate them.
|
|
193
|
-
- Follow the naming conventions: PascalCase components, camelCase props, kebab-case CSS classes.
|
|
194
|
-
- Co-locate component files (component, styles, tests) — do not scatter across `pages/`, `styles/`, and `components/`.
|
|
51
|
+
Every page agent in a multi-agent convoy MUST follow all rules below.
|
|
195
52
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
- Every page uses the shared Layout component — no exceptions.
|
|
203
|
-
- Follow the page structure pattern from the style guide brief (`hero → content → CTA`, etc.).
|
|
204
|
-
- Navigation labels must match the style guide brief exactly — no paraphrasing.
|
|
205
|
-
- Responsive breakpoints come from the tokens file (`--container-sm/md/lg/xl`). Define no new breakpoints.
|
|
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. |
|
|
206
59
|
|
|
207
60
|
---
|
|
208
61
|
|
|
209
|
-
## Convoy Integration
|
|
62
|
+
## Convoy Integration
|
|
210
63
|
|
|
211
64
|
```
|
|
212
65
|
Phase 1: foundation-setup (1 task, blocks Phase 2)
|
|
213
66
|
├── Agent: UI-UX Expert or Developer
|
|
214
|
-
├── Creates: tokens.css, Layout
|
|
67
|
+
├── Creates: tokens.css, Layout, UI component library
|
|
215
68
|
├── Defines: style guide brief (aesthetic, tone, nav labels, terminology)
|
|
216
|
-
└── Output: all paths documented for Phase 2
|
|
69
|
+
└── Output: all paths documented for Phase 2 prompts
|
|
217
70
|
|
|
218
71
|
Phase 2: page-building (N tasks, all parallel)
|
|
219
|
-
├── home-page
|
|
220
|
-
|
|
221
|
-
├── projects-page
|
|
222
|
-
├── contact-page
|
|
223
|
-
└── [every task prompt contains the 5 mandatory references below]
|
|
72
|
+
├── home-page · about-page · projects-page · contact-page · ...
|
|
73
|
+
└── [every prompt contains the 5 mandatory references below]
|
|
224
74
|
```
|
|
225
75
|
|
|
226
76
|
### 5 Mandatory References in Every Page Task Prompt
|
|
227
77
|
|
|
228
78
|
```
|
|
229
|
-
1. Design tokens:
|
|
230
|
-
2. Layout:
|
|
231
|
-
3. UI components:
|
|
232
|
-
4. Aesthetic:
|
|
233
|
-
5. Content tone:
|
|
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]
|
|
234
84
|
```
|
|
235
85
|
|
|
236
|
-
These are **inputs** to the task, not suggestions.
|
|
237
|
-
|
|
238
86
|
---
|
|
239
87
|
|
|
240
88
|
## Prompt Template: Foundation Task
|
|
241
89
|
|
|
242
|
-
Copy and fill in. This prompt goes to a single agent before parallel work begins.
|
|
243
|
-
|
|
244
90
|
````markdown
|
|
245
|
-
## Foundation Setup
|
|
246
|
-
|
|
247
|
-
Create the design system foundation for [project description].
|
|
248
|
-
|
|
249
|
-
### Aesthetic Direction
|
|
250
|
-
[2-3 word aesthetic] — [one sentence: what this feels like and who it's for]
|
|
251
|
-
|
|
252
|
-
### Design Tokens
|
|
253
|
-
Create `[path]/tokens.css` with CSS custom properties for:
|
|
254
|
-
- Colors: name for intent (ink, paper, accent, muted, surface, border)
|
|
255
|
-
- Typography: [display font] + [body font], fluid clamp() scale (xs → hero)
|
|
256
|
-
- Spacing: 4px base, geometric progression (space-1 through space-32)
|
|
257
|
-
- Motion: custom easing curves + duration tokens (fast/normal/slow)
|
|
258
|
-
- Shadows (sm/md/lg), border radius (sm/md/lg/full), breakpoints (sm/md/lg/xl)
|
|
259
|
-
|
|
260
|
-
### Shared Layout
|
|
261
|
-
Create `[path]/Layout.[tsx|astro|vue]` with:
|
|
262
|
-
- Responsive container (max-width centered, padded with --container-pad)
|
|
263
|
-
- Site header with navigation: [list nav labels exactly]
|
|
264
|
-
- Site footer with [footer content]
|
|
265
|
-
- Document head (title, description, fonts)
|
|
266
|
-
|
|
267
|
-
### UI Component Library
|
|
268
|
-
Create these components in `[path]/ui/`:
|
|
269
|
-
Button (primary/secondary/ghost), Card (default/bordered/elevated),
|
|
270
|
-
Heading (h1–h6 via level prop), Text (sm/base/lg), Link,
|
|
271
|
-
Section (vertical spacer), Container (width constraint), Grid
|
|
272
|
-
|
|
273
|
-
Rules: all components use only token variables — zero hardcoded values.
|
|
274
|
-
Consistent prop API: variant, size, className on every component.
|
|
275
|
-
|
|
276
|
-
### Style Guide Brief
|
|
277
|
-
- Tone: [formal/casual, active/passive, sentence length]
|
|
278
|
-
- Terminology: [key terms — e.g., "projects" not "work", "clients" not "customers"]
|
|
279
|
-
- Page structure: [hero → intro → features → CTA]
|
|
280
|
-
|
|
281
|
-
### Acceptance Criteria
|
|
282
|
-
- [ ] All design values use CSS custom properties — zero hardcoded hex/px in components
|
|
283
|
-
- [ ] Layout renders correctly at 320px (mobile), 768px (tablet), 1280px (desktop)
|
|
284
|
-
- [ ] All UI components import tokens from the tokens file — no new values
|
|
285
|
-
- [ ] Typography uses clamp() for fluid sizing throughout
|
|
286
|
-
- [ ] Fonts are loaded efficiently (subset, display=swap)
|
|
287
|
-
- [ ] At least one distinctive design detail beyond generic defaults
|
|
288
|
-
````
|
|
91
|
+
## Foundation Setup — [project description]
|
|
289
92
|
|
|
290
|
-
|
|
93
|
+
**Aesthetic:** [2-3 word direction] — [one sentence]
|
|
291
94
|
|
|
292
|
-
|
|
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.
|
|
293
98
|
|
|
294
|
-
|
|
99
|
+
**Style Guide:** Tone: [formal/casual]. Terminology: [key terms]. Page structure: [hero → ... → CTA].
|
|
295
100
|
|
|
296
|
-
|
|
297
|
-
## Build [Page Name] Page
|
|
298
|
-
|
|
299
|
-
[One paragraph: page purpose, target audience, primary user action]
|
|
300
|
-
|
|
301
|
-
### Foundation References (MANDATORY — do not deviate)
|
|
302
|
-
- **Design tokens:** `[path]/tokens.css` — use ONLY these variables. No new color/font/spacing values.
|
|
303
|
-
- **Layout component:** `[path]/Layout.[tsx|astro|vue]` — wrap all page content in this.
|
|
304
|
-
- **UI components:** `[path]/ui/` — use Button, Card, Heading, Section, Container. Do not recreate them.
|
|
305
|
-
- **Aesthetic:** [2-3 word direction]
|
|
306
|
-
- **Tone:** [tone from style guide brief]
|
|
307
|
-
- **Terminology:** [key terms from style guide brief]
|
|
308
|
-
|
|
309
|
-
### Page Content
|
|
310
|
-
[Specific sections, copy direction, media requirements]
|
|
311
|
-
|
|
312
|
-
### Page Structure
|
|
313
|
-
Follow the established pattern: [hero → intro → features → CTA] (from foundation brief)
|
|
314
|
-
|
|
315
|
-
### Acceptance Criteria
|
|
316
|
-
- [ ] Page uses the shared Layout component
|
|
317
|
-
- [ ] All styling uses design tokens — zero hardcoded values
|
|
318
|
-
- [ ] Shared UI components imported and used (not recreated)
|
|
319
|
-
- [ ] Content tone and terminology match the style guide brief
|
|
320
|
-
- [ ] Responsive at 320px, 768px, 1280px
|
|
321
|
-
- [ ] [page-specific criteria]
|
|
101
|
+
**Acceptance Criteria:** Zero hardcoded hex/px · Layout responsive at 320/768/1280px · Fluid typography via clamp() · Fonts loaded efficiently
|
|
322
102
|
````
|
|
323
103
|
|
|
324
104
|
---
|
|
325
105
|
|
|
326
|
-
##
|
|
106
|
+
## Prompt Template: Page Task
|
|
107
|
+
|
|
108
|
+
````markdown
|
|
109
|
+
## Build [Page Name] Page — [purpose, audience, primary action]
|
|
327
110
|
|
|
328
|
-
|
|
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]
|
|
329
112
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
| Copy-pasting `Button` between pages | API drift, visual divergence | Import from shared library |
|
|
335
|
-
| Inline `style={{ color: '#3b4f' }}` | Bypasses the token contract entirely | CSS class with token variable |
|
|
336
|
-
| Skipping foundation "for a simple site" | Still inconsistent — just smaller | Foundation takes 1 task, saves N fixes |
|
|
337
|
-
| Different terminology per page | Confuses users ("projects" vs "portfolio") | Terminology glossary in style guide brief |
|
|
338
|
-
| Foundation and page tasks run in parallel | Page tasks start before artifacts exist | Foundation phase must fully complete first |
|
|
113
|
+
**Content:** [sections, copy direction, media] **Structure:** [hero → ... → CTA]
|
|
114
|
+
|
|
115
|
+
**Acceptance Criteria:** Shared Layout used · Zero hardcoded values · UI components imported · Tone/terminology match · Responsive 320/768/1280px · [page-specific]
|
|
116
|
+
````
|
|
339
117
|
|
|
340
118
|
---
|
|
341
119
|
|
|
342
|
-
##
|
|
120
|
+
## Anti-Patterns
|
|
343
121
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
-
|
|
348
|
-
|
|
122
|
+
| Anti-pattern | Fix |
|
|
123
|
+
|-------------|-----|
|
|
124
|
+
| Agents pick their own fonts/colors | Foundation creates tokens first |
|
|
125
|
+
| Page-local `styles/global.css` | One shared tokens file, imported once |
|
|
126
|
+
| Copy-pasting `Button` between pages | Import from shared library |
|
|
127
|
+
| 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
|
+
| Foundation and page tasks run in parallel | Foundation phase must fully complete first |
|
|
349
131
|
|
|
350
|
-
The **decomposition** skill should reference this skill in multi-page task plans. The **generate-convoy** prompt template should embed the foundation-first pattern.
|
|
@@ -3,117 +3,69 @@ name: react-development
|
|
|
3
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."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
7
|
-
|
|
8
6
|
# React Development Standards
|
|
9
7
|
|
|
10
|
-
Modern React patterns
|
|
11
|
-
|
|
12
|
-
## Architecture
|
|
13
|
-
|
|
14
|
-
- Functional components with hooks as primary pattern.
|
|
15
|
-
- Component composition over inheritance.
|
|
16
|
-
- Organize by feature/domain, not by type.
|
|
17
|
-
- Separate presentational and container components.
|
|
18
|
-
- Custom hooks for reusable stateful logic.
|
|
8
|
+
Modern React patterns — https://react.dev.
|
|
19
9
|
|
|
20
|
-
##
|
|
10
|
+
## Architecture & Components
|
|
21
11
|
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
- Leverage built-in types (`React.FC`, `React.ComponentProps`, etc.).
|
|
27
|
-
- Union types for component variants and states.
|
|
28
|
-
- Shared types in `interfaces/` folder of appropriate project.
|
|
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.
|
|
29
16
|
|
|
30
|
-
##
|
|
17
|
+
## TypeScript
|
|
31
18
|
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
- Use `<>...</>` or `React.Fragment` to avoid extra DOM nodes.
|
|
37
|
-
- Never mutate props or state directly.
|
|
38
|
-
- Destructure props in function signature.
|
|
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/`.
|
|
39
23
|
|
|
40
|
-
## State
|
|
24
|
+
## State & Hooks
|
|
41
25
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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` |
|
|
46
34
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- `useEffect` with proper dependency arrays.
|
|
50
|
-
- Cleanup functions in effects to prevent memory leaks.
|
|
51
|
-
- `useMemo`/`useCallback` for performance optimization when needed.
|
|
52
|
-
- Custom hooks for reusable logic.
|
|
53
|
-
- Rules of hooks: only call at top level.
|
|
54
|
-
- `useRef` for DOM access and mutable values.
|
|
35
|
+
- `useEffect`: proper deps, cleanup to prevent leaks.
|
|
36
|
+
- Hooks only at top level; extract reusable logic to custom hooks.
|
|
55
37
|
|
|
56
38
|
## Styling
|
|
57
39
|
|
|
58
|
-
- **CSS Modules**
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
- Responsive design with mobile-first approach.
|
|
62
|
-
- CSS custom properties for theming.
|
|
63
|
-
- Consistent spacing, typography, color systems.
|
|
64
|
-
- Sass variables and mixins from shared libraries.
|
|
65
|
-
- Co-locate styles with components.
|
|
40
|
+
- **CSS Modules** (`.module.scss`) co-located with components.
|
|
41
|
+
- Sass for advanced features; variables/mixins from shared libraries.
|
|
42
|
+
- Mobile-first responsive; CSS custom properties for theming.
|
|
66
43
|
|
|
67
44
|
## Performance
|
|
68
45
|
|
|
69
|
-
- Stable `key` props
|
|
70
|
-
- `React.
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
- Virtual scrolling for large lists.
|
|
74
|
-
- Profile with React DevTools.
|
|
75
|
-
- Avoid anonymous functions in render.
|
|
76
|
-
- `ErrorBoundary` for graceful error handling.
|
|
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.
|
|
77
50
|
|
|
78
51
|
## Data Fetching
|
|
79
52
|
|
|
80
|
-
- Libraries: React Query, SWR, Apollo Client.
|
|
81
|
-
-
|
|
82
|
-
- Handle race conditions and request cancellation.
|
|
83
|
-
- Optimistic updates.
|
|
84
|
-
- Caching strategies.
|
|
85
|
-
- Offline/network error handling.
|
|
86
|
-
|
|
87
|
-
## Error Handling
|
|
88
|
-
|
|
89
|
-
- Error Boundaries for component-level errors.
|
|
90
|
-
- Proper error states in data fetching.
|
|
91
|
-
- Fallback UI for error scenarios.
|
|
92
|
-
- Meaningful error messages to users.
|
|
53
|
+
- Libraries: React Query, SWR, or Apollo Client.
|
|
54
|
+
- Always handle loading/error/success; cancel on unmount; optimistic updates.
|
|
93
55
|
|
|
94
56
|
## Forms
|
|
95
57
|
|
|
96
|
-
- Controlled components.
|
|
97
|
-
-
|
|
98
|
-
- Form submission and error states.
|
|
99
|
-
- Accessibility: labels, ARIA attributes.
|
|
100
|
-
- Debounced validation.
|
|
58
|
+
- Controlled components; React Hook Form + Zod for validation.
|
|
59
|
+
- Accessibility: labels, ARIA attributes; debounced validation.
|
|
101
60
|
|
|
102
61
|
## Testing
|
|
103
62
|
|
|
104
|
-
- React Testing Library
|
|
105
|
-
-
|
|
106
|
-
- Mock external dependencies and API calls.
|
|
63
|
+
- React Testing Library (behavior, not implementation); Jest runner.
|
|
64
|
+
- Co-locate tests in `__tests__`; mock external deps and API calls.
|
|
107
65
|
- Test accessibility and keyboard navigation.
|
|
108
|
-
-
|
|
109
|
-
- **CRITICAL**: Never mix static imports and `require()` for lazy-loaded libraries in tests.
|
|
110
|
-
- Use `jest.requireMock()` instead of `require()` in test functions.
|
|
111
|
-
- Use `jest.requireActual()` or equivalent in mock setup.
|
|
66
|
+
- **CRITICAL**: Never mix static imports and `require()` for lazy-loaded libs in tests — use `jest.requireMock()` / `jest.requireActual()`.
|
|
112
67
|
|
|
113
68
|
## Security
|
|
114
69
|
|
|
115
|
-
- Sanitize
|
|
116
|
-
-
|
|
117
|
-
- HTTPS for external APIs.
|
|
118
|
-
- Avoid storing sensitive data in localStorage/sessionStorage.
|
|
119
|
-
- CSP headers.
|
|
70
|
+
- Sanitize inputs (XSS); validate/escape before rendering.
|
|
71
|
+
- HTTPS for external APIs; no sensitive data in localStorage/sessionStorage; CSP headers.
|