opencastle 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +215 -0
  3. package/bin/cli.mjs +69 -0
  4. package/dist/cli/adapters/claude-code.d.ts +22 -0
  5. package/dist/cli/adapters/claude-code.d.ts.map +1 -0
  6. package/dist/cli/adapters/claude-code.js +237 -0
  7. package/dist/cli/adapters/claude-code.js.map +1 -0
  8. package/dist/cli/adapters/cursor.d.ts +20 -0
  9. package/dist/cli/adapters/cursor.d.ts.map +1 -0
  10. package/dist/cli/adapters/cursor.js +231 -0
  11. package/dist/cli/adapters/cursor.js.map +1 -0
  12. package/dist/cli/adapters/vscode.d.ts +20 -0
  13. package/dist/cli/adapters/vscode.d.ts.map +1 -0
  14. package/dist/cli/adapters/vscode.js +132 -0
  15. package/dist/cli/adapters/vscode.js.map +1 -0
  16. package/dist/cli/copy.d.ts +14 -0
  17. package/dist/cli/copy.d.ts.map +1 -0
  18. package/dist/cli/copy.js +62 -0
  19. package/dist/cli/copy.js.map +1 -0
  20. package/dist/cli/dashboard.d.ts +3 -0
  21. package/dist/cli/dashboard.d.ts.map +1 -0
  22. package/dist/cli/dashboard.js +183 -0
  23. package/dist/cli/dashboard.js.map +1 -0
  24. package/dist/cli/diff.d.ts +3 -0
  25. package/dist/cli/diff.d.ts.map +1 -0
  26. package/dist/cli/diff.js +27 -0
  27. package/dist/cli/diff.js.map +1 -0
  28. package/dist/cli/eject.d.ts +3 -0
  29. package/dist/cli/eject.d.ts.map +1 -0
  30. package/dist/cli/eject.js +27 -0
  31. package/dist/cli/eject.js.map +1 -0
  32. package/dist/cli/init.d.ts +3 -0
  33. package/dist/cli/init.d.ts.map +1 -0
  34. package/dist/cli/init.js +92 -0
  35. package/dist/cli/init.js.map +1 -0
  36. package/dist/cli/manifest.d.ts +14 -0
  37. package/dist/cli/manifest.d.ts.map +1 -0
  38. package/dist/cli/manifest.js +34 -0
  39. package/dist/cli/manifest.js.map +1 -0
  40. package/dist/cli/mcp.d.ts +14 -0
  41. package/dist/cli/mcp.d.ts.map +1 -0
  42. package/dist/cli/mcp.js +35 -0
  43. package/dist/cli/mcp.js.map +1 -0
  44. package/dist/cli/prompt.d.ts +12 -0
  45. package/dist/cli/prompt.d.ts.map +1 -0
  46. package/dist/cli/prompt.js +104 -0
  47. package/dist/cli/prompt.js.map +1 -0
  48. package/dist/cli/run/adapters/claude-code.d.ts +16 -0
  49. package/dist/cli/run/adapters/claude-code.d.ts.map +1 -0
  50. package/dist/cli/run/adapters/claude-code.js +82 -0
  51. package/dist/cli/run/adapters/claude-code.js.map +1 -0
  52. package/dist/cli/run/adapters/copilot.d.ts +16 -0
  53. package/dist/cli/run/adapters/copilot.d.ts.map +1 -0
  54. package/dist/cli/run/adapters/copilot.js +84 -0
  55. package/dist/cli/run/adapters/copilot.js.map +1 -0
  56. package/dist/cli/run/adapters/cursor.d.ts +16 -0
  57. package/dist/cli/run/adapters/cursor.d.ts.map +1 -0
  58. package/dist/cli/run/adapters/cursor.js +81 -0
  59. package/dist/cli/run/adapters/cursor.js.map +1 -0
  60. package/dist/cli/run/adapters/index.d.ts +14 -0
  61. package/dist/cli/run/adapters/index.d.ts.map +1 -0
  62. package/dist/cli/run/adapters/index.js +35 -0
  63. package/dist/cli/run/adapters/index.js.map +1 -0
  64. package/dist/cli/run/executor.d.ts +15 -0
  65. package/dist/cli/run/executor.d.ts.map +1 -0
  66. package/dist/cli/run/executor.js +249 -0
  67. package/dist/cli/run/executor.js.map +1 -0
  68. package/dist/cli/run/reporter.d.ts +10 -0
  69. package/dist/cli/run/reporter.d.ts.map +1 -0
  70. package/dist/cli/run/reporter.js +112 -0
  71. package/dist/cli/run/reporter.js.map +1 -0
  72. package/dist/cli/run/schema.d.ts +28 -0
  73. package/dist/cli/run/schema.d.ts.map +1 -0
  74. package/dist/cli/run/schema.js +511 -0
  75. package/dist/cli/run/schema.js.map +1 -0
  76. package/dist/cli/run.d.ts +6 -0
  77. package/dist/cli/run.d.ts.map +1 -0
  78. package/dist/cli/run.js +123 -0
  79. package/dist/cli/run.js.map +1 -0
  80. package/dist/cli/stack-config.d.ts +12 -0
  81. package/dist/cli/stack-config.d.ts.map +1 -0
  82. package/dist/cli/stack-config.js +146 -0
  83. package/dist/cli/stack-config.js.map +1 -0
  84. package/dist/cli/types.d.ts +169 -0
  85. package/dist/cli/types.d.ts.map +1 -0
  86. package/dist/cli/types.js +2 -0
  87. package/dist/cli/types.js.map +1 -0
  88. package/dist/cli/update.d.ts +3 -0
  89. package/dist/cli/update.d.ts.map +1 -0
  90. package/dist/cli/update.js +50 -0
  91. package/dist/cli/update.js.map +1 -0
  92. package/package.json +48 -0
  93. package/src/cli/adapters/claude-code.ts +287 -0
  94. package/src/cli/adapters/cursor.ts +377 -0
  95. package/src/cli/adapters/vscode.ts +168 -0
  96. package/src/cli/copy.ts +79 -0
  97. package/src/cli/dashboard.ts +225 -0
  98. package/src/cli/diff.ts +44 -0
  99. package/src/cli/eject.ts +39 -0
  100. package/src/cli/init.ts +120 -0
  101. package/src/cli/manifest.ts +45 -0
  102. package/src/cli/mcp.ts +49 -0
  103. package/src/cli/prompt.ts +115 -0
  104. package/src/cli/run/adapters/claude-code.ts +95 -0
  105. package/src/cli/run/adapters/copilot.ts +97 -0
  106. package/src/cli/run/adapters/cursor.ts +94 -0
  107. package/src/cli/run/adapters/index.ts +40 -0
  108. package/src/cli/run/executor.ts +292 -0
  109. package/src/cli/run/reporter.ts +129 -0
  110. package/src/cli/run/schema.ts +595 -0
  111. package/src/cli/run.ts +137 -0
  112. package/src/cli/stack-config.ts +180 -0
  113. package/src/cli/types.ts +207 -0
  114. package/src/cli/update.ts +75 -0
  115. package/src/dashboard/astro.config.mjs +6 -0
  116. package/src/dashboard/package-lock.json +5455 -0
  117. package/src/dashboard/package.json +14 -0
  118. package/src/dashboard/public/data/delegations.ndjson +35 -0
  119. package/src/dashboard/public/data/panels.ndjson +13 -0
  120. package/src/dashboard/public/data/sessions.ndjson +50 -0
  121. package/src/dashboard/public/icon-192.png +0 -0
  122. package/src/dashboard/scripts/generate-seed-data.ts +355 -0
  123. package/src/dashboard/src/layouts/Layout.astro +25 -0
  124. package/src/dashboard/src/pages/index.astro +1070 -0
  125. package/src/dashboard/src/styles/dashboard.css +1078 -0
  126. package/src/dashboard/tsconfig.json +6 -0
  127. package/src/orchestrator/agent-workflows/README.md +22 -0
  128. package/src/orchestrator/agent-workflows/bug-fix.md +128 -0
  129. package/src/orchestrator/agent-workflows/data-pipeline.md +145 -0
  130. package/src/orchestrator/agent-workflows/database-migration.md +159 -0
  131. package/src/orchestrator/agent-workflows/feature-implementation.md +223 -0
  132. package/src/orchestrator/agent-workflows/performance-optimization.md +125 -0
  133. package/src/orchestrator/agent-workflows/refactoring.md +142 -0
  134. package/src/orchestrator/agent-workflows/schema-changes.md +164 -0
  135. package/src/orchestrator/agent-workflows/security-audit.md +148 -0
  136. package/src/orchestrator/agent-workflows/shared-delivery-phase.md +33 -0
  137. package/src/orchestrator/agents/api-designer.agent.md +68 -0
  138. package/src/orchestrator/agents/architect.agent.md +129 -0
  139. package/src/orchestrator/agents/content-engineer.agent.md +57 -0
  140. package/src/orchestrator/agents/copywriter.agent.md +95 -0
  141. package/src/orchestrator/agents/data-expert.agent.md +63 -0
  142. package/src/orchestrator/agents/database-engineer.agent.md +62 -0
  143. package/src/orchestrator/agents/developer.agent.md +66 -0
  144. package/src/orchestrator/agents/devops-expert.agent.md +57 -0
  145. package/src/orchestrator/agents/documentation-writer.agent.md +60 -0
  146. package/src/orchestrator/agents/performance-expert.agent.md +58 -0
  147. package/src/orchestrator/agents/release-manager.agent.md +72 -0
  148. package/src/orchestrator/agents/researcher.agent.md +145 -0
  149. package/src/orchestrator/agents/reviewer.agent.md +62 -0
  150. package/src/orchestrator/agents/security-expert.agent.md +64 -0
  151. package/src/orchestrator/agents/seo-specialist.agent.md +67 -0
  152. package/src/orchestrator/agents/team-lead.agent.md +644 -0
  153. package/src/orchestrator/agents/testing-expert.agent.md +85 -0
  154. package/src/orchestrator/agents/ui-ux-expert.agent.md +63 -0
  155. package/src/orchestrator/copilot-instructions.md +3 -0
  156. package/src/orchestrator/customizations/AGENT-EXPERTISE.md +325 -0
  157. package/src/orchestrator/customizations/AGENT-FAILURES.md +69 -0
  158. package/src/orchestrator/customizations/AGENT-PERFORMANCE.md +58 -0
  159. package/src/orchestrator/customizations/DISPUTES.md +162 -0
  160. package/src/orchestrator/customizations/KNOWLEDGE-GRAPH.md +10 -0
  161. package/src/orchestrator/customizations/LESSONS-LEARNED.md +70 -0
  162. package/src/orchestrator/customizations/README.md +59 -0
  163. package/src/orchestrator/customizations/agents/agent-registry.md +46 -0
  164. package/src/orchestrator/customizations/agents/skill-matrix.md +142 -0
  165. package/src/orchestrator/customizations/logs/README.md +181 -0
  166. package/src/orchestrator/customizations/logs/delegations.ndjson +1 -0
  167. package/src/orchestrator/customizations/logs/panels.ndjson +1 -0
  168. package/src/orchestrator/customizations/logs/sessions.ndjson +1 -0
  169. package/src/orchestrator/customizations/project/docs-structure.md +23 -0
  170. package/src/orchestrator/customizations/project/tracker-config.md +45 -0
  171. package/src/orchestrator/customizations/project.instructions.md +64 -0
  172. package/src/orchestrator/customizations/stack/api-config.md +37 -0
  173. package/src/orchestrator/customizations/stack/cms-config.md +26 -0
  174. package/src/orchestrator/customizations/stack/data-pipeline-config.md +41 -0
  175. package/src/orchestrator/customizations/stack/database-config.md +44 -0
  176. package/src/orchestrator/customizations/stack/deployment-config.md +45 -0
  177. package/src/orchestrator/customizations/stack/testing-config.md +56 -0
  178. package/src/orchestrator/instructions/ai-optimization.instructions.md +143 -0
  179. package/src/orchestrator/instructions/general.instructions.md +194 -0
  180. package/src/orchestrator/mcp.json +55 -0
  181. package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +235 -0
  182. package/src/orchestrator/prompts/brainstorm.prompt.md +115 -0
  183. package/src/orchestrator/prompts/bug-fix.prompt.md +141 -0
  184. package/src/orchestrator/prompts/create-skill.prompt.md +103 -0
  185. package/src/orchestrator/prompts/generate-task-spec.prompt.md +154 -0
  186. package/src/orchestrator/prompts/implement-feature.prompt.md +124 -0
  187. package/src/orchestrator/prompts/metrics-report.prompt.md +142 -0
  188. package/src/orchestrator/prompts/quick-refinement.prompt.md +137 -0
  189. package/src/orchestrator/prompts/resolve-pr-comments.prompt.md +100 -0
  190. package/src/orchestrator/skills/accessibility-standards/SKILL.md +164 -0
  191. package/src/orchestrator/skills/agent-hooks/SKILL.md +147 -0
  192. package/src/orchestrator/skills/agent-memory/SKILL.md +144 -0
  193. package/src/orchestrator/skills/api-patterns/SKILL.md +106 -0
  194. package/src/orchestrator/skills/browser-testing/SKILL.md +203 -0
  195. package/src/orchestrator/skills/code-commenting/SKILL.md +133 -0
  196. package/src/orchestrator/skills/contentful-cms/SKILL.md +43 -0
  197. package/src/orchestrator/skills/context-map/SKILL.md +135 -0
  198. package/src/orchestrator/skills/convex-database/SKILL.md +80 -0
  199. package/src/orchestrator/skills/data-engineering/SKILL.md +99 -0
  200. package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +49 -0
  201. package/src/orchestrator/skills/documentation-standards/SKILL.md +85 -0
  202. package/src/orchestrator/skills/fast-review/SKILL.md +327 -0
  203. package/src/orchestrator/skills/frontend-design/SKILL.md +42 -0
  204. package/src/orchestrator/skills/jira-management/SKILL.md +168 -0
  205. package/src/orchestrator/skills/memory-merger/SKILL.md +123 -0
  206. package/src/orchestrator/skills/nextjs-patterns/SKILL.md +75 -0
  207. package/src/orchestrator/skills/nx-workspace/SKILL.md +192 -0
  208. package/src/orchestrator/skills/panel-majority-vote/SKILL.md +184 -0
  209. package/src/orchestrator/skills/panel-majority-vote/panel-report.template.md +38 -0
  210. package/src/orchestrator/skills/performance-optimization/SKILL.md +101 -0
  211. package/src/orchestrator/skills/react-development/SKILL.md +117 -0
  212. package/src/orchestrator/skills/sanity-cms/SKILL.md +18 -0
  213. package/src/orchestrator/skills/security-hardening/SKILL.md +118 -0
  214. package/src/orchestrator/skills/self-improvement/SKILL.md +137 -0
  215. package/src/orchestrator/skills/seo-patterns/SKILL.md +40 -0
  216. package/src/orchestrator/skills/session-checkpoints/SKILL.md +205 -0
  217. package/src/orchestrator/skills/slack-notifications/SKILL.md +211 -0
  218. package/src/orchestrator/skills/strapi-cms/SKILL.md +43 -0
  219. package/src/orchestrator/skills/supabase-database/SKILL.md +24 -0
  220. package/src/orchestrator/skills/task-management/SKILL.md +143 -0
  221. package/src/orchestrator/skills/team-lead-reference/SKILL.md +317 -0
  222. package/src/orchestrator/skills/teams-notifications/SKILL.md +249 -0
  223. package/src/orchestrator/skills/testing-workflow/SKILL.md +134 -0
  224. package/src/orchestrator/skills/validation-gates/SKILL.md +100 -0
