How pbierkortte/ai-runbook works
1. What this repo is
- This is not a product app; it is a dotfiles-style AI operating environment.
- The repository’s main job is to define, install, and keep synchronized a set of agent behaviors, skills, prompts, rules, and persona modules so they can be reused across tools and workspaces.
2. Primary architectural boundary
- The repo is organized around a source-of-truth vs. generated runtime state split.
- Human-edited markdown files define the behavior; scripts then hydrate those definitions into runtime-facing files like AGENTS.md and manifests.
- Before commit, generated content is often dehydrated back to minimal placeholders so the repo stays diff-clean while runtime can regenerate the full context.
3. Top-level subsystems
- skills/: reusable task-specific capabilities, each with a SKILL.md entry and sometimes supporting files or scripts.
- cores/: persona/identity modules; the README describes these as the “C/O/R/E/S” framework and the tree shows both spectrum and extras variants.
- rules/ and legacy_rules/: policy-like instructions that can be staged into agent contexts.
- docs/: operational documentation for the conventions and bootstrapping flow.
- script/: the orchestration layer that installs tools, wires shell integration, and generates agent-visible artifacts.
- tools/: standalone prompt assets for one-off workflows such as job search, writing, and LLM utilities.
4. How agent context is assembled
- The repo uses markdown heading structure and file placement as configuration.
- AGENTS.md files act as directory-level indexes that supported IDEs and agents can read automatically.
- The repo root AGENTS.md is both a landing page and a generated table of contents, while nested AGENTS.md files are hydrated in subdirectories to expose local context.
5. Rule system
- Rules are stored as RULE.md files under scoped directories such as rules/git/RULE.md and rules/house/RULE.md.
- The README describes a staging step that collects these rules into temporary, excluded files before hydration.
- This makes rules behave like directory-scoped policy overlays that are injected into agent context without polluting normal project commits.
6. Skills subsystem
- skills/ is the largest functional surface area and represents the repo’s reusable capability library.
- Each skill is a self-contained prompt bundle, usually centered on SKILL.md, with some skills containing helper scripts or bundled agent personas.
- Examples include transcription, docs consistency, repo-to-prompt conversion, prompt/meta-prompt utilities, and job-search automation prompts.
- The repo’s installation/update flow is designed so these skills can be installed into other environments via OpenSkills.
7. Cores / personas subsystem
- cores/ contains the persona or role definitions that shape how an AI agent behaves.
- The spectrum set maps to named roles like architect, engineer, executor, sentinel, steward, etc., while extras adds additional variants.
- Architecturally, these are not tools; they are behavioral lenses used to keep agent responses coherent and role-specific.
8. Operational scripts and lifecycle
- script/ is the execution layer for bootstrapping and maintenance.
- The scripts cover environment setup (bootstrap, configure-*, wire-shell), agent/skill linkage (hydrate-*, dehydrate-*, link-*, unlink-*), and repository hygiene (refresh-docs, rebuild-manifest, run-ci).
- This makes the repo function like an infrastructure-as-code system for AI workspace behavior.
9. Documentation and generated indexes
- docs/ explains the conventions: heading format, rule injection, Claude Code autoloading, Codespaces auth, dotfiles opt-in, Git/Python config, and the spectrum model.
- Root files such as MANIFEST.md and the docs manifest files act as catalog outputs, keeping the repo navigable for both humans and agents.
- The structure suggests documentation is not just explanatory; it is also part of the discovery mechanism for the agent system.
10. Tooling and external integration points
- The repo integrates with GitHub Codespaces as a dotfiles repository and uses environment variables like DOTFILES_ENABLE and agent-tool-specific flags to enable installs.
- The README references support for tools such as Claude Code, Cline, Kilo, OpenRouter, and Anthropic auth flows, but these are optional integration endpoints rather than core runtime dependencies.
- A GitHub Actions workflow (.github/workflows/run-ci.yml) provides repository-level validation for this configuration system.
11. Data flow at a glance
- A human edits markdown definitions in skills/, cores/, rules/, and docs/.
- Scripts stage rules, hydrate agent indexes, and rebuild manifests.
- The resulting generated files are consumed by editors, agent tools, and Codespaces bootstrap.
- Before commit, dehydration removes generated bulk so the repo remains maintainable while still being able to regenerate the full runtime view.
12. How to diagram it
- Model this repo as a configuration/content pipeline, not an application server.
- The key boxes are: source markdown definitions, script-driven generation, runtime agent context files, and optional tool integrations.
- The main architecture question is not “what request is served?” but “how does the repo turn markdown conventions into agent behavior?”
Main entry points: script Scripts · hydrate-agents Hydrate agents · README.md README · cores Cores
Components 23
Source definitions
Human-edited markdown sources that define behavior and policy
- Rules · Scoped rule files staged into agent context
rules - Legacy rules · Older rule definitions kept for compatibility
legacy_rules - Tools · Standalone workflow prompts and templates
tools
Capabilities library
Reusable skills and persona modules
Generation and runtime
Scripts and generated indexes that assemble agent context
- Root AGENTS · Top-level agent-facing table of contents
AGENTS.md - Root manifest · Repository catalog output for discovery
MANIFEST.md - Scripts · Bootstrap, hydration, staging, and maintenance scripts
script - Stage rules · Collects scoped rules for hydration
script/stage-rules - Hydrate agents · Builds AGENTS.md context from sources
script/hydrate-agents - Dehydrate agents · Strips generated bulk before commit
script/dehydrate-agents - Rebuild manifest · Regenerates repository catalogs and indexes
script/rebuild-manifest - Bootstrap · Installs and wires the workspace environment
script/bootstrap - Install skills · Links skills into other environments
script/install-skills - Skills manifest · OpenSkills manifest for installed capabilities
agents/openskills-manifest.yml
Docs and integrations
Operational docs, validation, and external tool entrypoints
- README · Repository overview and setup guide
README.md - Docs · Operational documentation for the runbook system
docs - Tool installers · Optional installs for Claude, Cline, Kilo, yq
script/install-claude - Run CI · Repository-level validation pipeline
.github/workflows/run-ci.yml - Docs manifest · Docs-side catalog for navigation
docs/MANIFEST.md - Docs AGENTS · Directory-local agent context index for docs
docs/AGENTS.md
Connections 27
- README → Scripts: explains setup · README documents the lifecycle and orchestration commands
- README → Skills: describes · README positions skills as reusable capability bundles
- README → Cores: describes · README explains the C/O/R/E/S persona framework
- README → Rules: describes · README explains directory-scoped rule overlays
- Rules → Stage rules: staged by · Rules are collected into temporary staged inputs
- Stage rules → Hydrate agents: feeds · Staged rules are incorporated during hydration
- Skills → Install skills: installed by · Skills are linked into target environments by installer scripts
- Cores → Hydrate agents: influences · Persona modules shape hydrated agent context
- Spectrum → Cores: subset of · Spectrum is the main named role set
- Extras → Cores: extends · Extras adds supplementary role variants
- Hydrate agents → Root AGENTS: generates · Hydration produces agent-visible indexes and context files
- Hydrate agents → Docs AGENTS: hydrates · Subdirectory AGENTS.md files are populated from local context
- Dehydrate agents → Root AGENTS: shrinks · Generated bulk is removed before commit
- Rebuild manifest → Root manifest: generates · Repository catalog is rebuilt from source definitions
- Rebuild manifest → Docs manifest: generates · Docs catalog is regenerated alongside the root manifest
- Bootstrap → Scripts: orchestrates · Bootstrap wires the shell and environment lifecycle
- Bootstrap → Tool installers: optionally installs · Bootstrap can set up external tooling integrations
- Run CI → Scripts: validates · Workflow exercises repo maintenance and generation scripts
- Docs → Docs AGENTS: documents · Docs explain local agent index conventions
- Docs → Docs manifest: documents · Docs provide navigable references and conventions
- Tools → Run CI: consumed by · Standalone prompts are governed by repo-level checks indirectly
- Skills → Skills manifest: publishes · Installed skills are summarized in an OpenSkills manifest
- Scripts → Skills manifest: builds · Scripts maintain the runtime-facing skills manifest
- Scripts → Hydrate agents: contains · Hydration is part of the script-driven lifecycle
- Scripts → Dehydrate agents: contains · Dehydration keeps generated files diff-clean
- Scripts → Rebuild manifest: contains · Manifest regeneration is a core maintenance task
- Docs → Run CI: covered by · Documentation and conventions are validated in CI