From e216fcc7cac8b1fa6a70c0a6104e063f0af16621 Mon Sep 17 00:00:00 2001 From: Lukasz Boryn Date: Wed, 23 Sep 2026 11:26:22 +0200 Subject: [PATCH] feat(skills): add init-octobot skill MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bootstraps AGENTS.md, optional CLAUDE.md, a bare OKF/, and README.md into any repo that never ran octobot before — fixes the gap where octobot was dropped into an ongoing repo with no ROADMAP, OKF, AGENTS.md, or CLAUDE.md. Adds its /steer row so it's discoverable. Claude-Session: https://claude.ai/code/session_01VZH57yueT8apHdFXffmffE --- skills/loop/steer/SKILL.md | 1 + skills/scaffold/init-octobot/AGENTS.md.tpl | 21 ++++ skills/scaffold/init-octobot/CLAUDE.md.tpl | 6 ++ skills/scaffold/init-octobot/README.md.tpl | 6 ++ skills/scaffold/init-octobot/SKILL.md | 97 +++++++++++++++++++ .../scaffold/init-octobot/scripts/repo-scan | 79 +++++++++++++++ .../scaffold/init-octobot/simplicity-block.md | 30 ++++++ 7 files changed, 240 insertions(+) create mode 100644 skills/scaffold/init-octobot/AGENTS.md.tpl create mode 100644 skills/scaffold/init-octobot/CLAUDE.md.tpl create mode 100644 skills/scaffold/init-octobot/README.md.tpl create mode 100644 skills/scaffold/init-octobot/SKILL.md create mode 100755 skills/scaffold/init-octobot/scripts/repo-scan create mode 100644 skills/scaffold/init-octobot/simplicity-block.md diff --git a/skills/loop/steer/SKILL.md b/skills/loop/steer/SKILL.md index af11992..5fc81ff 100644 --- a/skills/loop/steer/SKILL.md +++ b/skills/loop/steer/SKILL.md @@ -47,6 +47,7 @@ rig = bdd → 4-axis review → Verify → commit-atomic-jj → close (OKF refre | Situation | Skill | |---|---| +| repo never ran octobot — no `AGENTS.md`, no `OKF/` | `/init-octobot` | | task vague, no codebase to anchor on | `/grill-me` | | plan needs stress-testing against the codebase | `/grill-with-docs` | | build test-first (fires on "tdd"/"bdd" too) | `/bdd` | diff --git a/skills/scaffold/init-octobot/AGENTS.md.tpl b/skills/scaffold/init-octobot/AGENTS.md.tpl new file mode 100644 index 0000000..da11690 --- /dev/null +++ b/skills/scaffold/init-octobot/AGENTS.md.tpl @@ -0,0 +1,21 @@ + + +## Repo conventions — + + + +TODO(init-octobot): no conventions detected yet — fill in once the repo +has code, tests, or a lint config to scan. diff --git a/skills/scaffold/init-octobot/CLAUDE.md.tpl b/skills/scaffold/init-octobot/CLAUDE.md.tpl new file mode 100644 index 0000000..2b1316d --- /dev/null +++ b/skills/scaffold/init-octobot/CLAUDE.md.tpl @@ -0,0 +1,6 @@ +# CLAUDE.md — + +Read [`AGENTS.md`](AGENTS.md) first — it carries the full behavioral +contract (knowledge, guardrails, simplicity & rigor, repo conventions). +This file exists only because some tooling looks for `CLAUDE.md` by name; +it adds nothing AGENTS.md doesn't already say. diff --git a/skills/scaffold/init-octobot/README.md.tpl b/skills/scaffold/init-octobot/README.md.tpl new file mode 100644 index 0000000..7f0596c --- /dev/null +++ b/skills/scaffold/init-octobot/README.md.tpl @@ -0,0 +1,6 @@ +# + +TODO(init-octobot): one-line description. + +Run `/write-readme` for a fuller README generated from this repo's +manifests, scripts, and task runner. diff --git a/skills/scaffold/init-octobot/SKILL.md b/skills/scaffold/init-octobot/SKILL.md new file mode 100644 index 0000000..4d9e430 --- /dev/null +++ b/skills/scaffold/init-octobot/SKILL.md @@ -0,0 +1,97 @@ +--- +name: init-octobot +description: Bootstrap octobot's framework files (AGENTS.md, optional CLAUDE.md, a bare OKF/, README.md) into any repo — greenfield or ongoing — that never ran octobot before. +disable-model-invocation: true +--- + +# init-octobot + +Fixes the "octobot dropped into a repo with no ROADMAP, no OKF, no +AGENTS.md, no CLAUDE.md" gap. Writes everything itself — never chains to +another user-invoked skill mid-run, since write-OKF, `/chart`, and +write-readme each gate their own writes on explicit user confirmation +that a silent sub-step would bypass. + +## When to use +- User says "init octobot", "/init-octobot", "bootstrap octobot here", + "set up octobot in this repo". +- A repo has none of `AGENTS.md`, `OKF/`, `OKF/ROADMAP.md` and the user + wants octobot's framework in place. + +## Process +1. **Scan** — run `scripts/repo-scan `. Two line kinds: + - `LEGACY ` — `CONTEXT.md`, `docs/Roadmap.md`, or `docs/adr` + exists at root. + - `CONVENTION — ` — a language/lint/test signal. +2. **OKF/ROADMAP.md**: + - Any `LEGACY` line → **skip** `OKF/` and `ROADMAP.md` entirely. Tell + the user to run `/write-OKF` (offers the migration these files need) + then `/chart` (produces a real roadmap). Do not scaffold in this + branch — write-OKF's Scaffold-only migration step never fires once + `OKF/` already exists, so pre-creating it here would forfeit that + path. + - No `LEGACY` line → materialize `OKF/index.md` and `OKF/ROADMAP.md` + from write-OKF's own + [`templates/index.md.tpl`](../../loop/write-OKF/templates/index.md.tpl) + and + [`templates/ROADMAP.md.tpl`](../../loop/write-OKF/templates/ROADMAP.md.tpl) + verbatim (`` substituted) — reuse, don't reinvent. Both stay + all-`TODO`, so `/chart`'s "absent or all-TODO → Greenfield" mode + detection still fires correctly later. `OKF/` now exists, so a + future `/write-OKF` run takes Refresh mode — its rescan step (page + plan via `okf-scan`, sorted against the still-empty `index.md`) is + built to reconcile exactly this bare state; only the Scaffold-only + migration/hook-wiring steps are permanently skipped, not full + population. +3. **AGENTS.md** — create, assembling in order (never duplicate the + source prose into this repo's copy — insert each block verbatim): + 1. Knowledge + Behavioral guardrails, from write-OKF's + [`agents-md-hook.md`](../../loop/write-OKF/agents-md-hook.md). + 2. Simplicity & rigor, from + [`simplicity-block.md`](simplicity-block.md) (CLAUDE.md §1–4, + distilled). + 3. `## Repo conventions — `, from + [`AGENTS.md.tpl`](AGENTS.md.tpl) — empty repo: leave the + fill-in-later placeholder. Non-empty: turn each confirmed + `CONVENTION` line into one short bullet; anything needing more than + one line goes to `OKF/decisions/` instead, linked from the bullet + (skip if step 2 skipped `OKF/`). + - **Confirm** every `CONVENTION` bullet with the user before writing — + the scan proposes, it doesn't decide. +4. **CLAUDE.md** — ask first; only write it if the user opts in, from + [`CLAUDE.md.tpl`](CLAUDE.md.tpl) (a pointer to AGENTS.md, never a + duplicate of its content). +5. **README.md** — absent → write + [`README.md.tpl`](README.md.tpl)'s minimal placeholder. Present → + skip untouched; a stub over real content is a regression, not a + convenience. +6. **Existing AGENTS.md/CLAUDE.md** in the target repo — propose a merge + reshaping the existing prose into the step-3/4 structure; show the + diff; write only after the user confirms. +7. **Close out** — list what was written and skipped, and suggest next + steps: `/write-OKF`, `/chart`, `/write-readme` — whichever apply. + +## Output / done criteria +- Every file in Process is either written (diff shown) or explicitly + skipped with a stated reason. +- No `CONVENTION` bullet lands unconfirmed; no existing file is + overwritten without a shown diff and a yes. +- Nothing committed — hand to `/commit-atomic-jj` + (`feat(init): bootstrap octobot framework files`, or `chore(init):` if + the repo takes chore-scoped infra commits). + +## Guardrails +- **Never** invoke write-OKF, `/chart`, or write-readme as a sub-step — + point the user at them instead. +- **Never** fabricate a `CONVENTION` bullet without a `repo-scan` line + behind it. +- **Never** overwrite an existing README.md, AGENTS.md, or CLAUDE.md + without a shown diff and explicit confirmation. +- **Never** scaffold `OKF/` or `ROADMAP.md` when a `LEGACY` line fired. + +## See also +- `/write-OKF` — full OKF scaffold/refresh, legacy migration, AGENTS.md + hook-wiring on a repo with no prior `OKF/`. +- `/chart` — writes real `OKF/ROADMAP.md` content. +- `/write-readme` — full README generation by ecosystem detection. +- `/commit-atomic-jj` — the commit step this skill hands off to. diff --git a/skills/scaffold/init-octobot/scripts/repo-scan b/skills/scaffold/init-octobot/scripts/repo-scan new file mode 100755 index 0000000..26c8b4f --- /dev/null +++ b/skills/scaffold/init-octobot/scripts/repo-scan @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 +"""Scan a repo for init-octobot's two decisions. Usage: repo-scan + +Two kinds of line on stdout, each naming the disk evidence that warranted +it — no evidence, no line; this scan proposes, it never writes: + + LEGACY — a write-OKF migration source exists; + init-octobot defers OKF/ROADMAP.md + creation to /write-OKF instead of + scaffolding them itself. + CONVENTION — — a point-5 "Repo conventions" bullet + candidate, for user confirmation. +""" +import sys +from pathlib import Path + +LEGACY_MARKERS = ("CONTEXT.md", "docs/Roadmap.md", "docs/adr") + +# marker file -> (ecosystem, one-line bullet) +ECOSYSTEM_MARKERS = { + "pyproject.toml": "python", + "DESCRIPTION": "r-package", + "_targets.R": "r-analysis", + "package.json": "node", + "Cargo.toml": "rust", + "go.mod": "go", +} + +LINT_MARKERS = ( + ".eslintrc.json", ".eslintrc.js", ".eslintrc", "ruff.toml", + ".ruff.toml", ".flake8", ".rubocop.yml", "rustfmt.toml", ".golangci.yml", +) + +TEST_MARKERS = { + "pytest.ini": "pytest", "tests": "tests/", "test": "test/", + "spec": "spec/", +} + + +def legacy(root): + for marker in LEGACY_MARKERS: + path = root / marker + if path.exists(): + yield f"LEGACY {marker}" + + +def ecosystem(root): + for marker, name in ECOSYSTEM_MARKERS.items(): + path = root / marker + if path.exists(): + yield f"CONVENTION language: {name} — {marker}" + + +def lint(root): + for marker in LINT_MARKERS: + path = root / marker + if path.exists(): + yield f"CONVENTION lint: {marker} — {marker}" + + +def tests(root): + for marker, label in TEST_MARKERS.items(): + path = root / marker + if path.exists(): + yield f"CONVENTION tests: {label} — {marker}" + + +def main(): + if len(sys.argv) != 2: + print(__doc__, file=sys.stderr) + return 1 + root = Path(sys.argv[1]) + for line in (*legacy(root), *ecosystem(root), *lint(root), *tests(root)): + print(line) + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/skills/scaffold/init-octobot/simplicity-block.md b/skills/scaffold/init-octobot/simplicity-block.md new file mode 100644 index 0000000..f84e685 --- /dev/null +++ b/skills/scaffold/init-octobot/simplicity-block.md @@ -0,0 +1,30 @@ +# AGENTS.md simplicity block + +Insert verbatim into the target `AGENTS.md`, after the Knowledge and +Behavioral guardrails sections from +[write-OKF's `agents-md-hook.md`](../../loop/write-OKF/agents-md-hook.md). +Distills CLAUDE.md sections 1–4 to the same terse, always-loaded register +as the guardrails block above it — the full essay stays in CLAUDE.md for +projects that opt into it. + +```markdown +## Simplicity & rigor + +- **Think before coding** — state assumptions, name the simpler approach + you're rejecting, ask when unclear rather than guessing. +- **Three sieves before a line stays**: real (not speculative), good + (nameably better for the next reader), minimal (leanest form — + stdlib/existing code before new). Burden is on keeping, not cutting. +- **Surgical changes** — touch only what the task requires; don't + refactor, reformat, or "improve" adjacent code; match existing style. +- **Goal-driven execution** — turn the task into a verifiable check + before starting, then loop against that check instead of "looks done". +``` + +## Rules + +- Keep this block verbatim across scaffolded projects — same source + (`CLAUDE.md` §1–4, adapted from + ) every time. +- If the target repo already has an AGENTS.md with an equivalent section, + merge by hand and show the diff; never duplicate.