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
@@ -1,10 +1,8 @@
1
1
  ---
2
2
  name: nx-workspace
3
- description: "Run and generate NX targets, configure project.json, and visualize dependency graphs. Use when you say: 'run affected tests', 'nx generate a library', 'configure project.json', or 'show dependency graph'."
3
+ description: "Nx workspace rules: running targets, affected commands, generators, project.json and the Nx MCP tools. Use when running or generating anything in an Nx monorepo, editing project.json, or reading its dependency graph."
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
  # NX Workspace
9
7
 
10
8
  Docs: https://nx.dev/getting-started/intro. Project name → location mapping: `.opencastle/project.instructions.md`.
@@ -21,7 +19,7 @@ Always `npx nx run <project>:<target>` for one project, `npx nx affected -t <tar
21
19
 
22
20
  ## Requirements
23
21
 
24
- - Minimum coverage **95%** for new components/functions. Reports land in `reports/coverage/jest/`.
22
+ - Coverage must meet the threshold in the project's test config; reports land in the path that config sets.
25
23
  - Lint always with `--fix`. CSS/SCSS uses a separate target: `npx nx run <project>:lint-styles --fix`.
26
24
  - `npx nx run <project>:test -u` updates snapshots. `npx nx format --fix` after any generation.
27
25
 
@@ -1,10 +1,8 @@
1
1
  ---
2
2
  name: playwright-testing
3
- description: "Playwright E2E testing patterns, cross-browser configuration, page objects, and CI setup. Use when creating E2E specs, visual regression suites, or configuring Playwright in CI. Trigger terms: playwright, e2e, trace, page object, cross-browser"
3
+ description: "Playwright E2E tests: page objects, cross-browser projects, traces and CI setup. Use when writing or debugging Playwright specs, or configuring Playwright in CI."
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
  # Playwright Testing
9
7
 
10
8
  Project test config and breakpoints: `.opencastle/stack/testing-config.md`. Docs: https://playwright.dev/docs/intro
@@ -1,10 +1,8 @@
1
1
  ---
2
2
  name: prisma-database
3
- description: "Prisma ORM schema design, migrations, client generation, and query patterns. Use when designing database schemas, writing migrations, querying data, or managing Prisma Client."
3
+ description: "Prisma schema design, migrations, client generation and query patterns. Use when changing a Prisma schema, writing a migration, or querying with Prisma Client."
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
  # Prisma Database
9
7
 
10
8
  Project schema and connection details: `.opencastle/stack/database-config.md`. Docs: https://www.prisma.io/docs
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: resend-email
3
- description: "Resend transactional email patterns, React Email templates, domain configuration, and webhook handling. Use when sending emails, building email templates, or configuring email delivery."
3
+ description: "Resend transactional email, React Email templates, domain setup and webhooks. Use when sending email with Resend, building an email template, or configuring email delivery."
4
4
  ---
5
5
 
6
6
  # Resend Email
@@ -27,4 +27,4 @@ Failures here are nearly always DNS propagation, a wrong API key scope, or a mis
27
27
 
28
28
  ## Templates
29
29
 
30
- `npm install resend @react-email/components`. Build templates from `@react-email/components` primitives (`Html`, `Head`, `Body`, `Container`, `Heading`, `Text`, `Button`) — plain HTML/CSS is unreliable across clients. Preview locally with `npx email dev`.
30
+ `npm install resend @react-email/components`. Build templates from `@react-email/components` primitives (`Html`, `Head`, `Body`, `Container`, `Heading`, `Text`, `Button`) — plain HTML/CSS is unreliable across clients. Preview locally with `npx react-email dev` — the preview server is the `react-email` package, which `@react-email/components` does not install.
@@ -1,10 +1,8 @@
1
1
  ---
2
2
  name: sanity-cms
3
- description: "Manages Sanity CMS schemas, GROQ queries, dataset exports/imports, and Studio configuration. Use when updating Sanity schemas, running GROQ or Vision queries, exporting datasets, modifying content models, or configuring a headless CMS with Sanity.io."
3
+ description: "Sanity schemas, GROQ queries, Studio configuration and dataset imports and exports. Use when changing a Sanity content model, writing GROQ, or moving Sanity datasets."
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
  # Sanity CMS
9
7
 
10
8
  Project config, schemas, plugins, document types, and GROQ examples: `.opencastle/stack/sanity-config.md`. Docs: https://www.sanity.io/docs
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: sentry-monitoring
3
- description: "Sentry error monitoring, SDK initialization, performance tracing, source maps, session replay, and release tracking. Use when adding Sentry to a project, capturing errors with context, setting up distributed tracing, configuring source maps, or debugging production issues."
3
+ description: "Sentry SDK setup, error capture with context, tracing, source maps, session replay and releases. Use when adding Sentry to a project, configuring tracing or source maps, or debugging a production error in Sentry."
4
4
  ---
5
5
 
6
6
  # Sentry Monitoring
@@ -1,10 +1,8 @@
1
1
  ---
2
2
  name: slack-notifications
3
- description: "Slack MCP integration for agent-to-human notifications and bi-directional communication. Use when agents need to post progress updates, request approvals, or read user responses via Slack channels and threads."
3
+ description: "Slack MCP for agent-to-human messages: progress updates, approval requests and reading replies. Use when an agent needs to notify people or get an approval through Slack."
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
  # Slack Notifications
9
7
 
10
8
  Package `@kazuph/mcp-slack` (stdio). Docs: https://api.slack.com/docs. Channel mappings: `.opencastle/stack/notifications-config.md`
@@ -1,10 +1,8 @@
1
1
  ---
2
2
  name: strapi-cms
3
- description: "Builds Strapi content types, extends controllers and services, implements lifecycle hooks, and configures REST/GraphQL APIs. Use when creating content types, writing custom controllers, developing Strapi plugins, or querying the API."
3
+ description: "Strapi content types, custom controllers and services, lifecycle hooks, and REST/GraphQL APIs. Use when changing a Strapi content model, extending its API, or building a Strapi plugin."
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
  # Strapi CMS
9
7
 
10
8
  Project config, content types, and deployment details: `.opencastle/stack/cms-config.md`. Docs: https://docs.strapi.io/
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: stripe-payments
3
- description: "Stripe payment integration patterns, Checkout Sessions, billing/subscriptions, Connect platforms, and API best practices. Use when building, modifying, or reviewing any Stripe integration — including accepting payments, building marketplaces, setting up subscriptions, or implementing secure key handling."
3
+ description: "Stripe integration rules: API selection, Checkout Sessions, subscriptions, Connect, webhooks and key handling. Use when building, changing or reviewing a Stripe integration."
4
4
  ---
5
5
 
6
6
  # Stripe Payments
7
7
 
8
- Latest API version: **2026-03-25.dahlia**. Pin it explicitly on the client unless told otherwise.
8
+ Read the API version before writing code: the account's pinned version (Workbench, or the `Stripe-Version` header on any response) and the Stripe changelog (below) for anything newer. Pin the chosen version explicitly on the client unless told otherwise.
9
9
 
10
10
  ## Never use
11
11
 
@@ -23,10 +23,10 @@ Charges API, Sources API, Tokens API, legacy Card Element, Payment Element in ca
23
23
 
24
24
  - Verify webhook signatures against the **raw** request body (`await request.text()`) — a parsed JSON body fails verification.
25
25
  - Restricted keys (`rk_`) over secret keys (`sk_`); neither ever ships client-side (use ephemeral keys). Always pass `state` in Connect OAuth.
26
- - Stripe.js is evergreen, biannual, and hard-paired to its API version — no override: `https://js.stripe.com/dahlia/stripe.js`. Java/Go/.NET SDKs also fix the version to the release; bump the package instead of setting `apiVersion`.
26
+ - Stripe.js is versioned by release name in its URL (`https://js.stripe.com/<release>/stripe.js`) and hard-paired to that release's API version — no override. Java/Go/.NET SDKs also fix the version to the release; bump the package instead of setting `apiVersion`.
27
27
  - Store Stripe object IDs in columns accommodating 255 chars with case-sensitive collation.
