opencastle 1.5.0 → 1.6.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 (177) hide show
  1. package/dist/cli/adapters/claude-code.d.ts.map +1 -1
  2. package/dist/cli/adapters/claude-code.js +1 -0
  3. package/dist/cli/adapters/claude-code.js.map +1 -1
  4. package/dist/cli/adapters/single-file-base.d.ts +8 -0
  5. package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
  6. package/dist/cli/adapters/single-file-base.js +48 -22
  7. package/dist/cli/adapters/single-file-base.js.map +1 -1
  8. package/dist/cli/bootstrap-on-init.test.js +11 -0
  9. package/dist/cli/bootstrap-on-init.test.js.map +1 -1
  10. package/dist/cli/command-namespace.test.js +17 -0
  11. package/dist/cli/command-namespace.test.js.map +1 -1
  12. package/dist/cli/convoy/engine.d.ts +12 -0
  13. package/dist/cli/convoy/engine.d.ts.map +1 -1
  14. package/dist/cli/convoy/engine.git.test.js +55 -0
  15. package/dist/cli/convoy/engine.git.test.js.map +1 -1
  16. package/dist/cli/convoy/engine.js +39 -1
  17. package/dist/cli/convoy/engine.js.map +1 -1
  18. package/dist/cli/convoy/findings.d.ts +35 -0
  19. package/dist/cli/convoy/findings.d.ts.map +1 -0
  20. package/dist/cli/convoy/findings.js +100 -0
  21. package/dist/cli/convoy/findings.js.map +1 -0
  22. package/dist/cli/convoy/findings.test.d.ts +2 -0
  23. package/dist/cli/convoy/findings.test.d.ts.map +1 -0
  24. package/dist/cli/convoy/findings.test.js +75 -0
  25. package/dist/cli/convoy/findings.test.js.map +1 -0
  26. package/dist/cli/convoy/isolation.d.ts.map +1 -1
  27. package/dist/cli/convoy/isolation.js +2 -1
  28. package/dist/cli/convoy/isolation.js.map +1 -1
  29. package/dist/cli/convoy/worktree.d.ts +5 -0
  30. package/dist/cli/convoy/worktree.d.ts.map +1 -1
  31. package/dist/cli/convoy/worktree.js +12 -0
  32. package/dist/cli/convoy/worktree.js.map +1 -1
  33. package/dist/cli/docs-accuracy.test.js +34 -0
  34. package/dist/cli/docs-accuracy.test.js.map +1 -1
  35. package/dist/cli/doctor.d.ts +11 -0
  36. package/dist/cli/doctor.d.ts.map +1 -1
  37. package/dist/cli/doctor.js +70 -6
  38. package/dist/cli/doctor.js.map +1 -1
  39. package/dist/cli/doctor.test.js +82 -1
  40. package/dist/cli/doctor.test.js.map +1 -1
  41. package/dist/cli/init.d.ts.map +1 -1
  42. package/dist/cli/init.js +58 -53
  43. package/dist/cli/init.js.map +1 -1
  44. package/dist/cli/init.test.js +28 -23
  45. package/dist/cli/init.test.js.map +1 -1
  46. package/dist/cli/layers.d.ts +20 -0
  47. package/dist/cli/layers.d.ts.map +1 -1
  48. package/dist/cli/layers.js +53 -1
  49. package/dist/cli/layers.js.map +1 -1
  50. package/dist/cli/layers.test.js +67 -1
  51. package/dist/cli/layers.test.js.map +1 -1
  52. package/dist/cli/lessons.d.ts +10 -0
  53. package/dist/cli/lessons.d.ts.map +1 -1
  54. package/dist/cli/lessons.js +26 -1
  55. package/dist/cli/lessons.js.map +1 -1
  56. package/dist/cli/lessons.test.js +38 -1
  57. package/dist/cli/lessons.test.js.map +1 -1
  58. package/dist/cli/plan.test.js +10 -8
  59. package/dist/cli/plan.test.js.map +1 -1
  60. package/dist/cli/sync-check.test.js +14 -2
  61. package/dist/cli/sync-check.test.js.map +1 -1
  62. package/dist/orchestrator/plugins/notion/config.d.ts.map +1 -1
  63. package/dist/orchestrator/plugins/notion/config.js +21 -17
  64. package/dist/orchestrator/plugins/notion/config.js.map +1 -1
  65. package/package.json +1 -1
  66. package/src/cli/adapters/claude-code.ts +1 -0
  67. package/src/cli/adapters/single-file-base.ts +63 -31
  68. package/src/cli/bootstrap-on-init.test.ts +12 -0
  69. package/src/cli/command-namespace.test.ts +17 -0
  70. package/src/cli/convoy/engine.git.test.ts +59 -0
  71. package/src/cli/convoy/engine.ts +44 -0
  72. package/src/cli/convoy/findings.test.ts +86 -0
  73. package/src/cli/convoy/findings.ts +129 -0
  74. package/src/cli/convoy/isolation.ts +2 -1
  75. package/src/cli/convoy/worktree.ts +12 -0
  76. package/src/cli/docs-accuracy.test.ts +42 -0
  77. package/src/cli/doctor.test.ts +101 -1
  78. package/src/cli/doctor.ts +73 -7
  79. package/src/cli/init.test.ts +27 -22
  80. package/src/cli/init.ts +62 -57
  81. package/src/cli/layers.test.ts +72 -1
  82. package/src/cli/layers.ts +52 -1
  83. package/src/cli/lessons.test.ts +48 -0
  84. package/src/cli/lessons.ts +27 -1
  85. package/src/cli/plan.test.ts +10 -8
  86. package/src/cli/sync-check.test.ts +16 -2
  87. package/src/orchestrator/agent-workflows/feature-implementation.md +1 -1
  88. package/src/orchestrator/agents/team-lead.agent.md +5 -5
  89. package/src/orchestrator/agents/testing-expert.agent.md +2 -2
  90. package/src/orchestrator/customizations/LESSONS-LEARNED.md +1 -1
  91. package/src/orchestrator/instructions/ai-optimization.instructions.md +6 -23
  92. package/src/orchestrator/instructions/general.instructions.md +22 -95
  93. package/src/orchestrator/plugins/astro/skills/astro-framework/SKILL.md +1 -3
  94. package/src/orchestrator/plugins/chrome-devtools/skills/browser-testing/SKILL.md +3 -5
  95. package/src/orchestrator/plugins/cloudflare/skills/cloudflare-platform/SKILL.md +2 -2
  96. package/src/orchestrator/plugins/contentful/skills/contentful-cms/SKILL.md +1 -1
  97. package/src/orchestrator/plugins/convex/skills/convex-database/SKILL.md +1 -3
  98. package/src/orchestrator/plugins/coolify/skills/coolify-deployment/SKILL.md +1 -1
  99. package/src/orchestrator/plugins/cypress/skills/cypress-testing/SKILL.md +1 -1
  100. package/src/orchestrator/plugins/drizzle/skills/drizzle-orm/SKILL.md +1 -1
  101. package/src/orchestrator/plugins/expo/skills/expo-development/SKILL.md +2 -2
  102. package/src/orchestrator/plugins/figma/skills/figma-design/SKILL.md +1 -3
  103. package/src/orchestrator/plugins/hetzner/skills/hetzner-cloud/SKILL.md +1 -1
  104. package/src/orchestrator/plugins/jira/skills/jira-management/SKILL.md +1 -3
  105. package/src/orchestrator/plugins/linear/skills/linear-task-management/SKILL.md +1 -3
  106. package/src/orchestrator/plugins/netlify/skills/netlify-deployment/SKILL.md +2 -2
  107. package/src/orchestrator/plugins/nextjs/skills/nextjs-framework/SKILL.md +13 -6
  108. package/src/orchestrator/plugins/notion/config.ts +21 -17
  109. package/src/orchestrator/plugins/notion/skills/notion-knowledge-management/SKILL.md +8 -16
  110. package/src/orchestrator/plugins/nx/skills/nx-workspace/SKILL.md +2 -4
  111. package/src/orchestrator/plugins/playwright/skills/playwright-testing/SKILL.md +1 -3
  112. package/src/orchestrator/plugins/prisma/skills/prisma-database/SKILL.md +1 -3
  113. package/src/orchestrator/plugins/resend/skills/resend-email/SKILL.md +2 -2
  114. package/src/orchestrator/plugins/sanity/skills/sanity-cms/SKILL.md +1 -3
  115. package/src/orchestrator/plugins/sentry/skills/sentry-monitoring/SKILL.md +1 -1
  116. package/src/orchestrator/plugins/slack/skills/slack-notifications/SKILL.md +1 -3
  117. package/src/orchestrator/plugins/strapi/skills/strapi-cms/SKILL.md +1 -3
  118. package/src/orchestrator/plugins/stripe/skills/stripe-payments/SKILL.md +4 -4
  119. package/src/orchestrator/plugins/supabase/skills/supabase-database/SKILL.md +3 -5
  120. package/src/orchestrator/plugins/teams/skills/teams-notifications/SKILL.md +1 -3
  121. package/src/orchestrator/plugins/trello/skills/trello-task-management/SKILL.md +1 -1
  122. package/src/orchestrator/plugins/turborepo/skills/turborepo-monorepo/SKILL.md +15 -88
  123. package/src/orchestrator/plugins/vercel/skills/vercel-deployment/SKILL.md +2 -2
  124. package/src/orchestrator/plugins/vitest/skills/vitest-testing/SKILL.md +17 -150
  125. package/src/orchestrator/prompts/assess-complexity.prompt.md +1 -0
  126. package/src/orchestrator/prompts/create-skill.prompt.md +13 -67
  127. package/src/orchestrator/prompts/fix-convoy.prompt.md +1 -0
  128. package/src/orchestrator/prompts/fix-prd.prompt.md +1 -0
  129. package/src/orchestrator/prompts/generate-prd.prompt.md +1 -0
  130. package/src/orchestrator/prompts/resolve-pr-comments.prompt.md +2 -2
  131. package/src/orchestrator/prompts/validate-convoy.prompt.md +1 -0
  132. package/src/orchestrator/prompts/validate-prd.prompt.md +1 -0
  133. package/src/orchestrator/skills/accessibility-standards/REFERENCE.md +17 -12
  134. package/src/orchestrator/skills/accessibility-standards/SKILL.md +1 -1
  135. package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +3 -5
  136. package/src/orchestrator/skills/agent-hooks/SKILL.md +8 -6
  137. package/src/orchestrator/skills/api-patterns/SKILL.md +1 -1
  138. package/src/orchestrator/skills/code-commenting/SKILL.md +1 -1
  139. package/src/orchestrator/skills/context-map/REFERENCE.md +0 -2
  140. package/src/orchestrator/skills/context-map/SKILL.md +2 -2
  141. package/src/orchestrator/skills/data-engineering/REFERENCE.md +3 -9
  142. package/src/orchestrator/skills/data-engineering/SKILL.md +9 -16
  143. package/src/orchestrator/skills/decomposition/SKILL.md +1 -1
  144. package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +4 -4
  145. package/src/orchestrator/skills/documentation-standards/SKILL.md +4 -2
  146. package/src/orchestrator/skills/fast-review/REFERENCE.md +0 -2
  147. package/src/orchestrator/skills/fast-review/SKILL.md +5 -5
  148. package/src/orchestrator/skills/frontend-design/REFERENCE.md +6 -28
  149. package/src/orchestrator/skills/frontend-design/SKILL.md +19 -9
  150. package/src/orchestrator/skills/git-workflow/SKILL.md +1 -1
  151. package/src/orchestrator/skills/memory-merger/SKILL.md +13 -15
  152. package/src/orchestrator/skills/observability-logging/SKILL.md +1 -1
  153. package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +5 -9
  154. package/src/orchestrator/skills/orchestration-protocols/SKILL.md +6 -6
  155. package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +0 -4
  156. package/src/orchestrator/skills/panel-majority-vote/SKILL.md +1 -1
  157. package/src/orchestrator/skills/panel-majority-vote/panel-report.template.md +0 -2
  158. package/src/orchestrator/skills/performance-optimization/SKILL.md +2 -2
  159. package/src/orchestrator/skills/project-consistency/SKILL.md +2 -2
  160. package/src/orchestrator/skills/project-consistency/TEMPLATES.md +0 -4
  161. package/src/orchestrator/skills/react-development/SKILL.md +3 -3
  162. package/src/orchestrator/skills/security-hardening/SKILL.md +5 -5
  163. package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +0 -2
  164. package/src/orchestrator/skills/self-improvement/SKILL.md +1 -1
  165. package/src/orchestrator/skills/seo-patterns/SKILL.md +1 -1
  166. package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +0 -2
  167. package/src/orchestrator/skills/session-checkpoints/SKILL.md +1 -1
  168. package/src/orchestrator/skills/team-lead-reference/SKILL.md +1 -1
  169. package/src/orchestrator/skills/technical-writing/SKILL.md +8 -13
  170. package/src/orchestrator/skills/testing-workflow/SKILL.md +6 -6
  171. package/src/orchestrator/skills/typescript-best-practices/SKILL.md +1 -1
  172. package/src/orchestrator/skills/unslop/SKILL.md +1 -1
  173. package/src/orchestrator/skills/validation-gates/REFERENCE.md +6 -31
  174. package/src/orchestrator/skills/validation-gates/SKILL.md +12 -26
  175. package/src/orchestrator/skills/writing-for-agents/SKILL.md +2 -2
  176. package/src/orchestrator/skills/documentation-standards/WRITING-GUIDE.md +0 -39
  177. package/src/orchestrator/skills/frontend-design/COMPONENTS.md +0 -113
