opencastle 0.32.12 → 0.33.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 (115) hide show
  1. package/LICENSE +21 -93
  2. package/README.md +5 -3
  3. package/package.json +2 -2
  4. package/src/dashboard/dist/data/convoys/demo-api-v2.json +3 -3
  5. package/src/dashboard/dist/data/convoys/demo-auth-revamp.json +4 -4
  6. package/src/dashboard/dist/data/convoys/demo-dashboard-ui.json +12 -12
  7. package/src/dashboard/dist/data/convoys/demo-data-pipeline.json +3 -3
  8. package/src/dashboard/dist/data/convoys/demo-deploy-ci.json +1 -1
  9. package/src/dashboard/dist/data/convoys/demo-docs-update.json +7 -7
  10. package/src/dashboard/dist/data/convoys/demo-perf-opt.json +4 -4
  11. package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
  12. package/src/dashboard/public/data/convoys/demo-api-v2.json +3 -3
  13. package/src/dashboard/public/data/convoys/demo-auth-revamp.json +4 -4
  14. package/src/dashboard/public/data/convoys/demo-dashboard-ui.json +12 -12
  15. package/src/dashboard/public/data/convoys/demo-data-pipeline.json +3 -3
  16. package/src/dashboard/public/data/convoys/demo-deploy-ci.json +1 -1
  17. package/src/dashboard/public/data/convoys/demo-docs-update.json +7 -7
  18. package/src/dashboard/public/data/convoys/demo-perf-opt.json +4 -4
  19. package/src/orchestrator/customizations/stack/sanity-config.md +43 -0
  20. package/src/orchestrator/customizations/stack/supabase-config.md +53 -0
  21. package/src/orchestrator/plugins/astro/REFERENCE.md +5 -0
  22. package/src/orchestrator/plugins/astro/SKILL.md +22 -29
  23. package/src/orchestrator/plugins/chrome-devtools/REFERENCE.md +9 -0
  24. package/src/orchestrator/plugins/chrome-devtools/SKILL.md +10 -55
  25. package/src/orchestrator/plugins/contentful/REFERENCE.md +16 -0
  26. package/src/orchestrator/plugins/contentful/SKILL.md +69 -29
  27. package/src/orchestrator/plugins/convex/REFERENCE.md +9 -0
  28. package/src/orchestrator/plugins/convex/SKILL.md +13 -1
  29. package/src/orchestrator/plugins/cypress/REFERENCE.md +5 -0
  30. package/src/orchestrator/plugins/cypress/SKILL.md +29 -93
  31. package/src/orchestrator/plugins/figma/REFERENCE.md +18 -0
  32. package/src/orchestrator/plugins/figma/SKILL.md +41 -66
  33. package/src/orchestrator/plugins/jira/REFERENCE.md +9 -0
  34. package/src/orchestrator/plugins/jira/SKILL.md +26 -114
  35. package/src/orchestrator/plugins/linear/SKILL.md +42 -109
  36. package/src/orchestrator/plugins/netlify/REFERENCE.md +33 -0
  37. package/src/orchestrator/plugins/netlify/SKILL.md +34 -64
  38. package/src/orchestrator/plugins/nextjs/REFERENCE.md +73 -0
  39. package/src/orchestrator/plugins/nextjs/SKILL.md +49 -138
  40. package/src/orchestrator/plugins/notion/SKILL.md +26 -168
  41. package/src/orchestrator/plugins/notion/TEMPLATES.md +88 -0
  42. package/src/orchestrator/plugins/nx/REFERENCE.md +10 -0
  43. package/src/orchestrator/plugins/nx/SKILL.md +12 -12
  44. package/src/orchestrator/plugins/playwright/REFERENCE.md +12 -0
  45. package/src/orchestrator/plugins/playwright/SKILL.md +33 -98
  46. package/src/orchestrator/plugins/prisma/REFERENCE.md +42 -0
  47. package/src/orchestrator/plugins/prisma/SKILL.md +18 -68
  48. package/src/orchestrator/plugins/resend/REFERENCE.md +61 -0
  49. package/src/orchestrator/plugins/resend/SKILL.md +23 -137
  50. package/src/orchestrator/plugins/sanity/SKILL.md +50 -3
  51. package/src/orchestrator/plugins/slack/REFERENCE.md +24 -0
  52. package/src/orchestrator/plugins/slack/SKILL.md +36 -111
  53. package/src/orchestrator/plugins/strapi/REFERENCE.md +35 -0
  54. package/src/orchestrator/plugins/strapi/SKILL.md +60 -24
  55. package/src/orchestrator/plugins/supabase/REFERENCE.md +9 -0
  56. package/src/orchestrator/plugins/supabase/SKILL.md +44 -16
  57. package/src/orchestrator/plugins/teams/REFERENCE.md +36 -0
  58. package/src/orchestrator/plugins/teams/SKILL.md +35 -85
  59. package/src/orchestrator/plugins/trello/REFERENCE.md +9 -0
  60. package/src/orchestrator/plugins/trello/SKILL.md +25 -97
  61. package/src/orchestrator/plugins/turborepo/REFERENCE.md +9 -0
  62. package/src/orchestrator/plugins/turborepo/SKILL.md +13 -1
  63. package/src/orchestrator/plugins/vercel/SKILL.md +45 -52
  64. package/src/orchestrator/plugins/vitest/SKILL.md +10 -14
  65. package/src/orchestrator/prompts/create-skill.prompt.md +62 -20
  66. package/src/orchestrator/prompts/generate-convoy.prompt.md +6 -0
  67. package/src/orchestrator/prompts/generate-prd.prompt.md +4 -0
  68. package/src/orchestrator/skills/accessibility-standards/REFERENCE.md +34 -0
  69. package/src/orchestrator/skills/accessibility-standards/SKILL.md +6 -3
  70. package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +48 -0
  71. package/src/orchestrator/skills/agent-hooks/SKILL.md +41 -65
  72. package/src/orchestrator/skills/agent-memory/KNOWLEDGE-GRAPH.md +49 -0
  73. package/src/orchestrator/skills/agent-memory/SKILL.md +30 -67
  74. package/src/orchestrator/skills/api-patterns/SKILL.md +29 -1
  75. package/src/orchestrator/skills/backbone-scaffolding/EXAMPLES.md +16 -0
  76. package/src/orchestrator/skills/backbone-scaffolding/SKILL.md +99 -0
  77. package/src/orchestrator/skills/code-commenting/SKILL.md +1 -1
  78. package/src/orchestrator/skills/context-map/REFERENCE.md +70 -0
  79. package/src/orchestrator/skills/context-map/SKILL.md +28 -55
  80. package/src/orchestrator/skills/data-engineering/REFERENCE.md +55 -0
  81. package/src/orchestrator/skills/data-engineering/SKILL.md +40 -34
  82. package/src/orchestrator/skills/decomposition/REFERENCE.md +28 -0
  83. package/src/orchestrator/skills/decomposition/SKILL.md +15 -30
  84. package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +31 -65
  85. package/src/orchestrator/skills/documentation-standards/SKILL.md +31 -50
  86. package/src/orchestrator/skills/documentation-standards/WRITING-GUIDE.md +39 -0
  87. package/src/orchestrator/skills/fast-review/REFERENCE.md +30 -0
  88. package/src/orchestrator/skills/fast-review/SKILL.md +11 -31
  89. package/src/orchestrator/skills/frontend-design/COMPONENTS.md +113 -0
  90. package/src/orchestrator/skills/frontend-design/REFERENCE.md +36 -0
  91. package/src/orchestrator/skills/frontend-design/SKILL.md +36 -85
  92. package/src/orchestrator/skills/git-workflow/SKILL.md +13 -2
  93. package/src/orchestrator/skills/memory-merger/REFERENCE.md +20 -0
  94. package/src/orchestrator/skills/memory-merger/SKILL.md +29 -38
  95. package/src/orchestrator/skills/observability-logging/SKILL.md +5 -12
  96. package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +42 -0
  97. package/src/orchestrator/skills/orchestration-protocols/SKILL.md +54 -41
  98. package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +55 -0
  99. package/src/orchestrator/skills/panel-majority-vote/SKILL.md +30 -75
  100. package/src/orchestrator/skills/performance-optimization/SKILL.md +41 -1
  101. package/src/orchestrator/skills/project-consistency/SKILL.md +50 -89
  102. package/src/orchestrator/skills/project-consistency/TEMPLATES.md +39 -0
  103. package/src/orchestrator/skills/react-development/REFERENCE.md +7 -0
  104. package/src/orchestrator/skills/react-development/SKILL.md +50 -42
  105. package/src/orchestrator/skills/security-hardening/SKILL.md +88 -1
  106. package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +36 -0
  107. package/src/orchestrator/skills/self-improvement/SKILL.md +19 -25
  108. package/src/orchestrator/skills/seo-patterns/REFERENCE.md +54 -0
  109. package/src/orchestrator/skills/seo-patterns/SKILL.md +20 -88
  110. package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +58 -0
  111. package/src/orchestrator/skills/session-checkpoints/SKILL.md +34 -58
  112. package/src/orchestrator/skills/team-lead-reference/SKILL.md +37 -30
  113. package/src/orchestrator/skills/testing-workflow/SKILL.md +55 -2
  114. package/src/orchestrator/skills/validation-gates/REFERENCE.md +50 -0
  115. package/src/orchestrator/skills/validation-gates/SKILL.md +39 -35
