create_track
Create a new conductor track directory with plan.md, index.md, and metadata.json. Prevents duplicate creation by failing if the slug already exists.
Instructions
Create a new conductor track directory with plan.md, index.md, and metadata.json. Fails if the slug already exists.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | ||
| title | Yes | ||
| type | No | ||
| owner | No |
Implementation Reference
- src/managers/ConductorManager.ts:117-148 (handler)The core business logic for create_track. It validates the slug, generates plan.md, index.md, and metadata.json content, then delegates to FileSystemAccess.createTrackDir to write files to disk.
async function createTrack( slug: string, title: string, type: string = 'feature', owner: string = 'platform-team', ): Promise<CreateTrackResult> { assertSafeSlug(slug); const today = new Date().toISOString().slice(0, 10); const plan = `# Plan — ${slug}\n\n**Status:** 🟡 In Progress\n**Phase:** Initial\n\n## Phases\n\n### Phase 1 — ${title}\n- [ ] TODO\n`; const index = `# ${title}\n\n**Status:** In Progress\n**Track Type:** ${type}\n\n## Summary\n\n${title}\n`; const metadata = JSON.stringify( { id: slug, title, type, status: 'active', owner, created: today, completed: '', template: '', governanceArtifact: '', dependencies: [], }, null, 2, ) + '\n'; const files = { 'plan.md': plan, 'index.md': index, 'metadata.json': metadata }; await fs.createTrackDir(tracksDir, slug, files); return { slug, created: true, files: Object.keys(files) }; } - src/tools/conductor.tool.ts:50-55 (schema)Zod schema for create_track inputs: slug (required), title (required), type (optional), owner (optional).
export const CreateTrackSchema = z.object({ slug: z.string().min(1), title: z.string().min(1), type: z.string().optional(), owner: z.string().optional(), }); - src/tools/conductor.tool.ts:132-142 (handler)MCP tool handler registration for 'create_track'. Wires the schema to the manager.createTrack call and returns JSON-serialized result.
server.tool( 'create_track', 'Create a new conductor track directory with plan.md, index.md, and metadata.json. Fails if the slug already exists.', CreateTrackSchema.shape, async (args) => { const result = await manager.createTrack(args.slug, args.title, args.type, args.owner); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], }; }, ); - src/access/FileSystemAccess.ts:81-89 (helper)Low-level filesystem helper createTrackDir that creates the track directory (fails if exists due to recursive: false) and writes all provided files in parallel.
async function createTrackDir(tracksDir: string, slug: string, files: Record<string, string>): Promise<void> { const trackDir = join(tracksDir, slug); await mkdir(trackDir, { recursive: false }); await Promise.all( Object.entries(files).map(([filename, content]) => writeFile(join(trackDir, filename), content, { encoding: 'utf8' }), ), ); } - src/index.ts:52-52 (registration)Top-level registration: registerConductorTools(server, conductorManager) is called to register all conductor tools including create_track.
registerConductorTools(server, conductorManager);