writers-pattern

Featured

Add a new platform writer module in src/writers/ that generates and writes agent config files for a supported platform. Each writer exports a function that accepts a config interface, creates directories (rules/, skills/, mcp configs), writes files with proper formatting and frontmatter, and returns string[] of written file paths. Use when adding platform support for a new agent, integrating a new code AI tool, or extending caliber to support new targets. Do NOT use for modifying existing writers, refactoring scoring logic, or changing how writers are invoked.

AI & Automation 1,223 stars 116 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Platform Writer Pattern ## Critical - **Every writer MUST**: 1. Export a single named function: `write<Platform>Config(config: <PlatformConfig>): string[]` 2. Accept a platform-specific config interface defining what content to write 3. Return `string[]` of all written file paths (used by manifest and progress display) 4. Create parent directories with `fs.mkdirSync(dir, { recursive: true })` before writing files 5. Wrap skill frontmatter exactly as shown in Step 4 (YAML between `---` markers) 6. NOT modify files outside the intended platform directories (e.g., Claude writer only touches `.claude/`, `CLAUDE.md`, `.mcp.json`) - **Integration point**: Every writer MUST be imported and called in `src/writers/index.ts` within the `writeSetup()` function. Missing this step means the writer will never execute. - **Validation before Step 1**: Verify the platform name is unique (`ls src/writers/` shows no `<platform>/index.ts`). If it exists, you are modifying, not adding. ## Instructions ### Step 1: Define the Platform Config Interface Verify the platform name is unique (see Critical). Create `src/writers/<platform>/index.ts`. At the top of the file, define a config interface that describes all content the writer accepts. The interface MUST include: - A main markdown/text file (e.g., `claudeMd`, `cursorrules`, `agentsMd`, `instructions`) - Optional nested arrays: `rules`, `skills`, `mcpServers`, `instructionFiles`, etc. - Each rule/skill/file has at minimum: `na...

Details

Author
caliber-ai-org
Repository
caliber-ai-org/ai-setup
Created
4 months ago
Last Updated
yesterday
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category