opencastle 0.32.11 → 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 (133) hide show
  1. package/README.md +5 -3
  2. package/dist/cli/convoy/engine.d.ts.map +1 -1
  3. package/dist/cli/convoy/engine.js +1 -0
  4. package/dist/cli/convoy/engine.js.map +1 -1
  5. package/dist/cli/convoy/pipeline.d.ts.map +1 -1
  6. package/dist/cli/convoy/pipeline.js +5 -2
  7. package/dist/cli/convoy/pipeline.js.map +1 -1
  8. package/dist/cli/convoy/pipeline.test.js +44 -0
  9. package/dist/cli/convoy/pipeline.test.js.map +1 -1
  10. package/dist/cli/run.js +4 -4
  11. package/dist/cli/run.js.map +1 -1
  12. package/dist/dashboard/scripts/etl.d.ts +1 -0
  13. package/dist/dashboard/scripts/etl.d.ts.map +1 -1
  14. package/dist/dashboard/scripts/etl.js +7 -2
  15. package/dist/dashboard/scripts/etl.js.map +1 -1
  16. package/package.json +1 -1
  17. package/src/cli/convoy/engine.ts +1 -0
  18. package/src/cli/convoy/pipeline.test.ts +49 -0
  19. package/src/cli/convoy/pipeline.ts +7 -2
  20. package/src/cli/run.ts +4 -4
  21. package/src/dashboard/dist/_astro/{index.6xXNs4L2.css → index.CADNhRPS.css} +1 -1
  22. package/src/dashboard/dist/data/convoys/demo-api-v2.json +3 -3
  23. package/src/dashboard/dist/data/convoys/demo-auth-revamp.json +4 -4
  24. package/src/dashboard/dist/data/convoys/demo-dashboard-ui.json +18 -18
  25. package/src/dashboard/dist/data/convoys/demo-data-pipeline.json +3 -3
  26. package/src/dashboard/dist/data/convoys/demo-deploy-ci.json +1 -1
  27. package/src/dashboard/dist/data/convoys/demo-docs-update.json +3 -3
  28. package/src/dashboard/dist/data/convoys/demo-perf-opt.json +10 -10
  29. package/src/dashboard/dist/index.html +29 -6
  30. package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
  31. package/src/dashboard/public/data/convoys/demo-api-v2.json +3 -3
  32. package/src/dashboard/public/data/convoys/demo-auth-revamp.json +4 -4
  33. package/src/dashboard/public/data/convoys/demo-dashboard-ui.json +18 -18
  34. package/src/dashboard/public/data/convoys/demo-data-pipeline.json +3 -3
  35. package/src/dashboard/public/data/convoys/demo-deploy-ci.json +1 -1
  36. package/src/dashboard/public/data/convoys/demo-docs-update.json +3 -3
  37. package/src/dashboard/public/data/convoys/demo-perf-opt.json +10 -10
  38. package/src/dashboard/scripts/etl.ts +9 -5
  39. package/src/dashboard/src/pages/index.astro +36 -4
  40. package/src/dashboard/src/styles/dashboard.css +4 -0
  41. package/src/orchestrator/customizations/stack/sanity-config.md +43 -0
  42. package/src/orchestrator/customizations/stack/supabase-config.md +53 -0
  43. package/src/orchestrator/plugins/astro/REFERENCE.md +5 -0
  44. package/src/orchestrator/plugins/astro/SKILL.md +22 -29
  45. package/src/orchestrator/plugins/chrome-devtools/REFERENCE.md +9 -0
  46. package/src/orchestrator/plugins/chrome-devtools/SKILL.md +10 -55
  47. package/src/orchestrator/plugins/contentful/REFERENCE.md +16 -0
  48. package/src/orchestrator/plugins/contentful/SKILL.md +69 -29
  49. package/src/orchestrator/plugins/convex/REFERENCE.md +9 -0
  50. package/src/orchestrator/plugins/convex/SKILL.md +13 -1
  51. package/src/orchestrator/plugins/cypress/REFERENCE.md +5 -0
  52. package/src/orchestrator/plugins/cypress/SKILL.md +29 -93
  53. package/src/orchestrator/plugins/figma/REFERENCE.md +18 -0
  54. package/src/orchestrator/plugins/figma/SKILL.md +41 -66
  55. package/src/orchestrator/plugins/jira/REFERENCE.md +9 -0
  56. package/src/orchestrator/plugins/jira/SKILL.md +26 -114
  57. package/src/orchestrator/plugins/linear/SKILL.md +42 -109
  58. package/src/orchestrator/plugins/netlify/REFERENCE.md +33 -0
  59. package/src/orchestrator/plugins/netlify/SKILL.md +34 -64
  60. package/src/orchestrator/plugins/nextjs/REFERENCE.md +73 -0
  61. package/src/orchestrator/plugins/nextjs/SKILL.md +49 -138
  62. package/src/orchestrator/plugins/notion/SKILL.md +26 -168
  63. package/src/orchestrator/plugins/notion/TEMPLATES.md +88 -0
  64. package/src/orchestrator/plugins/nx/REFERENCE.md +10 -0
  65. package/src/orchestrator/plugins/nx/SKILL.md +12 -12
  66. package/src/orchestrator/plugins/playwright/REFERENCE.md +12 -0
  67. package/src/orchestrator/plugins/playwright/SKILL.md +33 -98
  68. package/src/orchestrator/plugins/prisma/REFERENCE.md +42 -0
  69. package/src/orchestrator/plugins/prisma/SKILL.md +18 -68
  70. package/src/orchestrator/plugins/resend/REFERENCE.md +61 -0
  71. package/src/orchestrator/plugins/resend/SKILL.md +23 -137
  72. package/src/orchestrator/plugins/sanity/SKILL.md +50 -3
  73. package/src/orchestrator/plugins/slack/REFERENCE.md +24 -0
  74. package/src/orchestrator/plugins/slack/SKILL.md +36 -111
  75. package/src/orchestrator/plugins/strapi/REFERENCE.md +35 -0
  76. package/src/orchestrator/plugins/strapi/SKILL.md +60 -24
  77. package/src/orchestrator/plugins/supabase/REFERENCE.md +9 -0
  78. package/src/orchestrator/plugins/supabase/SKILL.md +44 -16
  79. package/src/orchestrator/plugins/teams/REFERENCE.md +36 -0
  80. package/src/orchestrator/plugins/teams/SKILL.md +35 -85
  81. package/src/orchestrator/plugins/trello/REFERENCE.md +9 -0
  82. package/src/orchestrator/plugins/trello/SKILL.md +25 -97
  83. package/src/orchestrator/plugins/turborepo/REFERENCE.md +9 -0
  84. package/src/orchestrator/plugins/turborepo/SKILL.md +13 -1
  85. package/src/orchestrator/plugins/vercel/SKILL.md +45 -52
  86. package/src/orchestrator/plugins/vitest/SKILL.md +10 -14
  87. package/src/orchestrator/prompts/create-skill.prompt.md +62 -20
  88. package/src/orchestrator/skills/accessibility-standards/REFERENCE.md +34 -0
  89. package/src/orchestrator/skills/accessibility-standards/SKILL.md +6 -3
  90. package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +48 -0
  91. package/src/orchestrator/skills/agent-hooks/SKILL.md +41 -65
  92. package/src/orchestrator/skills/agent-memory/KNOWLEDGE-GRAPH.md +49 -0
  93. package/src/orchestrator/skills/agent-memory/SKILL.md +30 -67
  94. package/src/orchestrator/skills/api-patterns/SKILL.md +29 -1
  95. package/src/orchestrator/skills/code-commenting/SKILL.md +1 -1
  96. package/src/orchestrator/skills/context-map/REFERENCE.md +70 -0
  97. package/src/orchestrator/skills/context-map/SKILL.md +28 -55
  98. package/src/orchestrator/skills/data-engineering/REFERENCE.md +55 -0
  99. package/src/orchestrator/skills/data-engineering/SKILL.md +40 -34
  100. package/src/orchestrator/skills/decomposition/REFERENCE.md +28 -0
  101. package/src/orchestrator/skills/decomposition/SKILL.md +15 -30
  102. package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +31 -65
  103. package/src/orchestrator/skills/documentation-standards/SKILL.md +31 -50
  104. package/src/orchestrator/skills/documentation-standards/WRITING-GUIDE.md +39 -0
  105. package/src/orchestrator/skills/fast-review/REFERENCE.md +30 -0
  106. package/src/orchestrator/skills/fast-review/SKILL.md +11 -31
  107. package/src/orchestrator/skills/frontend-design/COMPONENTS.md +113 -0
  108. package/src/orchestrator/skills/frontend-design/REFERENCE.md +36 -0
  109. package/src/orchestrator/skills/frontend-design/SKILL.md +36 -85
  110. package/src/orchestrator/skills/git-workflow/SKILL.md +1 -1
  111. package/src/orchestrator/skills/memory-merger/REFERENCE.md +20 -0
  112. package/src/orchestrator/skills/memory-merger/SKILL.md +29 -38
  113. package/src/orchestrator/skills/observability-logging/SKILL.md +5 -12
  114. package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +42 -0
  115. package/src/orchestrator/skills/orchestration-protocols/SKILL.md +54 -41
  116. package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +55 -0
  117. package/src/orchestrator/skills/panel-majority-vote/SKILL.md +30 -75
  118. package/src/orchestrator/skills/performance-optimization/SKILL.md +41 -1
  119. package/src/orchestrator/skills/project-consistency/SKILL.md +50 -89
  120. package/src/orchestrator/skills/project-consistency/TEMPLATES.md +39 -0
  121. package/src/orchestrator/skills/react-development/REFERENCE.md +7 -0
  122. package/src/orchestrator/skills/react-development/SKILL.md +50 -42
  123. package/src/orchestrator/skills/security-hardening/SKILL.md +88 -1
  124. package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +36 -0
  125. package/src/orchestrator/skills/self-improvement/SKILL.md +19 -25
  126. package/src/orchestrator/skills/seo-patterns/REFERENCE.md +54 -0
  127. package/src/orchestrator/skills/seo-patterns/SKILL.md +20 -88
  128. package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +58 -0
  129. package/src/orchestrator/skills/session-checkpoints/SKILL.md +34 -58
  130. package/src/orchestrator/skills/team-lead-reference/SKILL.md +37 -30
  131. package/src/orchestrator/skills/testing-workflow/SKILL.md +55 -2
  132. package/src/orchestrator/skills/validation-gates/REFERENCE.md +50 -0
  133. package/src/orchestrator/skills/validation-gates/SKILL.md +39 -35
