ship
AGENTS.md93 starsChanged 5 months agoMITView on GitHub
Ship has one opt-in workflow layer. It fires only during user-triggered Ship workflows, especially /ship:auto:
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,691 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 48
Use Conventional Commits: feat(harness):, fix(harness):, feat(plugin):
- Very specific: line 53
Use set -u in every new shell script
- Very specific: line 56
Test hooks by piping JSON stdin: echo '{"cwd":"/path","tool_name":"Edit",...}' | bash scripts/hook.sh
- Very specific: line 59
Use eval on config values (use bash -c instead)
- Very specific: line 60
Use \s in grep -E (not POSIX on macOS.
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Commands
| Action | Command |
| Validate JSON | jq . <file> |
| Lint shell | shellcheck scripts/*.sh (if installed) |
| Test hooks | echo '<json>' | bash scripts/<hook>.sh |
| Reload plugin | /reload-plugins in Claude Code |
Repository Map
| Directory | Contents | Purpose |
scripts/ | Shell scripts | Startup hint, workflow hooks, auto orchestrator, PR readiness, docs index generation, PATH bootstrap, and dev-phase file handoffs (story-brief.sh, review-package.sh) |
hooks/ | hooks.json, codex-hooks.json | Same three hooks per platform (session hint, phase guardrail, stop gate); they differ only in the root variable each platform expands |
.codex-plugin/ | plugin.json | Native Codex plugin metadata for skills, MCP, and Codex UI |
skills/ | Skill dirs plus shared/ helpers | Slash commands (/ship:*) and shared references (shared/ has no SKILL.md, so it is not a routable skill) |
skills/use-ship/ | Routing skill | Agent-facing guide for grouping Ship phases based on task need |
skills/auto/prompts/ | .md.tmpl files | Prompt templates for the full workflow runner |
.claude-plugin/ | plugin.json | Plugin metadata for ShipAI |
.mcp.json | MCP config | Codex MCP server registration |
Architecture
Ship has one opt-in workflow layer. It fires only during user-triggered Ship
workflows, especially /ship:auto:
session-start.shinjects only a small/ship:use-shiprouting hint; no docs index or artifact content./ship:use-shipchooses the smallest useful standalone skill, phase bundle, or full workflow.- Full workflow runs write raw input to
.ship/tasks/<task_id>/input/requirement.md. - The runner owns exactly one state surface: the frontmatter of
.ship/ship-auto.local.md. There is no side-state; agents may create task-specific notes under the task dir if useful. - Markdown artifacts and repository code are the output plane.
- Bulk artifacts move between agents as file paths, never pasted prompt text: story briefs, implementer reports, and review packages live in the self-ignoring
.ship/scratch/. - Durable production artifacts may be organized under
docs/ship/<task-id-or-req-id>/when the repo lacks an existing convention. stop-gate.sh— blocks session exit while.ship/ship-auto.local.mdis active (with fast-path for terminal phases)auto-orchestrate.sh— code-driven state machine for staged workflows (init, resume, complete, status commands)phase-guardrail.sh— PreToolUse hook enforcing artifact access rules per phase (QA independence, review read-only, state file protection)- Claude Code loads hooks through plugin
hooks/hooks.json(${CLAUDE_PLUGIN_ROOT}). Codex loadshooks/codex-hooks.json(${PLUGIN_ROOT}) via the explicit"hooks"pointer in.codex-plugin/plugin.json— the pointer is REQUIRED: without it Codex falls back tohooks/hooks.json, whose variable does not expand there. Both SessionStart hooks matchstartup|clear|compactso the hint does not re-inject on resume
Code Style
- Shell:
set -uat top of every script,localfor function variables - JSON parsing:
jqonly (no yq, no Python yaml) - Hook input: always
INPUT=$(cat)then extract fields withjq -r - Hook output:
jq -nto produce response JSON - Use Conventional Commits:
feat(harness):,fix(harness):,feat(plugin):
Boundaries
Always Do
- Use
set -uin every new shell script - Exit 0 silently when config files don't exist (graceful degradation)
- Use Conventional Commits
- Test hooks by piping JSON stdin:
echo '{"cwd":"/path","tool_name":"Edit",...}' | bash scripts/hook.sh
Never Do
- Use
evalon config values (usebash -cinstead) - Use
\singrep -E(not POSIX on macOS; use[[:space:]]) - Depend on
yqor PyYAML (JSON-only, parsed withjq)
Gotchas
- macOS
/tmpresolves to/private/tmpvia symlink.git rev-parse --show-toplevelreturns the resolved path. All path matching must handle both forms. - Plugin-level hooks fire for ALL sessions. Project-level hooks (in
.claude/settings.json) fire only for that project. - Hook handlers run in parallel when multiple match the same event. Hooks must not depend on execution order.
stop-gate.shreads.ship/ship-auto.local.mdstate file. Blocks only the session that started the workflow (session isolation). Subagents are never blocked.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

