diff --git a/src/core/templates.ts b/src/core/templates.ts new file mode 100644 index 0000000..b94dbc1 --- /dev/null +++ b/src/core/templates.ts @@ -0,0 +1,58 @@ +export function agentsMd(projectName: string): string { + return `# AgentHub Instructions — ${projectName} + +This project uses AgentHub for shared team memory. + +Before you start working: +1. Read \`.agenthub/status/latest.md\`. +2. Check \`.agenthub/tasks/\` for open tasks assigned to your role. +3. Read any handoff files relevant to your current task. + +While working: +- Create decision records for architectural or technical choices (\`agenthub decision create\`). +- Update task status (\`agenthub task done TSK-0001\`). + +When handing off: +- Create a handoff file (\`agenthub handoff create\`). +- Include context, open questions, and next steps. + +Do not delete or overwrite files in \`.agenthub/\` unless explicitly asked. +`; +} + +export function claudeMd(): string { + return `# Claude Code — Team Role + +You are part of the AgentHub team in this project. +Your default roles: architect, reviewer. + +Read \`AGENTS.md\` and \`.agenthub/status/latest.md\` before making decisions. +Use \`agenthub decision create\` for architecture choices. +Use \`agenthub handoff create\` when passing work to the implementer. +`; +} + +export function codexMd(): string { + return `# Codex CLI — Team Role + +You are part of the AgentHub team in this project. +Your default roles: implementer, tester. + +Read \`AGENTS.md\` and \`.agenthub/status/latest.md\` before implementing. +Use \`agenthub task claim TSK-0001\` to reserve a task. +Use \`agenthub task done TSK-0001\` when implementation is complete. +Use \`agenthub handoff create\` when passing work to the reviewer. +`; +} + +export function kimiMd(): string { + return `# Kimi Code CLI — Team Role + +You are part of the AgentHub team in this project. +Your default roles: architect, implementer, reviewer. + +Read \`AGENTS.md\` and \`.agenthub/status/latest.md\` before making decisions. +Use \`agenthub decision create\` for architecture choices. +Use \`agenthub handoff create\` when passing work to another agent. +`; +} diff --git a/tests/templates.test.ts b/tests/templates.test.ts new file mode 100644 index 0000000..b66462f --- /dev/null +++ b/tests/templates.test.ts @@ -0,0 +1,13 @@ +import { describe, it, expect } from 'vitest'; +import { agentsMd, claudeMd, codexMd, kimiMd } from '../src/core/templates.js'; + +describe('templates', () => { + it('includes project name in AGENTS.md', () => { + expect(agentsMd('my-app')).toContain('my-app'); + }); + + it('references agenthub commands', () => { + expect(claudeMd()).toContain('agenthub decision create'); + expect(codexMd()).toContain('agenthub task claim'); + }); +});