Agents & MCP
How to build skills that work together in this repo: the entry-router, reference-file, and skill-chain patterns; split vs merge decisions; the versioning contract for repo skills vs flagship library skills; and safe cross-linking without duplicating AGENTS.md.
2 files
Description
How to build skills that work together in this repo: the entry-router, reference-file, and skill-chain patterns; split vs merge decisions; the versioning contract for repo skills vs flagship library skills; and safe cross-linking without duplicating AGENTS.md.
A single skill handles one repeatable job. But real workflows cross several jobs. This skill covers how to connect skills together without turning them into a tangled monolith.
This guide is grounded in the real skill structure of this repo. The existing skill system at .agents/skills/ and .claude/skills/ provides working examples of all three patterns.
A task crosses multiple sub-domains, you are seeing duplicate content across skills, a skill is getting too long to have one clear job, or you want to build a skill that dispatches to more specialized ones.
One skill acts as the dispatcher. It reads the request, maps it to the right specialized skill, and says "go there." It holds the map, not the procedures.
Real example in this repo: The skills-mcp-platform skill under .agents/skills/skills-mcp-platform/SKILL.md routes skill library work. The handoff skill routes content CI work.
Use this when:
The entry router holds no procedure of its own. If it starts accumulating steps, those steps belong in a specialized skill.
A skill has a main SKILL.md that covers the workflow and one or more reference files that cover supporting detail. Reference files are loaded on demand - the agent only fetches them when it decides it needs the depth.
Real example in this repo: agent-fleet-coordination in the public library has reference/roles.md, reference/file-ownership.md, and reference/harvest-loop.md. Each reference file covers one thing. The main SKILL.md describes the workflow and tells the agent when to load each reference.
For repo skills: use a flat SKILL.md with a ## Reference section at the end that lists what else the agent should read and when.
For flagship library skills: use the multi-file format. Source files go in skills-source/<slug>/reference/. The generator at scripts/build-flagship-skills.mjs compiles them into lib/library/flagship-skills.ts. Each reference file gets a purpose field in the META object that tells the agent when to fetch it.
skills-source/
my-skill/
SKILL.md <- main workflow
reference/
advanced-config.md <- loaded on demand
pitfall-catalog.md <- loaded on demand
Skills reference each other through the relatedPaths field and inline "after this, see" notes. Each skill is complete on its own; the chain is navigational, for an agent that needs the next step.
Real example in this repo: The neon-drizzle-migrations skill links to neon-serverless-patterns via relatedPaths. The skill-writing-guide skill links to skill-testing-checklist and skill-composition-patterns - this file.
Use this when two skills are naturally sequential (write the skill, then test it) or one skill has a well-known follow-up outside its scope. The chain is navigational, not procedural.
Split when:
AGENTS.md (those belong there, not in the skill).Merge when:
The right answer is almost always to split. Merging is usually laziness.
Reference another skill by slug or path. Never reproduce its content inline.
ship-pipeline skill."credit-metered-ai-endpoints in the library."Rules that apply everywhere (no em dashes, no gradients, square corners, work on branches) belong in AGENTS.md > CRITICAL RULES - not in a skill. Point there.
| Skill type | Where to edit | Build step |
|---|---|---|
| Repo skill (private) | .agents/skills/<name>/SKILL.md + .claude/skills/<name>/SKILL.md | None |
| Public flagship (multi-file) | skills-source/<slug>/ + META in build-flagship-skills.mjs | node scripts/build-flagship-skills.mjs skills-source/ |
| Public single-file | baseSkills in lib/library/skills.ts | None |
Full workflow: AGENTS.md > Repo Skills > Flagship skill authoring.
lib/library/flagship-skills.ts creates drift from the source files. If you change a flagship skill, always edit the source in skills-source/ and re-run the generator..agents/skills/ and .claude/skills/ means Codex agents and Claude Code agents have different skill sets. Always write to both.AGENTS.md. Keep global rules in AGENTS.md; keep workflow-specific knowledge in skills.Added 2026-07-05. Back to the Skill Library.

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.