Skip to content

@kekkai/blueprint / emitAgentFiles

Function: emitAgentFiles()

emitAgentFiles(blueprint, defaultTargets?): AgentFile[]

Defined in: emit/agent/targets.ts:64

Distribute the agent contract across tool-specific files. Shared context files (merge strategy — CLAUDE.md, AGENTS.md…) get the compact pointer block: people maintain those documents, so the bulk lives behind links. Tool-owned rule files (own — Cursor, Windsurf) get the full contract. defaultTargets overrides the built-in default when emit.agents is unset — init --agent claude narrows to the one tool actually in use. Pure — decides paths and content, writes nothing.

Parameters

blueprint

Blueprint

defaultTargets?

AgentTarget[]

Returns

AgentFile[]

Example

ts
for (const file of emitAgentFiles(blueprint)) {
  writeFileSync(file.path, file.content); // e.g. 'CLAUDE.md', '.cursor/rules/blueprint.mdc'
}