opencastle 0.1.0 → 0.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 +16 -7
- package/bin/cli.mjs +2 -3
- package/dist/cli/adapters/claude-code.d.ts.map +1 -1
- package/dist/cli/adapters/claude-code.js +7 -3
- 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 +27 -9
- package/dist/cli/adapters/cursor.js.map +1 -1
- package/dist/cli/dashboard.d.ts.map +1 -1
- package/dist/cli/dashboard.js +7 -4
- package/dist/cli/dashboard.js.map +1 -1
- package/dist/cli/eject.d.ts +1 -1
- package/dist/cli/eject.d.ts.map +1 -1
- package/dist/cli/eject.js +6 -1
- package/dist/cli/eject.js.map +1 -1
- package/dist/cli/gitignore.d.ts +11 -0
- package/dist/cli/gitignore.d.ts.map +1 -0
- package/dist/cli/gitignore.js +61 -0
- package/dist/cli/gitignore.js.map +1 -0
- package/dist/cli/init.d.ts +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +65 -2
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/mcp.d.ts +3 -2
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +23 -5
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/run/schema.d.ts.map +1 -1
- package/dist/cli/run/schema.js +28 -1
- package/dist/cli/run/schema.js.map +1 -1
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +16 -0
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +16 -3
- package/dist/cli/update.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/adapters/claude-code.ts +7 -5
- package/src/cli/adapters/cursor.ts +28 -13
- package/src/cli/dashboard.ts +9 -4
- package/src/cli/eject.ts +7 -1
- package/src/cli/gitignore.ts +77 -0
- package/src/cli/init.ts +69 -2
- package/src/cli/mcp.ts +31 -6
- package/src/cli/run/schema.ts +26 -1
- package/src/cli/run.ts +4 -0
- package/src/cli/update.ts +18 -3
- package/src/orchestrator/agent-workflows/README.md +2 -0
- package/src/orchestrator/agent-workflows/bug-fix.md +2 -0
- package/src/orchestrator/agent-workflows/data-pipeline.md +2 -0
- package/src/orchestrator/agent-workflows/database-migration.md +2 -0
- package/src/orchestrator/agent-workflows/feature-implementation.md +2 -0
- package/src/orchestrator/agent-workflows/performance-optimization.md +2 -0
- package/src/orchestrator/agent-workflows/refactoring.md +2 -0
- package/src/orchestrator/agent-workflows/schema-changes.md +2 -0
- package/src/orchestrator/agent-workflows/security-audit.md +2 -0
- package/src/orchestrator/agent-workflows/shared-delivery-phase.md +2 -0
- package/src/orchestrator/agents/api-designer.agent.md +2 -0
- package/src/orchestrator/agents/architect.agent.md +2 -0
- package/src/orchestrator/agents/content-engineer.agent.md +2 -0
- package/src/orchestrator/agents/copywriter.agent.md +2 -0
- package/src/orchestrator/agents/data-expert.agent.md +2 -0
- package/src/orchestrator/agents/database-engineer.agent.md +2 -0
- package/src/orchestrator/agents/developer.agent.md +2 -0
- package/src/orchestrator/agents/devops-expert.agent.md +2 -0
- package/src/orchestrator/agents/documentation-writer.agent.md +2 -0
- package/src/orchestrator/agents/performance-expert.agent.md +2 -0
- package/src/orchestrator/agents/release-manager.agent.md +2 -0
- package/src/orchestrator/agents/researcher.agent.md +2 -0
- package/src/orchestrator/agents/reviewer.agent.md +2 -0
- package/src/orchestrator/agents/security-expert.agent.md +2 -0
- package/src/orchestrator/agents/seo-specialist.agent.md +2 -0
- package/src/orchestrator/agents/team-lead.agent.md +2 -0
- package/src/orchestrator/agents/testing-expert.agent.md +3 -1
- package/src/orchestrator/agents/ui-ux-expert.agent.md +5 -3
- package/src/orchestrator/copilot-instructions.md +2 -0
- package/src/orchestrator/instructions/ai-optimization.instructions.md +2 -0
- package/src/orchestrator/instructions/general.instructions.md +2 -0
- package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +2 -0
- package/src/orchestrator/prompts/brainstorm.prompt.md +2 -0
- package/src/orchestrator/prompts/bug-fix.prompt.md +2 -0
- package/src/orchestrator/prompts/create-skill.prompt.md +2 -0
- package/src/orchestrator/prompts/generate-task-spec.prompt.md +2 -0
- package/src/orchestrator/prompts/implement-feature.prompt.md +2 -0
- package/src/orchestrator/prompts/metrics-report.prompt.md +2 -0
- package/src/orchestrator/prompts/quick-refinement.prompt.md +2 -0
- package/src/orchestrator/prompts/resolve-pr-comments.prompt.md +2 -0
- package/src/orchestrator/skills/accessibility-standards/SKILL.md +2 -0
- package/src/orchestrator/skills/agent-hooks/SKILL.md +2 -0
- package/src/orchestrator/skills/agent-memory/SKILL.md +2 -0
- package/src/orchestrator/skills/api-patterns/SKILL.md +2 -0
- package/src/orchestrator/skills/browser-testing/SKILL.md +14 -26
- package/src/orchestrator/skills/code-commenting/SKILL.md +2 -0
- package/src/orchestrator/skills/contentful-cms/SKILL.md +2 -0
- package/src/orchestrator/skills/context-map/SKILL.md +2 -0
- package/src/orchestrator/skills/convex-database/SKILL.md +2 -0
- package/src/orchestrator/skills/data-engineering/SKILL.md +2 -0
- package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +2 -0
- package/src/orchestrator/skills/documentation-standards/SKILL.md +2 -0
- package/src/orchestrator/skills/fast-review/SKILL.md +2 -0
- package/src/orchestrator/skills/frontend-design/SKILL.md +2 -0
- package/src/orchestrator/skills/jira-management/SKILL.md +2 -0
- package/src/orchestrator/skills/memory-merger/SKILL.md +2 -0
- package/src/orchestrator/skills/nextjs-patterns/SKILL.md +2 -0
- package/src/orchestrator/skills/nx-workspace/SKILL.md +2 -0
- package/src/orchestrator/skills/panel-majority-vote/SKILL.md +2 -0
- package/src/orchestrator/skills/panel-majority-vote/panel-report.template.md +2 -0
- package/src/orchestrator/skills/performance-optimization/SKILL.md +2 -0
- package/src/orchestrator/skills/react-development/SKILL.md +2 -0
- package/src/orchestrator/skills/sanity-cms/SKILL.md +2 -0
- package/src/orchestrator/skills/security-hardening/SKILL.md +2 -0
- package/src/orchestrator/skills/self-improvement/SKILL.md +2 -0
- package/src/orchestrator/skills/seo-patterns/SKILL.md +2 -0
- package/src/orchestrator/skills/session-checkpoints/SKILL.md +2 -0
- package/src/orchestrator/skills/slack-notifications/SKILL.md +2 -0
- package/src/orchestrator/skills/strapi-cms/SKILL.md +2 -0
- package/src/orchestrator/skills/supabase-database/SKILL.md +2 -0
- package/src/orchestrator/skills/task-management/SKILL.md +2 -0
- package/src/orchestrator/skills/team-lead-reference/SKILL.md +2 -0
- package/src/orchestrator/skills/teams-notifications/SKILL.md +2 -0
- package/src/orchestrator/skills/testing-workflow/SKILL.md +4 -2
- package/src/orchestrator/skills/validation-gates/SKILL.md +4 -2
- package/dist/cli/diff.d.ts +0 -3
- package/dist/cli/diff.d.ts.map +0 -1
- package/dist/cli/diff.js +0 -27
- package/dist/cli/diff.js.map +0 -1
- package/src/cli/diff.ts +0 -44
package/src/cli/init.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { resolve } from 'node:path'
|
|
2
|
-
import { readFile } from 'node:fs/promises'
|
|
2
|
+
import { readFile, unlink } from 'node:fs/promises'
|
|
3
|
+
import { existsSync } from 'node:fs'
|
|
3
4
|
import { select, confirm, closePrompts } from './prompt.js'
|
|
4
5
|
import { readManifest, writeManifest, createManifest } from './manifest.js'
|
|
6
|
+
import { removeDirIfExists } from './copy.js'
|
|
7
|
+
import { updateGitignore } from './gitignore.js'
|
|
5
8
|
import type { CliContext, IdeAdapter, CmsChoice, DbChoice, PmChoice, NotifChoice, StackConfig } from './types.js'
|
|
6
9
|
|
|
7
10
|
const ADAPTERS: Record<string, () => Promise<IdeAdapter>> = {
|
|
@@ -11,11 +14,13 @@ const ADAPTERS: Record<string, () => Promise<IdeAdapter>> = {
|
|
|
11
14
|
import('./adapters/claude-code.js') as Promise<IdeAdapter>,
|
|
12
15
|
}
|
|
13
16
|
|
|
14
|
-
export default async function init({ pkgRoot }: CliContext): Promise<void> {
|
|
17
|
+
export default async function init({ pkgRoot, args }: CliContext): Promise<void> {
|
|
15
18
|
const projectRoot = process.cwd()
|
|
19
|
+
const dryRun = args.includes('--dry-run')
|
|
16
20
|
|
|
17
21
|
// Check for existing installation
|
|
18
22
|
const existing = await readManifest(projectRoot)
|
|
23
|
+
let isReinit = false
|
|
19
24
|
if (existing) {
|
|
20
25
|
const proceed = await confirm(
|
|
21
26
|
`OpenCastle already installed (v${existing.version}, ${existing.ide}). Re-initialize?`,
|
|
@@ -25,6 +30,7 @@ export default async function init({ pkgRoot }: CliContext): Promise<void> {
|
|
|
25
30
|
console.log(' Aborted.')
|
|
26
31
|
return
|
|
27
32
|
}
|
|
33
|
+
isReinit = true
|
|
28
34
|
}
|
|
29
35
|
|
|
30
36
|
const pkg = JSON.parse(
|
|
@@ -89,6 +95,49 @@ export default async function init({ pkgRoot }: CliContext): Promise<void> {
|
|
|
89
95
|
console.log(`\n Installing for ${ide}...`)
|
|
90
96
|
console.log(` Stack: CMS=${stack.cms}, DB=${stack.db}, PM=${stack.pm}, Notifications=${stack.notifications}\n`)
|
|
91
97
|
|
|
98
|
+
// ── Dry run ─────────────────────────────────────────────────────
|
|
99
|
+
if (dryRun) {
|
|
100
|
+
const adapter = await ADAPTERS[ide]()
|
|
101
|
+
const managed = adapter.getManagedPaths()
|
|
102
|
+
console.log(' [dry-run] Files that would be created:\n')
|
|
103
|
+
for (const p of managed.framework) {
|
|
104
|
+
console.log(` + ${p}`)
|
|
105
|
+
}
|
|
106
|
+
for (const p of managed.customizable) {
|
|
107
|
+
console.log(` + ${p}`)
|
|
108
|
+
}
|
|
109
|
+
console.log(` + .opencastle.json`)
|
|
110
|
+
console.log(` + .gitignore (OpenCastle entries)`)
|
|
111
|
+
console.log('\n No files were written.\n')
|
|
112
|
+
closePrompts()
|
|
113
|
+
return
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ── Clean up previous installation on re-init ────────────────
|
|
117
|
+
if (isReinit && existing) {
|
|
118
|
+
const frameworkPaths = existing.managedPaths?.framework ?? []
|
|
119
|
+
for (const p of frameworkPaths) {
|
|
120
|
+
const fullPath = resolve(projectRoot, p)
|
|
121
|
+
if (p.endsWith('/')) {
|
|
122
|
+
await removeDirIfExists(fullPath)
|
|
123
|
+
} else if (existsSync(fullPath)) {
|
|
124
|
+
await unlink(fullPath)
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// Remove MCP config so it gets regenerated with new stack
|
|
128
|
+
const mcpCandidates = [
|
|
129
|
+
'.vscode/mcp.json',
|
|
130
|
+
'.cursor/mcp.json',
|
|
131
|
+
'.claude/mcp.json',
|
|
132
|
+
]
|
|
133
|
+
for (const mcpPath of mcpCandidates) {
|
|
134
|
+
const fullPath = resolve(projectRoot, mcpPath)
|
|
135
|
+
if (existsSync(fullPath)) {
|
|
136
|
+
await unlink(fullPath)
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
92
141
|
// ── Run adapter ─────────────────────────────────────────────────
|
|
93
142
|
const adapter = await ADAPTERS[ide]()
|
|
94
143
|
const results = await adapter.install(pkgRoot, projectRoot, stack)
|
|
@@ -99,16 +148,34 @@ export default async function init({ pkgRoot }: CliContext): Promise<void> {
|
|
|
99
148
|
manifest.stack = stack
|
|
100
149
|
await writeManifest(projectRoot, manifest)
|
|
101
150
|
|
|
151
|
+
// ── Update .gitignore ───────────────────────────────────────────
|
|
152
|
+
const managedPaths = adapter.getManagedPaths()
|
|
153
|
+
const gitignoreResult = await updateGitignore(projectRoot, managedPaths)
|
|
154
|
+
|
|
102
155
|
// ── Summary ─────────────────────────────────────────────────────
|
|
103
156
|
const created = results.created.length
|
|
104
157
|
const skipped = results.skipped.length
|
|
105
158
|
|
|
106
159
|
console.log(` ✓ Created ${created} files`)
|
|
160
|
+
if (gitignoreResult === 'created') {
|
|
161
|
+
console.log(' ✓ Created .gitignore with OpenCastle entries')
|
|
162
|
+
} else if (gitignoreResult === 'updated') {
|
|
163
|
+
console.log(' ✓ Updated .gitignore with OpenCastle entries')
|
|
164
|
+
}
|
|
107
165
|
if (skipped > 0) {
|
|
108
166
|
console.log(` → Skipped ${skipped} existing files`)
|
|
109
167
|
}
|
|
110
168
|
|
|
111
169
|
console.log(`\n Next steps:`)
|
|
170
|
+
if (ide === 'vscode') {
|
|
171
|
+
console.log(
|
|
172
|
+
' 0. Reload VS Code window (Cmd+Shift+P → "Reload Window") to pick up agents'
|
|
173
|
+
)
|
|
174
|
+
} else if (ide === 'cursor') {
|
|
175
|
+
console.log(
|
|
176
|
+
' 0. Reload Cursor window to pick up the new rule files'
|
|
177
|
+
)
|
|
178
|
+
}
|
|
112
179
|
console.log(
|
|
113
180
|
' 1. Run the "Bootstrap Customizations" prompt to configure for your project'
|
|
114
181
|
)
|
package/src/cli/mcp.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { getIncludedMcpServers } from './stack-config.js';
|
|
|
6
6
|
import type { ScaffoldResult, StackConfig } from './types.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Scaffold the MCP server config into the target project.
|
|
9
|
+
* Scaffold or merge the MCP server config into the target project.
|
|
10
10
|
*
|
|
11
11
|
* Reads the template from `opencastle/src/orchestrator/mcp.json`,
|
|
12
12
|
* writes it to `<projectRoot>/<destRelPath>` (e.g. `.vscode/mcp.json`).
|
|
@@ -14,7 +14,8 @@ import type { ScaffoldResult, StackConfig } from './types.js';
|
|
|
14
14
|
* When a StackConfig is provided, only servers relevant to the chosen
|
|
15
15
|
* CMS/DB stack (plus core servers) are included.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
17
|
+
* If the file already exists, missing servers are merged in without
|
|
18
|
+
* overwriting any existing server configs.
|
|
18
19
|
*/
|
|
19
20
|
export async function scaffoldMcpConfig(
|
|
20
21
|
pkgRoot: string,
|
|
@@ -24,10 +25,6 @@ export async function scaffoldMcpConfig(
|
|
|
24
25
|
): Promise<ScaffoldResult> {
|
|
25
26
|
const destPath = resolve(projectRoot, destRelPath);
|
|
26
27
|
|
|
27
|
-
if (existsSync(destPath)) {
|
|
28
|
-
return { path: destPath, action: 'skipped' };
|
|
29
|
-
}
|
|
30
|
-
|
|
31
28
|
const srcRoot = getOrchestratorRoot(pkgRoot);
|
|
32
29
|
const templatePath = resolve(srcRoot, 'mcp.json');
|
|
33
30
|
const content = await readFile(templatePath, 'utf8');
|
|
@@ -42,6 +39,34 @@ export async function scaffoldMcpConfig(
|
|
|
42
39
|
);
|
|
43
40
|
}
|
|
44
41
|
|
|
42
|
+
if (existsSync(destPath)) {
|
|
43
|
+
// Merge: add missing servers without overwriting existing ones
|
|
44
|
+
const existingContent = await readFile(destPath, 'utf8');
|
|
45
|
+
const existing = JSON.parse(existingContent) as {
|
|
46
|
+
servers?: Record<string, unknown>;
|
|
47
|
+
[key: string]: unknown;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
if (!existing.servers) {
|
|
51
|
+
existing.servers = {};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let added = 0;
|
|
55
|
+
for (const [key, value] of Object.entries(template.servers)) {
|
|
56
|
+
if (!(key in existing.servers)) {
|
|
57
|
+
existing.servers[key] = value;
|
|
58
|
+
added++;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (added === 0) {
|
|
63
|
+
return { path: destPath, action: 'skipped' };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
await writeFile(destPath, JSON.stringify(existing, null, 2) + '\n');
|
|
67
|
+
return { path: destPath, action: 'created' };
|
|
68
|
+
}
|
|
69
|
+
|
|
45
70
|
await mkdir(dirname(destPath), { recursive: true });
|
|
46
71
|
await writeFile(destPath, JSON.stringify(template, null, 2) + '\n');
|
|
47
72
|
|
package/src/cli/run/schema.ts
CHANGED
|
@@ -340,11 +340,36 @@ function parseBlockScalar(lines: string[], startIdx: number, parentIndent: numbe
|
|
|
340
340
|
|
|
341
341
|
/**
|
|
342
342
|
* Parse a flow sequence: [item1, item2, item3]
|
|
343
|
+
* Handles quoted strings that may contain commas.
|
|
343
344
|
*/
|
|
344
345
|
function parseFlowSequence(text: string): Array<string | number | boolean | null> {
|
|
345
346
|
const inner = text.slice(1, -1).trim()
|
|
346
347
|
if (inner === '') return []
|
|
347
|
-
|
|
348
|
+
|
|
349
|
+
const items: string[] = []
|
|
350
|
+
let current = ''
|
|
351
|
+
let inQuote: string | null = null
|
|
352
|
+
|
|
353
|
+
for (let i = 0; i < inner.length; i++) {
|
|
354
|
+
const ch = inner[i]
|
|
355
|
+
if (inQuote) {
|
|
356
|
+
if (ch === inQuote) {
|
|
357
|
+
inQuote = null
|
|
358
|
+
} else {
|
|
359
|
+
current += ch
|
|
360
|
+
}
|
|
361
|
+
} else if (ch === '"' || ch === "'") {
|
|
362
|
+
inQuote = ch
|
|
363
|
+
} else if (ch === ',') {
|
|
364
|
+
items.push(current.trim())
|
|
365
|
+
current = ''
|
|
366
|
+
} else {
|
|
367
|
+
current += ch
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
if (current.trim()) items.push(current.trim())
|
|
371
|
+
|
|
372
|
+
return items.map(castScalar)
|
|
348
373
|
}
|
|
349
374
|
|
|
350
375
|
// ── Schema validation ──────────────────────────────────────────────
|
package/src/cli/run.ts
CHANGED
|
@@ -43,6 +43,7 @@ function parseArgs(args: string[]): RunOptions {
|
|
|
43
43
|
break
|
|
44
44
|
case '--file':
|
|
45
45
|
case '-f':
|
|
46
|
+
if (i + 1 >= args.length) { console.error(' \u2717 --file requires a path'); process.exit(1) }
|
|
46
47
|
opts.file = args[++i]
|
|
47
48
|
break
|
|
48
49
|
case '--dry-run':
|
|
@@ -50,6 +51,7 @@ function parseArgs(args: string[]): RunOptions {
|
|
|
50
51
|
break
|
|
51
52
|
case '--concurrency':
|
|
52
53
|
case '-c': {
|
|
54
|
+
if (i + 1 >= args.length) { console.error(' \u2717 --concurrency requires a number'); process.exit(1) }
|
|
53
55
|
const val = parseInt(args[++i], 10)
|
|
54
56
|
if (!Number.isFinite(val) || val < 1) {
|
|
55
57
|
console.error(` ✗ --concurrency must be an integer >= 1`)
|
|
@@ -60,9 +62,11 @@ function parseArgs(args: string[]): RunOptions {
|
|
|
60
62
|
}
|
|
61
63
|
case '--adapter':
|
|
62
64
|
case '-a':
|
|
65
|
+
if (i + 1 >= args.length) { console.error(' \u2717 --adapter requires a name'); process.exit(1) }
|
|
63
66
|
opts.adapter = args[++i]
|
|
64
67
|
break
|
|
65
68
|
case '--report-dir':
|
|
69
|
+
if (i + 1 >= args.length) { console.error(' \u2717 --report-dir requires a path'); process.exit(1) }
|
|
66
70
|
opts.reportDir = args[++i]
|
|
67
71
|
break
|
|
68
72
|
case '--verbose':
|
package/src/cli/update.ts
CHANGED
|
@@ -38,18 +38,33 @@ export default async function update({
|
|
|
38
38
|
await readFile(resolve(pkgRoot, 'package.json'), 'utf8')
|
|
39
39
|
) as { version: string }
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
const dryRun = args.includes('--dry-run')
|
|
42
|
+
|
|
43
|
+
if (manifest.version === pkg.version && !args.includes('--force') && !dryRun) {
|
|
42
44
|
console.log(` Already up to date (v${pkg.version}).`)
|
|
43
45
|
return
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
console.log(
|
|
47
|
-
`\n 🏰 OpenCastle update: v${manifest.version} → v${pkg.version}\n`
|
|
49
|
+
`\n 🏰 OpenCastle ${dryRun ? 'dry-run' : 'update'}: v${manifest.version} → v${pkg.version}\n`
|
|
48
50
|
)
|
|
49
51
|
console.log(` IDE: ${manifest.ide}`)
|
|
50
52
|
console.log(' Framework files will be overwritten.')
|
|
51
53
|
console.log(' Customization files will be preserved.\n')
|
|
52
54
|
|
|
55
|
+
if (dryRun) {
|
|
56
|
+
console.log(' [dry-run] Framework files that would be updated:\n')
|
|
57
|
+
for (const p of manifest.managedPaths?.framework ?? []) {
|
|
58
|
+
console.log(` ↻ ${p}`)
|
|
59
|
+
}
|
|
60
|
+
console.log('\n Customization files that would be preserved:\n')
|
|
61
|
+
for (const p of manifest.managedPaths?.customizable ?? []) {
|
|
62
|
+
console.log(` ✓ ${p}`)
|
|
63
|
+
}
|
|
64
|
+
console.log('\n No files were written.\n')
|
|
65
|
+
return
|
|
66
|
+
}
|
|
67
|
+
|
|
53
68
|
const proceed = await confirm('Proceed with update?')
|
|
54
69
|
if (!proceed) {
|
|
55
70
|
console.log(' Aborted.')
|
|
@@ -57,7 +72,7 @@ export default async function update({
|
|
|
57
72
|
}
|
|
58
73
|
|
|
59
74
|
const adapter = await ADAPTERS[manifest.ide]()
|
|
60
|
-
const results = await adapter.update(pkgRoot, projectRoot)
|
|
75
|
+
const results = await adapter.update(pkgRoot, projectRoot, manifest.stack)
|
|
61
76
|
|
|
62
77
|
// Update manifest
|
|
63
78
|
manifest.version = pkg.version
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
2
|
+
|
|
1
3
|
# Workflow Templates
|
|
2
4
|
|
|
3
5
|
Declarative workflow templates for common orchestration patterns. Inspired by Sandcastle's YAML workflow engine, these templates provide reproducible execution plans that the Team Lead and prompts can reference.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
2
|
+
|
|
1
3
|
# Workflow: Feature Implementation
|
|
2
4
|
|
|
3
5
|
Standard execution plan for multi-layer features. Customize file paths, agents, and criteria per task.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
2
|
+
|
|
1
3
|
# Shared Delivery Phase
|
|
2
4
|
|
|
3
5
|
This phase is referenced by all workflow templates. It covers the final delivery steps after all implementation and verification is complete.
|
|
@@ -5,6 +5,8 @@ model: Gemini 3.1 Pro
|
|
|
5
5
|
tools: ['search/changes', 'search/codebase', 'edit/editFiles', 'web/fetch', 'read/problems', 'execute/getTerminalOutput', 'execute/runInTerminal', 'read/terminalLastCommand', 'read/terminalSelection', 'search', 'execute/testFailure', 'search/usages']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
9
|
+
|
|
8
10
|
# API Designer
|
|
9
11
|
|
|
10
12
|
You are an API designer specializing in route architecture, endpoint conventions, request/response schemas, versioning, error handling patterns, and API documentation.
|
|
@@ -5,6 +5,8 @@ model: Claude Opus 4.6
|
|
|
5
5
|
tools: ['search/codebase', 'edit/editFiles', 'web/fetch', 'read/problems', 'search', 'search/usages', 'execute/runInTerminal', 'execute/getTerminalOutput', 'read/terminalLastCommand', 'nx-mcp-server/nx_workspace', 'nx-mcp-server/nx_project_details', 'nx-mcp-server/nx_visualize_graph']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
9
|
+
|
|
8
10
|
# Software Architect
|
|
9
11
|
|
|
10
12
|
You are a senior software architect specializing in strategic architecture decisions, roadmap planning, system design, and technology evaluation.
|
|
@@ -5,6 +5,8 @@ model: Gemini 3.1 Pro
|
|
|
5
5
|
tools: ['search/changes', 'search/codebase', 'edit/editFiles', 'web/fetch', 'read/problems', 'execute/getTerminalOutput', 'execute/runInTerminal', 'read/terminalLastCommand', 'read/terminalSelection', 'search', 'execute/testFailure', 'search/usages', 'sanity/get_schema', 'sanity/get_sanity_rules', 'sanity/list_sanity_rules', 'sanity/query_documents', 'sanity/get_document', 'sanity/create_documents_from_json', 'sanity/create_documents_from_markdown', 'sanity/patch_document_from_json', 'sanity/patch_document_from_markdown', 'sanity/deploy_schema', 'sanity/publish_documents', 'sanity/unpublish_documents', 'sanity/discard_drafts', 'sanity/list_projects', 'sanity/list_datasets', 'sanity/list_workspace_schemas', 'sanity/list_embeddings_indices', 'sanity/search_docs', 'sanity/read_docs', 'sanity/semantic_search', 'sanity/migration_guide', 'sanity/create_version', 'sanity/generate_image', 'sanity/transform_image', 'sanity/add_cors_origin']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
9
|
+
|
|
8
10
|
# Content Engineer
|
|
9
11
|
|
|
10
12
|
You are a content engineer specializing in CMS schema design, content queries, content modeling, plugin development, and studio customization.
|
|
@@ -5,6 +5,8 @@ model: GPT-5 mini
|
|
|
5
5
|
tools: ['search/codebase', 'edit/editFiles', 'web/fetch', 'search', 'read/problems', 'search/usages', 'sanity/get_schema', 'sanity/query_documents', 'sanity/get_document', 'sanity/patch_document_from_json', 'sanity/patch_document_from_markdown', 'sanity/list_datasets', 'sanity/list_projects', 'resend/send-email']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
9
|
+
|
|
8
10
|
# Copywriter
|
|
9
11
|
|
|
10
12
|
You are a copywriter specializing in user-facing text for web applications — UI microcopy, marketing copy, email content, SEO text, error messages, and content polish.
|
|
@@ -5,6 +5,8 @@ model: GPT-5.3-Codex
|
|
|
5
5
|
tools: ['search/changes', 'search/codebase', 'edit/editFiles', 'web/fetch', 'read/problems', 'execute/getTerminalOutput', 'execute/runInTerminal', 'read/terminalLastCommand', 'read/terminalSelection', 'search', 'execute/testFailure', 'search/usages', 'sanity/get_schema', 'sanity/query_documents', 'sanity/create_documents_from_json', 'sanity/patch_document_from_json', 'sanity/get_document', 'sanity/list_datasets', 'sanity/list_projects']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
9
|
+
|
|
8
10
|
# Data Expert
|
|
9
11
|
|
|
10
12
|
You are an expert in building ETL pipelines, web scrapers, data processors, and CLI tools for data ingestion.
|
|
@@ -5,6 +5,8 @@ model: Gemini 3.1 Pro
|
|
|
5
5
|
tools: ['search/changes', 'search/codebase', 'edit/editFiles', 'web/fetch', 'read/problems', 'execute/getTerminalOutput', 'execute/runInTerminal', 'read/terminalLastCommand', 'read/terminalSelection', 'search', 'execute/testFailure', 'search/usages', 'supabase/apply_migration', 'supabase/execute_sql', 'supabase/list_tables', 'supabase/list_migrations', 'supabase/list_extensions', 'supabase/get_logs', 'supabase/get_project', 'supabase/get_project_url', 'supabase/list_projects', 'supabase/search_docs', 'supabase/generate_typescript_types', 'supabase/get_advisors', 'supabase/create_branch', 'supabase/list_branches']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
9
|
+
|
|
8
10
|
# Database Engineer
|
|
9
11
|
|
|
10
12
|
You are a database engineer specializing in schema design, migrations, row-level security, performance optimization, and auth integration.
|
|
@@ -5,6 +5,8 @@ model: Gemini 3.1 Pro
|
|
|
5
5
|
tools: ['search/changes', 'search/codebase', 'edit/editFiles', 'web/fetch', 'vscode/getProjectSetupInfo', 'vscode/installExtension', 'vscode/newWorkspace', 'vscode/runCommand', 'read/problems', 'execute/getTerminalOutput', 'execute/runInTerminal', 'read/terminalLastCommand', 'read/terminalSelection', 'search', 'execute/testFailure', 'search/usages', 'nx-mcp-server/nx_project_details', 'nx-mcp-server/nx_workspace', 'nx-mcp-server/nx_generators']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
9
|
+
|
|
8
10
|
# Developer
|
|
9
11
|
|
|
10
12
|
You are a full-stack developer specializing in building pages, components, routing, layouts, API routes, server-side logic, and feature implementation.
|
|
@@ -5,6 +5,8 @@ model: GPT-5.3-Codex
|
|
|
5
5
|
tools: ["search/changes", "search/codebase", "edit/editFiles", "web/fetch", "vscode/getProjectSetupInfo", "vscode/installExtension", "vscode/newWorkspace", "vscode/runCommand", "read/problems", "execute/getTerminalOutput", "execute/runInTerminal", "read/terminalLastCommand", "read/terminalSelection", "search", "execute/testFailure", "search/usages", "vercel/deploy_to_vercel", "vercel/get_deployment", "vercel/get_deployment_build_logs", "vercel/get_project", "vercel/get_runtime_logs", "vercel/list_deployments", "vercel/list_projects", "vercel/list_teams", "vercel/search_vercel_documentation", "vercel/check_domain_availability_and_price", "nx-mcp-server/nx_project_details", "nx-mcp-server/nx_workspace", "nx-mcp-server/nx_workspace_path"]
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
9
|
+
|
|
8
10
|
# DevOps Expert
|
|
9
11
|
|
|
10
12
|
You are a DevOps expert specializing in Vercel deployments, CI/CD pipelines, cron jobs, security headers, caching strategies, and build optimization.
|
|
@@ -5,6 +5,8 @@ model: GPT-5 mini
|
|
|
5
5
|
tools: ['search/codebase', 'edit/editFiles', 'web/fetch', 'search', 'read/problems']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
9
|
+
|
|
8
10
|
# Documentation Writer
|
|
9
11
|
|
|
10
12
|
You are a technical documentation specialist. You maintain project documentation, roadmaps, architecture records, and technical guides.
|
|
@@ -5,6 +5,8 @@ model: Gemini 3.1 Pro
|
|
|
5
5
|
tools: ['search/changes', 'search/codebase', 'edit/editFiles', 'web/fetch', 'read/problems', 'execute/getTerminalOutput', 'execute/runInTerminal', 'read/terminalLastCommand', 'read/terminalSelection', 'search', 'execute/testFailure', 'search/usages', 'chrome-devtools/*', 'nx-mcp-server/nx_project_details', 'nx-mcp-server/nx_workspace']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
9
|
+
|
|
8
10
|
# Performance Expert
|
|
9
11
|
|
|
10
12
|
You are an expert in frontend and backend performance optimization.
|
|
@@ -5,6 +5,8 @@ model: GPT-5.3-Codex
|
|
|
5
5
|
tools: ['search/changes', 'search/codebase', 'edit/editFiles', 'web/fetch', 'read/problems', 'execute/getTerminalOutput', 'execute/runInTerminal', 'read/terminalLastCommand', 'read/terminalSelection', 'search', 'execute/testFailure', 'search/usages', 'vercel/get_deployment', 'vercel/get_deployment_build_logs', 'vercel/get_runtime_logs', 'vercel/list_deployments', 'vercel/list_projects', 'nx-mcp-server/nx_project_details', 'nx-mcp-server/nx_workspace', 'nx-mcp-server/nx_workspace_path']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
9
|
+
|
|
8
10
|
# Release Manager
|
|
9
11
|
|
|
10
12
|
You are a release manager responsible for pre-release verification, changelog generation, version management, regression checks, and coordinating the release process.
|
|
@@ -5,6 +5,8 @@ model: GPT-5 mini
|
|
|
5
5
|
tools: ['search/codebase', 'search/textSearch', 'search/fileSearch', 'search/usages', 'read/readFile', 'search/listDirectory', 'web/fetch', 'execute/runInTerminal', 'read/terminalLastCommand']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
9
|
+
|
|
8
10
|
# Researcher
|
|
9
11
|
|
|
10
12
|
You are a codebase exploration specialist. Your job is to **find information, map patterns, and report back** — never to implement changes. You are the team's scout: fast, thorough, and focused on delivering actionable intelligence.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
2
|
+
|
|
1
3
|
```chatagent
|
|
2
4
|
---
|
|
3
5
|
description: 'Mandatory fast reviewer that validates every agent delegation output before acceptance. Checks acceptance criteria, file partitions, regressions, type safety, and security basics.'
|
|
@@ -5,6 +5,8 @@ model: Claude Opus 4.6
|
|
|
5
5
|
tools: ["search/changes", "search/codebase", "edit/editFiles", "web/fetch", "vscode/getProjectSetupInfo", "vscode/installExtension", "vscode/newWorkspace", "vscode/runCommand", "read/problems", "execute/getTerminalOutput", "execute/runInTerminal", "read/terminalLastCommand", "read/terminalSelection", "search", "execute/testFailure", "search/usages", "supabase/execute_sql", "supabase/list_tables", "supabase/get_advisors", "supabase/list_migrations", "supabase/get_project"]
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
9
|
+
|
|
8
10
|
# Security Expert
|
|
9
11
|
|
|
10
12
|
You are a security expert specializing in authentication, authorization, security headers, input validation, API security, and vulnerability management for Next.js applications with Supabase.
|
|
@@ -5,6 +5,8 @@ model: GPT-5 mini
|
|
|
5
5
|
tools: ['search/changes', 'search/codebase', 'edit/editFiles', 'web/fetch', 'read/problems', 'execute/getTerminalOutput', 'execute/runInTerminal', 'read/terminalLastCommand', 'search', 'search/usages', 'chrome-devtools/*']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
9
|
+
|
|
8
10
|
# SEO Specialist
|
|
9
11
|
|
|
10
12
|
You are an SEO specialist focused on technical SEO implementation — meta tags, structured data, sitemaps, Open Graph, crawlability, and search performance for web applications.
|
|
@@ -71,6 +71,8 @@ handoffs:
|
|
|
71
71
|
send: true
|
|
72
72
|
---
|
|
73
73
|
|
|
74
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
75
|
+
|
|
74
76
|
# Team Lead
|
|
75
77
|
|
|
76
78
|
You are a **team lead and task orchestrator**. You do **not** implement code yourself. Your role is to:
|
|
@@ -5,6 +5,8 @@ model: GPT-5.3-Codex
|
|
|
5
5
|
tools: ['search/changes', 'search/codebase', 'edit/editFiles', 'web/fetch', 'read/problems', 'execute/getTerminalOutput', 'execute/runInTerminal', 'read/terminalLastCommand', 'read/terminalSelection', 'search', 'execute/testFailure', 'search/usages', 'chrome-devtools/*']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
9
|
+
|
|
8
10
|
# Testing Expert
|
|
9
11
|
|
|
10
12
|
You are an expert tester who validates UI changes using Chrome DevTools MCP automation and writes E2E/integration test suites.
|
|
@@ -49,7 +51,7 @@ Every test suite must cover:
|
|
|
49
51
|
- Verify server-side behavior — confirm filter changes trigger new server requests
|
|
50
52
|
- Start the dev server before browser testing
|
|
51
53
|
- Reload between major test flows to prevent stale state
|
|
52
|
-
- **MANDATORY: Test every UI change at all
|
|
54
|
+
- **MANDATORY: Test every UI change at all responsive breakpoints defined in the project's testing config — never test at desktop only. Use `mcp_chrome-devtoo_resize_page()` to switch viewports. See the browser-testing skill for exact commands and per-breakpoint checklists.**
|
|
53
55
|
|
|
54
56
|
## Critical Rules
|
|
55
57
|
|
|
@@ -5,6 +5,8 @@ model: Gemini 3.1 Pro
|
|
|
5
5
|
tools: ['search/changes', 'search/codebase', 'edit/editFiles', 'web/fetch', 'vscode/getProjectSetupInfo', 'vscode/installExtension', 'vscode/newWorkspace', 'vscode/runCommand', 'read/problems', 'execute/getTerminalOutput', 'execute/runInTerminal', 'read/terminalLastCommand', 'read/terminalSelection', 'search', 'execute/testFailure', 'search/usages', 'chrome-devtools/*']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
9
|
+
|
|
8
10
|
# UI/UX Expert
|
|
9
11
|
|
|
10
12
|
You are an expert UI/UX developer specializing in building accessible, visually consistent React components based on a design system template.
|
|
@@ -29,7 +31,7 @@ Resolve via [skill-matrix.md](.github/customizations/agents/skill-matrix.md).
|
|
|
29
31
|
## Guidelines
|
|
30
32
|
|
|
31
33
|
- Design with mobile-first responsive approach
|
|
32
|
-
- **Validate every UI change at all
|
|
34
|
+
- **Validate every UI change at all responsive breakpoints** defined in the project's testing config — load the **e2e-testing** skill (resolved via matrix) for resize commands and per-breakpoint checklists
|
|
33
35
|
- Use semantic HTML before adding ARIA
|
|
34
36
|
- Test with keyboard-only navigation
|
|
35
37
|
- Implement hover, focus, and active states for all interactive elements
|
|
@@ -38,7 +40,7 @@ Resolve via [skill-matrix.md](.github/customizations/agents/skill-matrix.md).
|
|
|
38
40
|
|
|
39
41
|
## Done When
|
|
40
42
|
|
|
41
|
-
- Components render correctly at all
|
|
43
|
+
- Components render correctly at all project-defined responsive breakpoints
|
|
42
44
|
- WCAG 2.2 AA compliance verified (keyboard navigation, contrast, semantics)
|
|
43
45
|
- Components are exported from the UI library index
|
|
44
46
|
- Hover, focus, and active states are implemented for all interactive elements
|
|
@@ -57,7 +59,7 @@ When completing a task, return a structured summary:
|
|
|
57
59
|
|
|
58
60
|
1. **Components** — List components created/modified with purpose
|
|
59
61
|
2. **Accessibility** — WCAG checks performed and results
|
|
60
|
-
3. **Responsive** — Breakpoints tested (
|
|
62
|
+
3. **Responsive** — Breakpoints tested (per project testing config)
|
|
61
63
|
4. **Visual Evidence** — Screenshots at each breakpoint
|
|
62
64
|
|
|
63
65
|
See **Base Output Contract** in `general.instructions.md` for the standard closing items (Discovered Issues + Lessons Applied).
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
2
|
+
|
|
1
3
|
# Copilot Instructions
|
|
2
4
|
|
|
3
5
|
All conventions, architecture, and project context live in `.github/instructions/`. Read those files before making changes.
|
|
@@ -3,6 +3,8 @@ description: 'AI assistant optimization techniques for efficient context usage a
|
|
|
3
3
|
applyTo: '**'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
7
|
+
|
|
6
8
|
# AI Assistant Optimization Instructions
|
|
7
9
|
|
|
8
10
|
## Batch Processing
|
|
@@ -3,6 +3,8 @@ description: 'Bootstrap the .github/customizations/ directory for a new project.
|
|
|
3
3
|
agent: Researcher
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the customizations/ directory instead. -->
|
|
7
|
+
|
|
6
8
|
# Bootstrap Project Customizations
|
|
7
9
|
|
|
8
10
|
You are setting up the AI agent framework for a new project. Your job is to **discover** the project's structure, tech stack, and configuration, then **generate** the customization files that skills reference for project-specific context.
|