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.
- package/dist/cli/adapters/claude-code.d.ts.map +1 -1
- package/dist/cli/adapters/claude-code.js +1 -0
- package/dist/cli/adapters/claude-code.js.map +1 -1
- package/dist/cli/adapters/single-file-base.d.ts +8 -0
- package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
- package/dist/cli/adapters/single-file-base.js +48 -22
- package/dist/cli/adapters/single-file-base.js.map +1 -1
- package/dist/cli/bootstrap-on-init.test.js +11 -0
- package/dist/cli/bootstrap-on-init.test.js.map +1 -1
- package/dist/cli/command-namespace.test.js +17 -0
- package/dist/cli/command-namespace.test.js.map +1 -1
- package/dist/cli/convoy/engine.d.ts +12 -0
- package/dist/cli/convoy/engine.d.ts.map +1 -1
- package/dist/cli/convoy/engine.git.test.js +55 -0
- package/dist/cli/convoy/engine.git.test.js.map +1 -1
- package/dist/cli/convoy/engine.js +39 -1
- package/dist/cli/convoy/engine.js.map +1 -1
- package/dist/cli/convoy/findings.d.ts +35 -0
- package/dist/cli/convoy/findings.d.ts.map +1 -0
- package/dist/cli/convoy/findings.js +100 -0
- package/dist/cli/convoy/findings.js.map +1 -0
- package/dist/cli/convoy/findings.test.d.ts +2 -0
- package/dist/cli/convoy/findings.test.d.ts.map +1 -0
- package/dist/cli/convoy/findings.test.js +75 -0
- package/dist/cli/convoy/findings.test.js.map +1 -0
- package/dist/cli/convoy/isolation.d.ts.map +1 -1
- package/dist/cli/convoy/isolation.js +2 -1
- package/dist/cli/convoy/isolation.js.map +1 -1
- package/dist/cli/convoy/worktree.d.ts +5 -0
- package/dist/cli/convoy/worktree.d.ts.map +1 -1
- package/dist/cli/convoy/worktree.js +12 -0
- package/dist/cli/convoy/worktree.js.map +1 -1
- package/dist/cli/docs-accuracy.test.js +34 -0
- package/dist/cli/docs-accuracy.test.js.map +1 -1
- package/dist/cli/doctor.d.ts +11 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +70 -6
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/doctor.test.js +82 -1
- package/dist/cli/doctor.test.js.map +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +58 -53
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/init.test.js +28 -23
- package/dist/cli/init.test.js.map +1 -1
- package/dist/cli/layers.d.ts +20 -0
- package/dist/cli/layers.d.ts.map +1 -1
- package/dist/cli/layers.js +53 -1
- package/dist/cli/layers.js.map +1 -1
- package/dist/cli/layers.test.js +67 -1
- package/dist/cli/layers.test.js.map +1 -1
- package/dist/cli/lessons.d.ts +10 -0
- package/dist/cli/lessons.d.ts.map +1 -1
- package/dist/cli/lessons.js +26 -1
- package/dist/cli/lessons.js.map +1 -1
- package/dist/cli/lessons.test.js +38 -1
- package/dist/cli/lessons.test.js.map +1 -1
- package/dist/cli/plan.test.js +10 -8
- package/dist/cli/plan.test.js.map +1 -1
- package/dist/cli/sync-check.test.js +14 -2
- package/dist/cli/sync-check.test.js.map +1 -1
- package/dist/orchestrator/plugins/notion/config.d.ts.map +1 -1
- package/dist/orchestrator/plugins/notion/config.js +21 -17
- package/dist/orchestrator/plugins/notion/config.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/adapters/claude-code.ts +1 -0
- package/src/cli/adapters/single-file-base.ts +63 -31
- package/src/cli/bootstrap-on-init.test.ts +12 -0
- package/src/cli/command-namespace.test.ts +17 -0
- package/src/cli/convoy/engine.git.test.ts +59 -0
- package/src/cli/convoy/engine.ts +44 -0
- package/src/cli/convoy/findings.test.ts +86 -0
- package/src/cli/convoy/findings.ts +129 -0
- package/src/cli/convoy/isolation.ts +2 -1
- package/src/cli/convoy/worktree.ts +12 -0
- package/src/cli/docs-accuracy.test.ts +42 -0
- package/src/cli/doctor.test.ts +101 -1
- package/src/cli/doctor.ts +73 -7
- package/src/cli/init.test.ts +27 -22
- package/src/cli/init.ts +62 -57
- package/src/cli/layers.test.ts +72 -1
- package/src/cli/layers.ts +52 -1
- package/src/cli/lessons.test.ts +48 -0
- package/src/cli/lessons.ts +27 -1
- package/src/cli/plan.test.ts +10 -8
- package/src/cli/sync-check.test.ts +16 -2
- package/src/orchestrator/agent-workflows/feature-implementation.md +1 -1
- package/src/orchestrator/agents/team-lead.agent.md +5 -5
- package/src/orchestrator/agents/testing-expert.agent.md +2 -2
- package/src/orchestrator/customizations/LESSONS-LEARNED.md +1 -1
- package/src/orchestrator/instructions/ai-optimization.instructions.md +6 -23
- package/src/orchestrator/instructions/general.instructions.md +22 -95
- package/src/orchestrator/plugins/astro/skills/astro-framework/SKILL.md +1 -3
- package/src/orchestrator/plugins/chrome-devtools/skills/browser-testing/SKILL.md +3 -5
- package/src/orchestrator/plugins/cloudflare/skills/cloudflare-platform/SKILL.md +2 -2
- package/src/orchestrator/plugins/contentful/skills/contentful-cms/SKILL.md +1 -1
- package/src/orchestrator/plugins/convex/skills/convex-database/SKILL.md +1 -3
- package/src/orchestrator/plugins/coolify/skills/coolify-deployment/SKILL.md +1 -1
- package/src/orchestrator/plugins/cypress/skills/cypress-testing/SKILL.md +1 -1
- package/src/orchestrator/plugins/drizzle/skills/drizzle-orm/SKILL.md +1 -1
- package/src/orchestrator/plugins/expo/skills/expo-development/SKILL.md +2 -2
- package/src/orchestrator/plugins/figma/skills/figma-design/SKILL.md +1 -3
- package/src/orchestrator/plugins/hetzner/skills/hetzner-cloud/SKILL.md +1 -1
- package/src/orchestrator/plugins/jira/skills/jira-management/SKILL.md +1 -3
- package/src/orchestrator/plugins/linear/skills/linear-task-management/SKILL.md +1 -3
- package/src/orchestrator/plugins/netlify/skills/netlify-deployment/SKILL.md +2 -2
- package/src/orchestrator/plugins/nextjs/skills/nextjs-framework/SKILL.md +13 -6
- package/src/orchestrator/plugins/notion/config.ts +21 -17
- package/src/orchestrator/plugins/notion/skills/notion-knowledge-management/SKILL.md +8 -16
- package/src/orchestrator/plugins/nx/skills/nx-workspace/SKILL.md +2 -4
- package/src/orchestrator/plugins/playwright/skills/playwright-testing/SKILL.md +1 -3
- package/src/orchestrator/plugins/prisma/skills/prisma-database/SKILL.md +1 -3
- package/src/orchestrator/plugins/resend/skills/resend-email/SKILL.md +2 -2
- package/src/orchestrator/plugins/sanity/skills/sanity-cms/SKILL.md +1 -3
- package/src/orchestrator/plugins/sentry/skills/sentry-monitoring/SKILL.md +1 -1
- package/src/orchestrator/plugins/slack/skills/slack-notifications/SKILL.md +1 -3
- package/src/orchestrator/plugins/strapi/skills/strapi-cms/SKILL.md +1 -3
- package/src/orchestrator/plugins/stripe/skills/stripe-payments/SKILL.md +4 -4
- package/src/orchestrator/plugins/supabase/skills/supabase-database/SKILL.md +3 -5
- package/src/orchestrator/plugins/teams/skills/teams-notifications/SKILL.md +1 -3
- package/src/orchestrator/plugins/trello/skills/trello-task-management/SKILL.md +1 -1
- package/src/orchestrator/plugins/turborepo/skills/turborepo-monorepo/SKILL.md +15 -88
- package/src/orchestrator/plugins/vercel/skills/vercel-deployment/SKILL.md +2 -2
- package/src/orchestrator/plugins/vitest/skills/vitest-testing/SKILL.md +17 -150
- package/src/orchestrator/prompts/assess-complexity.prompt.md +1 -0
- package/src/orchestrator/prompts/create-skill.prompt.md +13 -67
- package/src/orchestrator/prompts/fix-convoy.prompt.md +1 -0
- package/src/orchestrator/prompts/fix-prd.prompt.md +1 -0
- package/src/orchestrator/prompts/generate-prd.prompt.md +1 -0
- package/src/orchestrator/prompts/resolve-pr-comments.prompt.md +2 -2
- package/src/orchestrator/prompts/validate-convoy.prompt.md +1 -0
- package/src/orchestrator/prompts/validate-prd.prompt.md +1 -0
- package/src/orchestrator/skills/accessibility-standards/REFERENCE.md +17 -12
- package/src/orchestrator/skills/accessibility-standards/SKILL.md +1 -1
- package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +3 -5
- package/src/orchestrator/skills/agent-hooks/SKILL.md +8 -6
- package/src/orchestrator/skills/api-patterns/SKILL.md +1 -1
- package/src/orchestrator/skills/code-commenting/SKILL.md +1 -1
- package/src/orchestrator/skills/context-map/REFERENCE.md +0 -2
- package/src/orchestrator/skills/context-map/SKILL.md +2 -2
- package/src/orchestrator/skills/data-engineering/REFERENCE.md +3 -9
- package/src/orchestrator/skills/data-engineering/SKILL.md +9 -16
- package/src/orchestrator/skills/decomposition/SKILL.md +1 -1
- package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +4 -4
- package/src/orchestrator/skills/documentation-standards/SKILL.md +4 -2
- package/src/orchestrator/skills/fast-review/REFERENCE.md +0 -2
- package/src/orchestrator/skills/fast-review/SKILL.md +5 -5
- package/src/orchestrator/skills/frontend-design/REFERENCE.md +6 -28
- package/src/orchestrator/skills/frontend-design/SKILL.md +19 -9
- package/src/orchestrator/skills/git-workflow/SKILL.md +1 -1
- package/src/orchestrator/skills/memory-merger/SKILL.md +13 -15
- package/src/orchestrator/skills/observability-logging/SKILL.md +1 -1
- package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +5 -9
- package/src/orchestrator/skills/orchestration-protocols/SKILL.md +6 -6
- package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +0 -4
- package/src/orchestrator/skills/panel-majority-vote/SKILL.md +1 -1
- package/src/orchestrator/skills/panel-majority-vote/panel-report.template.md +0 -2
- package/src/orchestrator/skills/performance-optimization/SKILL.md +2 -2
- package/src/orchestrator/skills/project-consistency/SKILL.md +2 -2
- package/src/orchestrator/skills/project-consistency/TEMPLATES.md +0 -4
- package/src/orchestrator/skills/react-development/SKILL.md +3 -3
- package/src/orchestrator/skills/security-hardening/SKILL.md +5 -5
- package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +0 -2
- package/src/orchestrator/skills/self-improvement/SKILL.md +1 -1
- package/src/orchestrator/skills/seo-patterns/SKILL.md +1 -1
- package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +0 -2
- package/src/orchestrator/skills/session-checkpoints/SKILL.md +1 -1
- package/src/orchestrator/skills/team-lead-reference/SKILL.md +1 -1
- package/src/orchestrator/skills/technical-writing/SKILL.md +8 -13
- package/src/orchestrator/skills/testing-workflow/SKILL.md +6 -6
- package/src/orchestrator/skills/typescript-best-practices/SKILL.md +1 -1
- package/src/orchestrator/skills/unslop/SKILL.md +1 -1
- package/src/orchestrator/skills/validation-gates/REFERENCE.md +6 -31
- package/src/orchestrator/skills/validation-gates/SKILL.md +12 -26
- package/src/orchestrator/skills/writing-for-agents/SKILL.md +2 -2
- package/src/orchestrator/skills/documentation-standards/WRITING-GUIDE.md +0 -39
- package/src/orchestrator/skills/frontend-design/COMPONENTS.md +0 -113
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: nx-workspace
|
|
3
|
-
description: "
|
|
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
|
-
-
|
|
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
|
|
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
|
|
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
|
|
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: "
|
|
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
|
|
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
|
|
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: "
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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: "
|
|
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
|
-
-
|
|
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.
|
|
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
|
|
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: "
|
|
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: "
|
|
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
|
|
16
|
-
turbo run
|
|
17
|
-
turbo run
|
|
18
|
-
turbo run build --
|
|
19
|
-
turbo run build --
|
|
20
|
-
turbo run build --
|
|
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
|
-
|
|
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
|
-
- `
|
|
70
|
-
- `
|
|
71
|
-
- `
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
| `
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
122
|
-
vi.advanceTimersByTime(300);
|
|
123
|
-
expect(fn).toHaveBeenCalledOnce();
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
```
|
|
10
|
+
## Running
|
|
127
11
|
|
|
128
|
-
|
|
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
|
-
|
|
131
|
-
import { defineConfig } from 'vitest/config';
|
|
16
|
+
## Mocking gotchas
|
|
132
17
|
|
|
133
|
-
|
|
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
|
-
|
|
20
|
+
```ts
|
|
21
|
+
const { getUser } = vi.hoisted(() => ({ getUser: vi.fn() }))
|
|
22
|
+
vi.mock('./database', () => ({ getUser }))
|
|
23
|
+
```
|
|
156
24
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
3.
|
|
160
|
-
|
|
161
|
-
|
|
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. -->
|