Skip to main content
A SKILL.md is not magic. It is a Markdown file with a YAML header that Claude Code’s native skill loader reads, registers as a slash-command, and feeds back as the system prompt when invoked. Everything sophisticated in gstack (the cross-skill handoff, the safety hooks, the institutional memory) is built out of that single primitive.

Anatomy of a SKILL.md

The frontmatter declares everything Claude Code needs to know to register and run the skill. The body is the prompt.
SKILL.md (skeleton)
Templates and rendered files are committed together. The .tmpl is the source of truth. The .md is what Claude Code actually reads. The build step (bun run gen:skill-docs) expands forty-eight distinct placeholder patterns to produce the final file. Both ship in the repo so installations without the build toolchain still work.

The four-tier preamble

scripts/resolvers/preamble.ts composes the shared preamble in four tiers. Every skill declares which tier it needs with preamble-tier: 1 to 4 in frontmatter. Lower tiers are leaner. Tier 4 is the full kitchen sink and is also the default when a skill does not declare a tier.
Included. Bash bootstrap, upgrade check, lake-intro, telemetry consent, voice directive (trimmed), completion-status protocol.Used by. /browse, /setup-browser-cookies, /benchmark, /make-pdf, /benchmark-models.These skills are atomic primitives. They do one thing per invocation and do not need the heavier behavioral framework.

What the preamble bash actually does

Every skill, on every invocation, runs roughly this sequence before the user-facing prompt starts.

Check for a gstack version upgrade

Emits UPGRADE_AVAILABLE x to y if the global install is behind. Subsequent steps respect the user’s snooze preference.

Touch a per-session file

~/.gstack/sessions/$PPID. Used to detect concurrent sessions. Files older than 120 minutes are swept.

Read user config

proactive, skill_prefix, explain_level, telemetry, question_tuning, checkpoint_mode from ~/.gstack/config.yaml.

Detect git branch plus repo mode

Distinguishes a regular checkout from a Conductor worktree from a vendored install. Affects path resolution downstream.

Log to analytics

Append-only JSONL at ~/.gstack/analytics/skill-usage.jsonl. If telemetry is set to community, also fires gstack-telemetry-log for remote reporting.

Resolve $SLUG via gstack-slug

The project identifier used in every ~/.gstack/projects/<slug>/ path.

Load learnings count plus recent learnings

~/.gstack/projects/$SLUG/learnings.jsonl. If count exceeds 5, fires gstack-learnings-search to surface relevant prior patterns.

Fire gstack-timeline-log in the background

Records the skill invocation for /retro to read later.

Run one-time onboarding gates if needed

Telemetry consent, proactive-suggestion consent, “Boil the Lake” philosophy intro, writing-style choice. Each fires at most once per machine and writes a marker file.

The state directory is the glue

Skills do not share runtime memory. Each invocation is a fresh claude -p process. The hand-off mechanism is the filesystem. Every skill that produces output for downstream consumption writes to a predictable path under ~/.gstack/. Every downstream skill reads from that same path.
~/.gstack/ (the substrate)
The discovery mechanism is ls -t. /plan-ceo-review runs ls -t ~/.gstack/projects/$SLUG/*-design-*.md | head -1 to find the most recent design doc. /qa runs ls -t ~/.gstack/projects/$SLUG/*-test-plan-*.md | head -1 to find the test plan. No registry, no manifest. The most recently modified file with the matching glob is the source of truth.

The hook system

Safety skills (/careful, /freeze, /guard, /investigate) declare PreToolUse hooks in their frontmatter. When the skill is active, Claude Code fires the hook script before every matching tool call. The hook reads the tool input as JSON, decides, and emits a verdict.
careful/bin/check-careful.sh

Empty object means allow

Empty JSON means the tool call proceeds normally with no user prompt.

permissionDecision ask means warn

Surfaces the warning to the user, who can override and proceed or cancel.

permissionDecision deny means block

The tool call is rejected outright. Used by /freeze to block edits outside the boundary.

Cross-skill invocation

Skills invoke other skills through Claude Code’s native Skill tool. The top-level SKILL.md contains explicit routing rules in its body.
A handful of skills also use the {{INVOKE_SKILL:office-hours}} template placeholder mid-flow. For example, /plan-ceo-review offers to drop into /office-hours mid-session when the user cannot articulate the problem.

Subagent dispatch

/ship and /cso use Claude Code’s Agent tool (subagent_type: "general-purpose") to dispatch self-contained subtasks that would otherwise bloat the parent context. Coverage audits, plan-completion audits, Greptile review-comment triage, parallel security verifiers.
Subagent contract
This is the cleanest pattern in the repo for protecting expensive context. The audit subagent might read 20 files and run 5 greps. The parent only sees {"coverage_pct":87,"gaps":3,"diagram":"...","tests_added":[...]}.

The /autoplan meta-orchestrator

/autoplan is structurally different from every other skill. It reads other SKILL.md files from disk through the Read tool and follows their instructions inline, while overriding the AskUserQuestion calls with six encoded decision principles. It is a skill that programmatically runs other skills as if they were a library.
/autoplan execution model
The six principles encode Garry’s defaults. Choose completeness. Boil the lake (fix everything in blast radius under 1 day CC effort). Pragmatic (cleaner option wins). DRY (reject duplicates). Explicit over clever. Bias toward action.

What this is, mechanically

There is no runtime, no agent, no framework. Every skill invocation is claude -p with the skill file as the system prompt. The “intelligence” is Claude Opus 4.7 reading a well-tuned prompt. The repository’s value is the prompts themselves plus the shared ~/.gstack/ state directory that lets them compose across sessions.
Continue to the sprint pipeline to see how the skills compose end-to-end, or jump to the verbatim prompts for the exact text inside the biggest specialists.