feat(skills): add init-octobot skill
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
This commit is contained in:
parent
fc51190d65
commit
e216fcc7ca
@ -47,6 +47,7 @@ rig = bdd → 4-axis review → Verify → commit-atomic-jj → close (OKF refre
|
|||||||
|
|
||||||
| Situation | Skill |
|
| Situation | Skill |
|
||||||
|---|---|
|
|---|---|
|
||||||
|
| repo never ran octobot — no `AGENTS.md`, no `OKF/` | `/init-octobot` |
|
||||||
| task vague, no codebase to anchor on | `/grill-me` |
|
| task vague, no codebase to anchor on | `/grill-me` |
|
||||||
| plan needs stress-testing against the codebase | `/grill-with-docs` |
|
| plan needs stress-testing against the codebase | `/grill-with-docs` |
|
||||||
| build test-first (fires on "tdd"/"bdd" too) | `/bdd` |
|
| build test-first (fires on "tdd"/"bdd" too) | `/bdd` |
|
||||||
|
|||||||
21
skills/scaffold/init-octobot/AGENTS.md.tpl
Normal file
21
skills/scaffold/init-octobot/AGENTS.md.tpl
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<!--
|
||||||
|
Assembly, not a flat file: init-octobot builds AGENTS.md from three
|
||||||
|
sources rather than this template holding real prose —
|
||||||
|
1. skills/loop/write-OKF/agents-md-hook.md — Knowledge + Behavioral
|
||||||
|
guardrails, verbatim.
|
||||||
|
2. simplicity-block.md — Simplicity & rigor, verbatim.
|
||||||
|
3. Point 5 below, materialized from scripts/repo-scan's output.
|
||||||
|
Only the point-5 skeleton lives here; the rest is inserted by reference,
|
||||||
|
never copy-pasted into this file, so there is one source of truth per
|
||||||
|
block.
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Repo conventions — <dir-name>
|
||||||
|
|
||||||
|
<!-- Empty/greenfield repo: leave this exactly as-is, a fill-in-later
|
||||||
|
placeholder. Non-empty repo: replace with the confirmed bullets from
|
||||||
|
scripts/repo-scan's CONVENTION lines — one short line each,
|
||||||
|
deeper detail linked to OKF/decisions/ instead of inlined here. -->
|
||||||
|
|
||||||
|
TODO(init-octobot): no conventions detected yet — fill in once the repo
|
||||||
|
has code, tests, or a lint config to scan.
|
||||||
6
skills/scaffold/init-octobot/CLAUDE.md.tpl
Normal file
6
skills/scaffold/init-octobot/CLAUDE.md.tpl
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# CLAUDE.md — <project>
|
||||||
|
|
||||||
|
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.
|
||||||
6
skills/scaffold/init-octobot/README.md.tpl
Normal file
6
skills/scaffold/init-octobot/README.md.tpl
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# <project>
|
||||||
|
|
||||||
|
TODO(init-octobot): one-line description.
|
||||||
|
|
||||||
|
Run `/write-readme` for a fuller README generated from this repo's
|
||||||
|
manifests, scripts, and task runner.
|
||||||
97
skills/scaffold/init-octobot/SKILL.md
Normal file
97
skills/scaffold/init-octobot/SKILL.md
Normal file
@ -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 <repo-root>`. Two line kinds:
|
||||||
|
- `LEGACY <path>` — `CONTEXT.md`, `docs/Roadmap.md`, or `docs/adr`
|
||||||
|
exists at root.
|
||||||
|
- `CONVENTION <bullet> — <path>` — 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 (`<project>` 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 — <dir-name>`, 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.
|
||||||
79
skills/scaffold/init-octobot/scripts/repo-scan
Executable file
79
skills/scaffold/init-octobot/scripts/repo-scan
Executable file
@ -0,0 +1,79 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Scan a repo for init-octobot's two decisions. Usage: repo-scan <repo-root>
|
||||||
|
|
||||||
|
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 <path> — a write-OKF migration source exists;
|
||||||
|
init-octobot defers OKF/ROADMAP.md
|
||||||
|
creation to /write-OKF instead of
|
||||||
|
scaffolding them itself.
|
||||||
|
CONVENTION <bullet> — <path> — 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())
|
||||||
30
skills/scaffold/init-octobot/simplicity-block.md
Normal file
30
skills/scaffold/init-octobot/simplicity-block.md
Normal file
@ -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
|
||||||
|
<https://github.com/multica-ai/andrej-karpathy-skills>) every time.
|
||||||
|
- If the target repo already has an AGENTS.md with an equivalent section,
|
||||||
|
merge by hand and show the diff; never duplicate.
|
||||||
Loading…
x
Reference in New Issue
Block a user