@@ -1,36 +1,19 @@
1
1
  ---
2
2
  name: data-engineering
3
- description: "Data pipeline ETL workflows, web scraping, NDJSON processing, and CMS data import. Use when building scrapers, processing data, running CLI tools, or importing to a CMS."
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, CLI commands, and data status see [data-pipeline-config.md](../../.opencastle/stack/data-pipeline-config.md).
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: `{"name":"…","lat":50.0755,"lng":14.4378,"source":"google-maps","sourceId":"ChIJ…","category":"bar","address":"…","rating":4.5,"reviewCount":120}`
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
- ## Design Principles
45
-
46
- | Principle | Detail |
47
- |-----------|--------|
48
- | Composable stages | Single-responsibility pipeline steps |
49
- | Streams | Use for large files to minimize memory |
50
- | Idempotent imports | `createOrReplace` + deterministic `_id` |
51
- | Dry-run mode | Required for all destructive operations |
52
- | Normalized names | Strip diacritics for search |
53
- | Structured addresses | `{ street, city, postalCode, country, countryCode }` |
54
- | Data lineage | Record source and transformation history |
55
- | Error handling | Skip bad records; don't halt pipeline |
56
- | Backup | Before all bulk operations |
57
- | Rate limiting | Respect `robots.txt`; attribute sources |
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: "Task decomposition patterns for the Team Lead: dependency resolution, phase assignment, delegation spec templates, prompt quality examples, and orchestration patterns."
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 (Score 5+)
24
+ ## Delegation Spec
26
25
 