@@ -183,7 +183,7 @@ If there are no open questions, explicitly state: "No open questions — plan is
183
183
 
184
184
  ### Exit Criteria (per track)
185
185
 
186
- - [ ] 95% test coverage on new code
186
+ - [ ] New code meets the coverage threshold in the project's test config
187
187
  - [ ] Browser screenshots at all breakpoints
188
188
  - [ ] Security audit passes (or panel review scheduled)
189
189
  - [ ] Documentation updated
@@ -40,9 +40,9 @@ Load on-demand **only when the phase is reached**.
40
40
  |-------|---------|
41
41
  | **team-lead-reference** | Session start — model routing, registry, pre-delegation, cost, DLQ, deepen-plan |
42
42
  | **session-checkpoints** | Session resume or checkpoint save |
43
- | **agent-hooks** | Step 3 — delegation prompt templates |
43
+ | **agent-hooks** | Session start/end, pre- and post-delegation checklists |
44
44
  | **task-management** | Step 2 — tracker conventions |
45
- | **decomposition** | Step 2–3 — dependency resolution, delegation specs |
45
+ | **decomposition** | Step 2–3 — dependency resolution, delegation spec templates |
46
46
  | **orchestration-protocols** | Step 4+ — steering, background agents, health-checks, escalation |
47
47
  | **context-map** | Step 2, 5+ files affected |
