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.
- package/LICENSE +21 -93
- package/README.md +5 -3
- package/package.json +2 -2
- package/src/dashboard/dist/data/convoys/demo-api-v2.json +3 -3
- package/src/dashboard/dist/data/convoys/demo-auth-revamp.json +4 -4
- package/src/dashboard/dist/data/convoys/demo-dashboard-ui.json +12 -12
- package/src/dashboard/dist/data/convoys/demo-data-pipeline.json +3 -3
- package/src/dashboard/dist/data/convoys/demo-deploy-ci.json +1 -1
- package/src/dashboard/dist/data/convoys/demo-docs-update.json +7 -7
- package/src/dashboard/dist/data/convoys/demo-perf-opt.json +4 -4
- package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
- package/src/dashboard/public/data/convoys/demo-api-v2.json +3 -3
- package/src/dashboard/public/data/convoys/demo-auth-revamp.json +4 -4
- package/src/dashboard/public/data/convoys/demo-dashboard-ui.json +12 -12
- package/src/dashboard/public/data/convoys/demo-data-pipeline.json +3 -3
- package/src/dashboard/public/data/convoys/demo-deploy-ci.json +1 -1
- package/src/dashboard/public/data/convoys/demo-docs-update.json +7 -7
- package/src/dashboard/public/data/convoys/demo-perf-opt.json +4 -4
- package/src/orchestrator/customizations/stack/sanity-config.md +43 -0
- package/src/orchestrator/customizations/stack/supabase-config.md +53 -0
- package/src/orchestrator/plugins/astro/REFERENCE.md +5 -0
- package/src/orchestrator/plugins/astro/SKILL.md +22 -29
- package/src/orchestrator/plugins/chrome-devtools/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/chrome-devtools/SKILL.md +10 -55
- package/src/orchestrator/plugins/contentful/REFERENCE.md +16 -0
- package/src/orchestrator/plugins/contentful/SKILL.md +69 -29
- package/src/orchestrator/plugins/convex/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/convex/SKILL.md +13 -1
- package/src/orchestrator/plugins/cypress/REFERENCE.md +5 -0
- package/src/orchestrator/plugins/cypress/SKILL.md +29 -93
- package/src/orchestrator/plugins/figma/REFERENCE.md +18 -0
- package/src/orchestrator/plugins/figma/SKILL.md +41 -66
- package/src/orchestrator/plugins/jira/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/jira/SKILL.md +26 -114
- package/src/orchestrator/plugins/linear/SKILL.md +42 -109
- package/src/orchestrator/plugins/netlify/REFERENCE.md +33 -0
- package/src/orchestrator/plugins/netlify/SKILL.md +34 -64
- package/src/orchestrator/plugins/nextjs/REFERENCE.md +73 -0
- package/src/orchestrator/plugins/nextjs/SKILL.md +49 -138
- package/src/orchestrator/plugins/notion/SKILL.md +26 -168
- package/src/orchestrator/plugins/notion/TEMPLATES.md +88 -0
- package/src/orchestrator/plugins/nx/REFERENCE.md +10 -0
- package/src/orchestrator/plugins/nx/SKILL.md +12 -12
- package/src/orchestrator/plugins/playwright/REFERENCE.md +12 -0
- package/src/orchestrator/plugins/playwright/SKILL.md +33 -98
- package/src/orchestrator/plugins/prisma/REFERENCE.md +42 -0
- package/src/orchestrator/plugins/prisma/SKILL.md +18 -68
- package/src/orchestrator/plugins/resend/REFERENCE.md +61 -0
- package/src/orchestrator/plugins/resend/SKILL.md +23 -137
- package/src/orchestrator/plugins/sanity/SKILL.md +50 -3
- package/src/orchestrator/plugins/slack/REFERENCE.md +24 -0
- package/src/orchestrator/plugins/slack/SKILL.md +36 -111
- package/src/orchestrator/plugins/strapi/REFERENCE.md +35 -0
- package/src/orchestrator/plugins/strapi/SKILL.md +60 -24
- package/src/orchestrator/plugins/supabase/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/supabase/SKILL.md +44 -16
- package/src/orchestrator/plugins/teams/REFERENCE.md +36 -0
- package/src/orchestrator/plugins/teams/SKILL.md +35 -85
- package/src/orchestrator/plugins/trello/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/trello/SKILL.md +25 -97
- package/src/orchestrator/plugins/turborepo/REFERENCE.md +9 -0
- package/src/orchestrator/plugins/turborepo/SKILL.md +13 -1
- package/src/orchestrator/plugins/vercel/SKILL.md +45 -52
- package/src/orchestrator/plugins/vitest/SKILL.md +10 -14
- package/src/orchestrator/prompts/create-skill.prompt.md +62 -20
- package/src/orchestrator/prompts/generate-convoy.prompt.md +6 -0
- package/src/orchestrator/prompts/generate-prd.prompt.md +4 -0
- package/src/orchestrator/skills/accessibility-standards/REFERENCE.md +34 -0
- package/src/orchestrator/skills/accessibility-standards/SKILL.md +6 -3
- package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +48 -0
- package/src/orchestrator/skills/agent-hooks/SKILL.md +41 -65
- package/src/orchestrator/skills/agent-memory/KNOWLEDGE-GRAPH.md +49 -0
- package/src/orchestrator/skills/agent-memory/SKILL.md +30 -67
- package/src/orchestrator/skills/api-patterns/SKILL.md +29 -1
- package/src/orchestrator/skills/backbone-scaffolding/EXAMPLES.md +16 -0
- package/src/orchestrator/skills/backbone-scaffolding/SKILL.md +99 -0
- package/src/orchestrator/skills/code-commenting/SKILL.md +1 -1
- package/src/orchestrator/skills/context-map/REFERENCE.md +70 -0
- package/src/orchestrator/skills/context-map/SKILL.md +28 -55
- package/src/orchestrator/skills/data-engineering/REFERENCE.md +55 -0
- package/src/orchestrator/skills/data-engineering/SKILL.md +40 -34
- package/src/orchestrator/skills/decomposition/REFERENCE.md +28 -0
- package/src/orchestrator/skills/decomposition/SKILL.md +15 -30
- package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +31 -65
- package/src/orchestrator/skills/documentation-standards/SKILL.md +31 -50
- package/src/orchestrator/skills/documentation-standards/WRITING-GUIDE.md +39 -0
- package/src/orchestrator/skills/fast-review/REFERENCE.md +30 -0
- package/src/orchestrator/skills/fast-review/SKILL.md +11 -31
- package/src/orchestrator/skills/frontend-design/COMPONENTS.md +113 -0
- package/src/orchestrator/skills/frontend-design/REFERENCE.md +36 -0
- package/src/orchestrator/skills/frontend-design/SKILL.md +36 -85
- package/src/orchestrator/skills/git-workflow/SKILL.md +13 -2
- package/src/orchestrator/skills/memory-merger/REFERENCE.md +20 -0
- package/src/orchestrator/skills/memory-merger/SKILL.md +29 -38
- package/src/orchestrator/skills/observability-logging/SKILL.md +5 -12
- package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +42 -0
- package/src/orchestrator/skills/orchestration-protocols/SKILL.md +54 -41
- package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +55 -0
- package/src/orchestrator/skills/panel-majority-vote/SKILL.md +30 -75
- package/src/orchestrator/skills/performance-optimization/SKILL.md +41 -1
- package/src/orchestrator/skills/project-consistency/SKILL.md +50 -89
- package/src/orchestrator/skills/project-consistency/TEMPLATES.md +39 -0
- package/src/orchestrator/skills/react-development/REFERENCE.md +7 -0
- package/src/orchestrator/skills/react-development/SKILL.md +50 -42
- package/src/orchestrator/skills/security-hardening/SKILL.md +88 -1
- package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +36 -0
- package/src/orchestrator/skills/self-improvement/SKILL.md +19 -25
- package/src/orchestrator/skills/seo-patterns/REFERENCE.md +54 -0
- package/src/orchestrator/skills/seo-patterns/SKILL.md +20 -88
- package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +58 -0
- package/src/orchestrator/skills/session-checkpoints/SKILL.md +34 -58
- package/src/orchestrator/skills/team-lead-reference/SKILL.md +37 -30
- package/src/orchestrator/skills/testing-workflow/SKILL.md +55 -2
- package/src/orchestrator/skills/validation-gates/REFERENCE.md +50 -0
- package/src/orchestrator/skills/validation-gates/SKILL.md +39 -35
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: context-map
|
|
3
|
-
description: "
|
|
3
|
+
description: "Maps file dependencies, flags shared imports, and groups files for safe parallel editing before code changes. Use when planning a refactoring, analyzing change impact, or understanding which files a modification will affect."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Skill: Context Map
|
|
@@ -22,72 +22,45 @@ Generate a **file impact map** before code changes to identify affected files, r
|
|
|
22
22
|
Identify files that MUST change from the task description.
|
|
23
23
|
|
|
24
24
|
### 2 — Trace Outward (dependents)
|
|
25
|
-
|
|
25
|
+
Find consumers of entry-point exports:
|
|
26
|
+
```
|
|
27
|
+
grep_search("import.*from.*places", isRegexp=true) # find importers
|
|
28
|
+
vscode_listCodeUsages("PlaceCard") # find component consumers
|
|
29
|
+
grep_search("places.*route|/places", isRegexp=true) # find route references
|
|
30
|
+
```
|
|
26
31
|
|
|
27
32
|
### 3 — Trace Inward (sources)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
## Context Map: [Task Name]
|
|
33
|
-
|
|
34
|
-
### Entry Points (MUST change)
|
|
35
|
-
| File | Reason | Owner |
|
|
36
|
-
|------|--------|-------|
|
|
37
|
-
| `libs/queries/src/lib/places.ts` | Add query field | Content Engineer |
|
|
38
|
-
| `libs/ui-kit/.../PlaceCard/` | Display new field | UI/UX Expert |
|
|
39
|
-
|
|
40
|
-
### Cascade Effects (WILL change)
|
|
41
|
-
| File | Triggered By | Reason | Owner |
|
|
42
|
-
|------|-------------|--------|-------|
|
|
43
|
-
| `apps/web-app/places/page.tsx` | PlaceCard | Update props | Frontend Dev |
|
|
44
|
-
| `libs/queries/src/lib/__tests__/places.test.ts` | Query | Update test | Testing Expert |
|
|
45
|
-
|
|
46
|
-
### Shared Boundaries (WATCH)
|
|
47
|
-
| File | Risk | Mitigation |
|
|
48
|
-
|------|------|------------|
|
|
49
|
-
| `libs/ui-kit/src/lib/index.ts` | Barrel export conflict | Merge sequentially |
|
|
50
|
-
|
|
51
|
-
### Unaffected
|
|
52
|
-
| Area | Why |
|
|
53
|
-
|------|-----|
|
|
54
|
-
| `db/migrations/` | No DB changes |
|
|
55
|
-
| `libs/auth/` | No auth changes |
|
|
33
|
+
Find what entry points depend on:
|
|
34
|
+
```
|
|
35
|
+
grep_search("from.*libs/", includePattern="src/places/**") # shared lib deps
|
|
36
|
+
grep_search("from.*config", includePattern="src/places/**") # config deps
|
|
56
37
|
```
|
|
57
38
|
|
|
58
|
-
###
|
|
59
|
-
|
|
60
|
-
Assign ownership — no file in two partitions; shared boundaries to one agent (merged first); test files to Testing Expert unless tightly coupled.
|
|
39
|
+
### 4 — Build the Map
|
|
61
40
|
|
|
62
|
-
|
|
63
|
-
Agent A: libs/queries/src/lib/places.ts
|
|
64
|
-
Agent B: libs/ui-kit/.../PlaceCard/
|
|
65
|
-
Agent C: apps/web-app/places/, apps/admin-panel/places/
|
|
66
|
-
Agent D: **/*test*, **/*spec*
|
|
67
|
-
```
|
|
41
|
+
Produce a compact Context Map for the Team Lead and downstream agents. Example minimal map (inline):
|
|
68
42
|
|
|
69
|
-
|
|
43
|
+
```markdown
|
|
44
|
+
Context Map — Feature: Add priceRange
|
|
70
45
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
| Medium | 4–8 | Entry + 1-hop cascade |
|
|
75
|
-
| Large | 9+ | Full dependency graph |
|
|
46
|
+
- Entry points:
|
|
47
|
+
- src/lib/place/schema.ts
|
|
48
|
+
- src/components/PriceRangeFilter/PriceRangeFilter.tsx
|
|
76
49
|
|
|
77
|
-
|
|
50
|
+
- Dependents (trace outward):
|
|
51
|
+
- src/pages/places/page.tsx
|
|
52
|
+
- src/components/PlacesList/PlaceCard.tsx
|
|
78
53
|
|
|
79
|
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
- **QA Gate** — compare actual changes against map to detect scope creep
|
|
54
|
+
- Sources (trace inward):
|
|
55
|
+
- src/lib/filters.ts
|
|
56
|
+
- src/shared/types/place.ts
|
|
83
57
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
## Your File Partition
|
|
87
|
-
Modify only: `libs/queries/src/lib/places.ts`, `libs/queries/src/lib/__tests__/places.test.ts`
|
|
88
|
-
Do NOT modify: `libs/ui-kit/` (UI/UX Expert), `apps/` (Developer)
|
|
58
|
+
- Unaffected (optional):
|
|
59
|
+
- src/components/Account/**
|
|
89
60
|
```
|
|
90
61
|
|
|
62
|
+
Validation checkpoint: run `grep_search` and `vscode_listCodeUsages` results into the map and confirm all listed files open without errors (CI: `pnpm typecheck`). For full template and Team Lead integration snippets see REFERENCE.md in this directory.
|
|
63
|
+
|
|
91
64
|
## Anti-Patterns
|
|
92
65
|
|
|
93
66
|
- Skipping for "obvious" tasks — shared libs cascade unexpectedly
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
> Parent: [SKILL.md](./SKILL.md)
|
|
2
|
+
|
|
3
|
+
## Data Engineering Reference
|
|
4
|
+
|
|
5
|
+
This file contains detailed code examples and schemas migrated from the skill doc.
|
|
6
|
+
|
|
7
|
+
### Minimal Scraper: `scrape-to-ndjson.js` (Playwright)
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
const { chromium } = require('playwright');
|
|
12
|
+
const out = process.argv[2] || 'data.ndjson';
|
|
13
|
+
(async () => {
|
|
14
|
+
const browser = await chromium.launch();
|
|
15
|
+
const page = await browser.newPage();
|
|
16
|
+
const fh = fs.createWriteStream(out, { flags: 'w' });
|
|
17
|
+
await page.goto('https://example.com/list');
|
|
18
|
+
const items = await page.$$eval('.item', (nodes) => nodes.map(n => ({
|
|
19
|
+
name: n.querySelector('.title')?.textContent?.trim(),
|
|
20
|
+
source: 'example',
|
|
21
|
+
sourceId: n.getAttribute('data-id')
|
|
22
|
+
})));
|
|
23
|
+
for (const it of items) fh.write(JSON.stringify(it) + '\n');
|
|
24
|
+
fh.end();
|
|
25
|
+
await browser.close();
|
|
26
|
+
})();
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### NDJSON Validator: `validate-ndjson.js` (Node)
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
const fs = require('fs');
|
|
33
|
+
const readline = require('readline');
|
|
34
|
+
const { z } = require('zod');
|
|
35
|
+
const schema = z.object({ name: z.string(), source: z.string(), sourceId: z.string() });
|
|
36
|
+
const path = process.argv[2];
|
|
37
|
+
if (!path) throw new Error('Usage: node validate-ndjson.js <file.ndjson>');
|
|
38
|
+
const rl = readline.createInterface({ input: fs.createReadStream(path), crlfDelay: Infinity });
|
|
39
|
+
let line = 0; let errors = 0;
|
|
40
|
+
(async () => {
|
|
41
|
+
for await (const l of rl) {
|
|
42
|
+
line++;
|
|
43
|
+
try { const obj = JSON.parse(l); schema.parse(obj); }
|
|
44
|
+
catch (e) { console.error('Line', line, e.message); errors++; }
|
|
45
|
+
}
|
|
46
|
+
if (errors) { console.error(errors, 'validation errors'); process.exit(2); }
|
|
47
|
+
console.log('OK');
|
|
48
|
+
})();
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### NDJSON Schema
|
|
52
|
+
|
|
53
|
+
For project-specific schemas, add JSON Schema files here.
|
|
54
|
+
|
|
55
|
+
Last Updated: 2026-03-31
|
|
@@ -1,36 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: data-engineering
|
|
3
|
-
description: "
|
|
3
|
+
description: "Transforms, validates, and loads data in ETL pipelines. Use when building scrapers, validating NDJSON feeds, or importing data into CMS/DB targets."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Data Engineering
|
|
7
7
|
|
|
8
|
-
Generic pipeline patterns. For project-specific sources
|
|
8
|
+
Generic pipeline patterns. For project-specific sources and full schema references see [REFERENCE.md](./REFERENCE.md).
|
|
9
9
|
|
|
10
10
|
## Scraper Architecture
|
|
11
11
|
|
|
12
|
-
```typescript
|
|
13
|
-
interface ScraperConfig {
|
|
14
|
-
source: string; query: string; maxPages: number; concurrency: number;
|
|
15
|
-
delay: { min: number; max: number }; outputPath: string; headless: boolean;
|
|
16
|
-
}
|
|
17
|
-
abstract class BaseScraper {
|
|
18
|
-
abstract scrape(config: ScraperConfig): Promise<void>;
|
|
19
|
-
abstract extractVenue(page: Page): Promise<RawVenue>;
|
|
20
|
-
abstract getNextPage(page: Page): Promise<string | null>;
|
|
21
|
-
}
|
|
22
|
-
```
|
|
23
|
-
|
|
24
12
|
Launch a headless browser cluster (Puppeteer Cluster / Playwright) with `retryLimit: 3`, `retryDelay: 5000`, `timeout: 30000`, `args: ['--no-sandbox', '--disable-setuid-sandbox']`.
|
|
25
13
|
|
|
26
|
-
**Anti-detection:** rotate user-agents; random 2–5 s delays; randomize viewport; block images/fonts/CSS; use stealth plugin.
|
|
27
|
-
|
|
28
|
-
**Error recovery:** exponential backoff (3 retries); log failed URLs; save partial results; checkpoint/resume for long runs.
|
|
29
|
-
|
|
30
14
|
## NDJSON Output
|
|
31
15
|
|
|
32
|
-
One record per line
|
|
33
|
-
|
|
16
|
+
One record per line. Schema:
|
|
34
17
|
| Field | Type | Notes |
|
|
35
18
|
|-------|------|-------|
|
|
36
19
|
| `name` | Required | Preserve original encoding |
|
|
@@ -41,17 +24,40 @@ One record per line: `{"name":"…","lat":50.0755,"lng":14.4378,"source":"google
|
|
|
41
24
|
| `category` | Required | Domain category |
|
|
42
25
|
| `rating`, `reviewCount`, `phone`, `website`, `openingHours`, `photos`, `priceLevel` | Optional | — |
|
|
43
26
|
|
|
44
|
-
##
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
27
|
+
## Recommended Workflow (numbered, with validation)
|
|
28
|
+
|
|
29
|
+
1. Scrape: run scraper in `--dry-run` to collect a sample (50–200 records).
|
|
30
|
+
- Checkpoint: sample contains expected fields and geo data.
|
|
31
|
+
- Recovery: fix extractor selectors, re-run sample.
|
|
32
|
+
2. Validate NDJSON: run line-by-line JSON parse + schema validator (see `validate-ndjson.js` example).
|
|
33
|
+
- Checkpoint: 0 parse errors, required fields present.
|
|
34
|
+
- Recovery: run `ndjson-filter` to isolate failing records and inspect source HTML.
|
|
35
|
+
3. Dry-run import: import into staging with `createOrReplace` disabled; check counts and duplicates.
|
|
36
|
+
- Checkpoint: counts match expectation ±5% and no duplicates inserted.
|
|
37
|
+
- Recovery: revert staging and adjust dedupe key.
|
|
38
|
+
4. Backup: snapshot current target (DB export) and store with timestamp.
|
|
39
|
+
5. Import: run import with idempotent keys and monitor logs; on failure revert to backup.
|
|
40
|
+
|
|
41
|
+
## Quick executable pipeline (copy & adapt)
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
node ./scripts/scrape-to-ndjson.js --out=data.ndjson --pages=100
|
|
45
|
+
node ./scripts/validate-ndjson.js data.ndjson
|
|
46
|
+
node ./scripts/dry-import.js data.ndjson --target=staging
|
|
47
|
+
node ./scripts/import.js data.ndjson --target=production
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Inline: minimal NDJSON validator
|
|
51
|
+
|
|
52
|
+
```js
|
|
53
|
+
const fs = require('fs'), rl = require('readline'), { z } = require('zod');
|
|
54
|
+
const schema = z.object({ name: z.string(), source: z.string(), sourceId: z.string() });
|
|
55
|
+
const iface = rl.createInterface({ input: fs.createReadStream(process.argv[2]) });
|
|
56
|
+
let line = 0, errors = 0;
|
|
57
|
+
for await (const l of iface) { line++; try { schema.parse(JSON.parse(l)); } catch(e) { console.error(`Line ${line}:`, e.message); errors++; } }
|
|
58
|
+
if (errors) { console.error(`${errors} errors`); process.exit(2); }
|
|
59
|
+
console.log('OK');
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Full scraper and extended validator: see [REFERENCE.md](./REFERENCE.md).
|
|
63
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
> Parent: [SKILL.md](./SKILL.md)
|
|
2
|
+
|
|
3
|
+
# Delegation Spec — Full Template
|
|
4
|
+
|
|
5
|
+
## Delegation Spec: [Task Title]
|
|
6
|
+
**Tracker Issue:** TAS-XX — [Title]
|
|
7
|
+
**Complexity:** [score]/13 → [tier] tier
|
|
8
|
+
**Agent:** [Agent Name]
|
|
9
|
+
|
|
10
|
+
### Objective
|
|
11
|
+
1-3 sentences: what to build/change and why.
|
|
12
|
+
|
|
13
|
+
### Context
|
|
14
|
+
- Key files: [list]
|
|
15
|
+
- Related patterns: [file:line references]
|
|
16
|
+
- Prior phase output: [compacted summary if applicable]
|
|
17
|
+
- Relevant lessons: [LES-XXX from LESSONS-LEARNED.md]
|
|
18
|
+
|
|
19
|
+
### Constraints
|
|
20
|
+
- File partition: Only modify files under [paths]
|
|
21
|
+
- Do NOT modify: [explicit exclusions]
|
|
22
|
+
- Dependencies: Requires [TAS-XX] Done first
|
|
23
|
+
|
|
24
|
+
### Acceptance Criteria
|
|
25
|
+
- [ ] Criterion 1
|
|
26
|
+
|
|
27
|
+
### Expected Output
|
|
28
|
+
Files changed · Verification (lint/test/build) · AC status (✅/❌) · Discovered issues · Lessons applied
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: decomposition
|
|
3
|
-
description: "
|
|
3
|
+
description: "Resolves task dependencies, generates machine-actionable delegation specs, and structures phased subtask plans for multi-agent work. Use when writing delegation specs, resolving task dependencies, building phased subtask plans for multi-agent work, assigning work to sub-agents, or partitioning a feature into parallelizable phases."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Task Decomposition
|
|
7
7
|
|
|
8
|
-
Load at: Decompose & Partition phase (Step 2) or when writing delegation prompts (Step 3).
|
|
9
8
|
|
|
10
9
|
## Dependency Resolution
|
|
11
10
|
|
|
@@ -22,36 +21,20 @@ D → B Phase 2: C, D (parallel)
|
|
|
22
21
|
F → C, D Phase 3: E, F (parallel)
|
|
23
22
|
```
|
|
24
23
|
|
|
25
|
-
## Delegation Spec
|
|
24
|
+
## Delegation Spec
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
| Field | Content |
|
|
27
|
+
|-------|---------|
|
|
28
|
+
| Tracker | TAS-XX — Title |
|
|
29
|
+
| Complexity | [score]/13 → [tier] |
|
|
30
|
+
| Agent | Agent Name |
|
|
31
|
+
| Objective | 1-3 sentences: what to build/change and why |
|
|
32
|
+
| Context | Key files, related patterns, prior phase output, relevant lessons |
|
|
33
|
+
| Constraints | File partition, explicit exclusions, phase dependencies |
|
|
34
|
+
| Acceptance Criteria | `[ ]` checklist |
|
|
35
|
+
| Expected Output | Files changed · Verification · AC status · Discovered issues |
|
|
28
36
|
|
|
29
|
-
|
|
30
|
-
## Delegation Spec: [Task Title]
|
|
31
|
-
**Tracker Issue:** TAS-XX — [Title]
|
|
32
|
-
**Complexity:** [score]/13 → [tier] tier
|
|
33
|
-
**Agent:** [Agent Name]
|
|
34
|
-
|
|
35
|
-
### Objective
|
|
36
|
-
1-3 sentences: what to build/change and why.
|
|
37
|
-
|
|
38
|
-
### Context
|
|
39
|
-
- Key files: [list]
|
|
40
|
-
- Related patterns: [file:line references]
|
|
41
|
-
- Prior phase output: [compacted summary if applicable]
|
|
42
|
-
- Relevant lessons: [LES-XXX from LESSONS-LEARNED.md]
|
|
43
|
-
|
|
44
|
-
### Constraints
|
|
45
|
-
- File partition: Only modify files under [paths]
|
|
46
|
-
- Do NOT modify: [explicit exclusions]
|
|
47
|
-
- Dependencies: Requires [TAS-XX] Done first
|
|
48
|
-
|
|
49
|
-
### Acceptance Criteria
|
|
50
|
-
- [ ] Criterion 1
|
|
51
|
-
|
|
52
|
-
### Expected Output
|
|
53
|
-
Files changed · Verification (lint/test/build) · AC status (✅/❌) · Discovered issues · Lessons applied
|
|
54
|
-
```
|
|
37
|
+
For score 1-3, objective + files + criteria is sufficient. See `REFERENCE.md` for the full delegation spec template.
|
|
55
38
|
|
|
56
39
|
Read `.opencastle/LESSONS-LEARNED.md` before starting. Add a lesson if you retry any approach.
|
|
57
40
|
|
|
@@ -107,4 +90,6 @@ Phase 2+: page tasks (parallel)
|
|
|
107
90
|
|
|
108
91
|
**Common mistake:** Decomposing pages as independent Phase 1 tasks → each agent invents its own design.
|
|
109
92
|
|
|
93
|
+
**Distinctive note (AI delegation):** This skill focuses on decomposition that produces machine-actionable delegation prompts: file partitions, explicit acceptance criteria, and machine-friendly constraints (exact paths, line ranges, forbidden files). The output should be ready to paste into a sub-agent prompt without additional human translation.
|
|
94
|
+
|
|
110
95
|
> Load the **project-consistency** skill for the full Foundation Phase pattern, prompt templates, and anti-patterns.
|
|
@@ -1,29 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: deployment-infrastructure
|
|
3
|
-
description: "
|
|
3
|
+
description: "Configures deployment pipelines, manages environment variables, schedules cron jobs, applies security headers, and implements caching strategies. Use when working with Docker, Vercel, AWS, Dockerfile, nginx.conf, or platform deployment configs."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Deployment Infrastructure
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## Generic Deployment Principles
|
|
11
|
-
|
|
12
|
-
- Use platform-native Git integration for CI/CD (push to `main` = production, push to branch = preview)
|
|
13
|
-
- Store all secrets as environment variables — never in code, commits, or logs
|
|
14
|
-
- Use `Bearer` token auth for cron job endpoints
|
|
15
|
-
- Apply security headers via framework config (HSTS, CSP, X-Frame-Options, Permissions-Policy)
|
|
16
|
-
- Cache static assets with `max-age=31536000, immutable`; use `max-age=86400` for favicon/manifest
|
|
17
|
-
- Load the **security-hardening** skill for full header inventory and CSP configuration
|
|
8
|
+
See [deployment-config.md](../../.opencastle/stack/deployment-config.md) for full architecture, env vars, cron jobs, and caching headers.
|
|
18
9
|
|
|
19
10
|
## Environment Variables
|
|
20
11
|
|
|
21
12
|
### Layering & Precedence
|
|
22
13
|
|
|
23
|
-
|
|
24
|
-
2. `.env.local` — developer overrides; git-ignored
|
|
25
|
-
3. `.env.production` / `.env.preview` — environment-specific values
|
|
26
|
-
4. Platform-injected — set in hosting dashboard (highest priority)
|
|
14
|
+
`.env` (defaults, committed) → `.env.local` (git-ignored) → `.env.production` / `.env.preview` → Platform-injected (highest).
|
|
27
15
|
|
|
28
16
|
### Startup Validation
|
|
29
17
|
|
|
@@ -43,8 +31,7 @@ export const env = envSchema.parse(process.env);
|
|
|
43
31
|
|
|
44
32
|
### Naming
|
|
45
33
|
|
|
46
|
-
|
|
47
|
-
- `SCREAMING_SNAKE_CASE`; gitignore `.env.local`, `.env.*.local`, `.env.production`
|
|
34
|
+
Prefix: `PUBLIC_*`/`NEXT_PUBLIC_*` (browser-safe), `SECRET_*`/`*_SECRET` (server-only). `SCREAMING_SNAKE_CASE`. Gitignore `.env.local`, `.env.*.local`.
|
|
48
35
|
|
|
49
36
|
## CI/CD Pipeline
|
|
50
37
|
|
|
@@ -65,65 +52,44 @@ export async function GET(request: Request) {
|
|
|
65
52
|
|
|
66
53
|
## Caching Strategy
|
|
67
54
|
|
|
68
|
-
| Asset Type | `Cache-Control` Header |
|
|
69
|
-
|
|
70
|
-
| Hashed static assets (JS, CSS) | `public, max-age=31536000, immutable` |
|
|
71
|
-
| Images / fonts | `public, max-age=31536000, immutable` |
|
|
72
|
-
| Favicon / manifest | `public, max-age=86400` |
|
|
73
|
-
| HTML pages (SSG) | `public, max-age=0, must-revalidate` |
|
|
74
|
-
| API responses | `private, no-cache` |
|
|
75
|
-
| Prerendered pages (ISR) | `public, s-maxage=3600, stale-while-revalidate=86400` |
|
|
55
|
+
| Asset Type | `Cache-Control` Header |
|
|
56
|
+
|---|---|
|
|
57
|
+
| Hashed static assets (JS, CSS) | `public, max-age=31536000, immutable` |
|
|
58
|
+
| Images / fonts | `public, max-age=31536000, immutable` |
|
|
59
|
+
| Favicon / manifest | `public, max-age=86400` |
|
|
60
|
+
| HTML pages (SSG) | `public, max-age=0, must-revalidate` |
|
|
61
|
+
| API responses | `private, no-cache` |
|
|
62
|
+
| Prerendered pages (ISR) | `public, s-maxage=3600, stale-while-revalidate=86400` |
|
|
76
63
|
|
|
77
64
|
Apply via framework `headers()` config or CDN rules.
|
|
78
65
|
|
|
79
66
|
## Security Headers
|
|
80
67
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
```javascript
|
|
84
|
-
const securityHeaders = [
|
|
85
|
-
{ key: 'Strict-Transport-Security', value: 'max-age=63072000; includeSubDomains; preload' },
|
|
86
|
-
{ key: 'X-Content-Type-Options', value: 'nosniff' },
|
|
87
|
-
{ key: 'X-Frame-Options', value: 'DENY' },
|
|
88
|
-
{ key: 'X-XSS-Protection', value: '1; mode=block' },
|
|
89
|
-
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
|
|
90
|
-
{ key: 'Permissions-Policy', value: 'camera=(), microphone=(), geolocation=()' },
|
|
91
|
-
{ key: 'Content-Security-Policy', value: "default-src 'self'; script-src 'self' 'unsafe-inline';" },
|
|
92
|
-
];
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
- HSTS `max-age` ≥ 31536000 for preload eligibility
|
|
96
|
-
- `X-Frame-Options: DENY` prevents clickjacking; use `SAMEORIGIN` only for self-embeds
|
|
97
|
-
- Keep CSP as restrictive as possible; document each exception
|
|
98
|
-
- Disable unused browser features via `Permissions-Policy`
|
|
68
|
+
Load **security-hardening** skill for full CSP inventory and header configuration.
|
|
99
69
|
|
|
100
70
|
## Release Process
|
|
101
71
|
|
|
102
|
-
1. **
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
72
|
+
1. **Audit** — lint, test, build; `git diff` since last tag; verify no draft PRs
|
|
73
|
+
- Gate: all commands exit 0
|
|
74
|
+
2. **Changelog** — generate from commits; categorize (Features, Fixes, Breaking); include migration notes
|
|
75
|
+
3. **Tag** — semver tag; update version references
|
|
76
|
+
4. **Verify** — `curl -sI https://example.com | grep -E 'HTTP|Strict'` — smoke-test production URLs; monitor error rates
|
|
77
|
+
- Gate: homepage returns 200; headers correct
|
|
78
|
+
- Fail → rollback immediately
|
|
107
79
|
|
|
108
|
-
## Rollback
|
|
80
|
+
## Rollback
|
|
109
81
|
|
|
110
|
-
|
|
111
|
-
2. **Git revert** — `git revert -m 1 HEAD && git push origin main`
|
|
82
|
+
Prefer platform rollback (promote last good deploy). Fallback: `git revert -m 1 HEAD && git push`.
|
|
112
83
|
|
|
113
|
-
-
|
|
114
|
-
|
|
115
|
-
- [ ] Smoke-test the rollback deployment
|
|
116
|
-
- [ ] Notify team; create post-mortem ticket
|
|
84
|
+
1. Roll back → 2. Smoke-test (`curl -sI`) → 3. Confirm 200 + correct behavior → 4. If still broken, escalate
|
|
85
|
+
5. Notify team; create post-mortem ticket
|
|
117
86
|
|
|
118
87
|
## Anti-Patterns
|
|
119
88
|
|
|
120
|
-
| Anti-Pattern |
|
|
121
|
-
|
|
122
|
-
| Hardcoding secrets |
|
|
123
|
-
| Skipping preview deployments |
|
|
124
|
-
| `Cache-Control: no-store` everywhere |
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
| Builds without `--frozen-lockfile` | Non-deterministic installs | Always use `--frozen-lockfile` in CI |
|
|
128
|
-
| `.env.local` in repository | Developer secrets leak | Gitignore; share via secure vault |
|
|
129
|
-
| No startup env validation | Cryptic late-failure errors | Validate all vars at boot (fail fast) |
|
|
89
|
+
| Anti-Pattern | Fix |
|
|
90
|
+
|---|---|
|
|
91
|
+
| Hardcoding secrets | Env vars + Zod startup validation |
|
|
92
|
+
| Skipping preview deployments | Deploy every branch to preview |
|
|
93
|
+
| `Cache-Control: no-store` everywhere | Per-asset cache durations (see table) |
|
|
94
|
+
| Disabling security headers "temporarily" | Keep strict; document exceptions |
|
|
95
|
+
| Builds without `--frozen-lockfile` | Always use `--frozen-lockfile` in CI |
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: documentation-standards
|
|
3
|
-
description: "
|
|
3
|
+
description: "Scaffolds issue docs, ADRs, README outlines, changelog entries, roadmap updates, and Mermaid architecture diagrams using project templates. Use when drafting an ADR, writing a changelog, updating the roadmap after a feature ships, creating a README for a new library, or diagramming a system flow."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Documentation Standards
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
For project-specific directory structure and practices, see [docs-structure.md](../../.opencastle/project/docs-structure.md).
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
## Issue Documentation Template
|
|
11
12
|
|
|
@@ -33,10 +34,14 @@ Generic documentation templates and writing standards. For project-specific dire
|
|
|
33
34
|
|
|
34
35
|
## Roadmap Update Template
|
|
35
36
|
|
|
36
|
-
When a feature is completed:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
When a feature is completed: add `COMPLETE` row with date and owner, list files changed with rationale, add validation command + exit status, move to `Completed` section with one-line release note.
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
- Feature: Add priceRange filter
|
|
41
|
+
Completed: 2026-03-30 | Owner: @developer
|
|
42
|
+
Files: src/components/PriceRangeFilter.tsx, src/lib/filters.ts
|
|
43
|
+
Validation: `pnpm build` (exit 0)
|
|
44
|
+
```
|
|
40
45
|
|
|
41
46
|
## Architecture Decision Record Template
|
|
42
47
|
|
|
@@ -68,13 +73,7 @@ High-level overview. Include a Mermaid diagram for non-trivial systems.
|
|
|
68
73
|
|
|
69
74
|
## Mermaid Diagrams
|
|
70
75
|
|
|
71
|
-
Keep diagrams focused — one concern per diagram.
|
|
72
|
-
|
|
73
|
-
| Type | Use For | Directive |
|
|
74
|
-
|------|---------|-----------|
|
|
75
|
-
| Flowchart | Decision logic, pipelines | `flowchart TD` (top-down) / `flowchart LR` (left-right) |
|
|
76
|
-
| Sequence | API flows, multi-service interactions | `sequenceDiagram` |
|
|
77
|
-
| ER | Data models, relationships | `erDiagram` |
|
|
76
|
+
Keep diagrams focused — one concern per diagram, max 10–12 nodes.
|
|
78
77
|
|
|
79
78
|
```mermaid
|
|
80
79
|
flowchart TD
|
|
@@ -83,8 +82,8 @@ flowchart TD
|
|
|
83
82
|
B -- No --> D[Return 401]
|
|
84
83
|
```
|
|
85
84
|
|
|
85
|
+
- `flowchart TD` for pipelines, `LR` for request flows, `sequenceDiagram` for API flows, `erDiagram` for data models
|
|
86
86
|
- Add `%% Title: ...` on complex diagrams; use verb labels on arrows
|
|
87
|
-
- Limit to 10–12 nodes per diagram; `flowchart TD` for pipelines, `LR` for request flows
|
|
88
87
|
|
|
89
88
|
## Changelog Entry Template
|
|
90
89
|
|
|
@@ -101,39 +100,21 @@ Group entries by Conventional Commits type under a version heading:
|
|
|
101
100
|
```
|
|
102
101
|
|
|
103
102
|
- One line per change; reference the PR or issue number
|
|
104
|
-
- Imperative mood
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
-
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
- **
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
##
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
- [ ] **Completeness** — no TODO placeholders or empty sections remain
|
|
123
|
-
- [ ] **Links** — all internal and external links resolve (no 404s)
|
|
124
|
-
- [ ] **Front matter** — YAML front matter is present and valid
|
|
125
|
-
- [ ] **Formatting** — consistent heading levels, list style, whitespace, and Mermaid renders
|
|
126
|
-
- [ ] **Cross-references** — related docs link to each other; "Last Updated" is current
|
|
127
|
-
|
|
128
|
-
## Anti-Patterns
|
|
129
|
-
|
|
130
|
-
| Anti-Pattern | Why It's Bad | Do This Instead |
|
|
131
|
-
|-------------|-------------|-----------------|
|
|
132
|
-
| Wall of text with no headings | Unnavigable; readers skip it | Break into sections with H2/H3 |
|
|
133
|
-
| Duplicating content across files | Copies drift; causes confusion | Link to a single source of truth |
|
|
134
|
-
| Screenshots without alt text | Inaccessible; breaks when UI changes | Use Mermaid diagrams or describe the UI |
|
|
135
|
-
| Documenting implementation details | Becomes stale as code changes | Document intent and contracts |
|
|
136
|
-
| Using absolute file paths | Breaks on other machines | Use relative paths from doc location |
|
|
137
|
-
| Huge monolithic README | Low signal-to-noise | Split into focused docs, link from README |
|
|
138
|
-
| Undated documents | No way to judge currency | Always include "Last Updated" date |
|
|
139
|
-
| Using H1 inside document body | Conflicts with auto-generated title | Start body headings at H2 |
|
|
103
|
+
- Imperative mood; most recent version first
|
|
104
|
+
|
|
105
|
+
## Documentation workflow
|
|
106
|
+
|
|
107
|
+
1. **Draft** — create doc using templates above.
|
|
108
|
+
2. **Validate** — run checks:
|
|
109
|
+
```bash
|
|
110
|
+
npx markdown-link-check docs/**/*.md && pnpm prettier --check "docs/**/*.md"
|
|
111
|
+
```
|
|
112
|
+
- Fail → fix broken paths/formatting → re-run step 2.
|
|
113
|
+
3. **Review** — peer review via PR; address comments.
|
|
114
|
+
4. **Publish** — merge; update roadmap/changelog.
|
|
115
|
+
5. **Pre-Merge Checklist** — accuracy ✓, links resolve ✓, front matter valid ✓, no TODO placeholders ✓, formatting consistent ✓.
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## Writing, Formatting & Anti-Patterns
|
|
119
|
+
|
|
120
|
+
See [WRITING-GUIDE.md](WRITING-GUIDE.md) for writing guidelines, formatting rules, and anti-patterns.
|