opencastle 1.6.2 → 1.6.4

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 (275) hide show
  1. package/README.md +9 -9
  2. package/bin/cli.mjs +19 -12
  3. package/dist/cli/adapters/adapter-contract.test.js +1 -1
  4. package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
  5. package/dist/cli/adapters/single-file-base.js +2 -12
  6. package/dist/cli/adapters/single-file-base.js.map +1 -1
  7. package/dist/cli/add.js +7 -7
  8. package/dist/cli/add.js.map +1 -1
  9. package/dist/cli/baseline.js +6 -6
  10. package/dist/cli/baseline.js.map +1 -1
  11. package/dist/cli/bootstrap.d.ts.map +1 -1
  12. package/dist/cli/bootstrap.js +15 -6
  13. package/dist/cli/bootstrap.js.map +1 -1
  14. package/dist/cli/bootstrap.test.js +8 -0
  15. package/dist/cli/bootstrap.test.js.map +1 -1
  16. package/dist/cli/ci.d.ts.map +1 -1
  17. package/dist/cli/ci.js +19 -9
  18. package/dist/cli/ci.js.map +1 -1
  19. package/dist/cli/command-namespace.test.js +4 -21
  20. package/dist/cli/command-namespace.test.js.map +1 -1
  21. package/dist/cli/convoy/engine.js +3 -3
  22. package/dist/cli/convoy/engine.js.map +1 -1
  23. package/dist/cli/convoy/engine.test.js +1 -1
  24. package/dist/cli/convoy/engine.test.js.map +1 -1
  25. package/dist/cli/convoy/read-model.d.ts +8 -15
  26. package/dist/cli/convoy/read-model.d.ts.map +1 -1
  27. package/dist/cli/convoy/read-model.js +9 -68
  28. package/dist/cli/convoy/read-model.js.map +1 -1
  29. package/dist/cli/convoy/read-model.test.js +6 -25
  30. package/dist/cli/convoy/read-model.test.js.map +1 -1
  31. package/dist/cli/convoy/spec-builder.d.ts +2 -2
  32. package/dist/cli/convoy/spec-builder.d.ts.map +1 -1
  33. package/dist/cli/convoy/spec-builder.js +3 -3
  34. package/dist/cli/convoy/spec-builder.js.map +1 -1
  35. package/dist/cli/convoy/spec-builder.test.js +2 -2
  36. package/dist/cli/convoy/spec-builder.test.js.map +1 -1
  37. package/dist/cli/convoy-cmd.js +16 -16
  38. package/dist/cli/convoy-cmd.js.map +1 -1
  39. package/dist/cli/convoy-cmd.test.js +11 -11
  40. package/dist/cli/convoy-cmd.test.js.map +1 -1
  41. package/dist/cli/dashboard.js +3 -3
  42. package/dist/cli/dashboard.js.map +1 -1
  43. package/dist/cli/dashboard.test.js +10 -2
  44. package/dist/cli/dashboard.test.js.map +1 -1
  45. package/dist/cli/dispatcher.test.js +7 -4
  46. package/dist/cli/dispatcher.test.js.map +1 -1
  47. package/dist/cli/docs-accuracy.test.js +5 -1
  48. package/dist/cli/docs-accuracy.test.js.map +1 -1
  49. package/dist/cli/doctor.d.ts.map +1 -1
  50. package/dist/cli/doctor.js +17 -42
  51. package/dist/cli/doctor.js.map +1 -1
  52. package/dist/cli/explain.js +2 -2
  53. package/dist/cli/explain.js.map +1 -1
  54. package/dist/cli/fleet.js +1 -1
  55. package/dist/cli/github-report.js +5 -5
  56. package/dist/cli/github-report.js.map +1 -1
  57. package/dist/cli/gitignore.js +1 -1
  58. package/dist/cli/gitignore.js.map +1 -1
  59. package/dist/cli/init.d.ts.map +1 -1
  60. package/dist/cli/init.js +27 -10
  61. package/dist/cli/init.js.map +1 -1
  62. package/dist/cli/layers.js +4 -4
  63. package/dist/cli/layers.js.map +1 -1
  64. package/dist/cli/lesson.js +12 -12
  65. package/dist/cli/lesson.js.map +1 -1
  66. package/dist/cli/lessons.d.ts.map +1 -1
  67. package/dist/cli/lessons.js +11 -7
  68. package/dist/cli/lessons.js.map +1 -1
  69. package/dist/cli/managed-block.js +1 -1
  70. package/dist/cli/managed-block.js.map +1 -1
  71. package/dist/cli/mcp-audit.js +6 -6
  72. package/dist/cli/mcp-audit.js.map +1 -1
  73. package/dist/cli/mcp-audit.test.js +5 -5
  74. package/dist/cli/mcp-audit.test.js.map +1 -1
  75. package/dist/cli/pipeline.d.ts +1 -1
  76. package/dist/cli/pipeline.flow.test.js +77 -77
  77. package/dist/cli/pipeline.flow.test.js.map +1 -1
  78. package/dist/cli/pipeline.js +30 -30
  79. package/dist/cli/pipeline.js.map +1 -1
  80. package/dist/cli/plan.d.ts +8 -2
  81. package/dist/cli/plan.d.ts.map +1 -1
  82. package/dist/cli/plan.js +18 -12
  83. package/dist/cli/plan.js.map +1 -1
  84. package/dist/cli/plan.test.js +17 -19
  85. package/dist/cli/plan.test.js.map +1 -1
  86. package/dist/cli/plugin.js +8 -8
  87. package/dist/cli/plugin.js.map +1 -1
  88. package/dist/cli/promote.js +5 -5
  89. package/dist/cli/promote.js.map +1 -1
  90. package/dist/cli/prompt.d.ts.map +1 -1
  91. package/dist/cli/prompt.js +15 -2
  92. package/dist/cli/prompt.js.map +1 -1
  93. package/dist/cli/prompt.test.js +33 -8
  94. package/dist/cli/prompt.test.js.map +1 -1
  95. package/dist/cli/remove.js +1 -1
  96. package/dist/cli/review.js +3 -3
  97. package/dist/cli/review.js.map +1 -1
  98. package/dist/cli/run/adapters/index.js +3 -3
  99. package/dist/cli/run/adapters/index.js.map +1 -1
  100. package/dist/cli/run/adapters/index.test.js +3 -3
  101. package/dist/cli/run/adapters/index.test.js.map +1 -1
  102. package/dist/cli/run/schema.js +3 -3
  103. package/dist/cli/run/schema.js.map +1 -1
  104. package/dist/cli/run.js +21 -21
  105. package/dist/cli/run.js.map +1 -1
  106. package/dist/cli/run.test.js +3 -3
  107. package/dist/cli/run.test.js.map +1 -1
  108. package/dist/cli/stack-config-update.test.js +18 -1
  109. package/dist/cli/stack-config-update.test.js.map +1 -1
  110. package/dist/cli/stack-config.d.ts.map +1 -1
  111. package/dist/cli/stack-config.js +10 -1
  112. package/dist/cli/stack-config.js.map +1 -1
  113. package/dist/cli/status.js +9 -9
  114. package/dist/cli/status.js.map +1 -1
  115. package/dist/cli/status.test.js +3 -3
  116. package/dist/cli/status.test.js.map +1 -1
  117. package/dist/cli/sync-check.js +16 -16
  118. package/dist/cli/sync-check.js.map +1 -1
  119. package/dist/cli/sync.js +1 -1
  120. package/dist/cli/team-ci.test.js +3 -3
  121. package/dist/cli/team-ci.test.js.map +1 -1
  122. package/dist/cli/team-commands.test.js +30 -1
  123. package/dist/cli/team-commands.test.js.map +1 -1
  124. package/dist/cli/update.d.ts.map +1 -1
  125. package/dist/cli/update.js +34 -66
  126. package/dist/cli/update.js.map +1 -1
  127. package/package.json +1 -1
  128. package/src/cli/adapters/adapter-contract.test.ts +1 -1
  129. package/src/cli/adapters/single-file-base.ts +2 -11
  130. package/src/cli/add.ts +7 -7
  131. package/src/cli/baseline.ts +6 -6
  132. package/src/cli/bootstrap.test.ts +9 -0
  133. package/src/cli/bootstrap.ts +16 -6
  134. package/src/cli/ci.ts +17 -9
  135. package/src/cli/command-namespace.test.ts +5 -22
  136. package/src/cli/convoy/engine.test.ts +1 -1
  137. package/src/cli/convoy/engine.ts +3 -3
  138. package/src/{orchestrator/prompts/assess-complexity.prompt.md → cli/convoy/prompts/convoy-assess.prompt.md} +0 -3
  139. package/src/{orchestrator/prompts/fix-convoy.prompt.md → cli/convoy/prompts/convoy-plan-fix.prompt.md} +0 -3
  140. package/src/{orchestrator/prompts/validate-convoy.prompt.md → cli/convoy/prompts/convoy-plan-review.prompt.md} +0 -3
  141. package/src/{orchestrator/prompts/generate-convoy.prompt.md → cli/convoy/prompts/convoy-plan.prompt.md} +0 -2
  142. package/src/{orchestrator/prompts/fix-prd.prompt.md → cli/convoy/prompts/convoy-prd-fix.prompt.md} +0 -3
  143. package/src/{orchestrator/prompts/validate-prd.prompt.md → cli/convoy/prompts/convoy-prd-review.prompt.md} +0 -3
  144. package/src/{orchestrator/prompts/generate-prd.prompt.md → cli/convoy/prompts/convoy-prd.prompt.md} +0 -3
  145. package/src/cli/convoy/read-model.test.ts +5 -29
  146. package/src/cli/convoy/read-model.ts +11 -71
  147. package/src/cli/convoy/spec-builder.test.ts +2 -2
  148. package/src/cli/convoy/spec-builder.ts +4 -4
  149. package/src/cli/convoy-cmd.test.ts +11 -11
  150. package/src/cli/convoy-cmd.ts +18 -18
  151. package/src/cli/dashboard/dashboard.js +2 -4
  152. package/src/cli/dashboard.test.ts +10 -2
  153. package/src/cli/dashboard.ts +3 -3
  154. package/src/cli/dispatcher.test.ts +8 -4
  155. package/src/cli/docs-accuracy.test.ts +5 -1
  156. package/src/cli/doctor.ts +17 -43
  157. package/src/cli/explain.ts +2 -2
  158. package/src/cli/fleet.ts +1 -1
  159. package/src/cli/github-report.ts +5 -5
  160. package/src/cli/gitignore.ts +1 -1
  161. package/src/cli/init.ts +26 -10
  162. package/src/cli/layers.ts +4 -4
  163. package/src/cli/lesson.ts +12 -12
  164. package/src/cli/lessons.ts +11 -7
  165. package/src/cli/managed-block.ts +1 -1
  166. package/src/cli/mcp-audit.test.ts +5 -5
  167. package/src/cli/mcp-audit.ts +6 -6
  168. package/src/cli/pipeline.flow.test.ts +78 -78
  169. package/src/cli/pipeline.ts +31 -31
  170. package/src/cli/plan.test.ts +18 -20
  171. package/src/cli/plan.ts +18 -12
  172. package/src/cli/plugin.ts +8 -8
  173. package/src/cli/promote.ts +5 -5
  174. package/src/cli/prompt.test.ts +41 -13
  175. package/src/cli/prompt.ts +14 -2
  176. package/src/cli/remove.ts +1 -1
  177. package/src/cli/review.ts +3 -3
  178. package/src/cli/run/adapters/index.test.ts +3 -3
  179. package/src/cli/run/adapters/index.ts +3 -3
  180. package/src/cli/run/schema.ts +3 -3
  181. package/src/cli/run.test.ts +3 -3
  182. package/src/cli/run.ts +21 -21
  183. package/src/cli/stack-config-update.test.ts +22 -1
  184. package/src/cli/stack-config.ts +9 -1
  185. package/src/cli/status.test.ts +3 -3
  186. package/src/cli/status.ts +9 -9
  187. package/src/cli/sync-check.ts +16 -16
  188. package/src/cli/sync.ts +1 -1
  189. package/src/cli/team-ci.test.ts +3 -3
  190. package/src/cli/team-commands.test.ts +32 -1
  191. package/src/cli/update.ts +32 -74
  192. package/src/orchestrator/agent-workflows/README.md +10 -18
  193. package/src/orchestrator/agent-workflows/data-pipeline.md +7 -140
  194. package/src/orchestrator/agent-workflows/database-migration.md +7 -153
  195. package/src/orchestrator/agent-workflows/performance-optimization.md +6 -119
  196. package/src/orchestrator/agent-workflows/refactoring.md +8 -137
  197. package/src/orchestrator/agent-workflows/schema-changes.md +8 -159
  198. package/src/orchestrator/agent-workflows/security-audit.md +7 -142
  199. package/src/orchestrator/agent-workflows/shared-delivery-phase.md +8 -25
  200. package/src/orchestrator/agents/architect.agent.md +2 -14
  201. package/src/orchestrator/agents/content-engineer.agent.md +8 -10
  202. package/src/orchestrator/agents/data-engineer.agent.md +8 -8
  203. package/src/orchestrator/agents/developer.agent.md +3 -10
  204. package/src/orchestrator/agents/devops-expert.agent.md +0 -3
  205. package/src/orchestrator/agents/performance-expert.agent.md +2 -3
  206. package/src/orchestrator/agents/security-expert.agent.md +10 -12
  207. package/src/orchestrator/agents/team-lead.agent.md +31 -75
  208. package/src/orchestrator/agents/testing-expert.agent.md +3 -6
  209. package/src/orchestrator/agents/ui-ux-expert.agent.md +1 -4
  210. package/src/orchestrator/agents/writer.agent.md +0 -3
  211. package/src/orchestrator/customizations/LESSONS-LEARNED.md +5 -3
  212. package/src/orchestrator/customizations/README.md +3 -4
  213. package/src/orchestrator/customizations/agents/agent-registry.md +3 -3
  214. package/src/orchestrator/customizations/agents/skill-matrix.json +6 -42
  215. package/src/orchestrator/instructions/general.instructions.md +10 -37
  216. package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +4 -6
  217. package/src/orchestrator/prompts/brainstorm.prompt.md +7 -12
  218. package/src/orchestrator/prompts/bug-fix.prompt.md +19 -100
  219. package/src/orchestrator/prompts/convoy.prompt.md +20 -0
  220. package/src/orchestrator/prompts/create-skill.prompt.md +1 -5
  221. package/src/orchestrator/prompts/implement-feature.prompt.md +22 -93
  222. package/src/orchestrator/prompts/resolve-pr-comments.prompt.md +1 -5
  223. package/src/orchestrator/skills/api-patterns/SKILL.md +21 -18
  224. package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +1 -1
  225. package/src/orchestrator/skills/fast-review/SKILL.md +28 -65
  226. package/src/orchestrator/skills/frontend-design/REFERENCE.md +0 -1
  227. package/src/orchestrator/skills/frontend-design/SKILL.md +3 -1
  228. package/src/orchestrator/skills/git-workflow/SKILL.md +18 -34
  229. package/src/orchestrator/skills/panel-majority-vote/SKILL.md +16 -46
  230. package/src/orchestrator/skills/security-hardening/SKILL.md +20 -19
  231. package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +2 -2
  232. package/src/orchestrator/skills/self-improvement/SKILL.md +21 -46
  233. package/src/orchestrator/skills/technical-writing/SKILL.md +3 -1
  234. package/src/orchestrator/skills/technical-writing/TEMPLATES.md +23 -0
  235. package/src/orchestrator/skills/testing-workflow/SKILL.md +21 -23
  236. package/src/orchestrator/skills/validation-gates/REFERENCE.md +2 -14
  237. package/src/orchestrator/skills/validation-gates/SKILL.md +10 -88
  238. package/dist/cli/log.d.ts +0 -44
  239. package/dist/cli/log.d.ts.map +0 -1
  240. package/dist/cli/log.js +0 -336
  241. package/dist/cli/log.js.map +0 -1
  242. package/dist/cli/log.test.d.ts +0 -2
  243. package/dist/cli/log.test.d.ts.map +0 -1
  244. package/dist/cli/log.test.js +0 -208
  245. package/dist/cli/log.test.js.map +0 -1
  246. package/src/cli/log.test.ts +0 -228
  247. package/src/cli/log.ts +0 -374
  248. package/src/orchestrator/agent-workflows/bug-fix.md +0 -130
  249. package/src/orchestrator/agent-workflows/feature-implementation.md +0 -232
  250. package/src/orchestrator/instructions/ai-optimization.instructions.md +0 -17
  251. package/src/orchestrator/prompts/quick-refinement.prompt.md +0 -110
  252. package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +0 -44
  253. package/src/orchestrator/skills/agent-hooks/SKILL.md +0 -80
  254. package/src/orchestrator/skills/agent-memory/KNOWLEDGE-GRAPH.md +0 -49
  255. package/src/orchestrator/skills/agent-memory/SKILL.md +0 -50
  256. package/src/orchestrator/skills/code-commenting/SKILL.md +0 -18
  257. package/src/orchestrator/skills/context-map/REFERENCE.md +0 -67
  258. package/src/orchestrator/skills/context-map/SKILL.md +0 -71
  259. package/src/orchestrator/skills/decomposition/SKILL.md +0 -103
  260. package/src/orchestrator/skills/documentation-standards/SKILL.md +0 -33
  261. package/src/orchestrator/skills/fast-review/REFERENCE.md +0 -28
  262. package/src/orchestrator/skills/memory-merger/SKILL.md +0 -77
  263. package/src/orchestrator/skills/observability-logging/LOG-SCHEMA.md +0 -238
  264. package/src/orchestrator/skills/observability-logging/SKILL.md +0 -73
  265. package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +0 -38
  266. package/src/orchestrator/skills/orchestration-protocols/SKILL.md +0 -120
  267. package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +0 -49
  268. package/src/orchestrator/skills/panel-majority-vote/panel-report.template.md +0 -38
  269. package/src/orchestrator/skills/performance-optimization/SKILL.md +0 -23
  270. package/src/orchestrator/skills/project-consistency/SKILL.md +0 -80
  271. package/src/orchestrator/skills/project-consistency/TEMPLATES.md +0 -35
  272. package/src/orchestrator/skills/react-development/SKILL.md +0 -24
  273. package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +0 -56
  274. package/src/orchestrator/skills/session-checkpoints/SKILL.md +0 -40
  275. package/src/orchestrator/skills/team-lead-reference/SKILL.md +0 -126