48
48
  | **validation-gates** | Step 4 — deterministic checks, browser testing, regression |
@@ -63,7 +63,7 @@ Developer | UI/UX Expert | Content Engineer | Data Engineer | Testing Expert | S
63
63
  **⛔ Hard gates:**
64
64
  - Log delegation record immediately after each return/spawn — **observability-logging** (`--mechanism sub-agent` or `--mechanism background`).
65
65
  - `tier` from the agent registry only; `model` is the one the assistant actually ran, when it says.
66
- - Empty/off-topic: retry max 3 → DLQ. Log failures (`--outcome failed`).
66
+ - Retries and escalation (FAIL, empty/off-topic output, DLQ): **fast-review**'s Handle Verdict table. Log failures (`--outcome failed`).
67
67
 
68
68
  **Partitioning:** Parallel agents never touch the same files. **Budget:** Target 5–7/session; 8 → warn; 9 → checkpoint; 10+ → STOP. **Pre-Delegation:** (1) Tracker issue, (2) clean partition, (3) dependencies Done, (4) file paths + criteria, (5) self-improvement reminder.
69
69
 
@@ -81,9 +81,9 @@ Developer | UI/UX Expert | Content Engineer | Data Engineer | Testing Expert | S
81
81
 
82
82
  **Step 2 — Decompose & Track:** No issue, no code. Break into single-responsibility units with Fibonacci scores (1–13). Map dependencies, file ownership, tracker issues with acceptance criteria. 5+ files → **context-map**. Consider deepen-plan (**team-lead-reference**).
83
83
 
84
- **Step 3 — Prompts:** Every delegation: issue ID, objective, file paths, acceptance criteria, patterns, self-improvement reminder. Score 5+ → load **decomposition**.
84
+ **Step 3 — Prompts:** Every delegation: issue ID, objective, file paths, acceptance criteria, patterns, self-improvement reminder — the Compact Delegation Envelope in **team-lead-reference**. Score 5+ → full delegation spec from **decomposition**.
85
85
 
86
- **Step 4 — Execute:** Per task: move → In Progress → delegate → log delegation ⛔ → monitor → verify (partition, lint/test/build, fast review PASS, UI browser-verified, high-stakes → panel, issues tracked, lessons captured) → log review ⛔ → Done. FAIL → re-delegate (max 3 → DLQ). Auto-PASS: research/docs-only, or ≤10 lines/≤2 files with gates passing.
86
+ **Step 4 — Execute:** Per task: move → In Progress → delegate → log delegation ⛔ → monitor → verify (partition, lint/test/build, fast review PASS, UI browser-verified, high-stakes → panel, issues tracked, lessons captured) → log review ⛔ → Done. FAIL → **fast-review**'s Handle Verdict table. Auto-PASS: research/docs-only, or ≤10 lines/≤2 files with gates passing.
87
87
 
88
88
  **Step 5 — Deliver:** Follow the workflow template's Delivery phase. Verify all Done → build/lint/test → commit feature branch → `GH_PAGER=cat gh pr create` — do NOT merge → link PR → clean checkpoint → call **Reviewer**.
89
89
 
@@ -17,7 +17,7 @@ Resolve skills via `.opencastle/agents/skill-matrix.json`.
17
17
  ## Rules
18
18
 
19
19
  1. **RED → GREEN → REFACTOR for every feature and fix.** The failing test comes before the production code.
20
- 2. **95% minimum coverage on all new code.**
20
+ 2. **New code meets the coverage threshold in the project's test config.**
21
21
  3. **Run the full suite before returning**, not only the tests you touched.
22
22
  4. **Never add a test-only method or hook to production code.** Refactor the interface instead.
23
23
  5. **Never assert on mock behavior.** Mock external APIs only, never internal modules.
@@ -32,7 +32,7 @@ Every suite covers: Initial State · User Interactions · State Transitions · E
32
32
 
33
33
  ## Verification
34
34
 
35
- All scenarios pass · 95% coverage · 3 consecutive green runs · browser-validated at every breakpoint · naming conventions followed
35
+ All scenarios pass · coverage threshold met · 3 consecutive green runs · browser-validated at every breakpoint · naming conventions followed
36
36
 
37
37
  ## Out of Scope
38
38
 
@@ -6,7 +6,7 @@ What agents on this project learned the hard way: a command that failed, a
6
6
  tool quirk, a convention written down nowhere else. **Read this before you
7
7
  start work**, then open the lessons that match your task.
8
8
 
9
- Each lesson is a file in [`lessons/`](lessons/). Add one with
9
+ Each lesson is a file in `.opencastle/lessons/`. Add one with
10
10
  `opencastle lesson --title ... --category ... --severity ... --problem ...`
11
11
  (and `--cite <path>` for the code it is about). Do not edit this index:
12
12
  it is rewritten from those files by every `opencastle sync`.
@@ -7,28 +7,11 @@ applyTo: '**'
7
7
 
8
8
  # AI Optimization
9
9
 