27
- For score 1-3, objective + files + criteria is sufficient.
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: "Deployment architecture, environment variables, cron jobs, security headers, and caching patterns. Use when configuring deployments, managing environment variables, setting up cron jobs, or troubleshooting build/deployment issues."
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
- All deployment configuration is project-specific. See [deployment-config.md](../../.opencastle/stack/deployment-config.md) for the full architecture, environment variables, cron jobs, caching headers, and key files.
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
- 1. `.env` shared defaults; committed, no secrets
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
- - Prefix: `PUBLIC_*`/`NEXT_PUBLIC_*` (browser-safe), `SECRET_*`/`*_SECRET` (server-only), `CRON_SECRET` (cron)
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 | Rationale |
69
- |---|---|---|
70
- | Hashed static assets (JS, CSS) | `public, max-age=31536000, immutable` | Content-addressed; safe to cache forever |
71
- | Images / fonts | `public, max-age=31536000, immutable` | Typically fingerprinted |
72
- | Favicon / manifest | `public, max-age=86400` | Refreshes within a day |
73
- | HTML pages (SSG) | `public, max-age=0, must-revalidate` | Serve stale while revalidating |
74
- | API responses | `private, no-cache` | User-specific or frequently changing |
75
- | Prerendered pages (ISR) | `public, s-maxage=3600, stale-while-revalidate=86400` | CDN: 1h cache, 1d stale |
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
- Apply globally via framework config or middleware. See **security-hardening** skill for full CSP configuration.
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. **Pre-Release Audit** — lint, test, build all affected projects; check `git diff` since last tag; verify no draft PRs
103
- 2. **Regression Check** — spot-check adjacent features; run full test suites; verify critical user flows
104
- 3. **Changelog** — generate from commits/PR titles; categorize (Features, Bug Fixes, Performance, Breaking Changes); include migration notes
105
- 4. **Version** — semver (MAJOR/MINOR/PATCH); tag in git; update version references
106
- 5. **Verify** — smoke-test production URLs; monitor error rates; document rollback steps
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 Procedures
80
+ ## Rollback
109
81
 
