opencastle 0.37.0 → 0.38.1
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 +1 -1
- package/dist/cli/adapters/rules-dir-base.d.ts.map +1 -1
- package/dist/cli/adapters/rules-dir-base.js +28 -4
- package/dist/cli/adapters/rules-dir-base.js.map +1 -1
- package/dist/cli/adapters/rules-dir-base.test.js +17 -1
- package/dist/cli/adapters/rules-dir-base.test.js.map +1 -1
- package/dist/cli/bootstrap-on-init.test.d.ts +2 -0
- package/dist/cli/bootstrap-on-init.test.d.ts.map +1 -0
- package/dist/cli/bootstrap-on-init.test.js +90 -0
- package/dist/cli/bootstrap-on-init.test.js.map +1 -0
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +9 -2
- package/dist/cli/init.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/adapters/rules-dir-base.test.ts +21 -1
- package/src/cli/adapters/rules-dir-base.ts +42 -6
- package/src/cli/bootstrap-on-init.test.ts +106 -0
- package/src/cli/init.ts +10 -2
- package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
- package/src/orchestrator/agents/team-lead.agent.md +1 -1
- package/src/orchestrator/customizations/agents/skill-matrix.json +11 -3
- package/src/orchestrator/plugins/astro/SKILL.md +1 -1
- package/src/orchestrator/plugins/nx/SKILL.md +7 -7
- package/src/orchestrator/plugins/strapi/SKILL.md +1 -1
- package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +1 -1
- package/src/orchestrator/skills/agent-hooks/SKILL.md +2 -2
- package/src/orchestrator/skills/api-patterns/SKILL.md +1 -1
- package/src/orchestrator/skills/context-map/SKILL.md +11 -9
- package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +1 -1
- package/src/orchestrator/skills/documentation-standards/SKILL.md +5 -2
- package/src/orchestrator/skills/fast-review/SKILL.md +8 -3
- package/src/orchestrator/skills/frontend-design/SKILL.md +0 -1
- package/src/orchestrator/skills/orchestration-protocols/SKILL.md +9 -11
- package/src/orchestrator/skills/panel-majority-vote/SKILL.md +1 -1
- package/src/orchestrator/skills/performance-optimization/SKILL.md +2 -1
- package/src/orchestrator/skills/project-consistency/SKILL.md +2 -2
- package/src/orchestrator/skills/react-development/SKILL.md +4 -7
- package/src/orchestrator/skills/security-hardening/SKILL.md +1 -1
- package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +1 -1
- package/src/orchestrator/skills/session-checkpoints/SKILL.md +2 -2
- package/src/orchestrator/skills/team-lead-reference/SKILL.md +2 -2
- package/src/orchestrator/skills/technical-writing/SKILL.md +91 -0
- package/src/orchestrator/skills/typescript-best-practices/SKILL.md +94 -0
- package/src/orchestrator/skills/unslop/SKILL.md +80 -0
- package/src/orchestrator/skills/validation-gates/REFERENCE.md +1 -1
- package/src/orchestrator/skills/validation-gates/SKILL.md +3 -3
- package/src/orchestrator/skills/writing-for-agents/SKILL.md +84 -0
|
@@ -116,11 +116,21 @@ export function createRulesDirAdapter(config: RulesDirConfig): RulesDirAdapter {
|
|
|
116
116
|
interface ConvertFileOptions {
|
|
117
117
|
alwaysApply?: boolean
|
|
118
118
|
descriptionFallback?: string
|
|
119
|
+
/**
|
|
120
|
+
* Rewrites the body before the rule is assembled.
|
|
121
|
+
*
|
|
122
|
+
* A skill's siblings land at `skills/<skill>/<NAME><ruleExt>` while the skill
|
|
123
|
+
* itself is `skills/<skill><ruleExt>`, so a pointer the source writes as
|
|
124
|
+
* `REFERENCE.md` is wrong twice over here: wrong directory and wrong
|
|
125
|
+
* extension. Fourteen skills point at a sibling this way, and on Cursor and
|
|
126
|
+
* Windsurf every one of those pointers led nowhere.
|
|
127
|
+
*/
|
|
128
|
+
rewriteBody?: (_body: string) => string
|
|
119
129
|
}
|
|
120
130
|
|
|
121
131
|
async function convertFile(
|
|
122
132
|
srcPath: string,
|
|
123
|
-
{ alwaysApply = false, descriptionFallback = '' }: ConvertFileOptions = {},
|
|
133
|
+
{ alwaysApply = false, descriptionFallback = '', rewriteBody }: ConvertFileOptions = {},
|
|
124
134
|
): Promise<string> {
|
|
125
135
|
const content = await readFile(srcPath, 'utf8')
|
|
126
136
|
const { frontmatter, body } = splitFrontmatter(content)
|
|
@@ -138,7 +148,7 @@ export function createRulesDirAdapter(config: RulesDirConfig): RulesDirAdapter {
|
|
|
138
148
|
applyTo: meta['applyTo'],
|
|
139
149
|
alwaysApply,
|
|
140
150
|
tier: meta['tier'],
|
|
141
|
-
}), '---', '', body.trim(), '']
|
|
151
|
+
}), '---', '', (rewriteBody ? rewriteBody(body) : body).trim(), '']
|
|
142
152
|
return lines.join('\n')
|
|
143
153
|
}
|
|
144
154
|
|
|
@@ -221,6 +231,26 @@ export function createRulesDirAdapter(config: RulesDirConfig): RulesDirAdapter {
|
|
|
221
231
|
}
|
|
222
232
|
}
|
|
223
233
|
|
|
234
|
+
/**
|
|
235
|
+
* Points a skill's sibling references at where this adapter actually puts them.
|
|
236
|
+
*
|
|
237
|
+
* `REFERENCE.md` and `./REFERENCE.md` both become `<skill>/REFERENCE<ruleExt>`,
|
|
238
|
+
* which covers the markdown links most skills use and the bare prose mentions
|
|
239
|
+
* a few of them use instead.
|
|
240
|
+
*/
|
|
241
|
+
function retargetSiblings(body: string, skill: string, extras: string[]): string {
|
|
242
|
+
let out = body
|
|
243
|
+
for (const extra of extras) {
|
|
244
|
+
const target = `${skill}/${ruleName(extra)}`
|
|
245
|
+
// Escaped because sibling names carry dots, and one carries two
|
|
246
|
+
// (`panel-report.template.md`), each of which would otherwise match any
|
|
247
|
+
// character and retarget text that is not a path.
|
|
248
|
+
const escaped = extra.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
249
|
+
out = out.replace(new RegExp(`(?<![\\w/-])(?:\\./)?${escaped}(?![\\w-])`, 'g'), target)
|
|
250
|
+
}
|
|
251
|
+
return out
|
|
252
|
+
}
|
|
253
|
+
|
|
224
254
|
async function convertSkills(
|
|
225
255
|
srcRoot: string,
|
|
226
256
|
destDir: string,
|
|
@@ -239,17 +269,23 @@ export function createRulesDirAdapter(config: RulesDirConfig): RulesDirAdapter {
|
|
|
239
269
|
const skillFile = resolve(skillsDir, entry.name, 'SKILL.md')
|
|
240
270
|
if (!existsSync(skillFile)) continue
|
|
241
271
|
|
|
272
|
+
// Extra files in the skill directory (e.g. templates). Resolved before the
|
|
273
|
+
// skill is written, because the skill's own pointers at them have to be
|
|
274
|
+
// rewritten to where they actually land.
|
|
275
|
+
const files = await readdir(resolve(skillsDir, entry.name))
|
|
276
|
+
const extras = files.filter((f) => f !== 'SKILL.md' && f.endsWith('.md'))
|
|
277
|
+
|
|
242
278
|
await writeConverted(
|
|
243
279
|
skillFile,
|
|
244
280
|
resolve(destDir, `${entry.name}${ruleExt}`),
|
|
245
|
-
{
|
|
281
|
+
{
|
|
282
|
+
descriptionFallback: `Skill: ${entry.name}`,
|
|
283
|
+
rewriteBody: (body) => retargetSiblings(body, entry.name, extras),
|
|
284
|
+
},
|
|
246
285
|
results,
|
|
247
286
|
overwrite,
|
|
248
287
|
)
|
|
249
288
|
|
|
250
|
-
// Extra files in the skill directory (e.g. templates)
|
|
251
|
-
const files = await readdir(resolve(skillsDir, entry.name))
|
|
252
|
-
const extras = files.filter((f) => f !== 'SKILL.md' && f.endsWith('.md'))
|
|
253
289
|
if (extras.length > 0) {
|
|
254
290
|
const subDest = resolve(destDir, entry.name)
|
|
255
291
|
await mkdir(subDest, { recursive: true })
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `init` must actually scan the project it is initialising.
|
|
3
|
+
*
|
|
4
|
+
* `bootstrapCustomizations` fills `.opencastle/` in from what the repo turned
|
|
5
|
+
* out to be: the project name, the tech-stack table, and the key-commands block
|
|
6
|
+
* that records which package manager to use. It is guarded so that a re-run
|
|
7
|
+
* cannot overwrite notes the user has since written, because its stack-config
|
|
8
|
+
* step writes unconditionally.
|
|
9
|
+
*
|
|
10
|
+
* That guard read `.opencastle/agents`, and the scaffold step eighteen lines
|
|
11
|
+
* above it creates `.opencastle/agents`. So it was true on the first run too,
|
|
12
|
+
* and the scan never executed for anybody: every marker in
|
|
13
|
+
* `project.instructions.md` stayed bare. The visible symptom was six skills
|
|
14
|
+
* hardcoding `pnpm`, having no populated file to read it from.
|
|
15
|
+
*
|
|
16
|
+
* Both halves are asserted here, because fixing the first by deleting the guard
|
|
17
|
+
* would destroy user content on the second.
|
|
18
|
+
*/
|
|
19
|
+
import { describe, it, expect, beforeEach, afterEach } from 'vitest'
|
|
20
|
+
import { execFileSync } from 'node:child_process'
|
|
21
|
+
import { mkdtempSync, rmSync, writeFileSync, readFileSync, existsSync, appendFileSync } from 'node:fs'
|
|
22
|
+
import { tmpdir } from 'node:os'
|
|
23
|
+
import { join, resolve } from 'node:path'
|
|
24
|
+
|
|
25
|
+
const repoRoot = resolve(import.meta.dirname, '..', '..')
|
|
26
|
+
const cli = join(repoRoot, 'bin', 'cli.mjs')
|
|
27
|
+
|
|
28
|
+
// `bin/cli.mjs` loads the command modules from `dist/`, so with no build these
|
|
29
|
+
// would all fail on a missing import rather than on anything they assert. CI
|
|
30
|
+
// builds before `npm test`, so nothing here is skipped there.
|
|
31
|
+
const cliBuilt = existsSync(join(repoRoot, 'dist', 'cli', 'init.js'))
|
|
32
|
+
|
|
33
|
+
function run(cwd: string, ...args: string[]): string {
|
|
34
|
+
try {
|
|
35
|
+
return execFileSync('node', [cli, ...args], { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] })
|
|
36
|
+
} catch (err) {
|
|
37
|
+
return String((err as { stdout?: string }).stdout ?? '')
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
describe.skipIf(!cliBuilt)('init scans the project it initialises', () => {
|
|
42
|
+
let projectRoot: string
|
|
43
|
+
|
|
44
|
+
beforeEach(() => {
|
|
45
|
+
projectRoot = mkdtempSync(join(tmpdir(), 'oc-bootstrap-'))
|
|
46
|
+
execFileSync('git', ['init', '-q'], { cwd: projectRoot })
|
|
47
|
+
writeFileSync(join(projectRoot, 'CLAUDE.md'), '# House rules\n')
|
|
48
|
+
writeFileSync(
|
|
49
|
+
join(projectRoot, 'package.json'),
|
|
50
|
+
JSON.stringify({
|
|
51
|
+
name: 'demo-app',
|
|
52
|
+
description: 'a demo app',
|
|
53
|
+
scripts: { dev: 'next dev', build: 'next build', test: 'vitest run', lint: 'eslint .' },
|
|
54
|
+
}),
|
|
55
|
+
)
|
|
56
|
+
// The lockfile is how the package manager is detected.
|
|
57
|
+
writeFileSync(join(projectRoot, 'pnpm-lock.yaml'), '')
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
afterEach(() => {
|
|
61
|
+
rmSync(projectRoot, { recursive: true, force: true })
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
const instructions = (): string =>
|
|
65
|
+
readFileSync(join(projectRoot, '.opencastle', 'project.instructions.md'), 'utf8')
|
|
66
|
+
|
|
67
|
+
it('records the detected package manager and its commands', () => {
|
|
68
|
+
run(projectRoot, 'init', '--yes')
|
|
69
|
+
const text = instructions()
|
|
70
|
+
expect(text).toContain('**Package manager:** `pnpm`')
|
|
71
|
+
expect(text).toContain('pnpm run test')
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
it('records what the repo is, not just what the template says', () => {
|
|
75
|
+
run(projectRoot, 'init', '--yes')
|
|
76
|
+
const text = instructions()
|
|
77
|
+
expect(text).toContain('**Project:** demo-app')
|
|
78
|
+
expect(text).toContain('**Description:** a demo app')
|
|
79
|
+
expect(text).toMatch(/\|\s*Package Manager\s*\|\s*pnpm\s*\|/)
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
it('leaves the user’s own notes alone when init is re-run', () => {
|
|
83
|
+
run(projectRoot, 'init', '--yes')
|
|
84
|
+
const stackFile = join(projectRoot, '.opencastle', 'stack', 'testing-config.md')
|
|
85
|
+
expect(existsSync(stackFile)).toBe(true)
|
|
86
|
+
appendFileSync(stackFile, '\nNOTES THE USER WROTE\n')
|
|
87
|
+
|
|
88
|
+
run(projectRoot, 'init', '--yes')
|
|
89
|
+
expect(readFileSync(stackFile, 'utf8')).toContain('NOTES THE USER WROTE')
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
it('leaves them alone after remove --keep-files, which drops only the manifest', () => {
|
|
93
|
+
run(projectRoot, 'init', '--yes')
|
|
94
|
+
const stackFile = join(projectRoot, '.opencastle', 'stack', 'testing-config.md')
|
|
95
|
+
appendFileSync(stackFile, '\nNOTES THE USER WROTE\n')
|
|
96
|
+
|
|
97
|
+
run(projectRoot, 'remove', '--keep-files', '--yes')
|
|
98
|
+
// No manifest means `isReinit` is false, so only the directory check stands
|
|
99
|
+
// between the user's notes and bootstrap's unconditional writes.
|
|
100
|
+
expect(existsSync(join(projectRoot, '.opencastle', 'manifest.json'))).toBe(false)
|
|
101
|
+
expect(existsSync(join(projectRoot, '.opencastle', 'agents'))).toBe(true)
|
|
102
|
+
|
|
103
|
+
run(projectRoot, 'init', '--yes')
|
|
104
|
+
expect(readFileSync(stackFile, 'utf8')).toContain('NOTES THE USER WROTE')
|
|
105
|
+
})
|
|
106
|
+
})
|
package/src/cli/init.ts
CHANGED
|
@@ -495,6 +495,14 @@ export default async function init({ pkgRoot, args }: CliContext): Promise<void>
|
|
|
495
495
|
}
|
|
496
496
|
|
|
497
497
|
// ── Scaffold customizations to .opencastle/ ──────────────────────────────
|
|
498
|
+
// Sampled before the copy below, which creates `.opencastle/agents` itself.
|
|
499
|
+
// Read after it, this was true on every run including the first, so the
|
|
500
|
+
// bootstrap guard downstream never let the project scan execute at all: no
|
|
501
|
+
// tech-stack table, no key commands, not even the project name. Every skill
|
|
502
|
+
// that wanted the package manager hardcoded one instead, because the file
|
|
503
|
+
// that was supposed to record it was never filled in.
|
|
504
|
+
const alreadyScaffolded = existsSync(resolve(projectRoot, '.opencastle', 'agents'))
|
|
505
|
+
|
|
498
506
|
const custSrcDir = resolve(getOrchestratorRoot(pkgRoot), 'customizations')
|
|
499
507
|
if (existsSync(custSrcDir)) {
|
|
500
508
|
const custDestDir = resolve(projectRoot, '.opencastle')
|
|
@@ -516,8 +524,8 @@ export default async function init({ pkgRoot, args }: CliContext): Promise<void>
|
|
|
516
524
|
// the manifest, by design) and a manifest with merge-conflict markers, which
|
|
517
525
|
// `readManifest` reports as "no install". Both then ran bootstrap's
|
|
518
526
|
// unconditional renames over a populated `.opencastle/` and replaced the
|
|
519
|
-
// user's own stack notes with a blank template.
|
|
520
|
-
|
|
527
|
+
// user's own stack notes with a blank template. `alreadyScaffolded` is
|
|
528
|
+
// sampled above, before the scaffold step supplies its own answer.
|
|
521
529
|
const bootstrapResult = isReinit || alreadyScaffolded
|
|
522
530
|
? { populated: [], removed: [], renamed: [] }
|
|
523
531
|
: await bootstrapCustomizations(projectRoot, combinedRepoInfo, stack)
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
"hash": "
|
|
2
|
+
"hash": "e372da9f",
|
|
3
3
|
"configHash": "30f8ea04",
|
|
4
|
-
"lockfileHash": "
|
|
5
|
-
"browserHash": "
|
|
4
|
+
"lockfileHash": "0c747fc2",
|
|
5
|
+
"browserHash": "69a1f03f",
|
|
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": "213cb247",
|
|
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": "f660feae",
|
|
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": "c1a1f686",
|
|
23
23
|
"needsInterop": true
|
|
24
24
|
}
|
|
25
25
|
},
|
|
@@ -59,7 +59,7 @@ Developer | UI/UX Expert | Content Engineer | Data Engineer | Testing Expert | S
|
|
|
59
59
|
|
|
60
60
|
## Delegation
|
|
61
61
|
|
|
62
|
-
**Sub-agents
|
|
62
|
+
**Sub-agents**: synchronous, critical-path, dispatched through whichever sub-agent mechanism the assistant exposes. **Background agents**: async in isolated worktrees, parallel work. Always name agent explicitly. Include: issue ID, objective, file paths, acceptance criteria, self-improvement reminder.
|
|
63
63
|
|
|
64
64
|
**⛔ Hard gates:**
|
|
65
65
|
- Log delegation record immediately after each return/spawn — **observability-logging** (`--mechanism sub-agent` or `--mechanism background`).
|
|
@@ -39,6 +39,9 @@
|
|
|
39
39
|
],
|
|
40
40
|
"testing-workflow": [
|
|
41
41
|
"e2e-testing"
|
|
42
|
+
],
|
|
43
|
+
"technical-writing": [
|
|
44
|
+
"unslop"
|
|
42
45
|
]
|
|
43
46
|
},
|
|
44
47
|
"bindings": {
|
|
@@ -113,7 +116,8 @@
|
|
|
113
116
|
"react-development",
|
|
114
117
|
"api-patterns",
|
|
115
118
|
"documentation-standards",
|
|
116
|
-
"security-hardening"
|
|
119
|
+
"security-hardening",
|
|
120
|
+
"typescript-best-practices"
|
|
117
121
|
]
|
|
118
122
|
},
|
|
119
123
|
"Data Engineer": {
|
|
@@ -181,7 +185,9 @@
|
|
|
181
185
|
"knowledge-management"
|
|
182
186
|
],
|
|
183
187
|
"directSkills": [
|
|
184
|
-
"documentation-standards"
|
|
188
|
+
"documentation-standards",
|
|
189
|
+
"technical-writing",
|
|
190
|
+
"writing-for-agents"
|
|
185
191
|
]
|
|
186
192
|
},
|
|
187
193
|
"Writer": {
|
|
@@ -194,7 +200,9 @@
|
|
|
194
200
|
"documentation-standards",
|
|
195
201
|
"validation-gates",
|
|
196
202
|
"seo-patterns",
|
|
197
|
-
"code-commenting"
|
|
203
|
+
"code-commenting",
|
|
204
|
+
"technical-writing",
|
|
205
|
+
"unslop"
|
|
198
206
|
]
|
|
199
207
|
},
|
|
200
208
|
"DevOps & Release": {
|
|
@@ -27,6 +27,6 @@ Docs: https://docs.astro.build
|
|
|
27
27
|
1. Declare it in `src/content.config.ts` via `defineCollection` + Zod schema; export from `collections`.
|
|
28
28
|
2. Add `src/content/<name>/` with one sample file.
|
|
29
29
|
3. Query with `getCollection('<name>', filterFn)`.
|
|
30
|
-
4.
|
|
30
|
+
4. The build must exit zero — collection types are generated at build time, so type errors only surface after a build.
|
|
31
31
|
|
|
32
32
|
Integrations: `astro add react tailwind mdx sitemap` etc. — never hand-edit the integrations array.
|
|
@@ -17,13 +17,13 @@ npm test | npm run test | npm run lint | npm run build | npm run dev | npm start
|
|
|
17
17
|
npx jest | npx eslint | jest --coverage | eslint --fix
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Always `
|
|
20
|
+
Always `npx nx run <project>:<target>` for one project, `npx nx affected -t <target>` for multi-project changes.
|
|
21
21
|
|
|
22
22
|
## Requirements
|
|
23
23
|
|
|
24
24
|
- Minimum coverage **95%** for new components/functions. Reports land in `reports/coverage/jest/`.
|
|
25
|
-
- Lint always with `--fix`. CSS/SCSS uses a separate target: `
|
|
26
|
-
- `
|
|
25
|
+
- Lint always with `--fix`. CSS/SCSS uses a separate target: `npx nx run <project>:lint-styles --fix`.
|
|
26
|
+
- `npx nx run <project>:test -u` updates snapshots. `npx nx format --fix` after any generation.
|
|
27
27
|
|
|
28
28
|
## MCP tools — query, don't guess
|
|
29
29
|
|
|
@@ -44,15 +44,15 @@ Always `yarn nx run <project>:<target>` for one project, `yarn nx affected -t <t
|
|
|
44
44
|
Prefer **local** generators over plugin generators — they encode repo conventions. Manual file creation is a last resort after `nx_generators` and `nx_available_plugins` both come up empty. Read `nx_generator_schema`, then read the generator source for side effects (config edits, dep installs).
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
npx nx generate <generator> <options> --dry-run --no-interactive # preview
|
|
48
|
+
npx nx generate <generator> <options> --no-interactive
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
- **`--no-interactive` is mandatory** — prompts hang the run with no output.
|
|
52
52
|
- **Verify cwd first** — generators derive file placement from it.
|
|
53
53
|
|
|
54
|
-
After generating: `
|
|
54
|
+
After generating: `npx nx format --fix`, then lint/test/build the affected projects.
|
|
55
55
|
|
|
56
56
|
## Running tasks
|
|
57
57
|
|
|
58
|
-
Check `nx_current_running_tasks_details` before starting anything. **Continuous targets (`serve`, `dev`) are already running — read their output instead of re-running.** To rerun, use `
|
|
58
|
+
Check `nx_current_running_tasks_details` before starting anything. **Continuous targets (`serve`, `dev`) are already running — read their output instead of re-running.** To rerun, use `npx nx run <taskId>` so NX context is preserved.
|
|
@@ -32,4 +32,4 @@ Strapi discovers code by path — a correct file in the wrong place is simply ig
|
|
|
32
32
|
|
|
33
33
|
## Verify
|
|
34
34
|
|
|
35
|
-
`
|
|
35
|
+
the `develop` script, confirm the type appears in admin, create a test entry, then assert `GET /api/<type>?pagination[page]=1` returns 200 with a `data` array and `GET /api/<type>?populate=*` returns the expected relations. Schema errors surface under the `build` script.
|
|
@@ -30,7 +30,7 @@ Log delegation: `opencastle log --type=delegation --issue=TAS-123 --status=start
|
|
|
30
30
|
|---|--------|---------|
|
|
31
31
|
| 1 | Log completion | `opencastle log --type=delegation --issue=TAS-XX --status=complete` |
|
|
32
32
|
| 2 | Fast review | `opencastle log --type=review --issue=TAS-XX --verdict=PASS` |
|
|
33
|
-
| 3 | CI checks |
|
|
33
|
+
| 3 | CI checks | Lint, typecheck, and test (commands via the **codebase-tool** slot) |
|
|
34
34
|
| 4 | Verify ACs | Check each acceptance criterion against tracker issue |
|
|
35
35
|
| 5 | Track issues | `rg -n "Discovered issue" KNOWN-ISSUES.md || gh issue create` |
|
|
36
36
|
| 6 | Lesson check | If agent retried, verify lesson added via **self-improvement** |
|
|
@@ -55,7 +55,7 @@ See [HOOKS-REFERENCE.md](HOOKS-REFERENCE.md) for extended startup checks (approv
|
|
|
55
55
|
| 5 | Prompt includes "Read LESSONS-LEARNED.md first" |
|
|
56
56
|
| 6 | 5+ files → load **context-map** skill |
|
|
57
57
|
|
|
58
|
-
All 6 must pass before
|
|
58
|
+
All 6 must pass before the sub-agent is dispatched. See [HOOKS-REFERENCE.md](HOOKS-REFERENCE.md) for example commands per check.
|
|
59
59
|
|
|
60
60
|
## on-post-delegate — Team Lead only
|
|
61
61
|
|
|
@@ -63,7 +63,7 @@ All 6 must pass before `runSubagent`. See [HOOKS-REFERENCE.md](HOOKS-REFERENCE.m
|
|
|
63
63
|
|---|--------|
|
|
64
64
|
| 1 | **⛔** `opencastle log --type=delegation --issue=TAS-XX --status=complete` |
|
|
65
65
|
| 2 | Run **fast-review** skill |
|
|
66
|
-
| 3 |
|
|
66
|
+
| 3 | Lint, typecheck, and test (commands via the **codebase-tool** slot) |
|
|
67
67
|
| 4 | `gh issue view TAS-XX --json body -q '.body'` — verify each AC met |
|
|
68
68
|
| 5 | If agent retried → verify lesson added via **self-improvement** |
|
|
69
69
|
| 6 | Move to Done or re-delegate; 3rd failure → `.opencastle/AGENT-FAILURES.md` |
|
|
@@ -5,7 +5,7 @@ description: "Creates API route handlers, implements Server Actions with Zod sch
|
|
|
5
5
|
|
|
6
6
|
# API Patterns
|
|
7
7
|
|
|
8
|
-
Project-specific config:
|
|
8
|
+
Project-specific config: `.opencastle/stack/api-config.md`.
|
|
9
9
|
|
|
10
10
|
## Architecture
|
|
11
11
|
|
|
@@ -23,17 +23,19 @@ Identify files that MUST change from task description.
|
|
|
23
23
|
|
|
24
24
|
### 2 — Trace Outward (dependents)
|
|
25
25
|
Find consumers of entry-point exports:
|
|
26
|
+
```bash
|
|
27
|
+
rg -n "import .*from .*libs/auth" # find importers
|
|
28
|
+
rg -n "\bAuthCard\b" --type ts --type tsx # find component consumers
|
|
29
|
+
rg -n "auth.*route|/auth" # find route references
|
|
26
30
|
```
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
grep_search("places.*route|/places", isRegexp=true) # find route references
|
|
30
|
-
```
|
|
31
|
+
If the assistant exposes a code-usage lookup (find-references), prefer it for
|
|
32
|
+
symbols: it resolves re-exports and aliases that a text search misses.
|
|
31
33
|
|
|
32
34
|
### 3 — Trace Inward (sources)
|
|
33
35
|
Find what entry points depend on:
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
```bash
|
|
37
|
+
rg -n "from .*libs/" src/auth/ # shared lib deps
|
|
38
|
+
rg -n "from .*config" src/auth/ # config deps
|
|
37
39
|
```
|
|
38
40
|
|
|
39
41
|
### 4 — Build the Map
|
|
@@ -59,11 +61,11 @@ Context Map — Feature: Add priceRange
|
|
|
59
61
|
- src/components/Account/**
|
|
60
62
|
```
|
|
61
63
|
|
|
62
|
-
Validation checkpoint: every
|
|
64
|
+
Validation checkpoint: every search hit lands in the map; all listed files open without errors (typecheck via the **codebase-tool** slot). Full template, depth levels, partition derivation, Team Lead integration: see [REFERENCE.md](./REFERENCE.md).
|
|
63
65
|
|
|
64
66
|
## Anti-Patterns
|
|
65
67
|
|
|
66
68
|
- Skipping for "obvious" tasks — shared libs cascade unexpectedly
|
|
67
|
-
- Guessing dependencies instead of
|
|
69
|
+
- Guessing dependencies instead of searching for them
|
|
68
70
|
- Over-mapping a 2-file fix
|
|
69
71
|
- Using a stale map after plan changes
|
|
@@ -5,7 +5,7 @@ description: "Configures deployment pipelines, manages environment variables, sc
|
|
|
5
5
|
|
|
6
6
|
# Deployment Infrastructure
|
|
7
7
|
|
|
8
|
-
See
|
|
8
|
+
See `.opencastle/stack/deployment-config.md` for full architecture, env vars, cron jobs, caching headers.
|
|
9
9
|
|
|
10
10
|
## Environment Variables
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ description: "Scaffolds issue docs, ADRs, README outlines, changelog entries, ro
|
|
|
5
5
|
|
|
6
6
|
# Documentation Standards
|
|
7
7
|
|
|
8
|
-
Project directory structure and practices:
|
|
8
|
+
Project directory structure and practices: `.opencastle/project/docs-structure.md`. Writing guidelines, formatting rules, anti-patterns: `WRITING-GUIDE.md`, beside this file.
|
|
9
9
|
|
|
10
10
|
## Templates
|
|
11
11
|
|
|
@@ -23,6 +23,9 @@ One concern per diagram, max 10–12 nodes. `flowchart TD` for pipelines, `LR` f
|
|
|
23
23
|
|
|
24
24
|
## Validate
|
|
25
25
|
|
|
26
|
+
Check links and formatting before committing docs. Resolve the formatter
|
|
27
|
+
command via the **codebase-tool** slot; the link checker is standalone:
|
|
28
|
+
|
|
26
29
|
```bash
|
|
27
|
-
npx markdown-link-check docs/**/*.md
|
|
30
|
+
npx markdown-link-check docs/**/*.md
|
|
28
31
|
```
|
|
@@ -23,10 +23,15 @@ Issue + acceptance criteria, file diff, file partition, deterministic results (l
|
|
|
23
23
|
|
|
24
24
|
### 2 — Spawn Reviewer
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
One sub-agent, dispatched as the Reviewer. Context = acceptance criteria, diff, partition, deterministic results **only** — no session history, no delegation prompt.
|
|
27
27
|
|
|
28
|
-
```
|
|
29
|
-
|
|
28
|
+
```
|
|
29
|
+
Agent: Reviewer
|
|
30
|
+
Review against these acceptance criteria:
|
|
31
|
+
[criteria]
|
|
32
|
+
Diff:
|
|
33
|
+
[diff]
|
|
34
|
+
Deterministic gates: lint ✅ test ✅ build ✅
|
|
30
35
|
```
|
|
31
36
|
|
|
32
37
|
Full reviewer prompt template: [REFERENCE.md](REFERENCE.md).
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: frontend-design
|
|
3
3
|
description: "Defines named visual aesthetic, selects typography pairings, builds CSS token systems, adds entrance animations for high-design-quality pages. Use when user asks to design landing page, style marketing site, create distinctive UI theme, pick fonts, or add CSS animations — specifically when visual polish, brand identity matter rather than generic component scaffolding."
|
|
4
|
-
license: Complete terms in LICENSE.txt
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
@@ -99,15 +99,13 @@ opencastle convoy retry
|
|
|
99
99
|
|
|
100
100
|
**Post-run verification (copy-paste checks):**
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
echo "convoy failed — inspect .opencastle/convoy.log" \
|
|
105
|
-
&& tail -n 200 .opencastle/convoy.log && exit 1
|
|
106
|
-
fi
|
|
107
|
-
|
|
108
|
-
npx opencastle convoy
|
|
102
|
+
Convoy records to `.opencastle/convoy.db` and `.opencastle/logs/`; there is no
|
|
103
|
+
plain-text run log to tail.
|
|
109
104
|
|
|
110
|
-
|
|
105
|
+
```bash
|
|
106
|
+
opencastle convoy --json # last run's status, machine-readable
|
|
107
|
+
opencastle convoy run --status # current convoy state from convoy.db
|
|
108
|
+
tail -n 50 .opencastle/logs/events.ndjson | jq -c 'select(.outcome != "success")'
|
|
111
109
|
```
|
|
112
110
|
|
|
113
111
|
## Validation & Verification Checkpoints
|
|
@@ -115,9 +113,9 @@ grep -i "error\|failed" .opencastle/convoy.log || echo "no obvious errors in log
|
|
|
115
113
|
| Phase | Check | Command / Action |
|
|
116
114
|
|-------|-------|-----------------|
|
|
117
115
|
| Pre-spawn | Inputs present (task, scope, ACs) | `test -s convoy.yml \|\| exit 1` |
|
|
118
|
-
| During-run |
|
|
119
|
-
| Pre-merge |
|
|
120
|
-
|
|
|
116
|
+
| During-run | Watch for failures | `opencastle convoy run --status` |
|
|
117
|
+
| Pre-merge | No task left failed or gate-failed | `opencastle convoy --json \| jq -e '.failed == 0'` |
|
|
118
|
+
| Dead letters | Queue is empty | `opencastle convoy run --dlq-list` |
|
|
121
119
|
| Post-merge | Lint + smoke tests pass | `npm run lint && npm test -- -t "smoke"` |
|
|
122
120
|
| Blocker | Any failure | Block merge; reopen to original researcher(s) |
|
|
123
121
|
|
|
@@ -20,7 +20,7 @@ description: "Runs 3 isolated reviewer sub-agents; consolidates PASS/BLOCK verdi
|
|
|
20
20
|
|
|
21
21
|
1. **Validate scope** — every artifact path under `<runRoot>`; list sufficient to answer question.
|
|
22
22
|
|
|
23
|
-
2. **Spawn 3 reviewers in parallel** — three
|
|
23
|
+
2. **Spawn 3 reviewers in parallel** — three sub-agent dispatches with identical prompts (same question, artifact list, constraints), each isolated. Required reviewer output sections (no others): `VERDICT: PASS | BLOCK`, `MUST-FIX:`, `SHOULD-FIX:`, `QUESTIONS:`, `TEST IDEAS:`, `CONFIDENCE: low | med | high`.
|
|
24
24
|
|
|
25
25
|
3. **Persist outputs** — write `<panelDir>/<panelKey>-reviewer-outputs.md` with a header (run root, panel key, question, artifacts) and each reviewer output verbatim, separated.
|
|
26
26
|
|
|
@@ -11,11 +11,12 @@ Measure before changing anything. Add `React.memo`/`useMemo`/`useCallback` only
|
|
|
11
11
|
|
|
12
12
|
- Node: async APIs only — never `readFileSync` or other sync I/O on a request path.
|
|
13
13
|
- Debounce input-driven fetches at 300 ms.
|
|
14
|
+
- INP replaced FID as a Core Web Vital in March 2024: budget it at ≤200 ms, and measure every interaction, not just the first.
|
|
14
15
|
- Profile Node with `clinic.js` or `node --inspect`; profile React with `<Profiler onRender>` or the DevTools Profiler.
|
|
15
16
|
|
|
16
17
|
## Profiling Workflow
|
|
17
18
|
|
|
18
|
-
1. Lighthouse (or the CI perf job) for a baseline; name the failing metric (LCP/CLS/
|
|
19
|
+
1. Lighthouse (or the CI perf job) for a baseline; name the failing metric (LCP/CLS/INP/TTI). Lighthouse emulates mobile by default; pass `--preset=desktop` when the regression is desktop-only.
|
|
19
20
|
2. Profile to locate the hotspot call stacks / long tasks.
|
|
20
21
|
3. Apply the minimal fix (code-split, memoize, shrink payloads, defer non-critical work); confirm in the profiler that the measured hotspot actually shrank.
|
|
21
22
|
4. Re-run Lighthouse / the CI perf job. Ship only at ≥10% improvement or once inside budget.
|
|
@@ -22,7 +22,7 @@ Phase 1 (sequential): `foundation-setup` creates tokens, Layout, UI library, sty
|
|
|
22
22
|
|
|
23
23
|
**Validation checkpoints:**
|
|
24
24
|
1. Foundation complete: `tokens.css` has all palette/type/spacing vars, Layout renders, UI components compile.
|
|
25
|
-
2. Per-page: `grep -
|
|
25
|
+
2. Per-page: `grep -rF 'style={{' src/pages/` returns 0 hits (no inline styles). All imports resolve.
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
@@ -50,7 +50,7 @@ Prompt templates: see [TEMPLATES.md](./TEMPLATES.md).
|
|
|
50
50
|
--color-primary-600: #0284c7;
|
|
51
51
|
|
|
52
52
|
/* Typography */
|
|
53
|
-
--font-base:
|
|
53
|
+
--font-base: Inter, system-ui, -apple-system, sans-serif;
|
|
54
54
|
--text-sm: 0.875rem;
|
|
55
55
|
--text-base: 1rem;
|
|
56
56
|
|
|
@@ -11,16 +11,13 @@ description: "Enforces React-specific patterns: functional components with hooks
|
|
|
11
11
|
- Export the props type as `ComponentNameProps`; PascalCase component names.
|
|
12
12
|
- Styling: CSS Modules (`.module.scss`), Sass variables/mixins pulled from the shared libraries, CSS custom properties for theming.
|
|
13
13
|
- `strict` stays enabled in `tsconfig.json`; no `as` casts.
|
|
14
|
-
- Tests: React Testing Library on
|
|
14
|
+
- Tests: React Testing Library on the runner bound to the **testing** capability slot, mocking external deps and API calls.
|
|
15
15
|
|
|
16
16
|
## Verification
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
pnpm test # single test: pnpm test -- -t <name>
|
|
22
|
-
pnpm build
|
|
23
|
-
```
|
|
18
|
+
Lint, typecheck, test, and build must all exit zero. Resolve the exact commands
|
|
19
|
+
via the **codebase-tool** slot; `.opencastle/project.instructions.md` records the
|
|
20
|
+
project's package manager and script names.
|
|
24
21
|
|
|
25
22
|
## Security
|
|
26
23
|
|
|
@@ -32,4 +32,4 @@ Cron routes: require `authorization: Bearer ${process.env.CRON_SECRET}`, else re
|
|
|
32
32
|
|
|
33
33
|
Zod schema validation on every Server Action and route handler before any DB operation; React Hook Form client-side.
|
|
34
34
|
|
|
35
|
-
Cross-reference:
|
|
35
|
+
Cross-reference: the **api-patterns** skill for Server Action patterns; the **session-checkpoints** skill for checkpointing security-sensitive work.
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|----------|---------|-----------|----------|-----------|
|
|
34
34
|
| slack | C0AHAQFJ7C1 | 1772393542.345149 | Run migration on production? | 2026-03-01 14:30 |
|
|
35
35
|
|
|
36
|
-
Remove row once answered (
|
|
36
|
+
Remove row once answered (a reply in chat counts as resolved).
|
|
37
37
|
|
|
38
38
|
## Decisions & Blockers
|
|
39
39
|
|