10
- Batch independent operations, gather context before acting, and avoid redundant tool calls.
11
-
12
- ## Key Rules
13
-
14
- - **Batch independent reads** — parallelize file reads, searches, and error checks in a single call instead of sequentially
15
- - **Don't batch dependent ops** — if step B needs step A's output, run them sequentially
16
- - **Gather context first** — read and search before editing; don't act on assumptions
17
- - **Read strategically** — prefer large ranges (500–2000 lines) over many micro-reads; use `grep_search` to locate, then read targeted ranges
18
- - **Combine searches** — use regex alternation (`word1|word2|word3`) instead of separate searches
19
- - **Don't re-read** — if a file or sub-agent result is already in context, use it directly
20
- - **Verify once per phase** — run tests/lint/errors after a batch of edits, not after each individual change
21
- - **Scale planning to complexity** — trivial (1–2 files) → act directly; large (10+ files) → full decomposition
22
- - **Trust sub-agent results** — don't re-search or re-read what a sub-agent already returned
23
- - **Include file paths in delegation prompts** — saves the sub-agent from wasting context on discovery
24
-
25
- ## Anti-Patterns
26
-
27
- 1. **Micro-reads** — reading tiny file sections repeatedly
28
- 2. **Sequential searches** — running independent searches one at a time
29
- 3. **Premature actions** — editing before gathering sufficient context
30
- 4. **Over-checking** — validating after every tiny change instead of batching
31
- 5. **Re-gathering delegated context** — re-reading files a sub-agent already analyzed
32
- 6. **Over-planning** — full decomposition for a 2-file fix
10
+ - **Batch what is independent** — reads, searches and checks that do not depend on each other go in one turn; what depends on an earlier result waits for it.
11
+ - **Read in large ranges** — search to locate, then read the range you need, not many small slices of one file.
12
+ - **Do not re-read** — a file or a sub-agent's result already in context is used as it is.
13
+ - **Verify once per phase** — run tests, lint and build after a batch of edits, not after each one.
14
+ - **Scale planning to the change** — one or two files: act; ten or more: decompose first.
15
+ - **Hand over what you know** — a delegation prompt names the files and facts the agent would otherwise rediscover.
33
16
 
34
17
  <!-- End of AI Optimization Instructions -->
@@ -9,112 +9,39 @@ applyTo: '**'
9
9
  ## Constitution
10
10
 
11
11
  1. **Never expose secrets** — no tokens, keys, or passwords in code, logs, commits, or terminal output. Use environment variables.
12
- 2. **Prefer boring solutions** — choose proven, simple approaches over clever ones. Complexity must justify itself.
12
+ 2. **Prefer boring solutions** — proven, simple approaches over clever ones. Complexity must justify itself.
13
13
  3. **Leave code better than you found it** — fix adjacent issues when the cost is low.
14
- 4. **Fail visibly** — surface errors clearly; never swallow exceptions silently.
15
- 5. **Verify, don't trust** — confirm outcomes with tools (tests, lint, build) rather than assuming success.
16
- 6. **Log every session** — append observability records to `.opencastle/logs/` before yielding to the user. No exceptions. Load the **observability-logging** skill for details.
14
+ 4. **Fail visibly** — surface errors; never swallow exceptions silently.
15
+ 5. **Verify, don't trust** — confirm outcomes with the project's own tests, lint and build rather than assuming success.
16
+ 6. **Log every session** — see Every session, below.
17
17
 
18
- ## Instruction Priority Hierarchy
18
+ ## Precedence
19
19
 
20
- **Project-specific instructions ALWAYS take precedence over external or general AI instructions.**
20
+ The project's own instructions win: the Project Context loaded with these, the rest of `.opencastle/`, and the project's rules outside OpenCastle's managed files. Then these standards. Then general habits.
21
21
 
22
- 1. **HIGHEST**: Project-specific instructions — `.opencastle/project.instructions.md`, and the project's own rules outside OpenCastle's managed files
23
- 2. **MEDIUM**: Project workspace conventions (resolve via the **codebase-tool** skill in the skill matrix)
24
- 3. **LOWER**: General AI assistant capabilities and suggestions
22
+ ## Working here
25
23
 
26
- ## General Coding Principles
27
-
28
- Clean code, readability, maintainability. TypeScript with proper types (never `as any`). DRY. Co-locate code that changes together; avoid barrel files. Shared code in shared libraries. Comment WHY, not WHAT (load **code-commenting** skill for patterns).
29
-
30
- ## Technology Standards
31
-
32
- Load the corresponding skill before writing code in that domain. See `.opencastle/agents/skill-matrix.json` for domain-to-skill mapping. Key domains: UI Components (**ui-library**), App Framework (**framework**), Accessibility (**accessibility-standards**), Performance (**performance-optimization**), Frontend Design (**frontend-design**).
33
-
34
- ## Task Decomposition
35
-
36
- Decompose → verify each step → batch edits → build once. Re-plan when execution diverges. Match verification to change type. Load **decomposition** skill for templates.
37
-
38
- ## Testing
39
-
40
- 95% minimum unit test coverage. Test plan before implementation. Browser testing mandatory for UI changes. Load **testing-workflow** and **browser-testing** skills.
41
-
42
- ## Build & Task Commands
43
-
44
- Always use the project's configured task runner. Load **codebase-tool** skill for exact commands. Direct CLI only for tools without task runner targets.
45
-
46
- ## Documentation
47
-
48
- Follow markdown formatting standards. Load **documentation-standards** skill for templates.
49
-
50
- ## AI Optimization
51
-
52
- Follow the **AI Optimization** instructions, which are always loaded with these.
53
-
54
- ## Project Context
55
-
56
- Read `.opencastle/project.instructions.md` — apps, stack, commands, ports — before planning.
57
-
58
- ## Git Workflow
59
-
60
- **NEVER push to `main`.** All changes via feature/fix branch → PR. Load **git-workflow** skill for branch naming and PR rules.
24
+ - **Commands.** Run the project's own commands — Key Commands in the Project Context — and go through its task runner (Nx, Turborepo) when it has one.
25
+ - **Domains.** Before writing code in a domain, load the skill for it: the Project Context's Domain Quick Reference maps domains to skills, and `.opencastle/agents/skill-matrix.json` maps each agent's capability slots. A slot with no skill bound means the project has nothing special there.
26
+ - **Tests.** Write the test with the change and meet the coverage the project's test config requires (**testing-workflow**). Check UI changes in a browser when the project has a UI (**browser-testing**).
27
+ - **Plans.** Decompose → verify each step → batch edits → build once; re-plan when execution diverges (**decomposition**).
28
+ - **Comments** say why, not what (**code-commenting**). Documents follow **documentation-standards**.
29
+ - **Git.** **Never push to `main`.** Every change goes through a branch and a pull request (**git-workflow**).
61
30
 
62
31
  ## Discovered Issues Policy