110
- 1. **Platform rollback** promote last known-good deployment from hosting dashboard
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
- - [ ] Confirm issue is deployment-related (not data or third-party)
114
- - [ ] Roll back via platform or git revert — never force-push `main`
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 | Why | Fix |
121
- |---|---|---|
122
- | Hardcoding secrets | Leak via git, logs, bundles | Env vars + Zod startup validation |
123
- | Skipping preview deployments | Bugs reach production unreviewed | Deploy every branch to preview |
124
- | `Cache-Control: no-store` everywhere | Every request hits origin | Per-asset cache durations (see table) |
125
- | Force-push `main` to fix a deploy | Destroys history; breaks teammates | `git revert` to undo cleanly |
126
- | Disabling security headers "temporarily" | Temporary becomes permanent | Keep strict; document exceptions |
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: "Documentation templates, structure, and standards for project docs, roadmaps, ADRs, and known issues. Use when writing or updating documentation files."
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
- Generic documentation templates and writing standards. For project-specific directory structure and practices, see [docs-structure.md](../../.opencastle/project/docs-structure.md).
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
- 1. Change status to `COMPLETE` and add completion date
38
- 2. List modified files and update the summary table
39
- 3. Move to completed section if applicable
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: "Add", "Fix", "Remove" — not "Added", "Fixed"
105
- - Groups: `Added`, `Fixed`, `Changed`, `Removed`, `Deprecated`, `Security`; most recent version first
106
-
107
- ## Writing & Formatting
108
-
109
- - Clear, concise prose; avoid jargon; use relative paths for links; tables for structured data; include "Last Updated" dates
110
- - Archive outdated docs rather than deleting; cross-reference between documents; Mermaid for architecture
111
- - **Headings:** H2 for sections, H3 for subsections; no H1 (auto-generated from title), no H4+
112
- - **Lists:** `-` for bullets, `1.` for numbered; 2-space nested indent
113
- - **Code Blocks:** Fenced with language tag for syntax highlighting
114
- - **Links:** `[text](URL)` with descriptive text and valid URLs
115
- - **Images:** `![alt](url)` with brief alt text
116
- - **Whitespace:** Blank lines between sections; no excessive whitespace
117
- - **Front Matter:** YAML required for instruction/skill files — `title`/`name`, `description`, `applyTo` (instructions: glob of applicable files)
118
-
119
- ## Pre-Merge Checklist
120
-
121
- - [ ] **Accuracy** all code snippets, file paths, and commands are correct and tested
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.
@@ -0,0 +1,39 @@
1
+ > Parent: [SKILL.md](./SKILL.md)
2
+
3
+ # Writing & Formatting Guide
4
+
5
+ ## Voice & Tone
6
+
7
+ - **Imperative mood** for instructions: "Add the header" not "You should add the header"
8
+ - **Active voice**: "The function returns X" not "X is returned by the function"
9
+ - **Concise**: one idea per sentence; trim filler words (just, simply, basically, very)
10
+
11
+ ## Formatting Rules
12
+
13
+ | Element | Convention |
14
+ |---------|-----------|
15
+ | Headings | Sentence case (`## Core principles`, not `## Core Principles`). Exception: proper nouns and acronyms. |
16
+ | Lists | Parallel structure — all items start with the same part of speech |
17
+ | Code | Inline backticks for symbols/commands; fenced blocks for multi-line |
18
+ | Links | Descriptive text: `[migration guide](./migrate.md)` not `[click here](./migrate.md)` |
19
+ | Tables | Use for structured comparisons; keep columns ≤5 |
20
+ | Line length | Wrap prose at ~120 characters for diff readability |
21
+
22
+ ## Markdown Standards
23
+
24
+ - One blank line before and after headings, code blocks, and tables
25
+ - No trailing whitespace
26
+ - Files end with a single newline
27
+ - Use `---` for horizontal rules (sparingly)
28
+ - Prefer `-` for unordered lists
29
+
30
+ ## Anti-Patterns
31
+
32
+ | Anti-pattern | Fix |
33
+ |-------------|-----|
34
+ | Walls of prose without structure | Break into headings, bullets, or tables |
35
+ | Duplicate content across docs | Link to the canonical source |
36
+ | Stale "Last Updated" dates | Remove or automate; manual dates drift |
37
+ | TODO/FIXME placeholders in published docs | Resolve before merging |
38
+ | Screenshots without alt text | Add descriptive alt text for accessibility |
39
+ | Overly nested headings (h4+) | Flatten; if you need h4, consider splitting the doc |
@@ -0,0 +1,30 @@
1
+ > Parent: [SKILL.md](./SKILL.md)
2
+
3
+ # Fast Review — Reviewer Prompt Template
4
+
5
+ ```markdown
6
+ You are a code reviewer. Be concise and specific.
7
+
8
+ ## Task: [ID] — [Title]
9
+ Acceptance Criteria: [list]
10
+
11
+ ## File Partition: [allowed dirs/files]
12
+ ## Changed Files: [path + key diff]
13
+ ## Deterministic: Lint: [P/F] | Tests: [P/F] | Build: [P/F]
14
+
15
+ ## Checklist
16
+ 1. Acceptance criteria met?
17
+ 2. Partition respected?
18
+ 3. No regressions?
19
+ 4. Errors surfaced (no swallowed exceptions)?
20
+ 5. Type safety (no `as any`)?
21
+ 6. No secrets/injection vectors?
22
+ 7. Edge cases handled?
23
+
24
+ ## Prior Feedback (retry only): [previous FAIL]
25
+
26
+ VERDICT: PASS | FAIL
27
+ ISSUES: - [severity:critical|major|minor] Description
28
+ FEEDBACK: [Actionable feedback.]
29
+ CONFIDENCE: low | medium | high
30
+ ```
@@ -1,7 +1,6 @@
1
- ````skill
2
1
  ---
