- Move index.js → src/index.ts with proper types for all 4 senses - Move schema.ts → src/schema.ts - Add package.json with esbuild build script per sense - Bundle to index.js at sense root (daemon loads this) - Update sense-generator coder prompt with TypeScript conventions Fixes #224
44 lines
1.5 KiB
TypeScript
44 lines
1.5 KiB
TypeScript
export function coderPrompt({ threadId }: { threadId: string }): string {
|
|
return `Read the workflow thread for the planner's sense design: \`nerve thread ${threadId}\`
|
|
Read the nerve-dev skill for sense file structure and conventions: \`cat node_modules/@uncaged/nerve-skills/nerve-dev/SKILL.md\`
|
|
|
|
Implement the sense following the patterns from existing senses and the skill guide.
|
|
|
|
File structure for each sense:
|
|
- \`senses/<name>/src/index.ts\` — TypeScript source with proper types; import schema as \`./schema.ts\`
|
|
- \`senses/<name>/src/schema.ts\` — Drizzle schema (TypeScript)
|
|
- \`senses/<name>/migrations/\` — Drizzle migration files (at sense root, not inside src/)
|
|
- \`senses/<name>/package.json\` — with esbuild build script (see below)
|
|
- \`senses/<name>/index.js\` — bundled output generated by \`pnpm build\` (do NOT edit by hand)
|
|
|
|
package.json template for each sense:
|
|
\`\`\`json
|
|
{
|
|
"name": "sense-<name>",
|
|
"version": "0.0.1",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"build": "esbuild src/index.ts --bundle --platform=node --format=esm --outfile=index.js --packages=external"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^22.0.0",
|
|
"esbuild": "^0.27.0",
|
|
"typescript": "^5.7.0"
|
|
},
|
|
"pnpm": {
|
|
"onlyBuiltDependencies": ["esbuild"]
|
|
}
|
|
}
|
|
\`\`\`
|
|
|
|
After creating all files, run inside the sense directory:
|
|
\`\`\`
|
|
pnpm install --no-cache && pnpm build
|
|
\`\`\`
|
|
|
|
This generates the bundled \`index.js\` at the sense root that the daemon loads.
|
|
|
|
Then update nerve.yaml and run any required migrations.`;
|
|
}
|