63
32
 
64
- **No issue gets ignored.** An untracked bug found during work is a quality-gate failure.
65
-
66
- When you hit a bug unrelated to your current task:
33
+ **No issue gets ignored.** When you hit a bug unrelated to your task:
67
34
 
68
35
  1. Search `.opencastle/KNOWN-ISSUES.md`, and the task tracker if tools are available. Already tracked? Move on.
69
- 2. Not tracked, and it is an upstream or platform limitation you cannot fix → add it to `.opencastle/KNOWN-ISSUES.md` with all six fields: Issue ID, Status, Severity, Evidence, Root Cause, Solution Options.
70
- 3. Not tracked, and it is fixable → open a tracker ticket labelled `bug` with symptoms, reproduction steps, and affected files. No tracker available? Add a `**Discovered Issues**` section to your output.
71
-
72
- A pre-existing issue is not somebody else's problem. If it is not tracked, track it.
73
-
74
- ## Observability Logging
75
-
76
- **Hard gate (Constitution rule 6).** Every session gets a record in
77
- `.opencastle/logs/events.ndjson`. No threshold, no "too small to log".
78
-
79
- - Log **before yielding** to the user — it is the last action before you respond.
80
- - Log **per task**, not per conversation. Three tasks means three records.
81
- - Never batch-log retrospectively across sessions.
82
- - `opencastle log --type session ...`, then confirm the append landed:
83
- `tail -1 .opencastle/logs/events.ndjson`.
84
-
85
- Load **observability-logging** for the record schemas and the other record types.
86
-
87
- ## Self-Improvement Protocol
88
-
89
- > **⛔ HARD GATE** — Read `.opencastle/LESSONS-LEARNED.md` before starting work. Add lessons via **self-improvement** skill when retries succeed.
90
-
91
- ## Universal Agent Rules
92
-
93
- 1. Never delegate (specialists complete their own work)
94
- 2. Follow the Discovered Issues Policy above
95
- 3. Read and update lessons
96
- 4. Log every session (Constitution rule 6)
97
-
98
- ## Standard Closing Items
99
-
100
- Every agent ends its output contract with these, after its own domain-specific items:
101
-
102
- - **Observability logged** — the `session` record always; `delegation`, `review`,
103
- `panel`, or `dispute` records if any of those happened
104
- - **Discovered issues** — anything found per the policy above, and what you did about it
105
- - **Lessons applied** — which entries in `.opencastle/LESSONS-LEARNED.md` shaped this
106
- work, and any new one you added
107
-
108
- ## Pre-Response Quality Gate
109
-
110
- > **⛔ STOP before responding.** Load **observability-logging** skill and run its pre-response checklist.
36
+ 2. An upstream or platform limitation you cannot fix → add it to `.opencastle/KNOWN-ISSUES.md` with Issue ID, Status, Severity, Evidence, Root Cause, Solution Options.
37
+ 3. Fixable → open a tracker ticket labelled `bug` with symptoms, reproduction steps and affected files; with no tracker, add a **Discovered Issues** section to your output.
111
38
 
112
- ## Governance Skills
39
+ ## Every session
113
40
 
114
- | Concern | Skill |
115
- |---------|-------|
116
- | Branching, PR rules, delivery, tracking | **git-workflow** |
117
- | Log commands, schemas, output contracts | **observability-logging** |
118
- | Lesson writing, categories, quality | **self-improvement** |
41
+ - **Before starting:** read `.opencastle/LESSONS-LEARNED.md` and the lessons that match your task.
42
+ - **Before responding:** log the session with `opencastle log --type session …`, one record per task, never batched afterwards; add `delegation`, `review`, `panel` or `dispute` records when those happened. **observability-logging** has the fields.
43
+ - **When a retry taught you something,** add a lesson (**self-improvement**).
44
+ - **Specialists finish their own work;** only the Team Lead delegates.
45
+ - **End your output** with what you logged, the issues you discovered and what you did about them, and the lessons you applied or added.
119
46
 
120
47
  <!-- End of Coding Standards -->
@@ -1,10 +1,8 @@
1
1
  ---
2
2
  name: astro-framework
3
- description: "Creates pages/layouts, defines content collections, configures hydration directives, and wires integrations. Use when adding or modifying Astro pages, layouts, components, or content collections. Trigger terms: Astro, content collection, client:load, client:visible, astro:content"
3
+ description: "Astro pages, layouts, content collections, hydration directives and integrations. Use when adding or changing Astro pages, components or content collections, or choosing a client: directive."
4
4
  ---
5
5
 
6
- <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
7
-
8
6
  # Astro Framework
9
7
 
10
8
  Docs: https://docs.astro.build
@@ -1,10 +1,8 @@
1
1
  ---
2
2
  name: browser-testing
3
- description: "Drive real browsers via Chrome DevTools MCP: navigate pages, capture snapshots, run responsive checks, and collect console/perf traces. Use when the user mentions: 'validate UI change in Chrome', 'capture a screenshot', 'run responsive checks', or 'collect console logs'. Trigger terms: browser testing, DevTools, console logs, screenshot, responsive testing"
3
+ description: "Browser testing through the Chrome DevTools MCP: navigation, DOM snapshots, scripted assertions, responsive checks, console and performance traces. Use when verifying a UI change in Chrome, checking breakpoints, or reading console errors."
4
4
  ---
5
5
 
6
- <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
7
-
8
6
  # Browser Testing with Chrome DevTools MCP
9
7
 
10
8
  Project test app, selectors, suites, and breakpoints: `.opencastle/stack/testing-config.md`. Docs: https://developer.chrome.com/docs/devtools
@@ -16,7 +14,7 @@ Screenshots are expensive. **MAX 3 per session**, reserved for evidence: a failu
16
14
  ## Tools
17
15
 
18
16
  - `navigate_page` — `{ type: 'url', url }` or `{ type: 'reload' }`
19
- - `click` / `type` / `wait_for` — `click` and `type` take a `uid` from a prior snapshot, not a CSS selector
17
+ - `click` / `fill` / `wait_for` — `click` and `fill` take a `uid` from a prior snapshot, not a CSS selector
20
18
  - `evaluate_script` — `{ function: '() => ...' }` (an arrow function *string*, not a raw expression)
21
19
  - `resize_page` — `{ width, height }`
22
20
  - `list_console_messages`
@@ -30,4 +28,4 @@ Navigate → `wait_for` anchor text → assert via `evaluate_script` → exercis
30
28
 
31
29
  ## Regression re-test
32
30
 