3
2
  name: fast-review
4
- description: "Mandatory single-reviewer gate that runs after every agent delegation. Provides automatic retry with feedback and escalation to panel review after repeated failures. Essential for overnight/long-running autonomous sessions."
3
+ description: "Mandatory post-delegation gate that checks output completeness, verifies acceptance criteria compliance, flags regressions, and produces a PASS/FAIL verdict. Use when checking delegated work against acceptance criteria, running the post-delegation gate, validating agent output before acceptance, verifying a sub-agent completed its assignment, or running a post-delegation QA check."
5
4
  ---
6
5
 
7
6
  # Skill: Fast Review
@@ -14,7 +13,7 @@ description: "Mandatory single-reviewer gate that runs after every agent delegat
14
13
  | Reviewer | Single sub-agent; Economy tier (Standard for premium/security work) |
15
14
  | Verdict | PASS or FAIL with structured feedback |
16
15
  | Retry | ≤2 retries on FAIL; 3rd FAIL → panel review |
17
- | Budget | ~2–5 min |
16
+
18
17
 
19
18
  ## Procedure
20
19
 
@@ -26,6 +25,10 @@ Issue + acceptance criteria, file diff, file partition, deterministic results (l
26
25
 
27
26
  Single `runSubagent`. Context = acceptance criteria, diff, partition, deterministic results **only** — no session history, no delegation prompt.
28
27
 
28
+ ```js
29
+ runSubagent({ agentName: 'Reviewer', prompt: `Review against ACs:\n${criteria}\nDiff:\n${diff}\nGates: lint ✅ test ✅ build ✅` });
30
+ ```
31
+
29
32
  ### 3 — Parse Verdict
30
33
 
31
34
  ```
@@ -54,37 +57,16 @@ CONFIDENCE: low | medium | high
54
57
 
55
58
  ## Reviewer Prompt Template
56
59
 
57
- ```markdown
58
- You are a code reviewer. Be concise and specific.
59
-
60
- ## Task: [ID] — [Title]
61
- Acceptance Criteria: [list]
60
+ See [REFERENCE.md](REFERENCE.md) for the full reviewer prompt template.
62
61
 
63
- ## File Partition: [allowed dirs/files]
64
- ## Changed Files: [path + key diff]
65
- ## Deterministic: Lint: [P/F] | Tests: [P/F] | Build: [P/F]
66
-
67
- ## Checklist
68
- 1. Acceptance criteria met?
69
- 2. Partition respected?
70
- 3. No regressions?
71
- 4. Errors surfaced (no swallowed exceptions)?
72
- 5. Type safety (no `as any`)?
73
- 6. No secrets/injection vectors?
74
- 7. Edge cases handled?
62
+ ## Logging
75
63
 
76
- ## Prior Feedback (retry only): [previous FAIL]
64
+ > **⛔ HARD GATE Log the review before proceeding.**
77
65
 
78
- VERDICT: PASS | FAIL
79
- ISSUES: - [severity:critical|major|minor] Description
80
- FEEDBACK: [Actionable feedback.]
81
- CONFIDENCE: low | medium | high
66
+ ```sh
67
+ npx opencastle log review --skill <name> --outcome pass|fail --reviewer "Reviewer" --mechanism sub-agent
82
68
  ```
83
69
 
84
- ## Logging
85
-
86
- > **⛔ HARD GATE — Log the review before proceeding.** Use **observability-logging** skill's review record command.
87
-
88
70
  ## Integration & Overnight Mode
89
71
 
90
72
  `on-post-delegate` Gate 5 (after deterministic Gates 1–4), ~5–15% token overhead. Overnight: upgrade one tier, escalate after 2 FAILs, checkpoint before panel.
@@ -97,5 +79,3 @@ CONFIDENCE: low | medium | high
97
79
  - **Ignoring minor issues** — track; 3+ recurrences → ticket.
98
80
  - **Force-accepting FAIL** — retry or escalate.
99
81
  - **Skipping deterministic checks** — does NOT replace lint/test/build.
100
-
101
- ````