opencastle 1.1.1 → 1.2.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/README.md +22 -5
- package/bin/cli.mjs +6 -0
- package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
- package/dist/cli/adapters/single-file-base.js +24 -2
- package/dist/cli/adapters/single-file-base.js.map +1 -1
- package/dist/cli/agent-plugin.d.ts +119 -0
- package/dist/cli/agent-plugin.d.ts.map +1 -0
- package/dist/cli/agent-plugin.js +449 -0
- package/dist/cli/agent-plugin.js.map +1 -0
- package/dist/cli/agent-plugin.test.d.ts +2 -0
- package/dist/cli/agent-plugin.test.d.ts.map +1 -0
- package/dist/cli/agent-plugin.test.js +227 -0
- package/dist/cli/agent-plugin.test.js.map +1 -0
- package/dist/cli/baseline.d.ts.map +1 -1
- package/dist/cli/baseline.js +99 -26
- package/dist/cli/baseline.js.map +1 -1
- package/dist/cli/convoy/gates.d.ts +2 -20
- package/dist/cli/convoy/gates.d.ts.map +1 -1
- package/dist/cli/convoy/gates.js +3 -111
- package/dist/cli/convoy/gates.js.map +1 -1
- package/dist/cli/copy.d.ts +0 -8
- package/dist/cli/copy.d.ts.map +1 -1
- package/dist/cli/copy.js +0 -21
- package/dist/cli/copy.js.map +1 -1
- package/dist/cli/dispatcher.test.js +2 -2
- package/dist/cli/dispatcher.test.js.map +1 -1
- package/dist/cli/docs-accuracy.test.js +2 -0
- package/dist/cli/docs-accuracy.test.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +2 -0
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/init.test.js +36 -24
- package/dist/cli/init.test.js.map +1 -1
- package/dist/cli/layers.d.ts +8 -0
- package/dist/cli/layers.d.ts.map +1 -1
- package/dist/cli/layers.js +130 -13
- package/dist/cli/layers.js.map +1 -1
- package/dist/cli/layers.test.js +2 -2
- package/dist/cli/layers.test.js.map +1 -1
- package/dist/cli/legacy-install.test.js +8 -1
- package/dist/cli/legacy-install.test.js.map +1 -1
- package/dist/cli/lesson-command.test.d.ts +2 -0
- package/dist/cli/lesson-command.test.d.ts.map +1 -0
- package/dist/cli/lesson-command.test.js +100 -0
- package/dist/cli/lesson-command.test.js.map +1 -0
- package/dist/cli/lesson.d.ts +0 -9
- package/dist/cli/lesson.d.ts.map +1 -1
- package/dist/cli/lesson.js +212 -276
- package/dist/cli/lesson.js.map +1 -1
- package/dist/cli/lessons.d.ts +134 -0
- package/dist/cli/lessons.d.ts.map +1 -0
- package/dist/cli/lessons.js +493 -0
- package/dist/cli/lessons.js.map +1 -0
- package/dist/cli/lessons.test.d.ts +2 -0
- package/dist/cli/lessons.test.d.ts.map +1 -0
- package/dist/cli/lessons.test.js +214 -0
- package/dist/cli/lessons.test.js.map +1 -0
- package/dist/cli/pack-plugins.d.ts +8 -0
- package/dist/cli/pack-plugins.d.ts.map +1 -0
- package/dist/cli/pack-plugins.js +70 -0
- package/dist/cli/pack-plugins.js.map +1 -0
- package/dist/cli/plugin-command.test.d.ts +2 -0
- package/dist/cli/plugin-command.test.d.ts.map +1 -0
- package/dist/cli/plugin-command.test.js +114 -0
- package/dist/cli/plugin-command.test.js.map +1 -0
- package/dist/cli/plugin.d.ts +30 -0
- package/dist/cli/plugin.d.ts.map +1 -0
- package/dist/cli/plugin.js +291 -0
- package/dist/cli/plugin.js.map +1 -0
- package/dist/cli/promote-command.test.d.ts +2 -0
- package/dist/cli/promote-command.test.d.ts.map +1 -0
- package/dist/cli/promote-command.test.js +151 -0
- package/dist/cli/promote-command.test.js.map +1 -0
- package/dist/cli/promote.d.ts +12 -0
- package/dist/cli/promote.d.ts.map +1 -0
- package/dist/cli/promote.js +364 -0
- package/dist/cli/promote.js.map +1 -0
- package/dist/cli/secret-scan.d.ts +21 -0
- package/dist/cli/secret-scan.d.ts.map +1 -0
- package/dist/cli/secret-scan.js +114 -0
- package/dist/cli/secret-scan.js.map +1 -0
- package/dist/cli/sync-check.d.ts.map +1 -1
- package/dist/cli/sync-check.js +9 -0
- package/dist/cli/sync-check.js.map +1 -1
- package/dist/cli/team-commands.test.js +2 -2
- package/dist/cli/team-commands.test.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +18 -0
- package/dist/cli/update.js.map +1 -1
- package/dist/orchestrator/plugins/agent-plugins.test.d.ts +2 -0
- package/dist/orchestrator/plugins/agent-plugins.test.d.ts.map +1 -0
- package/dist/orchestrator/plugins/agent-plugins.test.js +32 -0
- package/dist/orchestrator/plugins/agent-plugins.test.js.map +1 -0
- package/package.json +2 -1
- package/src/cli/adapters/single-file-base.ts +23 -2
- package/src/cli/agent-plugin.test.ts +267 -0
- package/src/cli/agent-plugin.ts +469 -0
- package/src/cli/baseline.ts +99 -26
- package/src/cli/convoy/gates.ts +9 -142
- package/src/cli/copy.ts +0 -25
- package/src/cli/dispatcher.test.ts +2 -2
- package/src/cli/docs-accuracy.test.ts +2 -0
- package/src/cli/doctor.ts +2 -0
- package/src/cli/fixtures/lessons-template-1.0.md +70 -0
- package/src/cli/init.test.ts +37 -24
- package/src/cli/layers.test.ts +2 -2
- package/src/cli/layers.ts +144 -14
- package/src/cli/legacy-install.test.ts +11 -1
- package/src/cli/lesson-command.test.ts +117 -0
- package/src/cli/lesson.ts +215 -266
- package/src/cli/lessons.test.ts +254 -0
- package/src/cli/lessons.ts +540 -0
- package/src/cli/pack-plugins.ts +70 -0
- package/src/cli/plugin-command.test.ts +125 -0
- package/src/cli/plugin.ts +309 -0
- package/src/cli/promote-command.test.ts +170 -0
- package/src/cli/promote.ts +371 -0
- package/src/cli/secret-scan.ts +154 -0
- package/src/cli/sync-check.ts +9 -0
- package/src/cli/team-commands.test.ts +2 -2
- package/src/cli/update.ts +20 -0
- package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
- package/src/orchestrator/agents/researcher.agent.md +1 -1
- package/src/orchestrator/customizations/LESSONS-LEARNED.md +10 -66
- package/src/orchestrator/customizations/README.md +2 -1
- package/src/orchestrator/customizations/logs/README.md +1 -1
- package/src/orchestrator/plugins/agent-plugins.test.ts +34 -0
- package/src/orchestrator/plugins/astro/mcp.json +9 -0
- package/src/orchestrator/plugins/astro/plugin.json +21 -0
- package/src/orchestrator/plugins/chrome-devtools/mcp.json +13 -0
- package/src/orchestrator/plugins/chrome-devtools/plugin.json +21 -0
- package/src/orchestrator/plugins/cloudflare/mcp.json +9 -0
- package/src/orchestrator/plugins/cloudflare/plugin.json +21 -0
- package/src/orchestrator/plugins/contentful/mcp.json +13 -0
- package/src/orchestrator/plugins/contentful/plugin.json +21 -0
- package/src/orchestrator/plugins/convex/mcp.json +15 -0
- package/src/orchestrator/plugins/convex/plugin.json +21 -0
- package/src/orchestrator/plugins/coolify/mcp.json +13 -0
- package/src/orchestrator/plugins/coolify/plugin.json +25 -0
- package/src/orchestrator/plugins/cypress/plugin.json +21 -0
- package/src/orchestrator/plugins/drizzle/plugin.json +21 -0
- package/src/orchestrator/plugins/expo/mcp.json +9 -0
- package/src/orchestrator/plugins/expo/plugin.json +21 -0
- package/src/orchestrator/plugins/figma/mcp.json +9 -0
- package/src/orchestrator/plugins/figma/plugin.json +21 -0
- package/src/orchestrator/plugins/hetzner/plugin.json +24 -0
- package/src/orchestrator/plugins/jira/mcp.json +9 -0
- package/src/orchestrator/plugins/jira/plugin.json +21 -0
- package/src/orchestrator/plugins/linear/mcp.json +9 -0
- package/src/orchestrator/plugins/linear/plugin.json +21 -0
- package/src/orchestrator/plugins/netlify/mcp.json +13 -0
- package/src/orchestrator/plugins/netlify/plugin.json +21 -0
- package/src/orchestrator/plugins/nextjs/mcp.json +13 -0
- package/src/orchestrator/plugins/nextjs/plugin.json +21 -0
- package/src/orchestrator/plugins/notion/mcp.json +9 -0
- package/src/orchestrator/plugins/notion/plugin.json +21 -0
- package/src/orchestrator/plugins/nx/mcp.json +14 -0
- package/src/orchestrator/plugins/nx/plugin.json +21 -0
- package/src/orchestrator/plugins/playwright/mcp.json +13 -0
- package/src/orchestrator/plugins/playwright/plugin.json +21 -0
- package/src/orchestrator/plugins/prisma/mcp.json +14 -0
- package/src/orchestrator/plugins/prisma/plugin.json +21 -0
- package/src/orchestrator/plugins/resend/mcp.json +13 -0
- package/src/orchestrator/plugins/resend/plugin.json +24 -0
- package/src/orchestrator/plugins/sanity/mcp.json +9 -0
- package/src/orchestrator/plugins/sanity/plugin.json +21 -0
- package/src/orchestrator/plugins/sentry/mcp.json +12 -0
- package/src/orchestrator/plugins/sentry/plugin.json +24 -0
- package/src/orchestrator/plugins/slack/mcp.json +13 -0
- package/src/orchestrator/plugins/slack/plugin.json +24 -0
- package/src/orchestrator/plugins/strapi/mcp.json +13 -0
- package/src/orchestrator/plugins/strapi/plugin.json +21 -0
- package/src/orchestrator/plugins/stripe/mcp.json +9 -0
- package/src/orchestrator/plugins/stripe/plugin.json +21 -0
- package/src/orchestrator/plugins/supabase/mcp.json +9 -0
- package/src/orchestrator/plugins/supabase/plugin.json +21 -0
- package/src/orchestrator/plugins/teams/plugin.json +24 -0
- package/src/orchestrator/plugins/trello/mcp.json +13 -0
- package/src/orchestrator/plugins/trello/plugin.json +25 -0
- package/src/orchestrator/plugins/turborepo/plugin.json +21 -0
- package/src/orchestrator/plugins/vercel/mcp.json +9 -0
- package/src/orchestrator/plugins/vercel/plugin.json +21 -0
- package/src/orchestrator/plugins/vitest/plugin.json +21 -0
- package/src/orchestrator/skill-config-links.test.ts +2 -1
- package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +1 -1
- package/src/orchestrator/skills/agent-hooks/SKILL.md +1 -1
- package/src/orchestrator/skills/decomposition/SKILL.md +1 -1
- package/src/orchestrator/skills/memory-merger/SKILL.md +17 -21
- package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +44 -23
- package/src/orchestrator/skills/self-improvement/SKILL.md +30 -15
- /package/src/orchestrator/plugins/astro/{SKILL.md → skills/astro-framework/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/chrome-devtools/{SKILL.md → skills/browser-testing/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/cloudflare/{SKILL.md → skills/cloudflare-platform/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/contentful/{SKILL.md → skills/contentful-cms/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/convex/{SKILL.md → skills/convex-database/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/coolify/{SKILL.md → skills/coolify-deployment/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/cypress/{SKILL.md → skills/cypress-testing/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/drizzle/{SKILL.md → skills/drizzle-orm/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/expo/{SKILL.md → skills/expo-development/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/figma/{SKILL.md → skills/figma-design/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/hetzner/{SKILL.md → skills/hetzner-cloud/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/jira/{SKILL.md → skills/jira-management/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/linear/{SKILL.md → skills/linear-task-management/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/netlify/{SKILL.md → skills/netlify-deployment/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/nextjs/{SKILL.md → skills/nextjs-framework/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/notion/{SKILL.md → skills/notion-knowledge-management/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/nx/{SKILL.md → skills/nx-workspace/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/playwright/{SKILL.md → skills/playwright-testing/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/prisma/{SKILL.md → skills/prisma-database/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/resend/{SKILL.md → skills/resend-email/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/sanity/{SKILL.md → skills/sanity-cms/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/sentry/{SKILL.md → skills/sentry-monitoring/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/slack/{SKILL.md → skills/slack-notifications/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/strapi/{SKILL.md → skills/strapi-cms/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/stripe/{SKILL.md → skills/stripe-payments/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/supabase/{SKILL.md → skills/supabase-database/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/teams/{SKILL.md → skills/teams-notifications/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/trello/{SKILL.md → skills/trello-task-management/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/turborepo/{SKILL.md → skills/turborepo-monorepo/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/vercel/{SKILL.md → skills/vercel-deployment/SKILL.md} +0 -0
- /package/src/orchestrator/plugins/vitest/{SKILL.md → skills/vitest-testing/SKILL.md} +0 -0
package/src/cli/baseline.ts
CHANGED
|
@@ -5,6 +5,8 @@ import { isAbsolute, join, relative, resolve } from 'node:path'
|
|
|
5
5
|
import { resolveSources, materialize, cliVersionOf, formatIssues, hasErrors } from './layers.js'
|
|
6
6
|
import { contentReport, tokensOf } from './lock.js'
|
|
7
7
|
import { CONFIG_SCHEMA_URL } from './team-config.js'
|
|
8
|
+
import { EXTENSION_NAMESPACE, claudeManifestFor, isAgentPlugin, mcpSchemaUrl, pluginNameFrom, pluginSchemaUrl, readAgentPlugin, type PluginManifest } from './agent-plugin.js'
|
|
9
|
+
import { staleClaudeFiles } from './plugin.js'
|
|
8
10
|
import { c } from './prompt.js'
|
|
9
11
|
import type { CliContext } from './types.js'
|
|
10
12
|
|
|
@@ -16,16 +18,24 @@ import type { CliContext } from './types.js'
|
|
|
16
18
|
* package manager does the fetching, the lockfile does the pinning, and an
|
|
17
19
|
* upgrade bot does the rollout — one pull request per repository, each with
|
|
18
20
|
* `opencastle review` explaining what it changes.
|
|
21
|
+
*
|
|
22
|
+
* A baseline `init` creates is also an Agent Plugin: `plugin.json`, skills in
|
|
23
|
+
* `skills/`, portable servers in `mcp.json`, and the rest of OpenCastle's layer
|
|
24
|
+
* — instructions, agents, prompts, workflows, policy — in `dev.opencastle/`.
|
|
25
|
+
* Assistants that read Agent Plugins can install it as it is; OpenCastle
|
|
26
|
+
* compiles all of it into every assistant for every repository that extends it.
|
|
19
27
|
*/
|
|
20
28
|
|
|
21
29
|
const HELP = `
|
|
22
30
|
opencastle baseline <init|check> [dir] [options]
|
|
23
31
|
|
|
24
|
-
init [dir] Scaffold a baseline package (default: ./opencastle-baseline)
|
|
25
|
-
|
|
26
|
-
a README on publishing and adopting it, and a
|
|
32
|
+
init [dir] Scaffold a baseline package (default: ./opencastle-baseline)
|
|
33
|
+
that is also an Agent Plugin: example instructions, a skill
|
|
34
|
+
and a policy, a README on publishing and adopting it, and a
|
|
35
|
+
CI check.
|
|
27
36
|
check [dir] Validate a baseline the way every repository extending it
|
|
28
|
-
will
|
|
37
|
+
will — its config, its content, its policy and its packaging —
|
|
38
|
+
and, when it is an Agent Plugin, the way assistants load it.
|
|
29
39
|
|
|
30
40
|
Options:
|
|
31
41
|
--name <pkg> Package name for init (default: @your-org/opencastle-baseline)
|
|
@@ -34,24 +44,35 @@ const HELP = `
|
|
|
34
44
|
`
|
|
35
45
|
|
|
36
46
|
function files(name: string, cliVersion: string): Record<string, string> {
|
|
47
|
+
const description = 'Our AI assistant standard: compiled by OpenCastle into every assistant in every repository that extends it, and an Agent Plugin any assistant that reads them can install.'
|
|
48
|
+
const manifest: PluginManifest = {
|
|
49
|
+
$schema: pluginSchemaUrl(),
|
|
50
|
+
name: pluginNameFrom(name),
|
|
51
|
+
version: '0.1.0',
|
|
52
|
+
description,
|
|
53
|
+
license: 'UNLICENSED',
|
|
54
|
+
}
|
|
37
55
|
return {
|
|
38
56
|
'package.json':
|
|
39
57
|
JSON.stringify(
|
|
40
58
|
{
|
|
41
59
|
name,
|
|
42
60
|
version: '0.1.0',
|
|
43
|
-
description
|
|
61
|
+
description,
|
|
44
62
|
license: 'UNLICENSED',
|
|
45
|
-
files: ['
|
|
46
|
-
opencastle: { baseline: '
|
|
47
|
-
scripts: { check: 'opencastle baseline check' },
|
|
63
|
+
files: ['plugin.json', 'mcp.json', 'skills/', `${EXTENSION_NAMESPACE}/`, '.claude-plugin/', '.mcp.json'],
|
|
64
|
+
opencastle: { baseline: '.' },
|
|
65
|
+
scripts: { check: 'opencastle baseline check', build: 'opencastle plugin build' },
|
|
48
66
|
devDependencies: { opencastle: `^${cliVersion}` },
|
|
49
67
|
publishConfig: { access: 'restricted' },
|
|
50
68
|
},
|
|
51
69
|
null,
|
|
52
70
|
2,
|
|
53
71
|
) + '\n',
|
|
54
|
-
'
|
|
72
|
+
'plugin.json': JSON.stringify(manifest, null, 2) + '\n',
|
|
73
|
+
'mcp.json': JSON.stringify({ $schema: mcpSchemaUrl(), mcpServers: {} }, null, 2) + '\n',
|
|
74
|
+
'.claude-plugin/plugin.json': JSON.stringify(claudeManifestFor(manifest), null, 2) + '\n',
|
|
75
|
+
[`${EXTENSION_NAMESPACE}/config.json`]: `{
|
|
55
76
|
"$schema": "${CONFIG_SCHEMA_URL}",
|
|
56
77
|
// Every repository that extends this baseline is held to this policy.
|
|
57
78
|
// A repository can tighten it in its own .opencastle/config.json, never relax it.
|
|
@@ -70,12 +91,14 @@ function files(name: string, cliVersion: string): Record<string, string> {
|
|
|
70
91
|
// Tokens every assistant may load before it reads the task.
|
|
71
92
|
"contextBudget": 8000
|
|
72
93
|
},
|
|
73
|
-
// Servers
|
|
74
|
-
// spells
|
|
94
|
+
// Servers that need a variable — a token, a tenant — go here: write it as
|
|
95
|
+
// \${NAME} and OpenCastle spells it the way each assistant expects. A server
|
|
96
|
+
// every assistant can start as it is goes in ../mcp.json, where assistants
|
|
97
|
+
// that install this as an Agent Plugin find it too.
|
|
75
98
|
"mcpServers": {}
|
|
76
99
|
}
|
|
77
100
|
`,
|
|
78
|
-
|
|
101
|
+
[`${EXTENSION_NAMESPACE}/instructions/engineering-standards.md`]: `# Engineering standards
|
|
79
102
|
|
|
80
103
|
These apply to every repository in the organisation, and every assistant reads
|
|
81
104
|
them before every task. Keep this file short: detail belongs in a skill, which
|
|
@@ -85,7 +108,7 @@ loads only when a task needs it.
|
|
|
85
108
|
- Never write credentials into files; read them from the environment.
|
|
86
109
|
- Keep changes small and focused; one pull request, one purpose.
|
|
87
110
|
`,
|
|
88
|
-
'
|
|
111
|
+
'skills/code-review/SKILL.md': `---
|
|
89
112
|
name: code-review
|
|
90
113
|
description: "How we review code: what to check, what to block on, and how to word feedback. Use when reviewing a pull request or preparing one for review."
|
|
91
114
|
---
|
|
@@ -100,18 +123,27 @@ Word feedback as a question or a suggestion with the reason attached.
|
|
|
100
123
|
`,
|
|
101
124
|
'README.md': `# ${name}
|
|
102
125
|
|
|
103
|
-
Our AI assistant standard
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
126
|
+
Our AI assistant standard. It is two things at once:
|
|
127
|
+
|
|
128
|
+
- an [OpenCastle](https://www.opencastle.dev) baseline — every repository that
|
|
129
|
+
extends it gets the same instructions, skills and MCP servers in every
|
|
130
|
+
assistant its developers use (Claude Code, Cursor, Copilot, OpenCode,
|
|
131
|
+
Windsurf, Codex CLI, Antigravity) and is held to the same policy;
|
|
132
|
+
- an [Agent Plugin](https://agent-plugins.org) — GitHub Copilot, VS Code,
|
|
133
|
+
Cursor, Codex and Kiro can install its skills and MCP servers as they are,
|
|
134
|
+
and Claude Code through \`.claude-plugin/\`.
|
|
107
135
|
|
|
108
136
|
## What is in it
|
|
109
137
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
138
|
+
| Path | What it is | Read by |
|
|
139
|
+
| --- | --- | --- |
|
|
140
|
+
| \`plugin.json\` | The Agent Plugins manifest | Every assistant that reads Agent Plugins |
|
|
141
|
+
| \`skills/<name>/SKILL.md\` | Agent Skills, loaded when a task matches | Every assistant |
|
|
142
|
+
| \`mcp.json\` | MCP servers every assistant can start as they are | Every assistant |
|
|
143
|
+
| \`${EXTENSION_NAMESPACE}/instructions/\` | Loaded by every assistant before every task | OpenCastle |
|
|
144
|
+
| \`${EXTENSION_NAMESPACE}/agents/\`, \`prompts/\`, \`workflows/\` | Optional | OpenCastle |
|
|
145
|
+
| \`${EXTENSION_NAMESPACE}/config.json\` | Servers that need variables, and the policy | OpenCastle |
|
|
146
|
+
| \`.claude-plugin/plugin.json\`, \`.mcp.json\` | Claude Code's copies — \`npm run build\` writes them | Claude Code |
|
|
115
147
|
|
|
116
148
|
## Adopting it in a repository
|
|
117
149
|
|
|
@@ -133,9 +165,10 @@ The version comes from package.json and the lockfile, like any dependency.
|
|
|
133
165
|
|
|
134
166
|
## Changing it
|
|
135
167
|
|
|
136
|
-
1. Edit
|
|
137
|
-
|
|
138
|
-
|
|
168
|
+
1. Edit it, then run \`npm run build\` (Claude Code's copies) and
|
|
169
|
+
\`npm run check\` — it validates the baseline the way every repository
|
|
170
|
+
extending it will, and the plugin the way assistants load it.
|
|
171
|
+
2. Bump the version in package.json and plugin.json, and publish.
|
|
139
172
|
3. Let your upgrade bot (Renovate, Dependabot) open the pull requests. In each,
|
|
140
173
|
CI runs \`opencastle sync --check\` and adds \`opencastle review\`'s summary of
|
|
141
174
|
what the new version changes for that repository's assistants.
|
|
@@ -170,7 +203,8 @@ async function init(pkgRoot: string, dir: string, name: string): Promise<void> {
|
|
|
170
203
|
await writeFile(abs, text)
|
|
171
204
|
}
|
|
172
205
|
console.log(`\n ${c.green('✓')} Created the baseline ${c.bold(name)} in ${dir}/`)
|
|
173
|
-
console.log(` ${c.dim('
|
|
206
|
+
console.log(` ${c.dim('It is an Agent Plugin too: skills/ and mcp.json are portable; the rest of the layer is in')} ${EXTENSION_NAMESPACE}/`)
|
|
207
|
+
console.log(` ${c.dim('Next: edit it, run')} ${c.cyan(`npx opencastle baseline check ${dir}`)}${c.dim(', then publish it.')}`)
|
|
174
208
|
console.log(` ${c.dim('Repositories adopt it with')} ${c.cyan(`npm i -D ${name}`)} ${c.dim('and')} ${c.cyan(`"extends": ["${name}"]`)}\n`)
|
|
175
209
|
}
|
|
176
210
|
|
|
@@ -190,6 +224,7 @@ function check(pkgRoot: string, dir: string): CheckReport {
|
|
|
190
224
|
let layerRoot = root
|
|
191
225
|
let name = dir
|
|
192
226
|
let version: string | undefined
|
|
227
|
+
let published: string[] | undefined
|
|
193
228
|
const pkgFile = join(root, 'package.json')
|
|
194
229
|
if (existsSync(pkgFile)) {
|
|
195
230
|
let pkg: { name?: string; version?: string; files?: string[]; opencastle?: { baseline?: string } } = {}
|
|
@@ -200,6 +235,7 @@ function check(pkgRoot: string, dir: string): CheckReport {
|
|
|
200
235
|
}
|
|
201
236
|
name = pkg.name ?? name
|
|
202
237
|
version = pkg.version
|
|
238
|
+
published = pkg.files
|
|
203
239
|
if (typeof pkg.opencastle?.baseline !== 'string') {
|
|
204
240
|
errors.push('package.json: has no "opencastle": { "baseline": "<dir>" }, so no repository can extend it')
|
|
205
241
|
} else {
|
|
@@ -220,6 +256,43 @@ function check(pkgRoot: string, dir: string): CheckReport {
|
|
|
220
256
|
}
|
|
221
257
|
if (!existsSync(layerRoot)) errors.push(`${relative(process.cwd(), layerRoot) || '.'}: the layer directory does not exist`)
|
|
222
258
|
|
|
259
|
+
// The plugin side: what an assistant that installs it as an Agent Plugin sees.
|
|
260
|
+
if (errors.length === 0 && isAgentPlugin(layerRoot)) {
|
|
261
|
+
const report = readAgentPlugin(layerRoot)
|
|
262
|
+
errors.push(...report.errors)
|
|
263
|
+
warnings.push(...report.warnings)
|
|
264
|
+
if (report.manifest) {
|
|
265
|
+
for (const f of staleClaudeFiles(layerRoot, report)) {
|
|
266
|
+
errors.push(`${f}: does not match plugin.json and mcp.json — run opencastle plugin build`)
|
|
267
|
+
}
|
|
268
|
+
if (!existsSync(join(layerRoot, '.claude-plugin', 'plugin.json'))) {
|
|
269
|
+
warnings.push('.claude-plugin/plugin.json: missing — Claude Code reads only its own manifest; run opencastle plugin build')
|
|
270
|
+
}
|
|
271
|
+
if (version && report.manifest.version && version !== report.manifest.version) {
|
|
272
|
+
warnings.push(`plugin.json: version ${report.manifest.version}, while package.json says ${version} — assistants offer updates by plugin.json's`)
|
|
273
|
+
}
|
|
274
|
+
// `files` decides what npm publishes; a plugin missing its manifest or
|
|
275
|
+
// its skills installs as nothing.
|
|
276
|
+
if (published) {
|
|
277
|
+
const at = relative(root, layerRoot).split('\\').join('/')
|
|
278
|
+
for (const part of ['plugin.json', 'skills', 'mcp.json', EXTENSION_NAMESPACE, '.claude-plugin', '.mcp.json']) {
|
|
279
|
+
if (!existsSync(join(layerRoot, part))) continue
|
|
280
|
+
const path = at ? `${at}/${part}` : part
|
|
281
|
+
const shipped = published.some((f) => {
|
|
282
|
+
const entry = f.replace(/\/$/, '')
|
|
283
|
+
return entry === path || path.startsWith(`${entry}/`)
|
|
284
|
+
})
|
|
285
|
+
if (!shipped) errors.push(`package.json: "files" does not include ${path}, so npm publish would leave it out`)
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
} else if (errors.length === 0) {
|
|
290
|
+
warnings.push(
|
|
291
|
+
'is not an Agent Plugin, so only OpenCastle can use it — assistants that read Agent Plugins cannot install it. ' +
|
|
292
|
+
'`opencastle baseline init` shows the layout: skills/ and mcp.json at the root, the rest in dev.opencastle/',
|
|
293
|
+
)
|
|
294
|
+
}
|
|
295
|
+
|
|
223
296
|
const contributes = { skills: 0, agents: 0, instructions: 0, prompts: 0, workflows: 0, mcpServers: 0 }
|
|
224
297
|
let contextTokens = 0
|
|
225
298
|
if (errors.length === 0) {
|
package/src/cli/convoy/gates.ts
CHANGED
|
@@ -3,150 +3,17 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
|
|
|
3
3
|
import { readFile } from 'node:fs/promises'
|
|
4
4
|
import { join } from 'node:path'
|
|
5
5
|
import { inflateSync } from 'node:zlib'
|
|
6
|
-
import { parse as yamlParse } from 'yaml'
|
|
7
6
|
import { filePathFields } from './contracts.js'
|
|
8
7
|
import type { BrowserTestConfig, MCPServerConfig } from './types.js'
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{ name: 'AWS Access Key', pattern: /AKIA[0-9A-Z]{16}/i },
|
|
19
|
-
{
|
|
20
|
-
name: 'AWS Secret Key',
|
|
21
|
-
// eslint-disable-next-line no-useless-escape
|
|
22
|
-
pattern: /(?:aws_secret_access_key|secret_key)\s*[=:]\s*[A-Za-z0-9\/+=]{40}/i,
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: 'Generic API Key',
|
|
26
|
-
pattern: /(?:api[_-]?key|apikey)\s*[=:]\s*['"]?[A-Za-z0-9_-]{20,}/i,
|
|
27
|
-
},
|
|
28
|
-
{ name: 'Bearer Token', pattern: /[Bb]earer\s+[A-Za-z0-9\-._~+/]+=*/ },
|
|
29
|
-
{ name: 'Private Key', pattern: /-----BEGIN (?:RSA|EC|OPENSSH) PRIVATE KEY-----/ },
|
|
30
|
-
{
|
|
31
|
-
name: 'Connection String',
|
|
32
|
-
// eslint-disable-next-line no-useless-escape
|
|
33
|
-
pattern: /(?:postgres|mysql|mongodb|redis):\/\/[^\s]+:[^\s]+@/,
|
|
34
|
-
},
|
|
35
|
-
{ name: 'GitHub Token', pattern: /(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9_]{36,}/ },
|
|
36
|
-
{
|
|
37
|
-
name: 'Generic Password',
|
|
38
|
-
pattern: /(?:password|passwd|pwd)\s*[=:]\s*['"]?[^\s'"]{8,}/i,
|
|
39
|
-
},
|
|
40
|
-
{ name: 'Slack Token', pattern: /xox[bprs]-[A-Za-z0-9-]{10,}/i },
|
|
41
|
-
{
|
|
42
|
-
name: 'Generic Secret',
|
|
43
|
-
pattern: /(?:secret|token|credential)\s*[=:]\s*['"]?[A-Za-z0-9_-]{16,}/i,
|
|
44
|
-
},
|
|
45
|
-
]
|
|
46
|
-
|
|
47
|
-
// ── Public types ──────────────────────────────────────────────────────────────
|
|
48
|
-
|
|
49
|
-
export interface SecretScanResult {
|
|
50
|
-
clean: boolean
|
|
51
|
-
findings: Array<{ pattern: string; file: string; line: number; snippet: string }>
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// ── Allowlist ─────────────────────────────────────────────────────────────────
|
|
55
|
-
|
|
56
|
-
interface AllowlistEntry {
|
|
57
|
-
pattern?: string
|
|
58
|
-
literal?: string
|
|
59
|
-
reason: string
|
|
60
|
-
paths?: string[]
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
let _allowlist: AllowlistEntry[] | null = null
|
|
64
|
-
|
|
65
|
-
/** The config path used for the allowlist. Override for testing. */
|
|
66
|
-
export let _allowlistConfigPath = join(process.cwd(), '.opencastle', 'secret-scan-config.yml')
|
|
67
|
-
|
|
68
|
-
/** Reset the allowlist cache (for testing). */
|
|
69
|
-
export function _resetAllowlistCache(): void {
|
|
70
|
-
_allowlist = null
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/** Override the allowlist config path and reset cache (for testing). */
|
|
74
|
-
export function _setAllowlistConfigPath(path: string): void {
|
|
75
|
-
_allowlistConfigPath = path
|
|
76
|
-
_allowlist = null
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function loadAllowlist(): AllowlistEntry[] {
|
|
80
|
-
if (_allowlist !== null) return _allowlist
|
|
81
|
-
try {
|
|
82
|
-
if (!existsSync(_allowlistConfigPath)) {
|
|
83
|
-
_allowlist = []
|
|
84
|
-
return _allowlist
|
|
85
|
-
}
|
|
86
|
-
const content = readFileSync(_allowlistConfigPath, 'utf-8')
|
|
87
|
-
const parsed = yamlParse(content) as Record<string, unknown> | null
|
|
88
|
-
if (!parsed || !Array.isArray(parsed['allowlist'])) {
|
|
89
|
-
_allowlist = []
|
|
90
|
-
return _allowlist
|
|
91
|
-
}
|
|
92
|
-
_allowlist = parsed['allowlist'] as AllowlistEntry[]
|
|
93
|
-
return _allowlist
|
|
94
|
-
} catch {
|
|
95
|
-
_allowlist = []
|
|
96
|
-
return _allowlist
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function isSuppressed(
|
|
101
|
-
finding: { snippet: string },
|
|
102
|
-
filePath: string,
|
|
103
|
-
allowlist: AllowlistEntry[],
|
|
104
|
-
): boolean {
|
|
105
|
-
for (const entry of allowlist) {
|
|
106
|
-
if (entry.paths && entry.paths.length > 0) {
|
|
107
|
-
if (!entry.paths.some((p) => filePath.includes(p))) continue
|
|
108
|
-
}
|
|
109
|
-
if (entry.literal) {
|
|
110
|
-
if (finding.snippet.includes(entry.literal)) return true
|
|
111
|
-
} else if (entry.pattern) {
|
|
112
|
-
try {
|
|
113
|
-
if (new RegExp(entry.pattern, 'i').test(finding.snippet)) return true
|
|
114
|
-
} catch {
|
|
115
|
-
// Invalid regex in allowlist — skip entry
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return false
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// ── scanForSecrets ────────────────────────────────────────────────────────────
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Scan text content line-by-line for secrets using the default pattern set.
|
|
126
|
-
* Allowlist entries in `.opencastle/secret-scan-config.yml` suppress false positives.
|
|
127
|
-
*/
|
|
128
|
-
export function scanForSecrets(content: string, filePath = ''): SecretScanResult {
|
|
129
|
-
const allowlist = loadAllowlist()
|
|
130
|
-
const lines = content.split('\n')
|
|
131
|
-
const findings: SecretScanResult['findings'] = []
|
|
132
|
-
|
|
133
|
-
for (let i = 0; i < lines.length; i++) {
|
|
134
|
-
const line = lines[i]
|
|
135
|
-
for (const { name, pattern } of SECRET_PATTERNS) {
|
|
136
|
-
if (pattern.test(line)) {
|
|
137
|
-
const snippet = line.length > 100 ? line.slice(0, 97) + '...' : line
|
|
138
|
-
const finding = { pattern: name, file: filePath, line: i + 1, snippet }
|
|
139
|
-
if (!isSuppressed(finding, filePath, allowlist)) {
|
|
140
|
-
findings.push(finding)
|
|
141
|
-
}
|
|
142
|
-
// Only report the first matching pattern per line
|
|
143
|
-
break
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return { clean: findings.length === 0, findings }
|
|
149
|
-
}
|
|
8
|
+
// Secret scanning is shared with the compiler's commands, so it lives outside the engine.
|
|
9
|
+
import { scanForSecrets, type SecretScanResult } from '../secret-scan.js'
|
|
10
|
+
export {
|
|
11
|
+
scanForSecrets,
|
|
12
|
+
_resetAllowlistCache,
|
|
13
|
+
_setAllowlistConfigPath,
|
|
14
|
+
_allowlistConfigPath,
|
|
15
|
+
type SecretScanResult,
|
|
16
|
+
} from '../secret-scan.js'
|
|
150
17
|
|
|
151
18
|
// ── withSecretScan ────────────────────────────────────────────────────────────
|
|
152
19
|
|
package/src/cli/copy.ts
CHANGED
|
@@ -172,28 +172,3 @@ export async function removeDirIfExists(dirPath: string): Promise<void> {
|
|
|
172
172
|
export function getPluginsRoot(pkgRoot: string): string {
|
|
173
173
|
return resolve(pkgRoot, 'src', 'orchestrator', 'plugins');
|
|
174
174
|
}
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Scan plugin directories for SKILL.md files.
|
|
178
|
-
* Returns entries with plugin ID and skill file path.
|
|
179
|
-
*/
|
|
180
|
-
export async function getPluginSkillEntries(
|
|
181
|
-
pluginsRoot: string,
|
|
182
|
-
includedPluginIds?: Set<string>
|
|
183
|
-
): Promise<Array<{ id: string; skillPath: string }>> {
|
|
184
|
-
if (!existsSync(pluginsRoot)) return [];
|
|
185
|
-
|
|
186
|
-
const entries = await readdir(pluginsRoot, { withFileTypes: true });
|
|
187
|
-
const results: Array<{ id: string; skillPath: string }> = [];
|
|
188
|
-
|
|
189
|
-
for (const entry of entries) {
|
|
190
|
-
if (!entry.isDirectory()) continue;
|
|
191
|
-
if (includedPluginIds && !includedPluginIds.has(entry.name)) continue;
|
|
192
|
-
const skillPath = resolve(pluginsRoot, entry.name, 'SKILL.md');
|
|
193
|
-
if (existsSync(skillPath)) {
|
|
194
|
-
results.push({ id: entry.name, skillPath });
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
return results;
|
|
199
|
-
}
|
|
@@ -39,9 +39,9 @@ const HIDDEN = extractKeys('HIDDEN')
|
|
|
39
39
|
const REPLACED = extractKeys('REPLACED')
|
|
40
40
|
|
|
41
41
|
describe('visible command surface', () => {
|
|
42
|
-
it('exposes the six product commands, the
|
|
42
|
+
it('exposes the six product commands, the seven team commands, and the convoy namespace', () => {
|
|
43
43
|
expect(new Set(VISIBLE)).toEqual(
|
|
44
|
-
new Set(['init', 'sync', 'add', 'doctor', 'remove', 'explain', 'review', 'ci', 'baseline', 'fleet', 'convoy']),
|
|
44
|
+
new Set(['init', 'sync', 'add', 'doctor', 'remove', 'explain', 'review', 'ci', 'baseline', 'plugin', 'promote', 'fleet', 'convoy']),
|
|
45
45
|
)
|
|
46
46
|
})
|
|
47
47
|
|
|
@@ -560,6 +560,8 @@ describe('declared flags are flags the parser reads', () => {
|
|
|
560
560
|
explain: ['explain.ts'],
|
|
561
561
|
ci: ['ci.ts'],
|
|
562
562
|
baseline: ['baseline.ts'],
|
|
563
|
+
plugin: ['plugin.ts'],
|
|
564
|
+
promote: ['promote.ts'],
|
|
563
565
|
fleet: ['fleet.ts'],
|
|
564
566
|
}
|
|
565
567
|
// Read by the entrypoint for every command, not by the modules.
|
package/src/cli/doctor.ts
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
import { UnreadableConfigError } from './types.js';
|
|
18
18
|
import { checkMcpSupplyChain } from './mcp-audit.js';
|
|
19
19
|
import { parseMcpConfigText } from './mcp-file.js';
|
|
20
|
+
import { checkLessons } from './lessons.js';
|
|
20
21
|
import {
|
|
21
22
|
teamStateFor,
|
|
22
23
|
teamAuditContext,
|
|
@@ -950,6 +951,7 @@ export async function runSharedChecks(
|
|
|
950
951
|
await checkGitignoreBlock(projectRoot),
|
|
951
952
|
await checkTornBlocks(projectRoot, manifest),
|
|
952
953
|
checkRootFileClassification(manifest),
|
|
954
|
+
checkLessons(projectRoot),
|
|
953
955
|
...team,
|
|
954
956
|
];
|
|
955
957
|
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
````markdown
|
|
2
|
+
# Lessons Learned
|
|
3
|
+
|
|
4
|
+
Structured log of tool/command pitfalls, workarounds, and correct approaches discovered through agent execution. **Every agent** must read this file before starting work and must add entries when they discover a new pitfall through trial-and-error.
|
|
5
|
+
|
|
6
|
+
> **This file is the collective memory of the agent team.** It prevents repeating the same mistakes across sessions.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## How to Use This File
|
|
11
|
+
|
|
12
|
+
### Before starting work
|
|
13
|
+
|
|
14
|
+
1. Read the **entire file** (or at minimum, the sections relevant to your task)
|
|
15
|
+
2. Apply any relevant lessons to your approach **before** attempting commands or tool calls
|
|
16
|
+
|
|
17
|
+
### When to add a new entry
|
|
18
|
+
|
|
19
|
+
Add a lesson when **any** of these occur:
|
|
20
|
+
- A command, tool call, or API call fails and you had to retry with a different approach
|
|
21
|
+
- You discover a parameter, syntax, or configuration quirk not documented elsewhere
|
|
22
|
+
- A workaround is needed for a third-party tool, MCP server, or platform limitation
|
|
23
|
+
- An approach that seems obvious turns out to be wrong
|
|
24
|
+
|
|
25
|
+
### Entry format
|
|
26
|
+
|
|
27
|
+
```markdown
|
|
28
|
+
### LES-XXX: Short descriptive title
|
|
29
|
+
|
|
30
|
+
| Field | Value |
|
|
31
|
+
|-------|-------|
|
|
32
|
+
| **Category** | `task-management` / `mcp-tools` / `codebase-tool` / `terminal` / `framework` / `cms` / `database` / `git` / `deployment` / `browser-testing` / `general` |
|
|
33
|
+
| **Added** | YYYY-MM-DD |
|
|
34
|
+
| **Severity** | `high` (blocks work) / `medium` (wastes 5+ min) / `low` (minor annoyance) |
|
|
35
|
+
|
|
36
|
+
**Problem:** What went wrong and what error or unexpected behavior was observed.
|
|
37
|
+
|
|
38
|
+
**Wrong approach:** The obvious/intuitive approach that fails.
|
|
39
|
+
|
|
40
|
+
**Correct approach:** The working solution.
|
|
41
|
+
|
|
42
|
+
**Why:** Root cause explanation (if known).
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Lessons
|
|
48
|
+
|
|
49
|
+
<!-- Lessons are appended here by agents during sessions.
|
|
50
|
+
Start numbering from LES-001. -->
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Index by Category
|
|
55
|
+
|
|
56
|
+
| Category | Lessons |
|
|
57
|
+
|----------|---------|
|
|
58
|
+
| `task-management` | — |
|
|
59
|
+
| `mcp-tools` | — |
|
|
60
|
+
| `codebase-tool` | — |
|
|
61
|
+
| `terminal` | — |
|
|
62
|
+
| `framework` | — |
|
|
63
|
+
| `cms` | — |
|
|
64
|
+
| `database` | — |
|
|
65
|
+
| `git` | — |
|
|
66
|
+
| `deployment` | — |
|
|
67
|
+
| `browser-testing` | — |
|
|
68
|
+
| `general` | — |
|
|
69
|
+
|
|
70
|
+
````
|
package/src/cli/init.test.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { describe, it, expect, beforeEach, afterEach } from 'vitest'
|
|
18
|
-
import { mkdtemp, readFile, readdir, rm, unlink, writeFile } from 'node:fs/promises'
|
|
18
|
+
import { mkdtemp, readFile, readdir, rename, rm, unlink, writeFile } from 'node:fs/promises'
|
|
19
19
|
import { join, resolve } from 'node:path'
|
|
20
20
|
import { tmpdir } from 'node:os'
|
|
21
21
|
import { existsSync } from 'node:fs'
|
|
@@ -449,12 +449,12 @@ describe('VS Code adapter install', () => {
|
|
|
449
449
|
const skills = await readdir(skillsDir)
|
|
450
450
|
|
|
451
451
|
// Selected plugin skills should be present
|
|
452
|
-
expect(skills).toContain('sanity')
|
|
453
|
-
expect(skills).toContain('linear')
|
|
452
|
+
expect(skills).toContain('sanity-cms')
|
|
453
|
+
expect(skills).toContain('linear-task-management')
|
|
454
454
|
// Unselected plugin skills should NOT be present
|
|
455
|
-
expect(skills).not.toContain('supabase')
|
|
456
|
-
expect(skills).not.toContain('slack')
|
|
457
|
-
expect(skills).not.toContain('vercel')
|
|
455
|
+
expect(skills).not.toContain('supabase-database')
|
|
456
|
+
expect(skills).not.toContain('slack-notifications')
|
|
457
|
+
expect(skills).not.toContain('vercel-deployment')
|
|
458
458
|
|
|
459
459
|
// Core skills (non-plugin) should always be present
|
|
460
460
|
expect(skills).toContain('accessibility-standards')
|
|
@@ -470,9 +470,9 @@ describe('VS Code adapter install', () => {
|
|
|
470
470
|
// Plugin-linked skill directories should be absent if tool not selected
|
|
471
471
|
// (The core skills directory names don't match plugin IDs — they're separate)
|
|
472
472
|
// But plugin SKILL.md dirs should not exist
|
|
473
|
-
expect(skills).not.toContain('sanity')
|
|
474
|
-
expect(skills).not.toContain('linear')
|
|
475
|
-
expect(skills).not.toContain('supabase')
|
|
473
|
+
expect(skills).not.toContain('sanity-cms')
|
|
474
|
+
expect(skills).not.toContain('linear-task-management')
|
|
475
|
+
expect(skills).not.toContain('supabase-database')
|
|
476
476
|
})
|
|
477
477
|
|
|
478
478
|
it('injects plugin tools into agent frontmatter', async () => {
|
|
@@ -672,12 +672,12 @@ describe('Cursor adapter install', () => {
|
|
|
672
672
|
expect(skills).toContain('testing-workflow.mdc')
|
|
673
673
|
|
|
674
674
|
// Selected plugin skills as .mdc
|
|
675
|
-
expect(skills).toContain('sanity.mdc')
|
|
676
|
-
expect(skills).toContain('linear.mdc')
|
|
675
|
+
expect(skills).toContain('sanity-cms.mdc')
|
|
676
|
+
expect(skills).toContain('linear-task-management.mdc')
|
|
677
677
|
|
|
678
678
|
// Unselected plugin skills should not be present
|
|
679
|
-
expect(skills).not.toContain('supabase.mdc')
|
|
680
|
-
expect(skills).not.toContain('slack.mdc')
|
|
679
|
+
expect(skills).not.toContain('supabase-database.mdc')
|
|
680
|
+
expect(skills).not.toContain('slack-notifications.mdc')
|
|
681
681
|
})
|
|
682
682
|
|
|
683
683
|
it('generates Cursor MCP config with mcpServers format', async () => {
|
|
@@ -735,6 +735,19 @@ describe('Claude Code adapter install', () => {
|
|
|
735
735
|
await rm(tempDir, { recursive: true, force: true })
|
|
736
736
|
})
|
|
737
737
|
|
|
738
|
+
it('moves an integration skill from its old directory and leaves no empty folder behind', async () => {
|
|
739
|
+
const adapter = await IDE_ADAPTERS['claude-code']()
|
|
740
|
+
await adapter.install(PKG_ROOT, tempDir, STACK_SANITY_LINEAR, EMPTY_REPO_INFO)
|
|
741
|
+
// As releases before integration skills took their own names left it.
|
|
742
|
+
const skills = join(tempDir, '.claude', 'skills')
|
|
743
|
+
await rename(join(skills, 'sanity-cms'), join(skills, 'sanity'))
|
|
744
|
+
const result = await adapter.update(PKG_ROOT, tempDir, STACK_SANITY_LINEAR, EMPTY_REPO_INFO)
|
|
745
|
+
const entries = await readdir(skills)
|
|
746
|
+
expect(entries).toContain('sanity-cms')
|
|
747
|
+
expect(entries).not.toContain('sanity')
|
|
748
|
+
expect(result.deleted).toContain('.claude/skills/sanity/SKILL.md')
|
|
749
|
+
})
|
|
750
|
+
|
|
738
751
|
it('creates CLAUDE.md with embedded instructions', async () => {
|
|
739
752
|
const adapter = await IDE_ADAPTERS['claude-code']()
|
|
740
753
|
await adapter.install(PKG_ROOT, tempDir, STACK_EMPTY, EMPTY_REPO_INFO)
|
|
@@ -778,10 +791,10 @@ describe('Claude Code adapter install', () => {
|
|
|
778
791
|
const content = await readFile(join(tempDir, 'CLAUDE.md'), 'utf8')
|
|
779
792
|
expect(content).toContain('## Available Skills')
|
|
780
793
|
expect(content).toContain('**self-improvement**')
|
|
781
|
-
expect(content).toContain('**sanity**')
|
|
782
|
-
expect(content).toContain('**linear**')
|
|
794
|
+
expect(content).toContain('**sanity-cms**')
|
|
795
|
+
expect(content).toContain('**linear-task-management**')
|
|
783
796
|
// Unselected plugin skills should NOT appear in skill index
|
|
784
|
-
expect(content).not.
|
|
797
|
+
expect(content).not.toContain('**supabase-database**')
|
|
785
798
|
})
|
|
786
799
|
|
|
787
800
|
it('strips frontmatter from agent files in .claude/agents/', async () => {
|
|
@@ -810,9 +823,9 @@ describe('Claude Code adapter install', () => {
|
|
|
810
823
|
|
|
811
824
|
// Skills are subdirectories (Anthropic's Claude Code Skills format)
|
|
812
825
|
expect(entries).toContain('self-improvement')
|
|
813
|
-
expect(entries).toContain('sanity')
|
|
814
|
-
expect(entries).toContain('linear')
|
|
815
|
-
expect(entries).not.toContain('supabase')
|
|
826
|
+
expect(entries).toContain('sanity-cms')
|
|
827
|
+
expect(entries).toContain('linear-task-management')
|
|
828
|
+
expect(entries).not.toContain('supabase-database')
|
|
816
829
|
|
|
817
830
|
// SKILL.md exists inside each skill subdirectory
|
|
818
831
|
const skillContent = await readFile(
|
|
@@ -1332,11 +1345,11 @@ describe('full stack configuration', () => {
|
|
|
1332
1345
|
|
|
1333
1346
|
// All 5 plugin skills should be installed
|
|
1334
1347
|
const skills = await readdir(join(tempDir, '.github', 'skills'))
|
|
1335
|
-
expect(skills).toContain('sanity')
|
|
1336
|
-
expect(skills).toContain('supabase')
|
|
1337
|
-
expect(skills).toContain('vercel')
|
|
1338
|
-
expect(skills).toContain('linear')
|
|
1339
|
-
expect(skills).toContain('slack')
|
|
1348
|
+
expect(skills).toContain('sanity-cms')
|
|
1349
|
+
expect(skills).toContain('supabase-database')
|
|
1350
|
+
expect(skills).toContain('vercel-deployment')
|
|
1351
|
+
expect(skills).toContain('linear-task-management')
|
|
1352
|
+
expect(skills).toContain('slack-notifications')
|
|
1340
1353
|
|
|
1341
1354
|
// MCP config should have all 5 servers
|
|
1342
1355
|
const mcpConfig = await readJson<Record<string, unknown>>(
|
package/src/cli/layers.test.ts
CHANGED
|
@@ -192,7 +192,7 @@ describe('resolving layers', () => {
|
|
|
192
192
|
expect(messages).toContain('"@acme/missing", which is not installed')
|
|
193
193
|
expect(messages).toContain('version belongs in package.json')
|
|
194
194
|
expect(messages).toContain('an absolute path')
|
|
195
|
-
expect(messages).toContain('"plain", which is
|
|
195
|
+
expect(messages).toContain('"plain", which is neither an OpenCastle baseline nor an Agent Plugin')
|
|
196
196
|
expect(hasErrors(r)).toBe(true)
|
|
197
197
|
})
|
|
198
198
|
|
|
@@ -340,7 +340,7 @@ describe('the merged source and the lock', () => {
|
|
|
340
340
|
const stack: StackConfig = { ides: ['claude-code'], techTools: ['sentry'], teamTools: [] }
|
|
341
341
|
const src = materialize(resolveSources({ pkgRoot, projectRoot: project, stack }), pkgRoot)
|
|
342
342
|
try {
|
|
343
|
-
expect(readdirSync(join(src.root, 'skills', 'sentry'))).toEqual(['SKILL.md'])
|
|
343
|
+
expect(readdirSync(join(src.root, 'skills', 'sentry-monitoring'))).toEqual(['SKILL.md'])
|
|
344
344
|
} finally {
|
|
345
345
|
src.dispose()
|
|
346
346
|
}
|