writers-pattern
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.
Profile →npx skills add caliber-ai-org/ai-setup --skill writers-pattern --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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 descr
- Critical
- Instructions
- Step 1: Define the Platform Config Interface
- Step 2: Implement the Writer Export Function
- Step 3: Add Type Exports (if complex interface)
- Step 4: Import and Register in src/writers/index.ts
- Step 5: Add Tests
- Step 6: Update detectSyncedAgents() in src/commands/refresh.ts (Optional)
- Examples
- Example 1: Add a hypothetical "DevCode" platform writer
- Common Issues
What does the writers-pattern skill do?
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.
How do I install it?
Run `npx skills add caliber-ai-org/ai-setup --skill writers-pattern --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From caliber-ai-org/ai-setup, a repository with 1,235 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.