--- name: onboarding description: "Set up a project to use implementation-workflow — verifies gh CLI/GitHub remote prerequisites, reports CI and docs/adr readiness, checks for a root AGENTS.md, and creates, updates, or migrates the project's docs/tools/ directory. Run once when adopting the plugin in a new project, or whenever project tooling changes. Not part of the fourteen-phase pipeline; user-invoked directly." --- Read [the Codex runtime adapter](../../docs/codex-runtime.md) before following this workflow. # Onboarding You are the **Onboarder**. implementation-workflow's phases quietly assume a few things are in place: a working `gh` CLI pointed at a real GitHub repo (Phases 1, 2, 6, 13 and 14 all shell out to it), a `docs/tools/` directory telling later phases which test/lint/build commands and MCP tools this project uses and which agent should reach for which, and — for the test-first gate to mean anything — CI that actually runs the suite. All of these are otherwise only surfaced as non-blocking nudges mid-run. This skill is where a user resolves them, once, up front. `docs/tools/` holds two kinds of file, and keeping them separate is the whole point of this layout: - `docs/tools/.md` — one per external tool (MCP server, CLI, etc.), describing the tool itself. It has no opinion on who uses it. - `docs/tools/.md` — one per consumer that has a real reason to reach for a tool, written from that consumer's point of view: which tool(s) to consider and when, linking back to the tool's own file. ## Quick Reference - Auto-detection heuristics per manifest file, and the fixed agent↔tool mapping this skill writes against: [reference.md](reference.md) - Templates this skill fills in: [../implementation-workflow/templates/tool-doc-template.md](../implementation-workflow/templates/tool-doc-template.md) (one per tool) and [../implementation-workflow/templates/agent-tool-template.md](../implementation-workflow/templates/agent-tool-template.md) (one per consumer — the same file `requirement-understanding`/orchestrator print as a bare nudge, reused here rather than duplicated) - The filesystem/network constraints this run operates under (you write `docs/tools/` and shell out to `gh` in Step 1): [../../docs/sandbox-environment.md](../../docs/sandbox-environment.md) --- ## Step 1 — Verify `gh` CLI Prerequisites ```bash gh --version gh auth status git remote -v gh repo view --json url 2>&1 ``` Report each check as pass/fail. On any failure, tell the user the exact command to run themselves (`gh auth login`, `git remote add origin `, etc.) — do not attempt to authenticate or add a remote on their behalf. This is informational: continue to Step 2 regardless of the outcome here, but call out clearly in the final summary if `gh` isn't usable yet, since Phases 1/2/6/12/13 of the main pipeline will fail without it. Also check that a work branch can be cut — the pipeline never commits to the default branch, and Phase 3 refuses to start on a dirty tree: ```bash gh repo view --json defaultBranchRef -q .defaultBranchRef.name git status --porcelain -- . ':!.codex/workflow-runs' | head ``` ## Step 2 — Check for a Root `AGENTS.md` ```bash test -f AGENTS.md && echo present || echo missing ``` **If present:** nothing to do, move on to Step 3. **If missing:** don't generate one yourself — that's the built-in `init` skill's job, and duplicating it here would just create a second, likely worse, code path for the same output. Tell the user to run `/init` first, then continue to Step 3 regardless; note in the final summary that `AGENTS.md` is still missing so it isn't lost as a follow-up. ## Step 3 — Check for `docs/tools/` and the Old `docs/tool.md` ```bash test -d docs/tools && echo "new-present" || echo "new-missing" test -f docs/tool.md && echo "old-present" || echo "old-missing" ``` Three cases: **`new-present`:** list `docs/tools/*.md` and show their contents. Ask the user (`ask_user`, options `["leave as-is", "update it"]`) whether to leave it or walk through an update. If "leave as-is", skip to Step 5. If "update it", go to Step 4 — treat it as the fresh-interview case, but propose each existing file's current content as the default answer instead of inferring from scratch. **`new-missing` and `old-present`:** this project has the old single-file format, which this version of implementation-workflow no longer reads — every agent/skill now looks for its own `docs/tools/.md`. Show the old file's contents, then ask (`ask_user`, options `["migrate now", "leave docs/tool.md as-is for now"]`). On "leave as-is", skip to Step 5 and mention in the Step 7 summary that the project is still on the old format. On "migrate now": 1. Parse the old file's sections. The four fixed ones (Test Command, Lint / Build Commands, Code Search Tools (MCP or CLI), Verification Tools (MCP)) map onto the fixed table in [reference.md](reference.md) §3 — carry each one's content into the tool/agent files that table names, without asking again what it means. 2. Any other section the old file has — a project may have appended its own (a wiki location, a project-specific convention) — is a tool this format didn't anticipate. For each one, ask which consumer(s) from [reference.md](reference.md) §3's list should know about it, same as a newly-discovered tool in Step 4.2 below. 3. **Also ask, before finishing:** "Is there any other tool this project has that `docs/tool.md` didn't capture?" — a stale file is exactly what migration should be the moment to fix, not just carry forward. Handle each answer the same way Step 4.2 handles a fresh one. 4. Write the resulting `docs/tools/*.md` files (Step 4.3's shape). Then ask (`ask_user`, options `["delete docs/tool.md", "keep it alongside docs/tools/"]`) whether to remove the now-superseded old file. Do not delete it without asking — it's the project's file, not this skill's scratch. 5. Continue to Step 5. **`new-missing` and `old-missing`:** continue to Step 4 for a fresh interview. ## Step 4 — Populate `docs/tools/` 1. **Auto-detect Test Command, and Lint/Build Commands,** by inspecting the project's manifest files per the heuristics in [reference.md](reference.md) §1 (`package.json`, `Makefile`, `pyproject.toml`, `go.mod`, `Cargo.toml`, `Gemfile`, etc.). Propose what you found; ask the user to confirm or correct it rather than guessing silently — a wrong test command will silently break `test-writer`'s red-confirmation step later. These two are written directly into the consumer files the fixed mapping names (§3): Test Command into `docs/tools/test-writer.md` and `docs/tools/implementation-planning.md`; Lint/Build Commands into `docs/tools/implementer.md`. Neither gets its own `docs/tools/.md` — a one-line shell command carries negligible duplication risk, so it's written inline in each consumer that needs it rather than factored out. 2. **Ask about each MCP-style tool**, one at a time, per the fixed mapping in [reference.md](reference.md) §3 (a code-search server, a library/docs server, a verification server). These can't be inferred from repo files — an MCP server's presence is local Codex configuration, not something checked into the repo. For each one the user names, write its own `docs/tools/.md` (tool-centric, no "who uses this") and append a short reference to every consumer file §3 says should know about it (agent-centric, in that consumer's own words). 3. **Ask if there's anything else** — a tool that doesn't fit the fixed categories (a wiki, a project-specific service). For each one named, ask which consumer(s) should know about it (multi-select from the agents/skills list, or "none — informational only", in which case it still gets a `docs/tools/.md` but no consumer file references it yet). 4. **Write or refresh `docs/tools/index.md`** — a flat list of every tool file and every consumer file that now exists, so both kinds are discoverable without reading the whole directory. 5. Use [../implementation-workflow/templates/tool-doc-template.md](../implementation-workflow/templates/tool-doc-template.md) for every `docs/tools/.md` and [../implementation-workflow/templates/agent-tool-template.md](../implementation-workflow/templates/agent-tool-template.md) for every `docs/tools/.md`. Never create a consumer file with nothing in it — if a consumer has no tool named for it, it simply has no file, exactly as the fixed mapping's absent rows already describe. ## Step 5 — Report CI, ADR, and Manual-Test Readiness Neither of these is created here — both are produced by the pipeline itself when a task needs them — but a user adopting the plugin should know where they stand before the first run. ```bash ls .github/workflows/*.yml .github/workflows/*.yaml 2>/dev/null test -d docs/adr && ls docs/adr/ || echo "no docs/adr yet" test -d docs/manual-tests && ls docs/manual-tests/ || echo "no docs/manual-tests yet" ``` Report, without fixing: - **CI.** Does a workflow run the test command from Step 4, on pull requests to the default branch? If not, tell the user that the first task with automated tests will include CI bootstrap in its test commit (per `../../docs/test-first.md`), so the first PR will carry a slightly larger diff than the feature alone. - **`docs/adr/`.** If it doesn't exist, say that it'll be created by the first decision heavy enough to warrant one — the half-day test in `../../docs/vcs-minimalism.md` — and point them at that document so the bar isn't a surprise. If it exists but has no `index.md`, mention that too: the index is part of the ADR contract, and the first ADR this plugin writes will create it. - **`docs/manual-tests/`.** Behaviour a test runner can't check gets a committed procedure here, indexed by `docs/manual-tests/index.md` and linked from `README.md` (`../../docs/test-first.md`). If the directory doesn't exist, say the first task with a manual test will create it along with the README link — so that link appearing in a feature PR isn't a surprise. - **Legacy directories.** If `docs/decision-records/` or `docs/incident-logs/` exist, say they're read-only history: this plugin writes ADRs to `docs/adr/` and no longer produces incident logs at all. ## Step 6 — Offer to Ignore the Scratch Workspace Each run writes its cross-phase handoff files to `.codex/workflow-runs/implementation-workflow//` — requirements report, impact analysis, plan, test manifest, review report. They're working files, not deliverables, and nothing in the pipeline ever commits them. If `.gitignore` doesn't already cover `.codex/workflow-runs/`, those files show up as untracked in every `git status` for the rest of the project's life, and can be swept into a commit by anyone who reaches for `git add -A`. ```bash grep -qE '^\.codex/workflow-runs/?$|^/\.codex/workflow-runs/?$' .gitignore 2>/dev/null && echo covered || echo "not covered" ``` **If not covered**, ask with `ask_user` whether to add it — options `["add .codex/workflow-runs/ to .gitignore", "leave .gitignore alone"]`. On approval, append a single entry with a comment saying what it is: ```gitignore # Codex agent scratch workspaces (task-splitter / implementation-workflow) .codex/workflow-runs/ ``` Do not edit `.gitignore` without asking, do not reorder or tidy what's already there, and do not commit the change — mention it in the summary as an uncommitted edit the user should include in their next commit. If the project deliberately tracks something under `.codex/workflow-runs/` (checked-in settings, project-scoped agents or commands), say so rather than proposing the blanket entry — `.codex/workflow-runs/implementation-workflow/` and `.codex/workflow-runs/task-splitter/` are the narrower pair that covers only the scratch workspaces. ## Step 7 — Summary Report what's in place and what still needs the user's action: - `gh` CLI: usable / needs `gh auth login` / needs a remote - Default branch and working-tree state: ready / dirty tree to resolve - `AGENTS.md`: present / missing (run `/init`) - `docs/tools/`: created / updated / left as-is, with the files written — or, if migrated this run, the old `docs/tool.md`'s fate (deleted / kept alongside) - CI: runs the test suite / exists but doesn't cover it / absent - `docs/adr/` and its `index.md`: present / will be created on first need - `docs/manual-tests/`: present / will be created on first need - `.gitignore`: already covers `.codex/workflow-runs/` / entry added (uncommitted) / left alone at the user's request Nothing here writes to `.codex/workflow-runs/implementation-workflow/` — that's created per-task by `requirement-understanding` when a real run starts. Nothing here commits, either; if `docs/tools/` was created, changed, or migrated (and `docs/tool.md` deleted), tell the user those are uncommitted changes in their working tree, since Phase 3 of a run will refuse to start on a dirty tree.