opencastle 1.1.1 → 1.3.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 +26 -9
- package/bin/cli.mjs +6 -0
- package/dist/cli/adapters/antigravity.d.ts +0 -1
- package/dist/cli/adapters/antigravity.d.ts.map +1 -1
- package/dist/cli/adapters/antigravity.js +2 -1
- package/dist/cli/adapters/antigravity.js.map +1 -1
- package/dist/cli/adapters/claude-code.d.ts +0 -1
- package/dist/cli/adapters/claude-code.d.ts.map +1 -1
- package/dist/cli/adapters/claude-code.js +0 -1
- package/dist/cli/adapters/claude-code.js.map +1 -1
- package/dist/cli/adapters/cursor.d.ts.map +1 -1
- package/dist/cli/adapters/cursor.js +8 -1
- package/dist/cli/adapters/cursor.js.map +1 -1
- package/dist/cli/adapters/opencode.d.ts +12 -5
- package/dist/cli/adapters/opencode.d.ts.map +1 -1
- package/dist/cli/adapters/opencode.js +17 -5
- package/dist/cli/adapters/opencode.js.map +1 -1
- package/dist/cli/adapters/rules-dir-base.d.ts +12 -1
- package/dist/cli/adapters/rules-dir-base.d.ts.map +1 -1
- package/dist/cli/adapters/rules-dir-base.js +43 -57
- package/dist/cli/adapters/rules-dir-base.js.map +1 -1
- package/dist/cli/adapters/rules-dir-base.test.js +27 -18
- package/dist/cli/adapters/rules-dir-base.test.js.map +1 -1
- package/dist/cli/adapters/single-file-base.d.ts +11 -0
- package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
- package/dist/cli/adapters/single-file-base.js +44 -14
- package/dist/cli/adapters/single-file-base.js.map +1 -1
- package/dist/cli/adapters/vscode.d.ts +2 -1
- package/dist/cli/adapters/vscode.d.ts.map +1 -1
- package/dist/cli/adapters/vscode.js +2 -1
- package/dist/cli/adapters/vscode.js.map +1 -1
- package/dist/cli/adapters/windsurf.d.ts.map +1 -1
- package/dist/cli/adapters/windsurf.js +11 -1
- package/dist/cli/adapters/windsurf.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 +114 -34
- package/dist/cli/baseline.js.map +1 -1
- package/dist/cli/ci.d.ts.map +1 -1
- package/dist/cli/ci.js +18 -4
- package/dist/cli/ci.js.map +1 -1
- package/dist/cli/codex-target.test.js +14 -1
- package/dist/cli/codex-target.test.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/doctor.test.js +2 -2
- package/dist/cli/doctor.test.js.map +1 -1
- package/dist/cli/explain.d.ts +5 -0
- package/dist/cli/explain.d.ts.map +1 -1
- package/dist/cli/explain.js +38 -2
- package/dist/cli/explain.js.map +1 -1
- package/dist/cli/init.test.js +78 -42
- 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/managed-paths.d.ts.map +1 -1
- package/dist/cli/managed-paths.js +3 -1
- package/dist/cli/managed-paths.js.map +1 -1
- package/dist/cli/mcp-audit.d.ts.map +1 -1
- package/dist/cli/mcp-audit.js +2 -0
- package/dist/cli/mcp-audit.js.map +1 -1
- package/dist/cli/mcp-upgrade.test.js +24 -1
- package/dist/cli/mcp-upgrade.test.js.map +1 -1
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +22 -3
- package/dist/cli/mcp.js.map +1 -1
- 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/sync-check.test.js +5 -4
- package/dist/cli/sync-check.test.js.map +1 -1
- package/dist/cli/team-commands.test.js +14 -2
- package/dist/cli/team-commands.test.js.map +1 -1
- package/dist/cli/team-sources.test.js +10 -0
- package/dist/cli/team-sources.test.js.map +1 -1
- package/dist/cli/types.d.ts +1 -1
- package/dist/cli/types.d.ts.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/cli/windsurf-target.test.d.ts +2 -0
- package/dist/cli/windsurf-target.test.d.ts.map +1 -0
- package/dist/cli/windsurf-target.test.js +62 -0
- package/dist/cli/windsurf-target.test.js.map +1 -0
- 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/dist/orchestrator/plugins/registry.test.d.ts +2 -0
- package/dist/orchestrator/plugins/registry.test.d.ts.map +1 -0
- package/dist/orchestrator/plugins/registry.test.js +37 -0
- package/dist/orchestrator/plugins/registry.test.js.map +1 -0
- package/package.json +2 -1
- package/src/cli/adapters/antigravity.ts +2 -1
- package/src/cli/adapters/claude-code.ts +0 -1
- package/src/cli/adapters/cursor.ts +8 -1
- package/src/cli/adapters/opencode.ts +18 -6
- package/src/cli/adapters/rules-dir-base.test.ts +28 -18
- package/src/cli/adapters/rules-dir-base.ts +51 -90
- package/src/cli/adapters/single-file-base.ts +53 -14
- package/src/cli/adapters/vscode.ts +2 -1
- package/src/cli/adapters/windsurf.ts +11 -1
- package/src/cli/agent-plugin.test.ts +267 -0
- package/src/cli/agent-plugin.ts +469 -0
- package/src/cli/baseline.ts +115 -32
- package/src/cli/ci.ts +19 -4
- package/src/cli/codex-target.test.ts +15 -1
- 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.test.ts +2 -2
- package/src/cli/doctor.ts +2 -0
- package/src/cli/explain.ts +36 -2
- package/src/cli/fixtures/lessons-template-1.0.md +70 -0
- package/src/cli/init.test.ts +82 -42
- 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/managed-paths.ts +3 -1
- package/src/cli/mcp-audit.ts +2 -0
- package/src/cli/mcp-upgrade.test.ts +26 -1
- package/src/cli/mcp.ts +22 -3
- 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.test.ts +5 -4
- package/src/cli/sync-check.ts +9 -0
- package/src/cli/team-commands.test.ts +18 -2
- package/src/cli/team-sources.test.ts +11 -0
- package/src/cli/types.ts +1 -1
- package/src/cli/update.ts +20 -0
- package/src/cli/windsurf-target.test.ts +70 -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/registry.test.ts +42 -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
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs'
|
|
2
|
+
import { join } from 'node:path'
|
|
3
|
+
import { parse as yamlParse } from 'yaml'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Finding a credential in text before it is written somewhere it is committed
|
|
7
|
+
* or logged.
|
|
8
|
+
*
|
|
9
|
+
* The convoy engine scans every event and artefact it writes with this; lessons
|
|
10
|
+
* are scanned before they are written, because a lesson is committed with the
|
|
11
|
+
* project. It lives outside the engine so the compiler's own commands can use
|
|
12
|
+
* it without depending on the experimental engine.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
// ── Secret patterns ───────────────────────────────────────────────────────────
|
|
16
|
+
|
|
17
|
+
interface SecretPatternEntry {
|
|
18
|
+
name: string
|
|
19
|
+
pattern: RegExp
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const SECRET_PATTERNS: SecretPatternEntry[] = [
|
|
23
|
+
{ name: 'AWS Access Key', pattern: /AKIA[0-9A-Z]{16}/i },
|
|
24
|
+
{
|
|
25
|
+
name: 'AWS Secret Key',
|
|
26
|
+
// eslint-disable-next-line no-useless-escape
|
|
27
|
+
pattern: /(?:aws_secret_access_key|secret_key)\s*[=:]\s*[A-Za-z0-9\/+=]{40}/i,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Generic API Key',
|
|
31
|
+
pattern: /(?:api[_-]?key|apikey)\s*[=:]\s*['"]?[A-Za-z0-9_-]{20,}/i,
|
|
32
|
+
},
|
|
33
|
+
{ name: 'Bearer Token', pattern: /[Bb]earer\s+[A-Za-z0-9\-._~+/]+=*/ },
|
|
34
|
+
{ name: 'Private Key', pattern: /-----BEGIN (?:RSA|EC|OPENSSH) PRIVATE KEY-----/ },
|
|
35
|
+
{
|
|
36
|
+
name: 'Connection String',
|
|
37
|
+
// eslint-disable-next-line no-useless-escape
|
|
38
|
+
pattern: /(?:postgres|mysql|mongodb|redis):\/\/[^\s]+:[^\s]+@/,
|
|
39
|
+
},
|
|
40
|
+
{ name: 'GitHub Token', pattern: /(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9_]{36,}/ },
|
|
41
|
+
{
|
|
42
|
+
name: 'Generic Password',
|
|
43
|
+
pattern: /(?:password|passwd|pwd)\s*[=:]\s*['"]?[^\s'"]{8,}/i,
|
|
44
|
+
},
|
|
45
|
+
{ name: 'Slack Token', pattern: /xox[bprs]-[A-Za-z0-9-]{10,}/i },
|
|
46
|
+
{
|
|
47
|
+
name: 'Generic Secret',
|
|
48
|
+
pattern: /(?:secret|token|credential)\s*[=:]\s*['"]?[A-Za-z0-9_-]{16,}/i,
|
|
49
|
+
},
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
// ── Public types ──────────────────────────────────────────────────────────────
|
|
53
|
+
|
|
54
|
+
export interface SecretScanResult {
|
|
55
|
+
clean: boolean
|
|
56
|
+
findings: Array<{ pattern: string; file: string; line: number; snippet: string }>
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// ── Allowlist ─────────────────────────────────────────────────────────────────
|
|
60
|
+
|
|
61
|
+
interface AllowlistEntry {
|
|
62
|
+
pattern?: string
|
|
63
|
+
literal?: string
|
|
64
|
+
reason: string
|
|
65
|
+
paths?: string[]
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let _allowlist: AllowlistEntry[] | null = null
|
|
69
|
+
|
|
70
|
+
/** The config path used for the allowlist. Override for testing. */
|
|
71
|
+
export let _allowlistConfigPath = join(process.cwd(), '.opencastle', 'secret-scan-config.yml')
|
|
72
|
+
|
|
73
|
+
/** Reset the allowlist cache (for testing). */
|
|
74
|
+
export function _resetAllowlistCache(): void {
|
|
75
|
+
_allowlist = null
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Override the allowlist config path and reset cache (for testing). */
|
|
79
|
+
export function _setAllowlistConfigPath(path: string): void {
|
|
80
|
+
_allowlistConfigPath = path
|
|
81
|
+
_allowlist = null
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function loadAllowlist(): AllowlistEntry[] {
|
|
85
|
+
if (_allowlist !== null) return _allowlist
|
|
86
|
+
try {
|
|
87
|
+
if (!existsSync(_allowlistConfigPath)) {
|
|
88
|
+
_allowlist = []
|
|
89
|
+
return _allowlist
|
|
90
|
+
}
|
|
91
|
+
const content = readFileSync(_allowlistConfigPath, 'utf-8')
|
|
92
|
+
const parsed = yamlParse(content) as Record<string, unknown> | null
|
|
93
|
+
if (!parsed || !Array.isArray(parsed['allowlist'])) {
|
|
94
|
+
_allowlist = []
|
|
95
|
+
return _allowlist
|
|
96
|
+
}
|
|
97
|
+
_allowlist = parsed['allowlist'] as AllowlistEntry[]
|
|
98
|
+
return _allowlist
|
|
99
|
+
} catch {
|
|
100
|
+
_allowlist = []
|
|
101
|
+
return _allowlist
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function isSuppressed(
|
|
106
|
+
finding: { snippet: string },
|
|
107
|
+
filePath: string,
|
|
108
|
+
allowlist: AllowlistEntry[],
|
|
109
|
+
): boolean {
|
|
110
|
+
for (const entry of allowlist) {
|
|
111
|
+
if (entry.paths && entry.paths.length > 0) {
|
|
112
|
+
if (!entry.paths.some((p) => filePath.includes(p))) continue
|
|
113
|
+
}
|
|
114
|
+
if (entry.literal) {
|
|
115
|
+
if (finding.snippet.includes(entry.literal)) return true
|
|
116
|
+
} else if (entry.pattern) {
|
|
117
|
+
try {
|
|
118
|
+
if (new RegExp(entry.pattern, 'i').test(finding.snippet)) return true
|
|
119
|
+
} catch {
|
|
120
|
+
// Invalid regex in allowlist — skip entry
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return false
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// ── scanForSecrets ────────────────────────────────────────────────────────────
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Scan text content line-by-line for secrets using the default pattern set.
|
|
131
|
+
* Allowlist entries in `.opencastle/secret-scan-config.yml` suppress false positives.
|
|
132
|
+
*/
|
|
133
|
+
export function scanForSecrets(content: string, filePath = ''): SecretScanResult {
|
|
134
|
+
const allowlist = loadAllowlist()
|
|
135
|
+
const lines = content.split('\n')
|
|
136
|
+
const findings: SecretScanResult['findings'] = []
|
|
137
|
+
|
|
138
|
+
for (let i = 0; i < lines.length; i++) {
|
|
139
|
+
const line = lines[i]
|
|
140
|
+
for (const { name, pattern } of SECRET_PATTERNS) {
|
|
141
|
+
if (pattern.test(line)) {
|
|
142
|
+
const snippet = line.length > 100 ? line.slice(0, 97) + '...' : line
|
|
143
|
+
const finding = { pattern: name, file: filePath, line: i + 1, snippet }
|
|
144
|
+
if (!isSuppressed(finding, filePath, allowlist)) {
|
|
145
|
+
findings.push(finding)
|
|
146
|
+
}
|
|
147
|
+
// Only report the first matching pattern per line
|
|
148
|
+
break
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return { clean: findings.length === 0, findings }
|
|
154
|
+
}
|
|
@@ -212,10 +212,11 @@ describe('two targets that share a root file', () => {
|
|
|
212
212
|
}
|
|
213
213
|
const text = readFileSync(join(projectRoot, 'AGENTS.md'), 'utf8')
|
|
214
214
|
expect(text).toContain('shared by more than one assistant')
|
|
215
|
-
expect(text).toContain('
|
|
216
|
-
expect(text).toContain('`.codex
|
|
217
|
-
//
|
|
218
|
-
expect(existsSync(join(projectRoot, '.opencode', '
|
|
215
|
+
expect(text).toContain('Skills are in `.agents/skills/`')
|
|
216
|
+
expect(text).toContain('also installed under `.codex/`.')
|
|
217
|
+
// Each keeps its own agents; both read the one skills directory.
|
|
218
|
+
expect(existsSync(join(projectRoot, '.opencode', 'agents'))).toBe(true)
|
|
219
|
+
expect(existsSync(join(projectRoot, '.codex', 'agents'))).toBe(true)
|
|
219
220
|
expect(existsSync(join(projectRoot, '.agents', 'skills'))).toBe(true)
|
|
220
221
|
})
|
|
221
222
|
})
|
package/src/cli/sync-check.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { IDE_ADAPTERS } from './adapters/index.js'
|
|
|
6
6
|
import { detectRepoInfo, mergeStackIntoRepoInfo } from './detect.js'
|
|
7
7
|
import { getMcpConfigRelPath, expectedTeamEntries, containerKeyFor } from './mcp.js'
|
|
8
8
|
import { parseMcpConfigText } from './mcp-file.js'
|
|
9
|
+
import { lessonsIndexDrift, LESSONS_INDEX } from './lessons.js'
|
|
9
10
|
import { resolveStack, getIncludedMcpServers } from './stack-config.js'
|
|
10
11
|
import { auditMcpConfig, describeFindingUnder, remedyFor, isFailure, type TeamAuditContext } from './mcp-audit.js'
|
|
11
12
|
import { resolveSources, materialize, hasErrors, cliVersionOf, type CompileSource } from './layers.js'
|
|
@@ -652,6 +653,14 @@ async function compareProject(
|
|
|
652
653
|
}
|
|
653
654
|
}
|
|
654
655
|
|
|
656
|
+
// The lessons index, compiled from `.opencastle/lessons/` by `sync`. Two
|
|
657
|
+
// branches that each add a lesson merge cleanly; the index they both touched
|
|
658
|
+
// is what this catches, and `sync` rebuilds it.
|
|
659
|
+
{
|
|
660
|
+
const why = lessonsIndexDrift(resolve(projectRoot, '.opencastle'))
|
|
661
|
+
if (why) drift.push({ ide: 'all', path: `.opencastle/${LESSONS_INDEX}`, kind: 'outdated', detail: why, fix: 'opencastle sync' })
|
|
662
|
+
}
|
|
663
|
+
|
|
655
664
|
// A manifest that parses but names no target this release knows is not a
|
|
656
665
|
// clean project — `sync` exits 1 on it. Reporting "0 generated files match
|
|
657
666
|
// their sources across 0 targets" is an assertion that cannot fail, and it
|
|
@@ -219,7 +219,7 @@ describe.skipIf(!built)('a baseline package', () => {
|
|
|
219
219
|
it('scaffolds one that passes its own check', () => {
|
|
220
220
|
expect(run(dir, ['baseline', 'init', 'base', '--name', '@acme/base']).code).toBe(0)
|
|
221
221
|
const pkg = JSON.parse(readFileSync(join(dir, 'base', 'package.json'), 'utf8'))
|
|
222
|
-
expect(pkg.opencastle).toEqual({ baseline: '
|
|
222
|
+
expect(pkg.opencastle).toEqual({ baseline: '.' })
|
|
223
223
|
const check = run(dir, ['baseline', 'check', 'base', '--json'])
|
|
224
224
|
expect(check.code).toBe(0)
|
|
225
225
|
const report = JSON.parse(check.out)
|
|
@@ -240,6 +240,22 @@ describe.skipIf(!built)('a baseline package', () => {
|
|
|
240
240
|
expect(check.out).toContain('points outside the package')
|
|
241
241
|
})
|
|
242
242
|
|
|
243
|
+
it('names each problem once, by the path it was given', () => {
|
|
244
|
+
run(dir, ['baseline', 'init', 'base', '--name', '@acme/base'])
|
|
245
|
+
writeFileSync(
|
|
246
|
+
join(dir, 'base', 'mcp.json'),
|
|
247
|
+
JSON.stringify({ $schema: 'https://agent-plugins.org/schemas/1.0.0/mcp.schema.json', mcpServers: { docs: { type: 'streamable-http', url: 'https://docs.acme.example/mcp' } } }),
|
|
248
|
+
)
|
|
249
|
+
run(dir, ['plugin', 'build', 'base'])
|
|
250
|
+
const check = run(dir, ['baseline', 'check', 'base'])
|
|
251
|
+
// eslint-disable-next-line no-control-regex
|
|
252
|
+
check.out = check.out.replace(/\x1b\[[0-9;]*m/g, '')
|
|
253
|
+
expect(check.code).toBe(1)
|
|
254
|
+
expect(check.out).toContain('✗ base/mcp.json: defines MCP server "docs", which @acme/base does not allow\n → add it to policy.mcp.allow in @acme/base')
|
|
255
|
+
expect(check.out).not.toContain('✗ ✗')
|
|
256
|
+
expect(check.out).not.toContain(dir.replace(/^\//, ''))
|
|
257
|
+
})
|
|
258
|
+
|
|
243
259
|
it('fails one that would publish empty', () => {
|
|
244
260
|
run(dir, ['baseline', 'init', 'base', '--name', '@acme/base'])
|
|
245
261
|
const path = join(dir, 'base', 'package.json')
|
|
@@ -248,6 +264,6 @@ describe.skipIf(!built)('a baseline package', () => {
|
|
|
248
264
|
writeFileSync(path, JSON.stringify(pkg))
|
|
249
265
|
const check = run(dir, ['baseline', 'check', 'base'])
|
|
250
266
|
expect(check.code).toBe(1)
|
|
251
|
-
expect(check.out).toContain('
|
|
267
|
+
expect(check.out).toContain('"files" does not include plugin.json, so npm publish would leave it out')
|
|
252
268
|
})
|
|
253
269
|
})
|
|
@@ -484,6 +484,17 @@ describe('what review found, kept fixed (compiler and commands)', () => {
|
|
|
484
484
|
expect(plan.codeowners?.block).toContain('/apps/web/.opencastle/lock.json @acme/platform')
|
|
485
485
|
})
|
|
486
486
|
|
|
487
|
+
it('ci: names paths as the project spells them, through a linked checkout', () => {
|
|
488
|
+
const real = join(project, 'real')
|
|
489
|
+
write(real, { 'package.json': '{}', 'package-lock.json': '{}', CODEOWNERS: '* @acme/everyone\n' })
|
|
490
|
+
execFileSync('git', ['init', '-q'], { cwd: real })
|
|
491
|
+
const linked = join(project, 'linked')
|
|
492
|
+
symlinkSync(real, linked)
|
|
493
|
+
const plan = planCi(linked, '0.36.0', '@acme/platform')
|
|
494
|
+
expect(plan.codeowners?.path).toBe(join(linked, 'CODEOWNERS'))
|
|
495
|
+
expect(plan.workflowPath.startsWith(linked)).toBe(true)
|
|
496
|
+
})
|
|
497
|
+
|
|
487
498
|
it('ci: gives pnpm a version when package.json does not name one', () => {
|
|
488
499
|
write(project, { 'package.json': '{}', 'pnpm-lock.yaml': '' })
|
|
489
500
|
expect(planCi(project, '0.36.0').workflow).toContain('version: 10')
|
package/src/cli/types.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { CompileSource } from './layers.js';
|
|
|
4
4
|
// ── Stack selection types ──────────────────────────────────────
|
|
5
5
|
|
|
6
6
|
export type IdeChoice = 'vscode' | 'cursor' | 'claude-code' | 'opencode' | 'windsurf' | 'codex' | 'antigravity';
|
|
7
|
-
export type TechTool = 'sanity' | 'contentful' | 'strapi' | 'supabase' | 'convex' | 'vercel' | 'nx' | 'chrome-devtools' | 'nextjs' | 'astro' | 'netlify' | 'turborepo' | 'prisma' | 'cypress' | 'playwright' | 'vitest' | 'figma' | 'resend' | 'stripe' | 'sentry' | 'drizzle' | 'cloudflare' | 'coolify' | 'expo';
|
|
7
|
+
export type TechTool = 'sanity' | 'contentful' | 'strapi' | 'supabase' | 'convex' | 'vercel' | 'nx' | 'chrome-devtools' | 'nextjs' | 'astro' | 'netlify' | 'turborepo' | 'prisma' | 'cypress' | 'playwright' | 'vitest' | 'figma' | 'resend' | 'stripe' | 'sentry' | 'drizzle' | 'cloudflare' | 'coolify' | 'expo' | 'hetzner';
|
|
8
8
|
export type TeamTool = 'linear' | 'jira' | 'trello' | 'notion' | 'slack' | 'teams';
|
|
9
9
|
|
|
10
10
|
export interface StackConfig {
|
package/src/cli/update.ts
CHANGED
|
@@ -33,6 +33,7 @@ import { buildLock, writeLock, LOCK_REL, priorTeam } from './lock.js'
|
|
|
33
33
|
import { parseVersion, compareVersions } from './version-range.js'
|
|
34
34
|
import { COMMAND_NAMESPACE } from './command-namespace.js'
|
|
35
35
|
import { parseMcpConfigText } from './mcp-file.js'
|
|
36
|
+
import { syncLessons, LESSONS_DIR, LESSONS_INDEX } from './lessons.js'
|
|
36
37
|
|
|
37
38
|
/** The config that replaced a legacy one, for the sentence that reports it. */
|
|
38
39
|
function configBesideLegacy(rel: string, ides: string[]): string {
|
|
@@ -698,6 +699,11 @@ export default async function update({
|
|
|
698
699
|
// ── Migrate legacy log files ────────────────────────────────────
|
|
699
700
|
await migrateLegacyLogs(projectRoot)
|
|
700
701
|
|
|
702
|
+
// ── Lessons: one file each, and the index agents read compiled from them ──
|
|
703
|
+
// Not compiled output of any target — agents read `.opencastle/` directly —
|
|
704
|
+
// but compiled all the same, and `sync --check` holds it to its sources.
|
|
705
|
+
const lessons = syncLessons(resolve(projectRoot, '.opencastle'))
|
|
706
|
+
|
|
701
707
|
// ── Update manifest ─────────────────────────────────────────────
|
|
702
708
|
const before = manifestMeaning(manifest as unknown as Record<string, unknown>)
|
|
703
709
|
manifest.version = pkg.version
|
|
@@ -749,6 +755,20 @@ export default async function update({
|
|
|
749
755
|
if (teamWritten.size > 0) {
|
|
750
756
|
console.log(` ${c.green('✓')} Wrote the team's MCP server(s) as defined: ${[...teamWritten].sort().join(', ')}`)
|
|
751
757
|
}
|
|
758
|
+
if (lessons.migrated > 0) {
|
|
759
|
+
console.log(
|
|
760
|
+
` ${c.green('✓')} Moved ${lessons.migrated} lesson(s) from .opencastle/${LESSONS_INDEX} into .opencastle/${LESSONS_DIR}/, one file each` +
|
|
761
|
+
(lessons.backup ? c.dim(` (the old file is kept as ${lessons.backup})`) : ''),
|
|
762
|
+
)
|
|
763
|
+
} else if (lessons.backup) {
|
|
764
|
+
console.log(` ${c.green('✓')} Replaced .opencastle/${LESSONS_INDEX} with an index of .opencastle/${LESSONS_DIR}/ ${c.dim(`(the old file is kept as ${lessons.backup})`)}`)
|
|
765
|
+
}
|
|
766
|
+
if (lessons.index === 'updated' && lessons.migrated === 0 && !lessons.backup) {
|
|
767
|
+
console.log(` ${c.green('✓')} Updated .opencastle/${LESSONS_INDEX} from .opencastle/${LESSONS_DIR}/`)
|
|
768
|
+
}
|
|
769
|
+
for (const problem of lessons.problems) {
|
|
770
|
+
console.log(` ${c.yellow('!')} Left .opencastle/${problem.split(' ')[0]} out of the lessons index — ${problem.slice(problem.indexOf(' ') + 1)}`)
|
|
771
|
+
}
|
|
752
772
|
for (const rel of legacyDeleted) {
|
|
753
773
|
console.log(` ${c.yellow('-')} Removed ${rel}, which its assistant never read ${c.dim(`(its servers are now in ${configBesideLegacy(rel, ides)})`)}`)
|
|
754
774
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Windsurf — now Devin Desktop — through the built CLI.
|
|
3
|
+
*
|
|
4
|
+
* Releases before this one wrote `.windsurf/mcp.json`, which no Devin Desktop
|
|
5
|
+
* agent reads (the legacy Cascade agent reads one global file, the default
|
|
6
|
+
* Devin Local agent `.devin/mcp_config.json`), and flattened every skill into
|
|
7
|
+
* a `.windsurf/rules/skills/` rule although both agents read Agent Skills.
|
|
8
|
+
*/
|
|
9
|
+
import { execFileSync } from 'node:child_process'
|
|
10
|
+
import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
|
|
11
|
+
import { tmpdir } from 'node:os'
|
|
12
|
+
import { dirname, join, resolve } from 'node:path'
|
|
13
|
+
import { describe, it, expect, beforeEach, afterEach } from 'vitest'
|
|
14
|
+
import type { Manifest } from './types.js'
|
|
15
|
+
|
|
16
|
+
const pkgRoot = resolve(import.meta.dirname, '..', '..')
|
|
17
|
+
const cli = join(pkgRoot, 'bin', 'cli.mjs')
|
|
18
|
+
const built = existsSync(join(pkgRoot, 'dist', 'cli', 'init.js'))
|
|
19
|
+
|
|
20
|
+
function write(root: string, files: Record<string, string>): void {
|
|
21
|
+
for (const [rel, text] of Object.entries(files)) {
|
|
22
|
+
mkdirSync(dirname(join(root, rel)), { recursive: true })
|
|
23
|
+
writeFileSync(join(root, rel), text)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const run = (cwd: string, ...args: string[]): string =>
|
|
28
|
+
execFileSync('node', [cli, ...args], { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] })
|
|
29
|
+
|
|
30
|
+
describe.skipIf(!built)('Windsurf as a target', () => {
|
|
31
|
+
let project: string
|
|
32
|
+
beforeEach(() => {
|
|
33
|
+
project = mkdtempSync(join(tmpdir(), 'oc-windsurf-'))
|
|
34
|
+
execFileSync('git', ['init', '-q'], { cwd: project })
|
|
35
|
+
write(project, {
|
|
36
|
+
'package.json': JSON.stringify({ name: 'app', dependencies: { '@supabase/supabase-js': '^2.0.0' } }),
|
|
37
|
+
'.windsurfrules': '# House rules\n',
|
|
38
|
+
})
|
|
39
|
+
run(project, 'init', '--yes')
|
|
40
|
+
})
|
|
41
|
+
afterEach(() => rmSync(project, { recursive: true, force: true }))
|
|
42
|
+
|
|
43
|
+
it('installs skills and servers where Devin Desktop reads them', () => {
|
|
44
|
+
expect(existsSync(join(project, '.agents', 'skills', 'testing-workflow', 'SKILL.md'))).toBe(true)
|
|
45
|
+
const mcp = JSON.parse(readFileSync(join(project, '.devin', 'mcp_config.json'), 'utf8'))
|
|
46
|
+
expect(mcp.mcpServers.Supabase).toEqual({ url: 'https://mcp.supabase.com/mcp' })
|
|
47
|
+
expect(readFileSync(join(project, '.windsurfrules'), 'utf8')).toContain('Skills are in `.agents/skills/`')
|
|
48
|
+
run(project, 'sync', '--check')
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it('the sync that upgrades a 1.0 install moves both, and leaves nothing behind', () => {
|
|
52
|
+
write(project, {
|
|
53
|
+
'.windsurf/mcp.json': JSON.stringify({ mcpServers: { Supabase: { url: 'https://mcp.supabase.com/mcp' } } }, null, 2) + '\n',
|
|
54
|
+
'.windsurf/rules/skills/testing-workflow.md': '---\ntrigger: model_decision\n---\n\nold\n',
|
|
55
|
+
'.windsurf/rules/skills/testing-workflow/REFERENCE.md': 'old\n',
|
|
56
|
+
})
|
|
57
|
+
const path = join(project, '.opencastle', 'manifest.json')
|
|
58
|
+
const manifest = JSON.parse(readFileSync(path, 'utf8')) as Manifest
|
|
59
|
+
manifest.version = '1.0.0'
|
|
60
|
+
manifest.createdConfigs = ['.windsurf/mcp.json']
|
|
61
|
+
writeFileSync(path, JSON.stringify(manifest, null, 2))
|
|
62
|
+
|
|
63
|
+
const out = run(project, 'sync', '--yes')
|
|
64
|
+
expect(out).toContain('Removed .windsurf/mcp.json')
|
|
65
|
+
expect(existsSync(join(project, '.windsurf', 'mcp.json'))).toBe(false)
|
|
66
|
+
expect(existsSync(join(project, '.windsurf', 'rules', 'skills'))).toBe(false)
|
|
67
|
+
expect(existsSync(join(project, '.devin', 'mcp_config.json'))).toBe(true)
|
|
68
|
+
run(project, 'sync', '--check')
|
|
69
|
+
})
|
|
70
|
+
})
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
"hash": "
|
|
2
|
+
"hash": "12c645f9",
|
|
3
3
|
"configHash": "30f8ea04",
|
|
4
|
-
"lockfileHash": "
|
|
5
|
-
"browserHash": "
|
|
4
|
+
"lockfileHash": "af43301a",
|
|
5
|
+
"browserHash": "13776f9b",
|
|
6
6
|
"optimized": {
|
|
7
7
|
"astro > cssesc": {
|
|
8
8
|
"src": "../../../../../node_modules/cssesc/cssesc.js",
|
|
9
9
|
"file": "astro___cssesc.js",
|
|
10
|
-
"fileHash": "
|
|
10
|
+
"fileHash": "94f71dbc",
|
|
11
11
|
"needsInterop": true
|
|
12
12
|
},
|
|
13
13
|
"astro > aria-query": {
|
|
14
14
|
"src": "../../../../../node_modules/aria-query/lib/index.js",
|
|
15
15
|
"file": "astro___aria-query.js",
|
|
16
|
-
"fileHash": "
|
|
16
|
+
"fileHash": "6f2c077e",
|
|
17
17
|
"needsInterop": true
|
|
18
18
|
},
|
|
19
19
|
"astro > axobject-query": {
|
|
20
20
|
"src": "../../../../../node_modules/axobject-query/lib/index.js",
|
|
21
21
|
"file": "astro___axobject-query.js",
|
|
22
|
-
"fileHash": "
|
|
22
|
+
"fileHash": "4c620914",
|
|
23
23
|
"needsInterop": true
|
|
24
24
|
}
|
|
25
25
|
},
|
|
@@ -64,7 +64,7 @@ Writing or editing code · running tests and builds · creating tracker issues
|
|
|
64
64
|
- [Question]: Searched [X, Y, Z] — could not determine
|
|
65
65
|
|
|
66
66
|
### Relevant Lessons
|
|
67
|
-
- [
|
|
67
|
+
- [lesson id]: [summary]
|
|
68
68
|
|
|
69
69
|
### Recommendations
|
|
70
70
|
- [Recommendation with rationale]
|
|
@@ -1,70 +1,14 @@
|
|
|
1
|
-
|
|
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
|
|
1
|
+
<!-- Generated by OpenCastle from the files in lessons/. Add a lesson with "opencastle lesson"; this index is rewritten by every sync. -->
|
|
26
2
|
|
|
27
|
-
|
|
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
|
-
---
|
|
3
|
+
# Lessons Learned
|
|
53
4
|
|
|
54
|
-
|
|
5
|
+
What agents on this project learned the hard way: a command that failed, a
|
|
6
|
+
tool quirk, a convention written down nowhere else. **Read this before you
|
|
7
|
+
start work**, then open the lessons that match your task.
|
|
55
8
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
| `codebase-tool` | — |
|
|
61
|
-
| `terminal` | — |
|
|
62
|
-
| `framework` | — |
|
|
63
|
-
| `cms` | — |
|
|
64
|
-
| `database` | — |
|
|
65
|
-
| `git` | — |
|
|
66
|
-
| `deployment` | — |
|
|
67
|
-
| `browser-testing` | — |
|
|
68
|
-
| `general` | — |
|
|
9
|
+
Each lesson is a file in [`lessons/`](lessons/). Add one with
|
|
10
|
+
`opencastle lesson --title ... --category ... --severity ... --problem ...`
|
|
11
|
+
(and `--cite <path>` for the code it is about). Do not edit this index:
|
|
12
|
+
it is rewritten from those files by every `opencastle sync`.
|
|
69
13
|
|
|
70
|
-
|
|
14
|
+
No lessons yet.
|
|
@@ -13,7 +13,8 @@ Skills reference these files by root-relative path, like `.opencastle/stack/api-
|
|
|
13
13
|
| File | Purpose |
|
|
14
14
|
|------|---------|
|
|
15
15
|
| `project.instructions.md` | High-level project context — apps, libraries, tech stack, ports, URLs |
|
|
16
|
-
| `LESSONS-LEARNED.md` |
|
|
16
|
+
| `LESSONS-LEARNED.md` | Index of the lessons in `lessons/` — read before every session. Rewritten by `opencastle sync`; never edited by hand |
|
|
17
|
+
| `lessons/` | One file per lesson: retries, workarounds and gotchas, written by `opencastle lesson` |
|
|
17
18
|
| `KNOWN-ISSUES.md` | Tracked issues, limitations, and accepted risks discovered during sessions |
|
|
18
19
|
| `AGENT-FAILURES.md` | Dead letter queue for failed agent delegations |
|
|
19
20
|
| `AGENT-PERFORMANCE.md` | Agent success tracking, log query recipes, performance metrics |
|
|
@@ -85,7 +85,7 @@ Run `opencastle log --help` for full options.
|
|
|
85
85
|
| `duration_min` | `number` | No | Estimated session duration in minutes |
|
|
86
86
|
| `files_changed` | `number` | No | Number of files created/modified |
|
|
87
87
|
| `retries` | `number` | No | Number of retried operations |
|
|
88
|
-
| `lessons_added` | `string[]` | No | Lesson
|
|
88
|
+
| `lessons_added` | `string[]` | No | Lesson ids added (e.g., `["2026-10-02-quote-shell-variables"]`) |
|
|
89
89
|
| `discoveries` | `string[]` | No | Issues discovered (issue IDs or KNOWN-ISSUES IDs) |
|
|
90
90
|
|
|
91
91
|
## Delegation Record (`type: "delegation"`)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { existsSync, readFileSync } from 'node:fs'
|
|
3
|
+
import { join } from 'node:path'
|
|
4
|
+
import { PLUGINS } from './index.js'
|
|
5
|
+
import { readAgentPlugin } from '../../cli/agent-plugin.js'
|
|
6
|
+
import { packFiles } from '../../cli/pack-plugins.js'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Every integration is an Agent Plugin 1.0 directory: plugin.json, its skill in
|
|
10
|
+
* skills/<name>/SKILL.md, and mcp.json when its server can be written portably.
|
|
11
|
+
* Checked the way a conformant client loads one, and held to config.ts, which
|
|
12
|
+
* the files are compiled from.
|
|
13
|
+
*/
|
|
14
|
+
const root = import.meta.dirname
|
|
15
|
+
|
|
16
|
+
describe.each(Object.values(PLUGINS).map((p) => [p.id, p] as const))('%s', (id, plugin) => {
|
|
17
|
+
const dir = join(root, id)
|
|
18
|
+
|
|
19
|
+
it('is a conformant Agent Plugin, with its skill and server', () => {
|
|
20
|
+
const report = readAgentPlugin(dir)
|
|
21
|
+
expect(report.errors).toEqual([])
|
|
22
|
+
expect(report.warnings).toEqual([])
|
|
23
|
+
expect(report.skills).toEqual(plugin.skillName ? [plugin.skillName] : [])
|
|
24
|
+
const portable = packFiles(plugin)['mcp.json'] !== undefined
|
|
25
|
+
expect(Object.keys(report.servers)).toEqual(portable ? [plugin.mcpServerKey] : [])
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it('matches its config.ts — run npm run plugins:build if not', () => {
|
|
29
|
+
for (const [rel, text] of Object.entries(packFiles(plugin))) {
|
|
30
|
+
expect(readFileSync(join(dir, rel), 'utf8'), `${id}/${rel}`).toBe(text)
|
|
31
|
+
}
|
|
32
|
+
if (!packFiles(plugin)['mcp.json']) expect(existsSync(join(dir, 'mcp.json'))).toBe(false)
|
|
33
|
+
})
|
|
34
|
+
})
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
|
+
"name": "astro",
|
|
4
|
+
"description": "Astro skill and MCP server for AI coding assistants: Content-driven web framework with islands architecture and Docs MCP.",
|
|
5
|
+
"homepage": "https://www.opencastle.dev/docs/plugins#astro",
|
|
6
|
+
"repository": "https://github.com/monkilabs/opencastle",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"tech",
|
|
10
|
+
"framework"
|
|
11
|
+
],
|
|
12
|
+
"extensions": {
|
|
13
|
+
"dev.opencastle": {
|
|
14
|
+
"label": "Astro",
|
|
15
|
+
"category": "tech",
|
|
16
|
+
"subCategory": "framework",
|
|
17
|
+
"authType": "none",
|
|
18
|
+
"officialDocs": "https://docs.astro.build"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
|
+
"name": "chrome-devtools",
|
|
4
|
+
"description": "Chrome DevTools skill and MCP server for AI coding assistants: Browser testing, screenshots, DOM inspection.",
|
|
5
|
+
"homepage": "https://www.opencastle.dev/docs/plugins#chrome-devtools",
|
|
6
|
+
"repository": "https://github.com/monkilabs/opencastle",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"tech",
|
|
10
|
+
"e2e-testing"
|
|
11
|
+
],
|
|
12
|
+
"extensions": {
|
|
13
|
+
"dev.opencastle": {
|
|
14
|
+
"label": "Chrome DevTools",
|
|
15
|
+
"category": "tech",
|
|
16
|
+
"subCategory": "e2e-testing",
|
|
17
|
+
"authType": "none",
|
|
18
|
+
"officialDocs": "https://developer.chrome.com/docs/devtools"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|