33
- Read the prior `result.json`, build + lint, then re-run the **entire** previous suite — a fix routinely regresses a different test. Every test must pass before writing the updated `result.json`. Do not stop on partial green.
31
+ Build + lint, then re-run the **entire** previous suite — a fix routinely regresses a different test. Every test must pass before reporting the result in the session output. Do not stop on partial green.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cloudflare-platform
3
- description: "Creates and deploys Cloudflare Workers, configures wrangler.toml bindings, sets up KV/D1/R2 storage and Durable Objects, manages Pages deployments, and implements edge function patterns. Use when building or deploying Cloudflare Workers, setting up Pages, working with KV/D1/R2 storage, configuring wrangler.toml, or deploying edge applications."
3
+ description: "Cloudflare Workers, Pages, wrangler bindings, KV/D1/R2 storage and Durable Objects. Use when building or deploying a Worker or Pages site, editing wrangler.toml, or using KV, D1, R2 or Durable Objects."
4
4
  ---
5
5
 
6
6
  # Cloudflare Platform
@@ -8,7 +8,7 @@ description: "Creates and deploys Cloudflare Workers, configures wrangler.toml b
8
8
  ## Workers
9
9
 
10
10
  - V8 isolates, not Node: `process`, `Buffer`, `fs` do not exist unless `compatibility_flags = ["nodejs_compat"]` is set. `compatibility_date` must be set or deploys fail.
11
- - Free tier bundle limit is 1MB. Cold starts are 0ms — keep dependencies minimal.
11
+ - Worker size limit is 3 MB compressed on the Free plan, 10 MB on Paid. Keep dependencies minimal.
12
12
  - `ctx.waitUntil(promise)` for side effects that must outlive the response (logging, analytics).
13
13
  - Bindings are reachable only via the handler's `env` argument, and must exist in both `wrangler.toml` and the `Env` interface.
14
14
  - Durable Objects need `[[durable_objects.bindings]]` **and** a `[[migrations]]` block with `new_classes = ["Counter"]` — the binding alone will not deploy.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: contentful-cms
3
- description: "Creates Contentful content types, queries entries via GraphQL/REST, runs CLI migrations, and manages assets and locales. Use when building or modifying Contentful content models, writing queries, or migrating content."
3
+ description: "Contentful content types, GraphQL/REST queries, CLI migrations, assets and locales. Use when changing a Contentful content model, querying Contentful, or migrating its content."
4
4
  ---
5
5
 
6
6
  # Contentful CMS
@@ -1,10 +1,8 @@
1
1
  ---
2
2
  name: convex-database
3
- description: "Convex reactive database patterns, schema design, real-time queries, mutations, actions, authentication, migrations, performance optimization, and component creation. Use when designing Convex schemas, writing queries/mutations, managing the Convex backend, setting up auth, migrating data, optimizing performance, or building Convex components."
3
+ description: "Convex schemas, queries, mutations, actions, auth, migrations and components. Use when designing a Convex schema, writing Convex functions, setting up Convex auth, or migrating Convex data."
4
4
  ---
5
5
 
6
- <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
7
-
8
6
  # Convex Database
9
7
 
10
8
  Project-specific schema, functions, and deployment details: `.opencastle/stack/database-config.md`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: coolify-deployment
3
- description: "Deploys applications, databases, and services on self-hosted Coolify instances, manages environments and env vars, runs infrastructure diagnostics, and performs batch operations. Use when deploying apps to Coolify, managing Coolify servers, debugging deployment issues, setting up databases, or managing Coolify infrastructure."
3
+ description: "Deploys and manages apps, databases and services on a self-hosted Coolify instance, with env vars, diagnostics and batch operations. Use when deploying to Coolify, debugging a Coolify deployment, or managing its servers."
4
4
  ---
5
5
 
6
6
  # Coolify Deployment
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cypress-testing
3
- description: "Writes Cypress E2E/component tests, configures `cy.intercept()` and `cy.session()`, authors custom commands, and wires CI artifacts. Use when creating E2E specs, component tests, or CI test pipelines. Trigger terms: cypress, e2e, component test, cy.intercept, cy.session"
3
+ description: "Cypress E2E and component tests: cy.intercept(), cy.session(), custom commands and CI artifacts. Use when writing or debugging Cypress specs, or running Cypress in CI."
4
4
  ---
5
5
 
6
6
  # Cypress Testing
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: drizzle-orm
3
- description: "Drizzle ORM schema definition, type-safe queries, relational queries, CRUD operations, transactions, migrations with drizzle-kit, and database setup for PostgreSQL, MySQL, and SQLite. Use when defining database schemas, writing queries or joins, managing migrations, setting up a new Drizzle project, or working with drizzle-kit."
3
+ description: "Drizzle ORM schemas, type-safe and relational queries, transactions and drizzle-kit migrations for PostgreSQL, MySQL and SQLite. Use when defining a Drizzle schema, writing Drizzle queries, or running drizzle-kit."
4
4
  ---
5
5
 
6
6
  # Drizzle ORM
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: expo-development
3
- description: "Scaffolds Expo/React Native apps, configures EAS Build profiles, manages native modules via CNG, sets up Expo Router navigation, and uses EAS Update for OTA deployments. Use when creating React Native apps with Expo, configuring EAS builds, setting up Expo Router, managing native modules, or deploying OTA updates."
3
+ description: "Expo and React Native apps: Continuous Native Generation, EAS Build and Update, Expo Router. Use when creating or configuring an Expo app, its EAS builds, native modules, routes or OTA updates."
4
4
  ---
5
5
 
6
6
  # Expo Development
@@ -16,7 +16,7 @@ description: "Scaffolds Expo/React Native apps, configures EAS Build profiles, m
16
16
  - `eas.json` profiles: development = `developmentClient: true` + `distribution: internal`; preview = `distribution: internal` + `channel`; production = `channel` + `autoIncrement: true`.
17
17
  - Set `runtimeVersion: { policy: "fingerprint" }` in app.json. `eas update --channel production` ships JS only — a runtimeVersion mismatch forces a new binary build, and native changes can never go OTA.
18
18
  - Rollback: `eas update:republish --group <previous-group-id>`. Diagnose failures via `eas build:list` then `eas build:view <id>`.
19
- - Secrets belong in EAS Secrets (`eas secret:create`), never `app.json`; device-side storage via `expo-secure-store`.
19
+ - Secrets belong in EAS environment variables with secret visibility (`eas env:create --visibility secret`; `eas secret:create` is deprecated), never `app.json`; device-side storage via `expo-secure-store`.
20
20
  - iOS signing failures: `eas credentials`. CI/CD lives in `.eas/workflows/`.
21
21
 
22
22
  ## Expo Router
@@ -1,10 +1,8 @@
1
1
  ---
2
2
  name: figma-design
3
- description: "Figma design-to-code workflows, design token extraction, component inspection, and asset export. Use when translating Figma designs into code, extracting design tokens, or referencing component specs."
3
+ description: "Figma design-to-code: design token extraction, component inspection and asset export. Use when implementing a Figma design, extracting its tokens, or checking a component's spec."
4
4
  ---