@@ -0,0 +1,141 @@
1
+ ---
2
+ description: 'Investigate and fix a reported bug with proper triage, root cause analysis, Linear tracking, and verification.'
3
+ agent: Team Lead
4
+ ---
5
+
6
+ # Fix Bug
7
+
8
+ You are the Team Lead. Investigate and fix the bug described below. Bugs are real defects that affect users — treat them seriously with proper triage, tracking, and verification.
9
+
10
+ ## Bug Report
11
+
12
+ {{bugDescription}}
13
+
14
+ ---
15
+
16
+ > **Canonical workflow:** `.github/agent-workflows/bug-fix.md` defines the phase structure. This prompt expands each phase with delegation-specific detail. If the two diverge, update the workflow first (SSOT) then sync the prompt.
17
+
18
+ ## How Bug Fixes Differ from Other Workflows
19
+
20
+ | Aspect | Roadmap Task | Follow-Up | Bug Fix |
21
+ |--------|-------------|-----------|---------|
22
+ | Linear tracking | Required | Not required | **Required** |
23
+ | Urgency | Planned | Low | Can be critical |
24
+ | Root cause analysis | Feature design | Not needed | **Required** |
25
+ | Reproduction steps | N/A | N/A | **Required** |
26
+ | Panel review | High-stakes only | Rarely | If security-related |
27
+ | Documentation | Roadmap + ADRs | Minimal | Known issues if needed |
28
+ | Scope | Multi-step feature | Focused tweak | Focused fix |
29
+
30
+ ## Workflow
31
+
32
+ ### 1. Triage & Reproduce
33
+
34
+ Before fixing anything, understand the bug:
35
+
36
+ 1. **Check known issues** — Search `docs/KNOWN-ISSUES.md` for an existing entry. If found, note workarounds and decide if a fix is now feasible
37
+ 2. **Check Linear** — Search for existing bug tickets. If one exists, take it over instead of creating a duplicate
38
+ 3. **Read lessons learned** — Check `.github/customizations/LESSONS-LEARNED.md` for related pitfalls
39
+ 4. **Reproduce the bug** — Start the dev server and confirm you can trigger the issue:
40
+ - `yarn nx run <app>:serve`
41
+ - Navigate to the affected page in Chrome
42
+ - Follow the reproduction steps from the bug report
43
+ - Take a screenshot of the broken state as evidence
44
+ 5. **Determine scope** — Which apps are affected? (see `project.instructions.md` for the app inventory)
45
+ 6. **Assess severity**:
46
+ - **Critical** — App crashes, data loss, auth bypass, page won't load
47
+ - **High** — Feature broken but workaround exists, significant UI breakage
48
+ - **Medium** — Minor functional issue, cosmetic but noticeable
49
+ - **Low** — Edge case, minor visual glitch
50
+
51
+ ### 2. Create Linear Issue
52
+
53
+ Every bug gets tracked. Create a Linear issue with:
54
+
55
+ - **Title**: `[Bug] Short description of the symptom`
56
+ - **Label**: `bug`
57
+ - **Priority**: Based on severity assessment above
58
+ - **Description**:
59
+ - **Symptom**: What the user sees
60
+ - **Reproduction steps**: Exact steps to trigger
61
+ - **Expected behavior**: What should happen
62
+ - **Actual behavior**: What happens instead
63
+ - **Affected apps**: which apps from the project inventory
64
+ - **Affected files** (once identified): File paths for the partition
65
+ - **Screenshot**: Link or description of the broken state
66
+
67
+ ### 3. Root Cause Analysis
68
+
69
+ Find WHY the bug happens, not just WHERE:
70
+
71
+ 1. **Search the codebase** — Find the components, queries, styles, and logic involved
72
+ 2. **Trace the data flow** — Follow the data from source (CMS/database) → query → component → render
73
+ 3. **Check recent changes** — Use `git log` on suspected files to see if a recent commit introduced the issue
74
+ 4. **Identify the root cause** — Distinguish between:
75
+ - **Code bug** — Logic error, wrong condition, missing null check
76
+ - **Data issue** — Unexpected data shape, missing field, bad reference
77
+ - **Race condition** — Timing issue, hydration mismatch, async ordering
78
+ - **CSS/Layout** — Specificity conflict, missing responsive rule, overflow
79
+ - **Integration** — API contract mismatch, schema drift, stale cache
80
+ 5. **Update the Linear issue** — Add root cause findings and affected file paths
81
+
82
+ ### 4. Implement the Fix
83
+
84
+ Delegate to the appropriate specialist agent via **sub-agent** (inline). For bugs that are clearly isolated and well-understood, a single delegation is usually sufficient.
85
+
86
+ #### Delegation Prompt Must Include
87
+
88
+ - **Linear issue ID and title** — e.g., `TAS-XX — [Bug] Description`
89
+ - **Root cause** — What's wrong and why
90
+ - **Fix approach** — How to fix it (be specific)
91
+ - **File paths** — Exact files to read and modify
92
+ - **Reproduction steps** — So the agent can verify the fix
93
+ - **Boundaries** — "Only modify files listed above. Fix the bug, do not refactor surrounding code."
94
+ - **Self-improvement reminder** — include per `general.instructions.md` § Self-Improvement Protocol
95
+
96
+ #### Implementation Rules
97
+
98
+ - **Minimal change** — Fix the bug with the smallest correct change. Resist the urge to refactor
99
+ - **Fix the cause, not the symptom** — A CSS `!important` or silent `catch {}` is not a fix
100
+ - **DRY** — If the fix involves logic that exists elsewhere, reuse it
101
+ - **Add a test** — If no test covers this scenario, add one. Bugs that aren't tested come back
102
+ - **Cross-app awareness** — If the fix is in shared code (`libs/`), verify it works for both apps
103
+
104
+ ### 5. Validate
105
+
106
+ > Load the **validation-gates** skill for detailed steps on each gate.
107
+
108
+ Every bug fix must pass ALL of these checks:
109
+
110
+ 1. **Deterministic Checks** — `yarn nx run <project>:lint --fix`, `:test`, `:build` — all zero errors
111
+ 2. **Bug-Specific Verification** (mandatory) — start dev server, reproduce original bug (should be gone), verify correct behavior, test edge cases, screenshot before/after, check both apps if shared code
112
+ 3. **Regression Check** — run tests for all projects consuming modified files, browser-test adjacent functionality
113
+ 4. **Panel Review** (only if needed) — use **panel-majority-vote** skill if fix touches auth/authorization, RLS, security headers/CSP, or sensitive data
114
+
115
+ ### 6. Delivery
116
+
117
+ Follow the **Delivery Outcome** defined in `general.instructions.md` — commit, push, open PR (not merged), and link to Linear.
118
+
119
+ ### 7. Wrap Up
120
+
121
+ 1. **Move Linear issue to Done** — Only after all validation passes
122
+ 2. **Update Known Issues** — If this was a documented known issue, remove or update the entry in `docs/KNOWN-ISSUES.md`
123
+ 3. **Capture lessons** — If the root cause reveals a pattern that other agents should know about, add it to `.github/customizations/LESSONS-LEARNED.md`
124
+ 4. **Note prevention** — If this class of bug could be caught earlier (by a lint rule, test, or type check), note that in the Linear issue as a follow-up suggestion
125
+
126
+ ### 8. Completion Criteria
127
+
128
+ The bug fix is complete when:
129
+
130
+ - [ ] Bug is reproduced and root cause identified
131
+ - [ ] Linear issue created with full details
132
+ - [ ] Fix implemented with minimal change
133
+ - [ ] Test added covering the bug scenario
134
+ - [ ] Lint, test, and build pass for all affected projects
135
+ - [ ] Bug verified fixed in the browser
136
+ - [ ] No regressions in adjacent functionality
137
+ - [ ] Both apps checked if shared code was modified
138
+ - [ ] Delivery Outcome completed (see `general.instructions.md`) — branch pushed, PR opened (not merged), Linear linked
139
+ - [ ] Linear issue moved to Done
140
+ - [ ] Known issues updated if applicable
141
+ - [ ] Lessons learned captured if any retries occurred
@@ -0,0 +1,103 @@
1
+ ---
2
+ description: 'Scaffold a new skill directory with proper frontmatter, structure, and content sections. Use when adding a new domain skill to the AI configuration.'
3
+ agent: Team Lead
4
+ ---
5
+
6
+ # Create Skill
7
+
8
+ Scaffold a new skill for the AI agent configuration. Skills encode domain-specific knowledge that agents load on demand.
9
+
10
+ ## Skill Request
11
+
12
+ {{skillDescription}}
13
+
14
+ ---
15
+
16
+ ## Workflow
17
+
18
+ ### Step 1: Determine Scope
19
+
20
+ Classify the skill:
21
+
22
+ | Scope | Prefix | When to Use |
23
+ |-------|--------|-------------|
24
+ | **Global** | `global-` | Domain knowledge applicable to any project (React, testing, security) |
25
+ | **Local** | `local-` | Project-specific conventions (Linear config, Sanity schema patterns, this project's API structure) |
26
+
27
+ ### Step 2: Name the Skill
28
+
29
+ - Format: `<scope>-<domain>` (e.g., `global-react-development`, `local-sanity-cms`)
30
+ - Use kebab-case
31
+ - Be specific enough to distinguish from other skills, broad enough to be reusable
32
+ - Check existing skills in `.github/skills/` to avoid overlap
33
+
34
+ ### Step 3: Create the Skill File
35
+
36
+ Create `.github/skills/<skill-name>/SKILL.md` with this structure:
37
+
38
+ ```markdown
39
+ ````skill
40
+ ---
41
+ name: <skill-name>
42
+ description: "<One-line description of what the skill covers. Include key topics and when to use it.>"
43
+ ---
44
+
45
+ # Skill: <Display Name>
46
+
47
+ <1-2 sentence overview of the skill's purpose and scope.>
48
+
49
+ ## When to Use
50
+
51
+ - <Trigger condition 1>
52
+ - <Trigger condition 2>
53
+ - <Trigger condition 3>
54
+
55
+ ## Core Principles
56
+
57
+ 1. **<Principle>** — <Explanation>
58
+ 2. **<Principle>** — <Explanation>
59
+ 3. **<Principle>** — <Explanation>
60
+
61
+ ## <Domain Section 1>
62
+
63
+ <Content organized by topic. Use tables, code blocks, and checklists.>
64
+
65
+ ## <Domain Section 2>
66
+
67
+ <More domain content.>
68
+
69
+ ## Checklist
70
+
71
+ - [ ] <Verification item 1>
72
+ - [ ] <Verification item 2>
73
+
74
+ ## Anti-Patterns
75
+
76
+ - **<Bad pattern>** — <Why it's bad and what to do instead>
77
+ - **<Bad pattern>** — <Why it's bad and what to do instead>
78
+ ````
79
+ ```
80
+
81
+ ### Step 4: Register the Skill
82
+
83
+ 1. **Add to the skill matrix** — Update `.github/customizations/agents/skill-matrix.md` with the new skill mapping
84
+ 2. **Add to relevant agents** — Update the `skills` section in each agent that should use this skill
85
+ 3. **Reference in instructions** — If the skill is loaded by default, add it to the appropriate `.github/instructions/` file
86
+
87
+ ### Step 5: Validate
88
+
89
+ - [ ] File created at `.github/skills/<name>/SKILL.md`
90
+ - [ ] Frontmatter has `name` and `description` fields
91
+ - [ ] Description is a single line (no line breaks)
92
+ - [ ] Content follows the template structure
93
+ - [ ] No overlap with existing skills
94
+ - [ ] Skill matrix updated
95
+ - [ ] At least one agent references the skill
96
+
97
+ ## Quality Guidelines
98
+
99
+ - **Be prescriptive** — Skills should give clear instructions, not vague advice. "Use `fetchPlaces()` from `libs/queries`" beats "use the query library"
100
+ - **Include examples** — Code snippets, file path examples, and table references from the actual codebase
101
+ - **Keep it scannable** — Use headings, tables, bullets, and code blocks. Agents need to find information fast
102
+ - **Avoid duplication** — If a rule already exists in `.github/instructions/`, reference it instead of repeating it
103
+ - **Size target** — 100-300 lines. Under 100 is probably too thin; over 300 should be split into multiple skills
@@ -0,0 +1,154 @@
1
+ ---
2
+ description: 'Generate a valid opencastle.tasks.yml spec file for autonomous overnight runs based on a high-level description of what needs to be done.'
3
+ agent: Team Lead
4
+ ---
5
+
6
+ # Generate Task Spec for Autonomous Run
7
+
8
+ You are the Team Lead. The user wants to run `opencastle run` to execute a batch of tasks autonomously (e.g., overnight). Your job is to produce a valid `opencastle.tasks.yml` file they can feed to the CLI.
9
+
10
+ ## User Goal
11
+
12
+ {{goal}}
13
+
14
+ ## Additional Context
15
+
16
+ {{context}}
17
+
18
+ ---
19
+
20
+ ## YAML Spec Schema Reference
21
+
22
+ The output file must conform to the following schema. Fields marked **(required)** cause validation errors if missing.
23
+
24
+ ### Top-Level Fields
25
+
26
+ | Field | Type | Required | Default | Description |
27
+ |-------|------|----------|---------|-------------|
28
+ | `name` | string | **yes** | — | Human-readable name for the run |
29
+ | `concurrency` | integer ≥ 1 | no | `1` | Max tasks executing in parallel |
30
+ | `on_failure` | `continue` \| `stop` | no | `continue` | Behaviour when a task fails |
31
+ | `adapter` | string | no | `claude-code` | Default CLI adapter (`claude-code`, `copilot`, `cursor`) |
32
+ | `tasks` | list | **yes** | — | Non-empty list of task objects |
33
+
34
+ ### Task Fields
35
+
36
+ | Field | Type | Required | Default | Description |
37
+ |-------|------|----------|---------|-------------|
38
+ | `id` | string | **yes** | — | Unique identifier (lowercase, kebab-case recommended) |
39
+ | `prompt` | string | **yes** | — | The instruction sent to the AI agent |
40
+ | `agent` | string | no | `developer` | Agent role hint (see Agent Roster below) |
41
+ | `description` | string | no | same as `id` | Short human label shown in progress output |
42
+ | `depends_on` | list of ids | no | `[]` | Task ids that must finish before this one starts |
43
+ | `files` | list of globs | no | `[]` | File scope the agent is allowed to modify |
44
+ | `timeout` | duration | no | `30m` | Max wall time (`<number><s|m|h>`, e.g. `10m`, `1h`) |
45
+
46
+ ### Agent Roster
47
+
48
+ Available values for the `agent` field:
49
+
50
+ `api-designer` · `architect` · `content-engineer` · `copywriter` · `data-expert` · `database-engineer` · `developer` · `devops-expert` · `documentation-writer` · `performance-expert` · `release-manager` · `researcher` · `security-expert` · `seo-specialist` · `team-lead` · `testing-expert` · `ui-ux-expert`
51
+
52
+ ### Adapter Options
53
+
54
+ | Adapter | CLI binary | Notes |
55
+ |---------|-----------|-------|
56
+ | `claude-code` | `claude` | Default. JSON output, max-turns flag. |
57
+ | `copilot` | `copilot` | Uses `--autopilot --allow-all-tools`. |
58
+ | `cursor` | `agent` | Uses `--force` for unattended file writes. |
59
+
60
+ ---
61
+
62
+ ## Workflow
63
+
64
+ ### 1. Analyse the Goal
65
+
66
+ - Read the user's goal carefully. Identify the **deliverables** — what must exist or change after the run completes.
67
+ - If context references a codebase, search it to understand current state, file layout, and conventions.
68
+ - List the high-level workstreams (e.g., "database changes", "UI components", "tests", "docs").
69
+
70
+ ### 2. Decompose into Tasks
71
+
72
+ For each workstream, break it down into the smallest meaningful unit of work that can be expressed as a single AI prompt. Follow these rules:
73
+
74
+ 1. **Single responsibility** — each task does exactly one thing.
75
+ 2. **Self-contained prompt** — the `prompt` field must contain everything the agent needs: objective, file paths, constraints, acceptance criteria. The agent has no other context.
76
+ 3. **Explicit file scopes** — list every directory or file the task may touch in `files`. This prevents conflicts between parallel tasks.
77
+ 4. **Appropriate agent** — pick the agent whose speciality matches the task (e.g., `testing-expert` for tests, `database-engineer` for migrations).
78
+ 5. **Realistic timeouts** — default 30 m is fine for most tasks; use `1h` for large refactors or test suites; use `10m` for small docs or config changes.
79
+
80
+ ### 3. Define the Dependency Graph (DAG)
81
+
82
+ - Tasks with no dependencies go first (they run in parallel up to `concurrency`).
83
+ - Tasks that consume output of earlier tasks declare `depends_on` with the prerequisite ids.
84
+ - **Never create cycles** — if A depends on B, B must not depend on A (directly or transitively).
85
+ - Draw the implicit phase structure:
86
+ ```
87
+ Phase 1: [independent tasks]
88
+ Phase 2: [tasks depending only on Phase 1]
89
+ Phase 3: [tasks depending on Phase 2]
90
+ ...
91
+ ```
92
+
93
+ ### 4. Set Global Options
94
+
95
+ - `concurrency` — set to 2–3 for overnight runs; keep at 1 if tasks share files or the machine is constrained.
96
+ - `on_failure` — use `continue` (default) when tasks are independent so one failure doesn't waste the whole run. Use `stop` when every subsequent task depends on success.
97
+ - `adapter` — pick based on which CLI the user has installed.
98
+
99
+ ### 5. Write the Prompts
100
+
101
+ Each task `prompt` must be a **complete, standalone instruction**. Include:
102
+
103
+ - **What** to build / change / fix.
104
+ - **Where** — exact file paths or directories.
105
+ - **Why** — business context so the agent can make good decisions.
106
+ - **Constraints** — coding standards, conventions, do-not-touch files.
107
+ - **Acceptance criteria** — bullet list of pass conditions.
108
+ - **Verification command** — e.g., `Run: yarn nx run project:test` so the agent self-checks.
109
+
110
+ > **Weak prompt:** "Add tests for the auth module."
111
+ >
112
+ > **Strong prompt:** "Write unit tests for `libs/auth/src/server.ts` covering token refresh, expiry edge cases, and invalid signatures. Place tests in `libs/auth/src/__tests__/server.test.ts`. Follow the existing Jest conventions (see `jest.preset.js`). Achieve ≥ 95 % coverage for `server.ts`. Run: `yarn nx run auth:test --coverage` and fix any failures."
113
+
114
+ ### 6. Validate Before Outputting
115
+
116
+ Before presenting the YAML, mentally verify:
117
+ - [ ] Every task has a unique `id`
118
+ - [ ] Every `depends_on` reference points to a valid `id` defined earlier in the list
119
+ - [ ] No dependency cycles exist
120
+ - [ ] No two parallel tasks share the same `files` entries (partition check)
121
+ - [ ] Prompts are self-contained — an agent with zero context can execute them
122
+ - [ ] Timeouts are reasonable for the scope of each task
123
+
124
+ ### 7. Output
125
+
126
+ Return the final YAML inside a fenced code block with a filename annotation:
127
+
128
+ ````yaml
129
+ # opencastle.tasks.yml
130
+ name: <run name>
131
+ concurrency: <n>
132
+ on_failure: <continue|stop>
133
+ adapter: <adapter>
134
+
135
+ tasks:
136
+ - id: <task-id>
137
+ agent: <agent>
138
+ description: <short label>
139
+ timeout: <duration>
140
+ files:
141
+ - <glob>
142
+ prompt: |
143
+ <full self-contained instruction>
144
+
145
+ - id: <next-task-id>
146
+ depends_on:
147
+ - <task-id>
148
+ ...
149
+ ````
150
+
151
+ Also provide:
152
+ 1. A **DAG summary** showing the phase structure so the user can verify execution order.
153
+ 2. An **estimated total duration** (sum of timeouts on the critical path).
154
+ 3. A `--dry-run` command they can use to validate: `opencastle run --file opencastle.tasks.yml --dry-run`
@@ -0,0 +1,124 @@
1
+ ---
2
+ description: 'Instruct the Team Lead to implement a specific task from the post-MVP roadmap with full orchestration, validation, and traceability.'
3
+ agent: Team Lead
4
+ ---
5
+
6
+ # Implement Roadmap Task
7
+
8
+ You are the Team Lead. Implement the roadmap task described below following this strict workflow. The task comes from `docs/ROADMAP-POST-MVP.md`.
9
+
10
+ ## Task
11
+
12
+ {{roadmapTask}}
13
+
14
+ ---
15
+
16
+ > **Canonical workflow:** `.github/agent-workflows/feature-implementation.md` defines the phase structure. This prompt adds Linear traceability, validation gate references, and completion criteria.
17
+
18
+ ## Workflow
19
+
20
+ > **HARD GATE:** Steps 1→2 are **blocking prerequisites**. Do NOT write, edit, or delegate any code until Linear issues exist for every subtask. If you catch yourself writing code before issues are created, STOP immediately, create the issues, then resume.
21
+
22
+ ### 1. Research & Context Gathering
23
+
24
+ Before writing any code, gather all relevant context:
25
+
26
+ 1. **Read the roadmap** — Open `docs/ROADMAP-POST-MVP.md` and find the full scope, status, and acceptance criteria for this task
27
+ 2. **Read known issues** — Check `docs/KNOWN-ISSUES.md` for blockers or workarounds that affect this task
28
+ 3. **Read architecture docs** — Check `docs/PROJECT.md` and `docs/DECISIONS.md` for constraints and prior decisions
29
+ 4. **Read lessons learned** — Check `.github/customizations/LESSONS-LEARNED.md` for pitfalls relevant to this feature area
30
+ 5. **Search existing code** — Find all files, components, queries, and tests related to this feature area
31
+ 6. **Identify reusable code** — Before creating anything new, check if similar logic, components, or utilities already exist in the codebase that can be reused or extended
32
+
33
+ ### 2. Linear Board Setup (BLOCKING — must complete before Step 3)
34
+
35
+ Every subtask must be tracked on Linear. **No issue = no implementation.** This step produces the issues that gate all downstream work.
36
+
37
+ 1. **Check existing issues** — Search the board for any in-progress or completed work related to this task
38
+ 2. **Decompose into issues** — Create one Linear issue per subtask using `[Area] Short description` naming
39
+ 3. **Set metadata** — Assign labels (agent name), priority, dependencies, and file partitions
40
+ 4. **Write descriptions** — Each issue must include:
41
+ - **Objective:** One sentence
42
+ - **Files (partition):** Exact paths this agent may modify
43
+ - **Acceptance criteria:** Verifiable checklist
44
+ - **Dependencies:** Links to prerequisite issues
45
+ 5. **Link to roadmap** — Reference the roadmap section in the issue description so context is never lost
46
+ 6. **Verify issues exist** — List all created issue IDs. If count is 0, do NOT proceed to Step 3
47
+
48
+ ### 3. Implementation Rules
49
+
50
+ #### Linear Issue Traceability
51
+
52
+ - **Pass issue ID to every agent** — When delegating a subtask (sub-agent or background), include the Linear issue ID and title in the prompt so the agent knows which tracked task it is completing
53
+ - **Reference in commits** — Include the issue ID (e.g., `TAS-42`) in commit messages when possible
54
+ - **Update issue status** — Move issues to In Progress before starting, Done after verification passes
55
+
56
+ #### DRY Code
57
+
58
+ - **Search before creating** — Before writing any new component, hook, utility, query, or type, search the codebase for existing implementations
59
+ - **Extract shared logic** — If two agents need similar functionality, extract it to a shared library (`libs/`) first
60
+ - **No copy-paste across apps** — Shared code belongs in shared libraries, not duplicated between apps
61
+ - **Refactor on discovery** — If you find duplicated code during implementation, create a subtask to consolidate it
62
+
63
+ #### Self-Improvement
64
+
65
+ Include the self-improvement reminder in every delegation prompt (see `general.instructions.md` § Self-Improvement Protocol).
66
+
67
+ #### Visual Consistency
68
+
69
+ - **Reuse existing components** — Use the shared component library; never re-implement a component that already exists
70
+ - **Follow the design system** — Match spacing, typography, colors, and interaction patterns from existing pages
71
+ - **Cross-app consistency** — Changes must look correct in all apps that share the codebase
72
+ - **Browser verification required** — Every UI change must be visually confirmed in Chrome (see Testing below)
73
+
74
+ ### 4. Validation & Testing
75
+
76
+ > Load the **validation-gates** skill for detailed steps on each gate.
77
+
78
+ Every subtask must pass ALL gates before being marked Done:
79
+
80
+ 1. **Gate 1: Deterministic Checks** — `yarn nx run <project>:lint --fix`, `:test`, `:build` — all zero errors
81
+ 2. **Gate 2: Browser Testing** (MANDATORY for UI changes) — clear cache, start server, verify features + responsive + screenshots
82
+ 3. **Gate 3: Regression Testing** — full test suite for affected projects, browser-test adjacent pages if shared components changed
83
+ 4. **Gate 4: Panel Review** (for high-stakes changes) — use **panel-majority-vote** skill for security, DB migrations, architecture
84
+
85
+ ### 5. Delivery
86
+
87
+ Follow the **Delivery Outcome** defined in `general.instructions.md` — commit, push, open PR (not merged), and link to Linear.
88
+
89
+ ### 6. Documentation & Traceability
90
+
91
+ Keep documentation current so future sessions have full context:
92
+
93
+ 1. **Update roadmap** — Mark completed items in `docs/ROADMAP-POST-MVP.md` with ✅ and the completion date. **Include Linear issue IDs and links** next to each scope item so progress is traceable across sessions. Format:
94
+ ```
95
+ **Linear Issues:**
96
+ - [PREFIX-6](https://linear.app/<workspace>/issue/PREFIX-6) — [Search] Description ✅ Done
97
+ - [PREFIX-7](https://linear.app/<workspace>/issue/PREFIX-7) — [UI] Description 📋 Todo
98
+ ```
99
+ > Replace `PREFIX` and `<workspace>` with the project's Linear prefix and workspace slug (see `linear-config.md`).
100
+ 2. **Update known issues** — If new limitations are discovered, add them to `docs/KNOWN-ISSUES.md`
101
+ 3. **Update architecture docs** — If architectural decisions were made, add an ADR to `docs/DECISIONS.md`
102
+ 4. **Link Linear issues** — Every issue description should reference:
103
+ - Related roadmap section
104
+ - Files modified (the partition)
105
+ - Related issues (dependencies and follow-ups)
106
+ 5. **Close issues properly** — Move to Done only after independent verification passes all gates
107
+
108
+ ### 7. Completion Criteria
109
+
110
+ The roadmap task is complete when:
111
+
112
+ - [ ] All Linear subtask issues are Done
113
+ - [ ] All deterministic checks pass (lint, test, build) for affected projects
114
+ - [ ] **Dev server started with CLEAN cache** (`rm -rf .next && yarn nx reset` before serving)
115
+ - [ ] **All UI changes verified in Chrome browser via MCP with screenshots taken as proof**
116
+ - [ ] **Every feature in the acceptance criteria visually confirmed** — not just "page loads"
117
+ - [ ] Regression tests confirm no existing functionality is broken
118
+ - [ ] No duplicated code — shared logic extracted to libraries
119
+ - [ ] Visual consistency maintained across all affected pages and apps
120
+ - [ ] Documentation updated (roadmap, known issues, decisions)
121
+ - [ ] Panel review passed for any high-stakes changes
122
+ - [ ] Roadmap item marked complete in `docs/ROADMAP-POST-MVP.md`
123
+ - [ ] Delivery Outcome completed (see `general.instructions.md`) — branch pushed, PR opened (not merged), Linear linked
124
+ - [ ] Lessons learned captured if any retries occurred
@@ -0,0 +1,142 @@
1
+ ---
2
+ description: 'Collect and report metrics from agent logs, GitHub PRs, Linear issues, and Vercel deployments'
3
+ agent: Researcher
4
+ ---
5
+
6
+ # Metrics Report
7
+
8
+ Generate a comprehensive metrics dashboard from all project data sources.
9
+
10
+ ## Data Sources
11
+
12
+ Collect data from ALL of these sources. Run collections in parallel where possible.
13
+
14
+ ### 1. Agent Session Logs (local)
15
+
16
+ Read `.github/customizations/logs/sessions.ndjson` and `.github/customizations/logs/delegations.ndjson`.
17
+
18
+ Compute:
19
+ - **Total sessions** and **sessions per agent**
20
+ - **Success rate** — `outcome` field breakdown (success / partial / failed)
21
+ - **Retries per session** — average and total
22
+ - **Lessons added** — count and which agents contribute most
23
+ - **Delegation stats** — mechanism (sub-agent vs background), tier distribution, success rate per agent
24
+ - **Model usage** — which models used how often
25
+ - **Activity timeline** — sessions per day/week
26
+
27
+ ### 2. GitHub PRs and Commits
28
+
29
+ Use `gh` CLI commands (always prefix with `GH_PAGER=cat`):
30
+
31
+ ```bash
32
+ # All PRs (open + closed + merged)
33
+ GH_PAGER=cat gh pr list --state all --limit 100 --json number,title,state,createdAt,mergedAt,closedAt,author,additions,deletions,changedFiles,labels,headRefName
34
+
35
+ # Recent commits on main
36
+ GH_PAGER=cat gh api repos/{owner}/{repo}/commits --paginate -q '.[0:50] | .[] | {sha: .sha[0:7], date: .commit.author.date, message: .commit.message}' 2>/dev/null || git --no-pager log main --oneline -50
37
+ ```
38
+
39
+ Compute:
40
+ - **PR count** — total, open, merged, closed-without-merge
41
+ - **Merge rate** — merged / (merged + closed-without-merge)
42
+ - **Time to merge** — median and average (createdAt → mergedAt)
43
+ - **PR size** — average additions, deletions, changedFiles
44
+ - **Commit frequency** — commits per day/week on main
45
+ - **Bogus/closed PRs** — PRs closed without merge (potential failed agent work)
46
+
47
+ ### 3. Linear Issues
48
+
49
+ Use Linear MCP tools (`list_issues`, `search_issues`):
50
+
51
+ ```
52
+ list_issues with status filter for each state: Backlog, Todo, In Progress, Done, Cancelled
53
+ ```
54
+
55
+ Compute:
56
+ - **Issue count by status** — Backlog, Todo, In Progress, Done, Cancelled
57
+ - **Completion rate** — Done / (Done + Cancelled + In Progress + Todo)
58
+ - **Issues by label** — which areas have the most work
59
+ - **Issues by priority** — distribution across Urgent/High/Medium/Low
60
+ - **Cycle time** — average time from In Progress → Done (if dates available)
61
+ - **Stale issues** — In Progress for >7 days without updates
62
+
63
+ ### 4. Vercel Deployments
64
+
65
+ Use Vercel MCP tools (`list_deployments`, `get_deployment`):
66
+
67
+ Query deployments for all configured apps (see `project.instructions.md` for the app inventory).
68
+
69
+ Compute:
70
+ - **Total deployments** — count over last 30 days
71
+ - **Deployment success rate** — ready / (ready + error + cancelled)
72
+ - **Failure rate** — error / total
73
+ - **Build times** — average, median, p95
74
+ - **Deployments per day** — activity timeline
75
+ - **Failed deployment details** — which commits/branches failed and why (use `get_deployment_build_logs` for recent failures)
76
+
77
+ ### 5. Panel Reviews (local)
78
+
79
+ Read `.github/customizations/logs/panels.ndjson`.
80
+
81
+ Compute:
82
+ - **Total reviews** — count of panel runs
83
+ - **Pass rate** — pass / total
84
+ - **Must-fix vs should-fix** — average counts per review
85
+ - **Retry rate** — reviews with attempt > 1
86
+ - **Model usage** — which reviewer models used
87
+ - **Reviews by panel key** — what gets reviewed most
88
+
89
+ ### 6. Agent Failures (DLQ)
90
+
91
+ Read `.github/customizations/AGENT-FAILURES.md`.
92
+
93
+ Compute:
94
+ - **Total failures** — count of DLQ entries
95
+ - **Failures by agent** — which agents fail most
96
+ - **Failure status** — pending vs resolved
97
+ - **Common root causes** — categorize failure reasons
98
+
99
+ ## Report Format
100
+
101
+ Present the report as a structured markdown summary with these sections:
102
+
103
+ ```markdown
104
+ # Project Metrics Dashboard
105
+ > Generated: {date} | Period: Last 30 days
106
+
107
+ ## Executive Summary
108
+ - X agent sessions, Y% success rate
109
+ - Z PRs merged, W% merge rate
110
+ - N deployments, M% success rate
111
+ - P Linear issues completed
112
+
113
+ ## Agent Activity
114
+ {sessions table, success rates, model usage}
115
+
116
+ ## Delegation Performance
117
+ {per-agent delegation stats, tier distribution}
118
+
119
+ ## GitHub
120
+ {PR stats, merge rates, commit frequency}
121
+
122
+ ## Linear Board
123
+ {issue distribution, completion rate, stale issues}
124
+
125
+ ## Vercel Deployments
126
+ {success rate, failure rate, build times}
127
+
128
+ ## Panel Reviews
129
+ {pass rate, retry rate, must-fix/should-fix stats}
130
+
131
+ ## Agent Failures (DLQ)
132
+ {failure count, pending items}
133
+
134
+ ## Trends & Recommendations
135
+ {observations, areas for improvement}
136
+ ```
137
+
138
+ ## Usage
139
+
140
+ Run this prompt periodically (weekly recommended) to track project health. Compare with previous reports to identify trends.
141
+
142
+ If session logs are empty (no data yet), still collect GitHub/Linear/Vercel data and note that agent logging has just been enabled.