@@ -1,50 +0,0 @@
1
- ---
2
- name: agent-memory
3
- description: "Creates, queries agent expertise profiles in AGENT-EXPERTISE.md; increments file-familiarity counters after each task; ranks candidate agents by recency, task-area match. Use when deciding which agent should handle a file, checking who last worked on a module, recording task outcomes, or assigning work based on past performance."
4
- ---
5
-
6
- # Agent Memory Protocol
7
-
8
- ## Expertise File
9
-
10
- **Location:** `.opencastle/AGENT-EXPERTISE.md`, created on the first update. One `## <Agent>` section per agent that has worked here, each with `### Strong Areas`, `### Weak Areas` and `### File Familiarity`; add the file, then the section, when they are missing.
11
-
12
- Entry format: `| Area | Evidence | Last Updated |` — e.g. `| Server Components | Built TAS-42 | 2026-03-15 |`. File familiarity: `- src/lib/search/ — 3 tasks`.
13
-
14
- ## Update Triggers
15
-
16
- | Trigger | Action |
17
- |---------|--------|
18
- | First-attempt success | Update Strong |
19
- | 2+ retries | Update Weak |
20
- | File modified | Increment familiarity |
21
- | DLQ failure | Add Weak with ref |
22
- | >3 months stale | Mark as "stale" |
23
-
24
- ## Retrieval & Delegation
25
-
26
- Query before delegating — there is nothing to read until the file exists — and include a concise context block in the prompt:
27
-
28
- ```sh
29
- grep -A12 "^## Developer" .opencastle/AGENT-EXPERTISE.md 2>/dev/null
30
- ```
31
-
32
- Example prompt block: `Agent Context: Strong — Server Components (3 tasks); Weak — Component styling (2 retries); Familiar — src/lib/search/ (2 tasks)`
33
-
34
- **After task completion,** edit the agent's section with your file-editing tool: add the row under the right table, or raise the task count on the familiarity line. Appending with `>>` puts the row at the end of the file, under whichever agent's section happens to be last.
35
-
36
- After each task also add file relationships to `.opencastle/KNOWLEDGE-GRAPH.md`, created the same way. On DLQ failure, the Weak Area entry must carry the failure ID and a link to its logs.
37
-
38
- ## Validation Checkpoints
39
-
40
- - Before delegating: chosen agent has a Strong area matching the task and no conflicting Weak entry.
41
- - After completion: expertise file has the new entry, timestamped today.
42
- - After pruning: every path on a familiarity line still exists.
43
-
44
- ## Pruning
45
-
46
- Prune entries older than 6 months; remove familiarity for deleted paths; consolidate duplicates.
47
-
48
- ## Knowledge Graph
49
-
50
- File dependency graph, cross-agent relationships. See [KNOWLEDGE-GRAPH.md](./KNOWLEDGE-GRAPH.md) for entity types, templates, triggers, queries.
@@ -1,18 +0,0 @@
1
- ---
2
- name: code-commenting
3
- description: "When and how to comment code: the why over the what, annotation tags, public API docs and anti-patterns. Use when writing or reviewing comments, docstrings or TODO/FIXME tags."
4
- ---
5
-
6
- # Code Commenting
7
-
8
- Comment WHY, not WHAT. When a bad name is the real problem, rename instead of commenting. Do comment: non-obvious algorithm choices, regexes, external API constraints, and the rationale behind every magic number or config constant. JSDoc every public API function.
9
-
10
- ## Annotation Tags
11
-
12
- `TODO` planned work · `FIXME` known bug · `HACK` workaround (say why and when it can go) · `NOTE` non-obvious constraint · `WARNING` side effect / mutation risk · `PERF` hot path · `SECURITY` security-sensitive · `DEPRECATED` (name the replacement and removal version).
13
-
14
- ## Never
15
-
16
- - Leave commented-out code — delete it; git has the history.
17
- - Keep a changelog in comments — that is `git log`.
18
- - Add decorative divider comments.
@@ -1,67 +0,0 @@
1
- Full context-map template, partition derivation, and Team Lead integration.
2
-
3
- ## Context Map Template
4
-
5
- ## Context Map: [Task Name]
6
-
7
- ### Entry Points (MUST change)
8
- | File | Reason | Owner |
9
- |------|--------|-------|
10
- | `libs/queries/src/lib/places.ts` | Add query field | Content Engineer |
11
- | `libs/ui-kit/.../PlaceCard/` | Display new field | UI/UX Expert |
12
-
13
- ### Cascade Effects (WILL change)
14
- | File | Triggered By | Reason | Owner |
15
- |------|-------------|--------|-------|
16
- | `apps/web-app/places/page.tsx` | PlaceCard | Update props | Frontend Dev |
17
- | `libs/queries/src/lib/__tests__/places.test.ts` | Query | Update test | Testing Expert |
18
-
19
- ### Shared Boundaries (WATCH)
20
- | File | Risk | Mitigation |
21
- |------|------|------------|
22
- | `libs/ui-kit/src/lib/index.ts` | Barrel export conflict | Merge sequentially |
23
-
24
- ### Unaffected (optional)
25
- | Area | Why |
26
- |------|-----|
27
- | `db/migrations/` | No DB changes |
28
- | `libs/auth/` | No auth changes |
29
-
30
- ### 4b — Validate Map
31
- - [ ] Every file appears in exactly one section (Entry/Cascade/Shared/Unaffected)
32
- - [ ] No file appears in two agents' partitions
33
- - [ ] Test files are listed for every changed source file
34
- - [ ] Shared boundaries have explicit mitigation strategies
35
-
36
- ### 5 — Derive File Partitions
37
-
38
- Assign ownership — no file in two partitions; shared boundaries to one agent (merged first); test files to Testing Expert unless tightly coupled.
39
-
40
- ```
41
- Agent A: libs/queries/src/lib/places.ts
42
- Agent B: libs/ui-kit/.../PlaceCard/
43
- Agent C: apps/web-app/places/, apps/admin-panel/places/
44
- Agent D: **/*test*, **/*spec*
45
- ```
46
-
47
- ## Depth Levels
48
-
49
- | Complexity | Files | Depth |
50
- |------------|-------|-------|
51
- | Small | 1–3 | Entry points + direct imports |
52
- | Medium | 4–8 | Entry + 1-hop cascade |
53
- | Large | 9+ | Full dependency graph |
54
-
55
- ## Team Lead Integration
56
-
57
- Produced in **Phase 1**; consumed by:
58
- - **Decomposition** — informs file partitions
59
- - **Delegation prompts** — agents receive their map section
60
- - **QA Gate** — compare actual changes against map to detect scope creep
61
-
62
- Delegation prompt snippet:
63
- ```markdown
64
- ## Your File Partition
65
- Modify only: `libs/queries/src/lib/places.ts`, `libs/queries/src/lib/__tests__/places.test.ts`
66
- Do NOT modify: `libs/ui-kit/` (UI/UX Expert), `apps/` (Developer)
67
- ```
@@ -1,71 +0,0 @@
1
- ---
2
- name: context-map
3
- description: "Maps which files a change touches, their importers and shared dependencies, and groups them for safe parallel editing. Use when planning a refactor or a change across 5+ files, or partitioning files between agents."
4
- ---
5
-
6
- # Skill: Context Map
7
-
8
- Generate **file impact map** before code changes to identify affected files, relationships, cascades — improves agent file partitions for parallel work.
9
-
10
- ## When to Use
11
-
12
- | Use | Skip |
13
- |-----|------|
14
- | Feature implementation (Phase 1) | Isolated bug fixes ≤2 files |
15
- | Refactoring (Phase 1 Scope) | |
16
- | Schema changes cascading through queries/components | |
17
- | Any task touching `libs/` | |
18
-
19
- ## Steps
20
-
21
- ### 1 — Entry Points
22
- Identify files that MUST change from task description.
23
-
24
- ### 2 — Trace Outward (dependents)
25
- Find consumers of entry-point exports:
26
- ```bash
27
- rg -n "import .*from .*libs/auth" # find importers
28
- rg -n "\bAuthCard\b" --type ts # find component consumers (ts covers .tsx)
29
- rg -n "auth.*route|/auth" # find route references
30
- ```
31
- If the assistant exposes a code-usage lookup (find-references), prefer it for
32
- symbols: it resolves re-exports and aliases that a text search misses.
33
-
34
- ### 3 — Trace Inward (sources)
35
- Find what entry points depend on:
36
- ```bash
37
- rg -n "from .*libs/" src/auth/ # shared lib deps
38
- rg -n "from .*config" src/auth/ # config deps
39
- ```
40
-
41
- ### 4 — Build the Map
42
-
43
- Produce a compact map for Team Lead and downstream agents:
44
-
45
- ```markdown
46
- Context Map — Feature: Add priceRange
47
-
48
- - Entry points:
49
- - src/lib/place/schema.ts
50
- - src/components/PriceRangeFilter/PriceRangeFilter.tsx
51
-
52
- - Dependents (trace outward):
53
- - src/pages/places/page.tsx
54
- - src/components/PlacesList/PlaceCard.tsx
55
-
56
- - Sources (trace inward):
57
- - src/lib/filters.ts
58
- - src/shared/types/place.ts
59
-
60
- - Unaffected (optional):
61
- - src/components/Account/**
62
- ```
63
-
64
- Validation checkpoint: every search hit lands in the map; all listed files open without errors (typecheck via the **codebase-tool** slot). Full template, depth levels, partition derivation, Team Lead integration: see [REFERENCE.md](./REFERENCE.md).
65
-
66
- ## Anti-Patterns
67
-
68
- - Skipping for "obvious" tasks — shared libs cascade unexpectedly
69
- - Guessing dependencies instead of searching for them
70
- - Over-mapping a 2-file fix
71
- - Using a stale map after plan changes
@@ -1,103 +0,0 @@
1
- ---
2
- name: decomposition
3
- description: "Breaks a feature into phased subtasks by dependency and writes the delegation spec for each. Use when planning delegations for multi-agent work, ordering dependent tasks, or splitting a feature into parallel phases."
4
- ---
5
-
6
- # Task Decomposition
7
-
8
-
9
- ## Dependency Resolution
10
-
11
- `TaskB → TaskA` = B depends on A (must finish first).
12
-
13
- **Topological sort:** No-dep tasks → Phase 1. Tasks depending only on Phase N → Phase N+1. Same-phase tasks with no mutual deps run in parallel.
14
-
15
- **Cycle detection:** If A → B → C → A, split one task into independent part + dependent part.
16
-
17
- ```
18
- Graph: Plan:
19
- E → C → A Phase 1: A, B (parallel)
20
- D → B Phase 2: C, D (parallel)
21
- F → C, D Phase 3: E, F (parallel)
22
- ```
23
-
24
- ## Delegation Spec
25
-
26
- For score 1-3, objective + files + criteria is sufficient. Full template:
27
-
28
- ```markdown
29
- ## Delegation Spec: [Task Title]
30
- **Tracker Issue:** TAS-XX — [Title]
31
- **Complexity:** [score]/13 → [tier] tier
32
- **Agent:** [Agent Name]
33
-
34
- ### Objective
35
- 1-3 sentences: what to build/change and why.
36
-
37
- ### Context
38
- - Key files: [list]
39
- - Related patterns: [file:line references]
40
- - Prior phase output: [compacted summary if applicable]
41
- - Relevant lessons: [ids from LESSONS-LEARNED.md]
42
-
43
- ### Constraints
44
- - File partition: Only modify files under [paths]
45
- - Do NOT modify: [explicit exclusions]
46
- - Dependencies: Requires [TAS-XX] Done first
47
-
48
- ### Acceptance Criteria
49
- - [ ] Criterion 1
50
-
51
- ### Expected Output
52
- Files changed · Verification (lint/test/build) · AC status (✅/❌) · Discovered issues · Lessons applied
53
- ```
54
-
55
- Read `.opencastle/LESSONS-LEARNED.md` before starting. Add lesson if you retry any approach.
56
-
57
- ## Prompt Quality
58
-
59
- | Quality | Example |
60
- |---------|---------|
61
- | Strong (score 2) | "**TAS-42** — Fix token refresh. Users get 'Invalid token' after 30 min. JWT 1h expiry in `libs/auth/src/server.ts`. Fix refresh logic. Only `libs/auth/`. Run auth tests." |
62
- | Strong (score 8) | Use Delegation Spec Template above (all sections). |
63
- | Weak | "Fix the authentication bug." |
64
-
65
- ## Delegation Mechanism
66
-
67
- ```
68
- Need result immediately?
69
- YES → Is dependency for next step?
70
- YES → Sub-Agent (inline)
71
- NO → Sub-Agent or Background (if large)
72
- NO → Expected > 5 min?
73
- YES → Background Agent
74
- NO → Sub-Agent (sequential)
75
- ```
76
-
77
- ## Mixed Delegation
78
-
79
- | Phase | Mode | Work |
80
- |-------|------|------|
81
- | 1 | sub-agent | Research — context, patterns, file map |
82
- | 2 | background | Foundation — DB migration + scaffolding (parallel) |
83
- | 3 | sub-agent | Integration — wire components to data |
84
- | 4 | background | Validation — security audit + tests + docs (parallel) |
85
- | 5 | sub-agent | QA gate — verify phases, run builds |
86
- | 6 | sub-agent | Panel review — load panel-majority-vote skill |
87
-
88
- ## Foundation-First Pattern
89
-
90
- Apply when: 2+ pages/views/UI sections · multiple agents produce visual output · no existing design system.
91
-
92
- Phase 1 `foundation-setup` is sequential; every visual task gets `depends_on: [foundation-setup]` and the 5 Foundation References in its prompt.
93
-
94
- **Partition rules:**
95
- - Foundation owns: `src/styles/`, `src/components/Layout.*`, `src/components/ui/`
96
- - Page tasks own: their page file + page-specific components only
97
- - No page task may list a foundation-owned path in its `files[]`
98
-
99
- **Common mistake:** Decomposing pages as independent Phase 1 tasks → each agent invents its own design.
100
-
101
- Specs must be paste-ready for a sub-agent: exact paths, line ranges, forbidden files — no human translation step.
102
-
103
- > Load **project-consistency** skill for full Foundation Phase pattern, prompt templates, anti-patterns.
@@ -1,33 +0,0 @@
1
- ---
2
- name: documentation-standards
3
- description: "Templates for issue docs, ADRs, roadmap entries, changelogs and Mermaid diagrams. Use when drafting an ADR, a changelog entry or a known-issue doc, updating the roadmap after a feature ships, or diagramming a system."
4
- ---
5
-
6
- # Documentation Standards
7
-
8
- The project's own documents are listed under Key Documentation in `.opencastle/project.instructions.md`.
9
-
10
- ## Templates
11
-
12
- Write the prose in each by the **technical-writing** and **unslop** skills.
13
-
14
- **Issue doc** — `### ISSUE-ID: Brief Description`, then: Issue ID, Status (Known Limitation | Fixed | Workaround Available), Severity (Critical | High | Medium | Low), Impact, Problem, Root Cause, Solution Options (numbered, each with Pros/Cons), Related Files (path — what it does).
15
-
16
- **ADR** — `## ADR-NNN: Decision Title`, then: Date, Status (Accepted | Superseded | Deprecated), Context, Decision, Consequences, Alternatives Considered.
17
-
18
- **Roadmap completion** — add a `COMPLETE` row: feature, `Completed: YYYY-MM-DD | Owner: @handle`, files changed with rationale, validation command plus exit status. Then move it to the `Completed` section with a one-line release note.
19
-
20
- **Changelog** — under a `## [1.2.0] - YYYY-MM-DD` heading, group changes as Added / Changed / Fixed / Removed, one imperative line per change with its PR or issue number, most recent version first. Breaking changes lead their group.
21
-
22
- ## Mermaid Diagrams
23
-
24
- One concern per diagram, max 10–12 nodes. `flowchart TD` for pipelines, `LR` for request flows, `sequenceDiagram` for API flows, `erDiagram` for data models. Verb labels on arrows; `%% Title: ...` on complex diagrams.
25
-
26
- ## Validate
27
-
28
- Check links and formatting before committing docs. Resolve the formatter
29
- command via the **codebase-tool** slot; the link checker is standalone:
30
-
31
- ```bash
32
- npx markdown-link-check docs/**/*.md
33
- ```
@@ -1,28 +0,0 @@
1
- # Fast Review — Reviewer Prompt Template
2
-
3
- ```markdown
4
- You are a code reviewer. Be concise and specific.
5
-
6
- ## Task: [ID] — [Title]
7
- Acceptance Criteria: [list]
8
-
9
- ## File Partition: [allowed dirs/files]
10
- ## Changed Files: [path + key diff]
11
- ## Deterministic: Lint: [P/F] | Tests: [P/F] | Build: [P/F]
12
-
13
- ## Checklist
14
- 1. Acceptance criteria met?
15
- 2. Partition respected?
16
- 3. No regressions?
17
- 4. Errors surfaced (no swallowed exceptions)?
18
- 5. Type safety (no `as any`)?
19
- 6. No secrets/injection vectors?
20
- 7. Edge cases handled?
21
-
22
- ## Prior Feedback (retry only): [previous FAIL]
23
-
24
- VERDICT: PASS | FAIL
25
- ISSUES: - [severity:critical|major|minor] Description
26
- FEEDBACK: [Actionable feedback.]
27
- CONFIDENCE: low | medium | high
28
- ```
@@ -1,77 +0,0 @@
1
- ---
2
- name: memory-merger
3
- description: "Graduates mature lessons from .opencastle/lessons/ into permanent rules in skill or instruction files, then archives them. Use when the lessons index grows past 50, or a lesson has proven itself and belongs in a skill."
4
- ---
5
-
6
- # Memory Merger
7
-
8
-
9
- ## Run Criteria
10
-
11
- Run a pass when `.opencastle/lessons/` holds more than 50 lessons. A lesson is a merge candidate when it meets one or more of these, each checkable from its file:
12
-
13
- | Criterion | Check |
14
- |-----------|-------|
15
- | Age | `added:` more than 60 days ago, and the lesson still holds |
16
- | Valid citation | Its cited files still exist and `opencastle doctor` reports no changed citation (or `verified:` is recent) |
17
- | Recurrence | Two or more lessons describe the same problem, or 5+ share a category |
18
- | Severity | `severity: high`, or the lesson blocked work |
19
-
20
- ## Workflow (numbered)
21
-
22
- 1. Scan `.opencastle/lessons/` for candidate lessons by the criteria above.
23
- 2. Map each candidate to target file, section.
24
- 3. Draft exact edit (concise rule or example).
25
- 4. Apply edit with attribution comment.
26
- 5. Archive the lesson with `opencastle lesson archive`.
27
- 6. Run validation checks.
28
-
29
- ## Merge Protocol
30
-
31
- ### 3 — Draft Edit
32
-
33
- ```
34
- Lesson: <id> — [title]
35
- Target: [file path]
36
- Section: [section name]
37
- Edit: [exact text]
38
- ```
39
- Strategies: add rule, add anti-pattern, add code example, expand existing rule, add table row.
40
-
41
- ### 4 — Apply & Attribute
42
-
43
- Edit target file; add `<!-- Merged from <id> -->` attribution inline.
44
-
45
- ### 5 — Archive
46
-
47
- ```sh
48
- opencastle lesson archive <id> --into <target file>
49
- ```
50
-
51
- The lesson keeps its file, is marked archived with where it went, and moves to the index's **Archived** section — out of the list agents read before work. Never edit `LESSONS-LEARNED.md` by hand: it is rewritten from the lesson files.
52
-
53
- **Never delete lessons** — archive for traceability.
54
-
55
- ### Automating the scan
56
-
57
- ```sh
58
- # Oldest lessons first — candidates once past 60 days
59
- rg -H '^added:' .opencastle/lessons/ | sort -t'"' -k2 | head -20
60
-
61
- # Categories with 5+ lessons
62
- rg -o --no-filename '^category: *.*' .opencastle/lessons/ | sort | uniq -c | awk '$1 >= 5'
63
- ```
64
-
65
- ## Quality Gates (validation checkpoints)
66
-
67
- - [ ] No duplicate rules created in target files or other skills
68
- - [ ] Archived lesson references target file and date
69
- - [ ] Target file still passes lint/markdown checks (if applicable)
70
- - [ ] Keyword search in the target file confirms the merge applied
71
-
72
- ## Anti-Patterns
73
-
74
- - Merge too eagerly — a lesson younger than 60 days needs recurrence or high severity to qualify
75
- - Copy verbatim — rewrite as rules/guidelines, not incident reports
76
- - Merge conflicting lessons — resolve conflict first
77
- - Create new files for merged content — merge INTO existing files only