5
5
 
6
- <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
7
-
8
6
  # Figma Design
9
7
 
10
8
  Project design system: the **frontend-design** skill. Docs: https://developers.figma.com/docs/figma-mcp-server/
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: hetzner-cloud
3
- description: "Provisions Hetzner Cloud servers, volumes, private networks, and firewalls via the hcloud CLI and the Pulumi/Terraform hcloud provider; plans CAX/arm64 sizing; configures backups, snapshots, and DR rebuilds. Use when creating or resizing Hetzner servers, attaching volumes, configuring private networks or firewalls, choosing server types, scripting hcloud commands, or authoring hcloud IaC resources."
3
+ description: "Hetzner Cloud servers, volumes, private networks, firewalls, backups and snapshots, through the hcloud CLI or Pulumi/Terraform. Use when provisioning, resizing or scripting Hetzner resources, or choosing a server type."
4
4
  ---
5
5
 
6
6
  # Hetzner Cloud
@@ -1,10 +1,8 @@
1
1
  ---
2
2
  name: jira-management
3
- description: "Create and update Jira issues, epics, and sprints; manage backlog and sprint transitions. Use when you say: 'create a ticket', 'open a story', 'link an epic', 'start a sprint', or 'search the backlog'."
3
+ description: "Jira issues, epics, sprints, backlog and workflow transitions. Use when creating or updating Jira issues, linking epics, moving work through a sprint, or searching the backlog."
4
4
  ---
5
5
 
6
- <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
7
-
8
6
  # Task Management with Jira
9
7
 
10
8
  Project keys, workflow state IDs, and board config: `.opencastle/project/jira-config.md`. Docs: https://developer.atlassian.com/cloud/jira/platform/
@@ -1,10 +1,8 @@
1
1
  ---
2
2
  name: linear-task-management
3
- description: "Creates and names Linear issues, assigns labels and priorities, manages status transitions, and links issues to PRs. Use when decomposing features into tasks or resuming interrupted sessions. Trigger terms: tickets, backlog, task breakdown, project board, sprint planning"
3
+ description: "Linear issue conventions: naming, labels, priorities, status transitions and PR links. Use when creating or updating Linear issues, breaking a feature into Linear tasks, or resuming work tracked in Linear."
4
4
  ---
5
5
 
6
- <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
7
-
8
6
  # Task Management with Linear
9
7
 
10
8
  Team, workflow states and labels: `.opencastle/project/linear-config.md`. Docs: https://linear.app/docs/mcp
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: netlify-deployment
3
- description: "Deploy sites, configure serverless and edge functions, and verify builds on Netlify. Use when the user mentions: 'deploy preview', 'configure netlify.toml', or 'debug a failed deploy'. Trigger terms: build error, Netlify Functions, deploy logs, deploy preview"
3
+ description: "Netlify deploys, deploy previews, netlify.toml, serverless and edge functions. Use when deploying to Netlify, configuring netlify.toml or functions, or debugging a failed Netlify build."
4
4
  ---
5
5
 
6
6
  # Netlify Deployment
7
7
 
8
8
  Project deployment architecture, env vars, and key files: `.opencastle/stack/deployment-config.md`. Docs: https://docs.netlify.com
9
9
 
10
- `main` → production (auto). `feature/*`, `fix/*` → deploy preview at a unique URL (auto).
10
+ `main` → production (auto). Every other branch (`feat/*`, `fix/*`, …) → deploy preview at a unique URL (auto).
11
11
 
12
12
  ## Hard limits
13
13
 
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  name: nextjs-framework
3
- description: "Explains how to configure App Router, implement server/client components, optimize data fetching, and secure routes. Use when the user mentions: 'add an authenticated route', 'migrate to App Router', 'optimize fetch caching', or 'fix RSC hydration'."
3
+ description: "Next.js App Router conventions, server and client components, data fetching, caching and route protection, by Next version. Use when building or debugging a Next.js app, its caching, middleware/proxy or hydration errors."
4
4
  ---
5
5
 
6
- <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
7
-
8
6
  # Next.js Framework
9
7
 
8
+ Check the `next` version in `package.json` first: caching and the request-interception file changed in 15 and 16.
9
+
10
+ The integration configures `next-devtools-mcp` (MCP server `next-devtools`). With the dev server running it reports build and runtime errors, logs, and route and page metadata — read those before guessing at a failure.
11
+
10
12
  ### Critical rule
11
13
 
12
14
  **Never use `next/dynamic` with `{ ssr: false }` inside a Server Component** — it crashes at build/runtime. Extract it into a `'use client'` wrapper and import that from the server normally.
@@ -24,12 +26,17 @@ export function MapClient(props: MapProps) { return <Map {...props} />; }
24
26
  - `error.tsx` must be a Client Component, and needs to exist per segment — otherwise an unhandled error takes down the page. `template.tsx` re-mounts on navigation where `layout.tsx` persists. `default.tsx` is the parallel-route fallback.
25
27
  - Independent fetches awaited in sequence become a waterfall — use `Promise.all()`. Fetching in `useEffect` where a Server Component could fetch costs an extra roundtrip plus a loading flash.
26
28
  - `getServerSideProps` / `getStaticProps` are Pages Router only; App Router uses async Server Components.
27
- - Auth: check the session at the top of an async Server Component and `redirect('/login')` before returning any UI. Middleware with `matcher: ['/dashboard/:path*']` covers whole subtrees.
29
+ - 15+: `params`, `searchParams`, `cookies()` and `headers()` are async — await them.
30
+ - Auth: check the session at the top of an async Server Component and `redirect('/login')` before returning any UI. Request interception with `matcher: ['/dashboard/:path*']` covers whole subtrees: `middleware.ts` up to 15, `proxy.ts` (exporting `proxy`) from 16.
28
31
  - Dynamic segments: `[slug]`, catch-all `[...slug]`, optional catch-all `[[...slug]]`.
29
32
  - Put providers in a `Providers` Client Component rather than growing `layout.tsx`; `'use client'` on everything defeats RSC.
30
33
 
31
- ### Caching layers
34
+ ### Caching, by version
35
+
36
+ - **14 and earlier:** `fetch` is cached by default (opt out with `cache: 'no-store'`), GET Route Handlers are static by default.
37
+ - **15:** nothing is cached unless you ask. `fetch`, GET Route Handlers and client navigations are uncached by default; opt in with `cache: 'force-cache'`, `export const dynamic = 'force-static'`, or `staleTimes`.
38
+ - **16:** the 15 defaults, plus Cache Components (`cacheComponents: true`): opt in with `"use cache"` on a function or component, `cacheLife()` for lifetime and `cacheTag()` for tags. `revalidateTag(tag, profile)` takes a `cacheLife` profile (e.g. `'max'`) and serves stale while it refreshes; `updateTag(tag)`, Server Actions only, expires the tag so the user reads their own write.
32
39
 