@@ -0,0 +1,24 @@
1
+ > Parent: [SKILL.md](./SKILL.md)
2
+
3
+ Slack REFERENCE: authentication scopes, token setup, and MCP server environment variables.
4
+
5
+ Move security and auth details here to keep `SKILL.md` concise.
6
+ Last Updated: 2026-03-31
7
+
8
+ Reference: Slack scopes & MCP tools
9
+
10
+ ## OAuth Scopes (recommended minimal sets)
11
+
12
+ - Bot (notifications): `chat:write`, `channels:read`, `conversations:history`, `users:read`
13
+ - Read-only: `channels:read`, `channels:history`, `im:read`
14
+
15
+ ## MCP Tools (compact)
16
+
17
+ - `conversations_add_message` — `channel_id`, `payload`, `content_type`, `thread_ts`
18
+ - `conversations_history` — `channel_id`, `limit`
19
+ - `conversations_replies` — `channel_id`, `thread_ts`, `limit`
20
+ - `users_resolve` — `email|username`
21
+
22
+ ## Token handling
23
+
24
+ - Store `SLACK_MCP_XOXB_TOKEN` in CI/env; rotate periodically; log token rotations in the observability log.
@@ -7,145 +7,70 @@ description: "Slack MCP integration for agent-to-human notifications and bi-dire
7
7
 