28
28
  - Breaking changes to grep for: `paymentIntent.charges` removed 2022-11-15 → `stripe.charges.retrieve(pi.latest_charge)`; `invoice.lines.data` → `stripe.invoices.listLineItems()` 2023-08-16.
29
- - Test locally with `stripe listen --forward-to localhost:3000/api/webhooks` and `stripe trigger <event> --api-version 2026-03-25.dahlia`; probe a new version with the `Stripe-Version` header before promoting it to default.
29
+ - Test locally with `stripe listen --forward-to localhost:3000/api/webhooks` and `stripe trigger <event> --api-version <version>`; probe a new version with the `Stripe-Version` header before promoting it to default.
30
30
  - `stripe plugin install projects` then `stripe projects init` writes `stripe-project.json` and a `.stripe/` directory of local skills — prefer those local skills afterwards.
31
31
 
32
32
  Docs: [changelog](https://docs.stripe.com/changelog) · [integration options](https://docs.stripe.com/payments/payment-methods/integration-options) · [go-live checklist](https://docs.stripe.com/get-started/checklist/go-live)
@@ -1,10 +1,8 @@
1
1
  ---
2
2
  name: supabase-database
3
- description: "Generates Supabase database migrations, writes RLS policies with auth.uid(), configures auth integration, and generates TypeScript types. Use when creating tables, writing migrations, configuring RLS, or implementing Supabase auth."
3
+ description: "Supabase migrations, RLS policies, auth integration and generated TypeScript types. Use when creating Supabase tables or migrations, writing RLS policies, or wiring Supabase auth."
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
  # Supabase Database
9
7
 
10
8
  Project schema, roles, migration history, auth flow, and key files: `.opencastle/stack/supabase-config.md`. Docs: https://supabase.com/docs
@@ -14,7 +12,7 @@ Project schema, roles, migration history, auth flow, and key files: `.opencastle
14
12
  - **`ENABLE ROW LEVEL SECURITY` with no policy denies everything.** Enabling and adding policies must land in the same migration.
15
13
  - Policies are per-operation. `FOR SELECT USING (...)` does not cover writes; `INSERT` needs `WITH CHECK`, not `USING`.
16
14
  - `auth.uid()` is the owner check (`auth.uid() = id`). It is `NULL` for the `anon` role, so any policy relying on it silently blocks anonymous access.
17
- - Test every policy against **all three** roles — `anon`, `user`, `admin`. A policy that works as your own user tells you nothing about `anon`.
15
+ - Policies target the Postgres roles `anon`, `authenticated` and `service_role` (which bypasses RLS). Test every policy as `anon` and as `authenticated`, plus any app-level role your policies check. A policy that works as your own user tells you nothing about `anon`.
18
16
  - Reference `auth.users(id)` with `ON DELETE CASCADE` on profile-style tables, or deleted users leave orphans.
19
17
 
20
18
  Confirm RLS coverage before shipping:
@@ -25,7 +23,7 @@ SELECT tablename, rowsecurity FROM pg_tables WHERE schemaname = 'public';
25
23
 
26
24
  ## Migration workflow
27
25
 
28
- 1. Name migrations `YYYYMMDD_add_profiles.sql`; comment intent and rollback considerations inline.
26
+ 1. Create the file with `supabase migration new add_profiles` (it writes `supabase/migrations/<14-digit timestamp>_add_profiles.sql`); comment intent and rollback considerations inline.
29
27
  2. Apply to a local/ephemeral DB; run smoke tests plus per-role RLS checks.
30
28
  3. Review the SQL for destructive actions (table drops, column rewrites) — those need a backfill script and phased rollout, never a single migration.
31
29
  4. Re-run in CI against a test replica with the full suite.
@@ -1,10 +1,8 @@
1
1
  ---
2
2
  name: teams-notifications
3
- description: "Microsoft Teams MCP integration for agent-to-human notifications and bi-directional communication. Use when agents need to post progress updates, request approvals, or read user responses via Teams channels and chats."
3
+ description: "Microsoft Teams MCP for agent-to-human messages: progress updates, approval requests and reading replies. Use when an agent needs to notify people or get an approval through Teams."
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
  # Teams Notifications
9
7
 
10
8
  ## MCP Server
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: trello-task-management
3
- description: "Create and manage Trello cards, checklists, and boards for kanban workflows. Use when the user says: 'create a kanban board', 'add a task card', 'move card to sprint', or 'track project board'."
3
+ description: "Trello cards, checklists and boards for kanban tracking. Use when creating or moving Trello cards, adding checklists, or tracking work on a Trello board."
4
4
  ---
5
5
 
6
6
  # Task Management with Trello
@@ -1,42 +1,23 @@
1
1
  ---
2
2
  name: turborepo-monorepo
3
- description: "Configure pipelines, set up local/remote caching, and run scoped tasks in a Turborepo monorepo. Use when you say: 'enable remote caching', 'optimize pipeline inputs/outputs', or 'filter builds to affected packages'."
3
+ description: "Turborepo task pipelines, caching and package filtering. Use when editing turbo.json, running tasks for changed or filtered packages, or debugging cache misses and remote caching."
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
  # Turborepo Monorepo
9
7
 
10
8
  ## Commands
11
9
 
12
- ### Running Tasks
13
-
14
10
  ```bash
15
- turbo run build # Build all packages
16
- turbo run test # Test all packages
17
- turbo run lint # Lint all packages
18
- turbo run build --filter=web # Build specific package
19
- turbo run build --filter=./apps/* # Build all apps
20
- turbo run build --filter=...[HEAD~1] # Only affected since last commit
11
+ turbo run build # Build all packages
12
+ turbo run build --filter=web # One package
13
+ turbo run build --filter=./apps/* # All apps
14
+ turbo run build test lint --affected # Only packages changed vs the default branch (CI)
15
+ turbo run build --dry-run # Preview what would run
16
+ turbo run build --graph # Visualize task graph
17
+ turbo run build --force # Ignore cache, rebuild all
21
18
  ```
22
19
 
23
- ### Common Patterns
24
-
25
- ```bash
26
- turbo run build test lint # Run multiple tasks
27
- turbo run build --dry-run # Preview what would run
28
- turbo run build --graph # Visualize task graph
29
- turbo run build --force # Ignore cache, rebuild all
30
- turbo run build --concurrency=4 # Limit parallelism
31
- ```
32
-
33
- ### Forbidden Commands
34
-
35
- ```bash
36
- # NEVER use these directly — always go through turbo:
37
- npm run build # Skips caching and parallelism
38
- cd apps/web && npm test # Skips dependency resolution
39
- ```
20
+ Run tasks through `turbo run` (or a root script that wraps it). `cd apps/web && npm test` skips caching and dependency order.
40
21
 
41
22
  ## Pipeline Configuration (turbo.json)
42
23
 
@@ -63,69 +44,15 @@ cd apps/web && npm test # Skips dependency resolution
63
44
  }
64
45
  ```
65
46
 
66
- ### Key Concepts
67
-
68
47
  - `^build` — run `build` in dependencies first (topological)
69
- - `dependsOn` — declare task dependencies
70
- - `outputs` — files to cache (miss = rebuild)
71
- - `inputs` — files to hash for cache key (default: all tracked files)
72
- - `cache: false` — never cache (use for `dev`, `start`)
73
- - `persistent: true` — long-running tasks (dev servers)
48
+ - `outputs` — files to cache; leave them out and a cache hit restores no files
49
+ - `inputs` — files hashed for the cache key (default: all tracked files in the package)
50
+ - `cache: false` + `persistent: true` — long-running tasks (dev servers)
74
51
 
75
52
  ## Caching
76
53
 
77
- ### Local Cache
78
-
79
- Turborepo caches task outputs automatically in `node_modules/.cache/turbo`. Cache keys are computed from:
80
-
81
- 1. Task inputs (source files)
82
- 2. Environment variables
83
- 3. Dependencies' build outputs
84
- 4. `turbo.json` configuration
85
-
86
- ### Remote Cache
87
-
88
- ```bash
89
- turbo login # Authenticate
90
- turbo link # Link project to remote cache
91
- turbo run build --remote-only # Force remote cache usage
92
- ```
93
-
94
- - Shares cache across CI and team members
95
- - Vercel Remote Cache or self-hosted (Ducktape, TurboCache)
96
- - Set `TURBO_TOKEN` and `TURBO_TEAM` in CI environment
97
-
98
- ## Quick Workflow: Setup remote caching in CI
99
- 1. Add `TURBO_TOKEN` and `TURBO_TEAM` to your CI secrets.
100
- 2. Locally run `turbo login` and `turbo link` to verify the project is linked.
101
- 3. Add `turbo run build --remote` to the CI pipeline and watch for cache hit/miss logs.
102
- 4. If cache misses persist: verify `inputs`/`outputs` in `turbo.json`, stable env vars, then re-run.
103
-
104
- **Validation (recommended):** run `turbo run build --dry-run` locally or in CI to preview the task graph and catch misconfigured inputs/outputs before executing.
105
-
106
-
107
- ## Package Workspace Structure
108
-
109
- ```
110
- monorepo/
111
- ├── turbo.json
112
- ├── package.json # Root workspace config
113
- ├── apps/
114
- │ ├── web/ # Next.js app
115
- │ └── docs/ # Documentation site
116
- ├── packages/
117
- │ ├── ui/ # Shared UI components
118
- │ ├── config/ # Shared config (ESLint, TS)
119
- │ └── utils/ # Shared utilities
120
- ```
121
-
122
- ## Best Practices
54
+ The local cache lives in `.turbo/cache` (Turborepo 2.0+). Keys hash task inputs, declared env vars, dependencies' outputs and `turbo.json`. An env var the build reads but `env` does not declare causes stale hits; one that changes every run causes constant misses.
123
55
 
124
- - Always use `turbo run` instead of directly invoking package scripts
125
- - Define `outputs` for every cacheable task — missing outputs mean missing cache
126
- - Use `--filter` to scope commands to affected packages
127
- - Set `inputs` to narrow cache keys and avoid unnecessary rebuilds
128
- - Use `--dry-run` to debug pipeline configuration
129
- - Add `TURBO_TOKEN` and `TURBO_TEAM` to CI for remote caching
130
- - Never commit `.turbo/` or `node_modules/.cache/turbo`
56
+ Remote cache: `turbo login` and `turbo link` locally; in CI set `TURBO_TOKEN` and `TURBO_TEAM` and a plain `turbo run` reads and writes it. Persistent misses → check `inputs`/`outputs`/`env` in `turbo.json`, then compare runs with `--dry-run=json`.
131
57
 
58
+ Never commit `.turbo/`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: vercel-deployment
3
- description: "Vercel deployment workflows, environment management, domain configuration, and build troubleshooting. Use when deploying, checking deployment status, reviewing build logs, or managing environments."
3
+ description: "Vercel deployments, environments, domains and build troubleshooting through the Vercel MCP. Use when deploying to Vercel, checking a deployment, reading its build or runtime logs, or managing its environments."
4
4
  ---
5
5
 
6
6
  # Vercel Deployment
@@ -14,7 +14,7 @@ Branch → Environment mapping:
14
14
  | Branch pattern | Environment |
15
15
  |----------------|-------------|
16
16
  | `main` | Production deployment (auto) |
17
- | `feature/*`, `fix/*` | Preview deployment (auto) |
17
+ | Any other branch (`feat/*`, `fix/*`, …) | Preview deployment (auto) |
18
18
 
19
19
  ## MCP Tools
20
20
 
@@ -1,162 +1,29 @@
1
1
  ---
2
2
  name: vitest-testing
3
- description: "Vitest unit and integration testing patterns, commands, mocking (vi.mock), and coverage. Use when writing .test.ts files, configuring the test runner, or adding coverage thresholds."
3
+ description: "Vitest gotchas for mocking, timers, type tests and coverage. Use when writing or debugging Vitest tests, configuring vitest.config, or a coverage threshold fails."
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
  # Vitest Testing
9
7
 
10
- For project-specific test configuration, see `.opencastle/stack/testing-config.md`.
11
-
12
- ## Commands
13
-
14
- ```bash
15
- npx vitest # Run in watch mode
16
- npx vitest run # Run once (CI)
17
- npx vitest run --coverage # Run with coverage report
18
- npx vitest run src/utils/ # Run specific directory
19
- npx vitest run auth.test.ts # Run specific file
20
- npx vitest run -t "should validate" # Filter by test name
21
- npx vitest --ui # Open Vitest UI
22
- npx vitest --reporter=json # JSON output for CI
23
- npx vitest typecheck # Run type-checking tests
24
- ```
25
-
26
- ## Test Structure
27
-
28
- ### File Naming
29
-
30
- ```
31
- src/
32
- ├── utils/
33
- │ ├── format.ts
34
- │ └── format.test.ts # Co-located test
35
- ├── components/
36
- │ ├── Button.tsx
37
- │ └── Button.test.tsx # Component test
38
- └── __tests__/ # Integration tests
39
- └── auth-flow.test.ts
40
- ```
41
-
42
- ### Writing Tests
43
-
44
- ```typescript
45
- import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
46
- import { formatPrice } from './format';
47
-
48
- describe('formatPrice', () => {
49
- it('should format USD prices', () => {
50
- expect(formatPrice(9.99, 'USD')).toBe('$9.99');
51
- });
52
-
53
- it('should handle zero', () => {
54
- expect(formatPrice(0, 'USD')).toBe('$0.00');
55
- });
56
-
57
- it('should throw for negative values', () => {
58
- expect(() => formatPrice(-1, 'USD')).toThrow('Price cannot be negative');
59
- });
60
- });
61
- ```
62
-
63
- ## Mocking
64
-
65
- ### Module Mocking
66
-
67
- ```typescript
68
- import { vi, describe, it, expect } from 'vitest';
69
-
70
- // Mock entire module
71
- vi.mock('./database', () => ({
72
- getUser: vi.fn().mockResolvedValue({ id: '1', name: 'Alice' }),
73
- }));
74
-
75
- // Mock specific export
76
- vi.mock('./config', async (importOriginal) => {
77
- const original = await importOriginal<typeof import('./config')>();
78
- return { ...original, API_URL: 'http://test-api.example.com' };
79
- });
80
- ```
81
-
82
- ### Spy and Stub
83
-
84
- ```typescript
85
- import { vi, describe, it, expect } from 'vitest';
86
-
87
- describe('notifications', () => {
88
- it('should call the API', async () => {
89
- const fetchSpy = vi.spyOn(globalThis, 'fetch').mockResolvedValue(
90
- new Response(JSON.stringify({ ok: true }))
91
- );
92
-
93
- await sendNotification('Hello');
94
-
95
- expect(fetchSpy).toHaveBeenCalledWith('/api/notify', expect.objectContaining({
96
- method: 'POST',
97
- }));
98
-
99
- fetchSpy.mockRestore();
100
- });
101
- });
102
- ```
103
-
104
- ### Timer Mocking
105
-
106
- ```typescript
107
- import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest';
108
-
109
- describe('debounce', () => {
110
- beforeEach(() => vi.useFakeTimers());
111
- afterEach(() => vi.useRealTimers());
112
-
113
- it('should debounce calls', () => {
114
- const fn = vi.fn();
115
- const debounced = debounce(fn, 300);
116
-
117
- debounced();
118
- debounced();
119
- debounced();
8
+ Project test configuration: `.opencastle/stack/testing-config.md`. Coverage thresholds, environment and setup files: the project's `vitest.config.*` (or the `test` block of `vite.config.*`) — read them, never assume a number.
120
9
 
121
- expect(fn).not.toHaveBeenCalled();
122
- vi.advanceTimersByTime(300);
123
- expect(fn).toHaveBeenCalledOnce();
124
- });
125
- });
126
- ```
10
+ ## Running
127
11
 
128
- ## Configuration (vitest.config.ts)
12
+ - `vitest` alone starts **watch mode** in a terminal and never exits. Agents run `vitest run [file] [-t "name"]`.
13
+ - Type tests (`*.test-d.ts`, `expectTypeOf`) run with `vitest --typecheck` (or `vitest run --typecheck`). The old `vitest typecheck` subcommand is gone since 1.0.
14
+ - Coverage: `vitest run --coverage`. Below threshold → read the uncovered lines in the text report, add tests for those branches, re-run.
129
15
 
130
- ```typescript
131
- import { defineConfig } from 'vitest/config';
16
+ ## Mocking gotchas
132
17
 
133
- export default defineConfig({
134
- test: {
135
- globals: true, // Use describe/it/expect without imports
136
- environment: 'jsdom', // 'node' | 'jsdom' | 'happy-dom'
137
- include: ['src/**/*.test.{ts,tsx}'],
138
- coverage: {
139
- provider: 'v8',
140
- reporter: ['text', 'json', 'html'],
141
- include: ['src/**/*.{ts,tsx}'],
142
- exclude: ['src/**/*.test.{ts,tsx}', 'src/**/*.d.ts'],
143
- thresholds: {
144
- branches: 80,
145
- functions: 80,
146
- lines: 80,
147
- statements: 80,
148
- },
149
- },
150
- setupFiles: ['./src/test-setup.ts'],
151
- },
152
- });
153
- ```
18
+ - **`vi.mock()` is hoisted** above every import, so its factory cannot use variables declared in the file. Declare them with `vi.hoisted()`:
154
19
 
155
- ## Workflow
20
+ ```ts
21
+ const { getUser } = vi.hoisted(() => ({ getUser: vi.fn() }))
22
+ vi.mock('./database', () => ({ getUser }))
23
+ ```
156
24
 
157
- 1. Create `*.test.ts` adjacent to the source file.
158
- 2. Write focused unit tests (happy path + edge cases). Use `vi.mock()` before imports; restore in `afterEach` with `vi.restoreAllMocks()`.
159
- 3. Run `npx vitest run <file>` — fix failures.
160
- 4. If tests fail: run `npx vitest run <file> --reporter=verbose` to inspect, fix, re-run.
161
- 5. Coverage validation: run `npx vitest run --coverage --reporter=json` (CI) or `npx vitest run --coverage --reporter=text` (local) to generate coverage reports. Inspect `coverage`/`coverage-final.json` or the human-readable summary to find uncovered files/branches. If coverage is below thresholds, add targeted tests for uncovered branches, then re-run `npx vitest run --coverage` until thresholds pass.
162
- 6. Commit tests alongside source changes.
25
+ - Partial mock: `vi.mock('./config', async (importOriginal) => ({ ...(await importOriginal<typeof import('./config')>()), API_URL: 'http://test' }))`.
26
+ - `vi.spyOn(namespace, 'fn')` on a module's export misses calls made inside that module, and fails in Browser Mode; mock the module instead.
27
+ - **`vi.restoreAllMocks()` only restores `vi.spyOn` spies** (Vitest 3+). It does not reset `vi.fn()` call history; use `vi.clearAllMocks()`, or `restoreMocks` / `clearMocks` in the config, so state cannot leak between tests.
28
+ - Fake timers: `vi.useFakeTimers()` in `beforeEach`, `vi.useRealTimers()` in `afterEach`; advance with `vi.advanceTimersByTime(ms)` or `await vi.advanceTimersByTimeAsync(ms)` when promises are involved.
29
+ - One file needs a DOM in a `node` project: `// @vitest-environment jsdom` on its first line.
@@ -2,6 +2,7 @@
2
2
  description: 'Size the work in a PRD, score each workstream, and say whether to plan it in one go or as groups planned side by side. Returns JSON.'
3
3
  agent: 'Reviewer'
4
4
  output: json
5
+ pipeline: true
5
6
  ---
6
7
 
7
8
  <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->