33
- Four tiers: per-request `fetch` memoization (automatic) → Data Cache (cross-request, cached by default, opt out with `cache: 'no-store'`) → Full Route Cache (static HTML + RSC payload at build) → client Router Cache (prefetched and visited routes). Tag with `fetch(url, { next: { tags: ['posts'] } })`, then invalidate from a Server Action via `revalidateTag('posts')` or `revalidatePath('/posts')`.
40
+ Tag with `fetch(url, { next: { tags: ['posts'] } })` (or `cacheTag`), invalidate from a Server Action with `revalidateTag` / `revalidatePath('/posts')`.
34
41
 
35
42
  Docs: https://nextjs.org/docs
@@ -15,31 +15,35 @@ export const config: PluginConfig = {
15
15
  },
16
16
  authType: 'oauth',
17
17
  envVars: [],
18
+ // The hosted server's tool names (developers.notion.com/docs/mcp-supported-tools):
19
+ // `notion-update-page` both edits a page and appends to it.
18
20
  agentToolMap: {
19
21
  'team-lead': [
20
- 'Notion/search',
21
- 'Notion/create_page',
22
- 'Notion/update_page',
23
- 'Notion/query_database',
24
- 'Notion/append_block_children',
22
+ 'Notion/notion-search',
23
+ 'Notion/notion-fetch',
24
+ 'Notion/notion-create-pages',
25
+ 'Notion/notion-update-page',
26
+ 'Notion/notion-query-data-sources',
25
27
  ],
26
28
  'researcher': [
27
- 'Notion/search',
28
- 'Notion/create_page',
29
- 'Notion/append_block_children',
30
- 'Notion/query_database',
29
+ 'Notion/notion-search',
30
+ 'Notion/notion-fetch',
31
+ 'Notion/notion-create-pages',
32
+ 'Notion/notion-update-page',
33
+ 'Notion/notion-query-data-sources',
31
34
  ],
32
35
  'writer': [
33
- 'Notion/search',
34
- 'Notion/create_page',
35
- 'Notion/update_page',
36
- 'Notion/append_block_children',
36
+ 'Notion/notion-search',
37
+ 'Notion/notion-fetch',
38
+ 'Notion/notion-create-pages',
39
+ 'Notion/notion-update-page',
37
40
  ],
38
41
  'architect': [
39
- 'Notion/search',
40
- 'Notion/create_page',
41
- 'Notion/update_page',
42
- 'Notion/query_database',
42
+ 'Notion/notion-search',
43
+ 'Notion/notion-fetch',
44
+ 'Notion/notion-create-pages',
45
+ 'Notion/notion-update-page',
46
+ 'Notion/notion-query-data-sources',
43
47
  ],
44
48
  },
45
49
  docsUrl: 'https://www.opencastle.dev/docs/plugins#notion',
@@ -1,31 +1,23 @@
1
1
  ---
2
2
  name: notion-knowledge-management
3
- description: "Creates Notion pages and databases, applies templates for research docs, ADRs, and specs, and manages team knowledge bases. Use when creating Notion pages, structuring databases, documenting decisions, or capturing research findings."
3
+ description: "Notion pages, databases and team knowledge bases through the hosted Notion MCP, with templates for research docs, ADRs, specs and meeting notes. Use when reading, creating or updating Notion pages or querying a Notion database."
4
4
  ---
5
5
 
6
- <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
7
-
8
6
  # Knowledge Management with Notion
9
7
 
10
- MCP endpoint `https://mcp.notion.com/mcp` (OAuth). Tools: `search`, `create_page`, `update_page`, `append_block_children`, `query_database`. Docs: https://developers.notion.com/docs/mcp
8
+ Hosted Notion MCP at `https://mcp.notion.com/mcp` (OAuth, acting as the signed-in user). Tools: `notion-search`, `notion-fetch`, `notion-create-pages`, `notion-update-page`, `notion-query-data-sources`, `notion-create-comment`. Full list: https://developers.notion.com/docs/mcp-supported-tools
11
9
 
12
10
  ## Gotchas
13
11
 
14
- - **`search` only returns pages explicitly shared with the integration.** An empty result usually means missing access, not a missing page — ask the user to share the parent page rather than creating a duplicate.
15
- - Notion's index lags writes. A page you just created can be absent from `search` for ~30s; retry before concluding the create failed.
16
- - `create_page` needs a real `parent` (`{ "page_id": "..." }`) obtained from `search` first — always search for the parent before creating, then verify the new page by searching its exact title and confirming `parent` matches.
17
- - Page titles are a rich-text array, not a string:
18
- `"properties": { "title": [{ "type": "text", "text": { "content": "[Spec] Price Range Filter" } }] }`
19
- - Databases take `query_database` (with `filter` / `sorts`); ordinary pages take `append_block_children`. Using the wrong one fails.
20
-
21
- ```json
22
- // query_database
23
- { "database_id": "db_id", "filter": { "property": "Status", "select": { "equals": "In Progress" } }, "sorts": [{ "timestamp": "last_edited_time", "direction": "descending" }] }
24
- ```
12
+ - Results are limited to what the connected account can open. An empty `notion-search` usually means missing access, not a missing page — ask the user to share the parent rather than creating a duplicate.
13
+ - `notion-create-pages` needs a `parent` (page or database), so find it with `notion-search` first, then `notion-fetch` the new page to confirm it landed under that parent.
14
+ - Content is Notion-flavored Markdown, not block JSON. `notion-fetch` a page before `notion-update-page` so an edit keeps mentions, links and inline dates.
15
+ - A database holds one or more **data sources** (`collection://…` URLs). `notion-fetch` the database to get the data source and its schema, then read rows with `notion-query-data-sources`.
16
+ - `notion-search` and `notion-query-data-sources` share a rate limit of about 20 calls per 10 seconds; batch reads instead of looping.
25
17
 
26
18
  ## Document conventions
27
19
 
28
- Place pages under the right parent (e.g. Engineering/Specs) and close the loop by appending implementation links back to the spec. Required sections per type:
20
+ Place pages under the right parent (e.g. Engineering/Specs) and close the loop by adding implementation links back to the spec. Required sections per type:
29
21
 
30
22
  - **Research** — Summary, Sources (URL + why relevant), Key Findings, Implications, Open Questions.
31
23
  - **ADR** — `ADR-NNN: <title>`, Status (Proposed | Accepted | Deprecated | Superseded), Date, Context, Decision, Consequences, Alternatives Considered (with why rejected).