So you have built a few dozen agent skills and flat markdown files are starting to collide. Tightly coupled commands duplicate rubrics, lose track of state mid-run, and bloat context. Here are the patterns that keep larger skill sets clean and composable.
1. Command trees
When several skills share a domain and call each other (like creating, scoring, and upgrading skills), combine them under one parent folder with subcommands:
/skillz
SKILL.md # Router / command tree
_shared/
rubric.md # Shared knowledge references
create/
001_task_create.md
score/
001_task_create.md
Users can still call subcommands independently (/skillz create, /skillz score), while shared references live once in _shared/.
2. Porcelain and plumbing (_ directories)
Borrowing from Git, there is one simple rule: the menu router ignores every _-prefixed folder.
_shared/(knowledge): Rubrics, schemas, and rules the agent reads and internalizes to guide judgment._lib/(procedures): Self-describing step files the agent reads and runs directly when needed._phase/(private sub-workflows): Multi-step internal phases (for examplemr/_prepare/andmr/_ship/) that a parent workflow runs in sequence while another workflow can call just one phase directly.
Choosing the right pattern by scope:
- Procedure used by one command: Keep it inline in the step file.
- Single-file procedure shared by 2+ commands: Put it in
_lib/procedure.md. - Multi-step workflow owned by one command, callable by others: Make it a subcommand phase (such as
mr/_ship/).
3. Change logs to stop "moving deck chairs"
Self-improvement loops easily cycle back and forth, switching a step from subagents to background jobs one week and right back the next. Keeping a short change log of past adjustments lets the loop see what was already tried and ask why it cycled instead of flipping again.
4. Interactive text-UI loops
Skills do not have to be one-shot scripts. Think of an interactive skill like a classic text game such as Zork: a numbered menu, a topic detail view, open discussion, and explicit back and exit controls so you can steer complex investigations inside one session.
5. Saving reusable results & state manifests
- Knowledge artifact hydration: Expensive API or log-gathering runs can save structured markdown artifacts on disk so later sessions load the artifact directly instead of re-crawling everything.
- State / manifest files: Long multi-stage workflows bury early decisions under tool output. Writing a live manifest file and telling the agent to re-read it at phase boundaries prevents drift, and gives you clean seams for context compaction.
6. Graph-backed routing (Signal -> Workflow -> Pattern -> Tool)
At larger scale, static skill files give way to a Neo4j knowledge graph:
- Dual-write (Markdown + Graph): Human-readable markdown stays the source of truth, and the graph acts as the fast runtime index.
- Signal -> Workflow -> Pattern -> Tool: An entry hub advertises lightweight context signals. Only matched signals expand into workflows, reusable patterns, attached
GOVERNED_BYrules, and exact-name tool docs, keeping context lean on boot and deep only where the work goes. - Living doc tiers: Capture ongoing work in
primer(orientation),research(open questions and findings), andcapstone(distilled, anchored present-tense policy) tiers so expensive findings do not evaporate when a session ends.