8
8
  # Slack Notifications
9
9
 
10
- Agent communication patterns via the Slack MCP server. Enables agents to post progress updates, request human approvals, and read responses — all through Slack channels and threads.
11
-
12
10
  ## MCP Server
13
11
 
14
- | Field | Value |
15
- |-------|-------|
16
- | **Package** | [`@kazuph/mcp-slack`](https://www.npmjs.com/package/@kazuph/mcp-slack) |
17
- | **Type** | stdio (spawned via `npx -y @kazuph/mcp-slack`) |
18
- | **Auth** | Bot token (`xoxb-…`) via `SLACK_MCP_XOXB_TOKEN` env var |
19
- | **Extra env** | `SLACK_MCP_ADD_MESSAGE_TOOL=true` — enables `conversations_add_message` |
20
-
21
- ### Authentication
22
-
23
- Use a **bot token** (`SLACK_MCP_XOXB_TOKEN`). For message search, a user token (`xoxp-…`) via `SLACK_MCP_XOXP_TOKEN` is required instead.
24
-
25
- **Bot Token Scopes:**
26
-
27
- | Scope | Purpose |
28
- |-------|---------|
29
- | `chat:write` | Post messages and replies |
30
- | `channels:read`, `channels:history` | List and read public channels |
31
- | `groups:read`, `groups:history` | List and read private channels |
32
- | `im:read`, `im:history`, `mpim:read`, `mpim:history` | DMs and group DMs |
33
- | `users:read`, `users:read.email` | Look up user profiles and emails |
34
- | `channels:manage` | Create/rename channels (optional) |
35
-
36
- ## Available MCP Tools
37
-
38
- ### Channel Management
39
-
40
- `channels_list`, `conversations_create`, `conversations_rename`, `conversations_set_topic`, `conversations_invite`
41
-
42
- ### Messaging
43
-
44
- | Tool | Description | Key Parameters |
45
- |------|-------------|----------------|
46
- | `conversations_add_message` | Post a message to a channel or thread | `channel_id`, `payload`, `content_type` (`text/markdown`), `thread_ts` |
47
- | `conversations_history` | Read recent messages from a channel | `channel_id`, `limit` (e.g. `1d`, `50`) |
48
- | `conversations_replies` | Get replies in a thread | `channel_id`, `thread_ts`, `limit` |
49
- | `conversations_search_messages` | Search messages across channels | `search_query`, `filter_in_channel`, `filter_date_*` |
50
-
51
- ### Users
52
-
53
- `users_resolve` — look up a user by name or email; returns user ID for mentions.
12
+ Package: `@kazuph/mcp-slack` (stdio). Auth: `SLACK_MCP_XOXB_TOKEN` env var. Enable `SLACK_MCP_ADD_MESSAGE_TOOL=true`.
54
13
 
55
- ### Key Differences from Slack Web API
56
-
57
- - Tool names use `conversations_*` pattern, not `chat.postMessage` etc.
58
- - Message body is sent via `payload` parameter, not `text`
59
- - Message posting is **disabled by default** — requires `SLACK_MCP_ADD_MESSAGE_TOOL=true` env var
60
- - `limit` on history/replies accepts time ranges (`1d`, `7d`, `30d`) or message counts (`50`)
61
- - No reaction tools or canvas tools available via this MCP server
14
+ See [REFERENCE.md](REFERENCE.md) for OAuth scopes and token setup.
62
15
 
63
16
  ## Agent Notification Patterns
64
17
 
65
18
  ### Progress Updates
66
19
 
67
20
  ```
68
- Channel: #agent-updates (or project-specific channel)
69
- Format:
70
- 🔄 **Task:** TAS-42 — Add price filter component
71
- **Status:** In progress — implementing unit tests
72
- **Files changed:** 3 (PriceFilter.tsx, PriceFilter.test.tsx, index.ts)
73
- **ETA:** ~5 minutes
21
+ 🔄 TAS-42 In progress — implementing unit tests
22
+ Files: 3 (PriceFilter.tsx, test, index) | ETA: ~5 min
74
23
  ```
75
24
 
76
- ## Bi-Directional Communication
77
-
78
- ### Dual-Channel Approval Pattern
25
+ ### MCP invocation example
79
26
 
80
- Approval requests are always **dual-channel** — posted to Slack AND asked in the chat window. The first response wins.
27
+ Post an approval request:
81
28
 
29
+ ```js
30
+ const res = mcp_slack_conversations_add_message({
31
+ channel: 'C012345',
32
+ text: '⏳ Approval Required — TAS-42: Run DB migration?',
33
+ thread_ts: null
34
+ });
35
+ if (!res?.ok) throw new Error('Slack post failed: ' + res?.error);
82
36
  ```
83
- Agent needs approval
84
- ├─→ Posts to Slack channel/thread
85
- │ → User replies in Slack
86
- │ → Agent polls & picks it up ──────┐
87
- │ ▼
88
- │ Agent acts
89
- │ ▲
90
- └─→ Asks in VS Code chat │
91
- → User replies here ──────────────┘
92
- (immediate, no polling needed)
93
- ```
94
37
 
95
- ### Approval Flow
38
+ ## Bi-Directional Communication
39
+
40
+ Approval requests are **dual-channel** — post to Slack AND ask in chat. First response wins.
96
41
 
97
- 1. **Post to Slack** with a structured approval request:
42
+ 1. **Post to Slack:**
98
43
  ```
99
- **Approval Required**
100
- Task: TAS-42 Database migration adds `price_range` column
101
- Action: Run migration on production database
102
-
103
- Reply in this thread with:
104
- ✅ "approved" — Approve and proceed
105
- ❌ "rejected" — Reject and stop
106
- 💬 Or reply with questions
44
+ ⏳ Approval Required — TAS-42: Run DB migration
45
+ Reply: approved | rejected | 💬 questions
107
46
  ```
108
47
 
109
- 2. **Ask in chat** — Yield to the user with the same question so they can respond directly.
48
+ 2. **Ask in chat** with the same question.
110
49
 
111
- 3. **If the user responds in chat** Post confirmation to the Slack thread: `✅ Approved via VS Code chat. Proceeding.`
50
+ 3. **Chat response wins** post confirmation to Slack thread.
112
51
 
113
- 4. **If waiting for Slack reply** Poll every 30 seconds using `conversations_replies` with the message's `thread_ts`. Continue independent subtasks between polls.
52
+ 4. **Waiting for Slack** poll thread:
114
53
 
115
- 5. **If session ends before reply** — Save to checkpoint with channel, thread ID, question, and timestamp. The next session's `on-session-start` hook checks for replies.
116
-
117
- ### Parsing Conventions
118
-
119
- | Signal | Meaning |
120
- |--------|---------|
121
- | Thread reply with "approved" / "yes" / "go" | Approved — proceed |
122
- | Thread reply with "rejected" / "no" / "stop" | Rejected — stop and report |
123
- | Thread reply with "reviewing" / "looking" | Acknowledged — user is reviewing |
124
- | Thread reply with detailed text | Instructions or questions |
125
- | `@agent` mention | Direct command or question for the agent |
54
+ ```js
55
+ // Poll for approval reply (30s interval, 10 min timeout)
56
+ const replies = mcp_slack_conversations_replies({ channel: 'C012345', ts: threadTs, limit: 20 });
57
+ for (const msg of replies?.messages || []) {
58
+ if (/\b(approved|yes|go)\b/i.test(msg.text)) return 'approved';
59
+ if (/\b(rejected|no|stop)\b/i.test(msg.text)) return 'rejected';
60
+ }
61
+ // Retry after 30s; timeout after 10 min
62
+ ```
126
63
 
127
- > **Note:** Reactions are not available via the Slack MCP server. Use thread replies for all approval workflows.
64
+ 5. **If session ends before reply** Save to checkpoint with channel, thread ID, question, and timestamp. The next session's `on-session-start` hook checks for replies.
128
65
 
129
- ## Channel & Thread Conventions
130
66
 
131
- Project-specific channel mappings are defined in `.opencastle/stack/notifications-config.md`. Always prefer channel IDs from the config over hardcoded names.
132
67
 
133
- ### Threading Rules
68
+ ## Conventions
134
69
 
135
- - **Always thread replies** never post top-level messages for follow-ups
136
- - **One thread per task** — keep all updates for a single task in one thread
137
- - **Include task ID** — every message references the tracker issue ID
138
- - **Pin important threads** — pin approval requests and blocking issues
70
+ Project-specific channel mappings: `.opencastle/stack/notifications-config.md`. Always thread replies; one thread per task; include tracker issue ID.
139
71
 
140
72
  ## Rate Limits
141
73
 
142
- Write ops are Tier 2 (20/min); read ops Tier 3 (50/min). Best practices:
143
- - Batch updates into single messages rather than posting many small messages
144
- - Use threads to consolidate related updates
145
- - Cache channel/user IDs — don't look them up repeatedly
146
-
147
- ## Security Considerations
74
+ Write: 20/min; Read: 50/min. Batch updates; use threads; cache channel/user IDs.
148
75
 
149
- - **Bot tokens** are passed via `SLACK_MCP_XOXB_TOKEN` env var — never hardcode in config files or commit to git
150
- - **Scope minimization** — request only the scopes agents actually need
151
- - **No secrets in messages** — never post tokens, passwords, or credentials in Slack messages
76
+ See [REFERENCE.md](REFERENCE.md) for security guidelines.
@@ -0,0 +1,35 @@
1
+ > Parent: [SKILL.md](./SKILL.md)
2
+
3
+ ## Strapi Reference: GraphQL & Plugin Development
4
+
5
+ ### GraphQL Plugin
6
+
7
+ - Enable via `@strapi/plugin-graphql`.
8
+ - Auto-generates types and resolvers from content types; use `filters`, `pagination`, and `sort` arguments.
9
+ - Custom resolvers live under `src/api/<type>/graphql/` — keep GraphQL-specific transformations isolated.
10
+
11
+ ### Plugin Development
12
+
13
+ - Scaffold with `strapi generate plugin <name>`.
14
+ - Plugin structure: `admin/`, `server/`, `content-types/` — register in `config/plugins.ts`.
15
+ - Use the Plugin SDK for admin panel extensions and keep server logic under `server/` to avoid bundling admin code.
16
+ # Strapi Reference (REFERENCE.md)
17
+
18
+ Last Updated: 2026-03-31
19
+
20
+ ## Populate & filters quick reference
21
+
22
+ - Populate relations: `?populate=author,categories` or deep `?populate=deep` for all relations.
23
+ - Filters example: `?filters[status][$eq]=published&filters[views][$gte]=100`
24
+ - Fields selection: `?fields[0]=title&fields[1]=slug`
25
+
26
+ ## Common API patterns
27
+
28
+ - Paginated list with relations: `/api/articles?populate=author,categories&pagination[page]=1&pagination[pageSize]=10`
29
+ - Single entry by slug: `/api/articles?filters[slug][$eq]=my-post&populate=author`
30
+
31
+ ## Recommended tests
32
+
33
+ 1. Endpoint smoke test: GET `/api/<type>?pagination[page]=1` returns 200 and `data` array.
34
+ 2. Relation test: GET with `populate` returns `relationships` with expected keys.
35
+ 3. Permission test: verify `public` role returns 200/403 as configured.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: strapi-cms
3
- description: "Strapi CMS development patterns, REST/GraphQL API usage, content type building, plugin development, and deployment best practices. Use when working with Strapi content types, controllers, services, or plugins."
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."
4
4
  ---
5
5
 
6
6
  <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
@@ -13,33 +13,69 @@ Generic Strapi CMS development methodology. For project-specific configuration,
13
13
 
14
14
  1. **Use Content-Type Builder** — define content types through the admin panel or `content-types` directory
15
15
  2. **REST API by default** — Strapi exposes REST endpoints automatically; enable GraphQL plugin if needed
16
- 3. **Customize controllers** — extend auto-generated controllers in `src/api/<type>/controllers/`
17
- 4. **Services for business logic** — keep business logic in services, not controllers
18
- 5. **Lifecycle hooks** — use model lifecycle hooks for side effects (e.g., `beforeCreate`, `afterUpdate`)
19
- 6. **Permissions and roles** — configure permissions via the Users & Permissions plugin
20
- 7. **Draft/Publish system** — enable draft/publish on content types that need editorial workflow
21
- 8. **Media Library** — use Strapi's media library for asset management; configure providers for S3/Cloudinary
22
- 9. **Environment configs** — use `config/env/<env>/` for environment-specific configuration
23
- 10. **Never modify `node_modules`** — extend functionality through plugins and customizations
16
+ 3. **Extend controllers** — implement `src/api/<type>/controllers/<type>.js` with wrapper logic that calls services
17
+ 4. **Implement services** — place business logic in `src/api/<type>/services/` and keep controllers thin
18
+ 5. **Use lifecycle hooks** — add `beforeCreate`/`afterUpdate` handlers in `src/api/<type>/lifecycles.js` for side effects
19
+ 6. **Configure permissions per role** — set public/authenticated access in Users & Permissions; keep environment configs under `config/env/<env>/`
24
20
 
25
21
  ## API Patterns
26
22
 
27
- ### REST API
28
- - Endpoints follow `/api/<content-type>` convention
29
- - Use `populate` parameter to include relations
30
- - Use `filters` parameter with operators (`$eq`, `$contains`, `$in`, etc.)
23
+ ### REST API (Strapi-specific)
24
+ - Use `populate` to include relations
25
+ - Use `filters` with operators (`$eq`, `$contains`, `$in`, etc.)
31
26
  - Pagination via `pagination[page]` and `pagination[pageSize]`
32
- - Use `fields` to select specific attributes
27
+ - Use `fields` to select attributes
33
28
 
34
- ### GraphQL Plugin
35
- - Enable via `@strapi/plugin-graphql`
36
- - Auto-generates types and resolvers from content types
37
- - Use `filters`, `pagination`, and `sort` arguments
38
- - Custom resolvers in `src/api/<type>/graphql/`
29
+ ### Quick REST examples
39
30
 
40
- ## Plugin Development
31
+ GET with populate and filters (client-side fetch):
41
32
 
42
- - Scaffold with `strapi generate plugin <name>`
43
- - Follow the plugin structure: `admin/`, `server/`, `content-types/`
44
- - Register plugin in `config/plugins.ts`
45
- - Use the Plugin SDK for admin panel extensions
33
+ ```js
34
+ // GET /api/articles?populate=author,categories&filters[status][$eq]=published&pagination[page]=1&pagination[pageSize]=10
35
+ const res = await fetch('https://cms.example.com/api/articles?populate=author,categories&filters[status][$eq]=published');
36
+ const json = await res.json();
37
+ console.log(json.data[0].attributes.title);
38
+ ```
39
+
40
+ Custom controller extension (server):
41
+
42
+ ```js
43
+ // src/api/article/controllers/article.js
44
+ const { createCoreController } = require('@strapi/strapi').factories;
45
+
46
+ module.exports = createCoreController('api::article.article', ({ strapi }) => ({
47
+ async find(ctx) {
48
+ // call default then modify response
49
+ const res = await super.find(ctx);
50
+ // add extra field
51
+ res.meta.custom = { processedAt: new Date().toISOString() };
52
+ return res;
53
+ },
54
+ }));
55
+ ```
56
+
57
+ Lifecycle hook example:
58
+
59
+ ```js
60
+ // src/api/article/content-types/article/lifecycles.js
61
+ module.exports = {
62
+ async beforeCreate(event) {
63
+ const { data } = event.params;
64
+ if (data.title) data.slug = slugify(data.title);
65
+ },
66
+ };
67
+ ```
68
+
69
+
70
+ ## Quick workflow: create content type + custom controller + service
71
+
72
+ 1. Create content type using Content-Type Builder or `src/api/<type>/content-types/schema.json` → commit schema.
73
+ 2. Scaffold controller and service files under `src/api/<type>/controllers/` and `src/api/<type>/services/` with thin controller calling service functions.
74
+ 3. Add lifecycle hooks (optional) in `content-types/<type>/lifecycles.js` for side effects.
75
+ 4. Run local Strapi (`yarn develop`) → check admin UI for new content type.
76
+ - Validation: create a test entry in admin UI and confirm via `GET /api/<type>?pagination[page]=1` that fields exist.
77
+ - If fail: check server logs, run `yarn build` to surface schema errors, verify `schema.json` validity.
78
+ 5. Add permissions (Users & Permissions) for public/authenticated roles if API access required.
79
+ 6. Add automated API test: `fetch('/api/<type>?populate=*')` in test suite to validate relations populate.
80
+
81
+ For more reference patterns and larger examples, see [REFERENCE.md](REFERENCE.md).
@@ -0,0 +1,9 @@
1
+ > Parent: [SKILL.md](./SKILL.md)
2
+
3
+ Last Updated: 2026-03-31
4
+
5
+ Reference: Supabase migrations & RLS tests
6
+
7
+ - CI snippets for applying migrations and generating TypeScript types
8
+ - Example RLS test queries for `anon`, `user`, and `admin` roles
9
+ - Backfill and phased-migration strategies for destructive changes
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: supabase-database
3
- description: "Supabase database migration rules, RLS policy patterns, and auth integration best practices. Use when designing database tables, writing migrations, configuring RLS policies, implementing auth, or managing user roles."
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."
4
4
  ---
5
5
 
6
6
  <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
@@ -9,18 +9,46 @@ description: "Supabase database migration rules, RLS policy patterns, and auth i
9
9
 
10
10
  Generic Supabase development methodology. For project-specific schema, roles, migration history, auth flow, and key files, see [supabase-config.md](../../.opencastle/stack/supabase-config.md).
11
11
 
12
- ## Migration Rules
13
-
14
- 1. Always write migrations for schema changes never modify schema directly.
15
- 2. Use RLS on all tables no exceptions.
16
- 3. Test RLS from different roles (anon, user, moderator, admin).
17
- 4. `CASCADE DELETE` where appropriate.
18
- 5. Add indexes for frequently queried columns.
19
- 6. Naming: `NNN_description.sql` or `YYYYMMDD_description.sql`.
20
- 7. Write idempotent migrations they must be safe to re-run.
21
- 8. Document migration purpose with SQL comments.
22
- 9. Validate schema changes don't break existing RLS policies.
23
- 10. Use `auth.uid()` in RLS policies — never pass user ID from the client.
24
- 11. Prefer database functions for complex authorization logic.
25
- 12. Test migrations in a development dataset before production.
26
- 13. Always generate TypeScript types after schema changes.
12
+ ## Migration Rules (sequential workflow)
13
+
14
+ 1. Plan: create a migration with a descriptive name (`YYYYMMDD_add_profiles.sql`) and list expected schema changes.
15
+ 2. Author: write the SQL migration and include inline comments describing intent and rollback considerations.
16
+ 3. Local validate: apply the migration to a local or ephemeral DB; run smoke tests and verify RLS policies for `anon`, `user`, and `admin`.
17
+ 4. Inspect: review generated SQL for destructive actions (table drops, column rewrites). If destructive, add backfill scripts and phased changes.
18
+ 5. CI verify: run the migration in CI against a test replica and run the full test suite.
19
+ 6. Deploy: promote migration to production using the project's safe-deploy pipeline.
20
+ 7. Post-check: verify row-level security, indexes, and perform a small data validation query.
21
+
22
+ Validation checkpoints: after steps 3 and 5 assert (a) migration completes, (b) RLS policies still pass for role-specific queries, (c) tests covering changed paths pass. On failure: revert, adjust migration, and re-run.
23
+
24
+ ## Migration Example (consolidated)
25
+
26
+ ```sql
27
+ -- 20260331_create_profiles.sql
28
+ CREATE TABLE IF NOT EXISTS public.profiles (
29
+ id UUID PRIMARY KEY REFERENCES auth.users(id) ON DELETE CASCADE,
30
+ display_name TEXT NOT NULL,
31
+ avatar_url TEXT,
32
+ created_at TIMESTAMPTZ DEFAULT now()
33
+ );
34
+
35
+ ALTER TABLE public.profiles ENABLE ROW LEVEL SECURITY;
36
+
37
+ -- RLS: Users can read all profiles, update only their own
38
+ CREATE POLICY "Profiles are viewable by everyone"
39
+ ON public.profiles FOR SELECT USING (true);
40
+ CREATE POLICY "Users can update own profile"
41
+ ON public.profiles FOR UPDATE USING (auth.uid() = id);
42
+ CREATE POLICY "Users can insert own profile"
43
+ ON public.profiles FOR INSERT WITH CHECK (auth.uid() = id);
44
+
45
+ -- Type generation (CI):
46
+ -- supabase gen types typescript --project-id <project-id> > src/types/supabase.ts
47
+ ```
48
+
49
+ ## Verification
50
+
51
+ ```sql
52
+ -- Confirm RLS is enabled on all tables
53
+ SELECT tablename, rowsecurity FROM pg_tables WHERE schemaname = 'public';
54
+ ```
@@ -0,0 +1,36 @@
1
+ > Parent: [SKILL.md](./SKILL.md)
2
+
3
+ # Teams Reference (REFERENCE.md)
4
+
5
+ Last Updated: 2026-03-31
6
+
7
+ ## Adaptive Cards
8
+
9
+ Use this file for canonical Adaptive Card payloads used by approval workflows.
10
+
11
+ Example Approval card (structured submit):
12
+
13
+ ```json
14
+ {
15
+ "type": "AdaptiveCard",
16
+ "body": [
17
+ { "type": "TextBlock", "text": "Approval Required", "weight": "Bolder", "size": "Medium" },
18
+ { "type": "TextBlock", "text": "Task: <ID> — <Short description>", "wrap": true }
19
+ ],
20
+ "actions": [
21
+ { "type": "Action.Submit", "title": "Approve", "data": { "action": "approve" } },
22
+ { "type": "Action.Submit", "title": "Reject", "data": { "action": "reject" } }
23
+ ],
24
+ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
25
+ "version": "1.4"
26
+ }
27
+ ```
28
+
29
+ ## Rate Limits
30
+
31
+ - Graph API suggestions: cache IDs, batch messages, and avoid per-user repeated lookups. Specific tenant limits may vary.
32
+
33
+ ## Security Notes
34
+
35
+ - Keep scopes minimal. If the integration needs approve/reject, delegated user consent is preferable to application-level broad scopes.
36
+ - Never include secrets in message bodies. Use the MCP server to mediate tokens.
@@ -7,115 +7,65 @@ description: "Microsoft Teams MCP integration for agent-to-human notifications a
7
7
 
8
8
  # Teams Notifications
9
9
 
10
- Agent communication patterns via the Microsoft Teams MCP server (Microsoft Agent 365). Enables agents to post progress updates, request human approvals, and read responses — all through Teams channels and chats.
11
-
12
10
  ## MCP Server
13
11
 
14
- | Field | Value |
15
- |-------|-------|
16
- | **URL** | `https://mcp.microsoft365.com/mcp` |
17
- | **Type** | Remote MCP server (HTTP) |
18
- | **Auth** | Microsoft Graph API — OAuth 2.0 with `McpServers.Teams.All` scope |
19
- | **Platform** | Microsoft Agent 365 (Frontier preview) |
20
- | **Status** | Preview — requires Microsoft Agent 365 Frontier preview access |
12
+ URL: `https://mcp.microsoft365.com/mcp`. Auth: OAuth 2.0 (Azure AD, scopes: `Chat.ReadWrite`, `ChannelMessage.Send`).
21
13
 
22
- ### Prerequisites
14
+ ## MCP Tools
23
15
 
24
- 1. **Microsoft Agent 365 Frontier preview** enrollment
25
- 2. **App registration** in Microsoft Entra ID (Azure AD)
26
- 3. **Graph API permissions:** `McpServers.Teams.All` (delegated or application)
27
- 4. **Admin consent** for the registered app
16
+ Covers chats, messages, channels, members, and settings.
28
17
 
29
- ## Available MCP Tools
18
+ ### Example MCP calls
30
19
 
31
- Tool names follow `teams_<resource>_<action>`. Covers: chats, messages, channels, members, and team settings. Use tool discovery to list available tools at runtime.
20
+ Post a progress update:
32
21
 
33
- ## Agent Notification Patterns
22
+ ```json
23
+ // tool: teams_messages_create
24
+ { "channel_id": "channel-xyz", "body": "🔄 TAS-42 — In progress — implementing unit tests\nFiles: 3 (PriceFilter.tsx, test, index)" }
25
+ ```
34
26
 
35
- ### Progress Updates
27
+ Read replies in thread:
36
28
 
37
- ```
38
- Channel: Agent Updates (or project-specific channel)
39
- Format:
40
- 🔄 **Task:** TAS-42 — Add price filter component
41
- **Status:** In progress — implementing unit tests
42
- **Files changed:** 3 (PriceFilter.tsx, PriceFilter.test.tsx, index.ts)
43
- **ETA:** ~5 minutes
29
+ ```json
30
+ // tool: teams_messages_list_replies
31
+ { "channel_id": "channel-xyz", "thread_id": "thread-abc", "limit": 50 }
44
32
  ```
45
33
 
46
34
  ## Human-in-the-Loop Approval
47
35
 
48
- 1. **Post approval request** to the channel:
49
- ```
50
- ⏳ **Approval Required**
51
- Task: TAS-42 — Database migration adds `price_range` column
52
- Action: Run migration on production database
53
-
54
- Reply with:
55
- ✅ Approve — to proceed
56
- ❌ Reject — to stop
57
- Or reply with questions/comments
58
- ```
59
- 2. **Poll for response** — Read replies to determine the decision.
60
- 3. **Acknowledge** — Post confirmation of the action taken.
61
-
62
- ### Parsing Conventions
63
-
64
- | Signal | Meaning |
65
- |--------|---------|
66
- | `✅` or "approve"/"yes" reply | Approved — proceed |
67
- | `❌` or "reject"/"no" reply | Rejected — stop and report |
68
- | `👀` reaction or "looking" reply | Acknowledged — user is reviewing |
69
- | Detailed reply | Instructions or questions for the agent |
70
- | `@mention` of agent | Direct command or question |
71
-
72
- ## Channel & Chat Conventions
73
-
74
- ### Threading Rules
75
-
76
- - **Always reply in threads** — use message replies, not top-level posts for follow-ups
77
- - **One thread per task** — keep all updates for a single task in one conversation thread
78
- - **Include task ID** — every message references the tracker issue ID
79
- - **Mark important messages** — use importance flags for approval requests
36
+ 1. **Post approval request** verify the response confirms message_id:
80
37
 
81
- ## Message Formatting
38
+ ```json
39
+ // tool: teams_messages_create
40
+ { "channel_id": "channel-xyz", "body": "⏳ Approval Required\nTask: TAS-42 — Run migration on production\nReply: Approve or Reject", "threading": { "start_thread": true } }
41
+ // → { "message_id": "msg-123", "thread_id": "thread-abc" }
42
+ ```
82
43
 
83
- ### Adaptive Cards
44
+ If post fails: retry once; if still failing, fall back to asking in chat only.
84
45
 
85
- For richer formatting, use Adaptive Cards (JSON-based):
46
+ 2. **Poll for response** (5s interval, 5 min timeout):
86
47
 
87
- ```json
88
- {
89
- "type": "AdaptiveCard",
90
- "body": [
91
- { "type": "TextBlock", "text": "Approval Required", "weight": "Bolder", "size": "Medium" },
92
- { "type": "TextBlock", "text": "Task: TAS-42 — Database migration", "wrap": true }
93
- ],
94
- "actions": [
95
- { "type": "Action.Submit", "title": "Approve", "data": { "action": "approve" } },
96
- { "type": "Action.Submit", "title": "Reject", "data": { "action": "reject" } }
97
- ],
98
- "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
99
- "version": "1.4"
48
+ ```js
49
+ const replies = await teams_messages_list_replies({ channel_id: channelId, thread_id: threadId, limit: 50 });
50
+ for (const r of replies || []) {
51
+ if (/\b(approve|yes)\b/i.test(r.body)) return 'approved';
52
+ if (/\b(reject|no)\b/i.test(r.body)) return 'rejected';
100
53
  }
54
+ // Retry after 5s; timeout after 5 min → post escalation message
101
55
  ```
102
56
 
103
- Use Adaptive Cards for approval workflows when available they provide structured input.
57
+ 3. **Acknowledge** Post confirmation of the action taken and close the thread.
104
58
 
105
- ## Rate Limits
106
59
 
107
- Microsoft Graph API: 50 messages/second per app per tenant; 10,000 individual API calls per 10 minutes.
108
60
 
109
- **Best practices:**
110
- - Batch updates into single messages rather than posting many small messages
111
- - Cache team/channel/user IDs — don't look them up repeatedly
61
+ ## Channel & Chat Conventions
62
+
63
+ ### Threading Rules
112
64
 
113
- ## Security Considerations
65
+ - Always reply in threads; one thread per task; include tracker issue ID in every message.
114
66
 
115
- - **OAuth tokens** are managed by the MCP server — agents never see raw tokens
116
- - **Scope minimization** — request only the Graph API permissions agents actually need
117
- - **No secrets in messages** — never post tokens, passwords, or credentials in Teams messages
67
+ ## Message Formatting
118
68
 
119
- ## Preview Limitations
69
+ ### Adaptive Cards and advanced payloads
120
70
 
121
- The Teams MCP server is in Frontier preview availability and tool surface may change without notice. Check [Microsoft Agent 365 documentation](https://learn.microsoft.com/en-us/microsoft-365-copilot/extensibility/) for the latest status.
71
+ For large Adaptive Card JSON, rate limits, and security considerations see [REFERENCE.md](REFERENCE.md). Use Adaptive Cards when structured inputs or buttons are required; otherwise post a simple threaded message.
@@ -0,0 +1,9 @@
1
+ > Parent: [SKILL.md](./SKILL.md)
2
+
3
+ Last Updated: 2026-03-31
4
+
5
+ Reference: Trello MCP tool details
6
+
7
+ - Full MCP tool parameter table and example calls (`get_boards`, `get_lists`, `create_card`, `update_card`).
8
+ - Example scripts for adding checklists and migrating cards between lists.
9
+ - Auth token troubleshooting and token rotation guidance.