dev-skills Full Harness Setup (Interview Mode)
Goal
Turn the current repository into a project that runs the
Diagnose → Register/Draft → Plan → Resolve ⇄ Verify cycle with
mechanical guardrails (hooks) and a lean CLAUDE.md.
Skills alone are L1. This setup adds L2–L3: a short project brain
(CLAUDE.md), hard rails (hooks + settings), and cycle guidance (rules).
It never creates scheduled or cron-driven automation (L4); event-driven
GitHub Actions — strict CI and the opt-in PR Agent review — are L2–L3 and
in scope.
Principles
- Interview, no auto-detection. Do NOT infer languages from
go.mod,
package.json, etc., even when they exist. This setup targets
pre-development projects where detection misleads. File existence is
used only for overwrite/merge prompts.
- Never overwrite existing CLAUDE.md / settings / hooks without
explicit per-file approval. Prefer merge (append missing sections).
- Hooks enforce hard rules; CLAUDE.md holds soft guidance. Keep
CLAUDE.md short — detail lives in skills and
.claude/rules/.
- Write files only after the user approves the Phase 4 summary.
Workflow
Ask one phase at a time and wait for answers. If the user says
"use defaults", still require the primary language choice, then apply
the defaults table below to everything else.
How to ask (question-tool contract)
When a structured question tool (e.g. AskUserQuestion) is available, use one
call per phase, and keep every call within the tool's contract — violating it
aborts the turn with "Invalid tool parameters":
- At most 4 questions per call; every question needs 2–4 predefined
options — never an empty or single-option list. A free-text "Other"
choice is provided by the tool automatically; rely on it for custom values
instead of inventing an "enter manually" option list.
- Free-form items (project name, custom commands) must still offer 2+
options: make option 1 the recommended default (e.g. "Use directory name:
- Multi-choice items (additional languages, components) use the tool's
multi-select mode.
- If the tool is unavailable or returns an error, fall back to asking the
same questions as plain chat text and wait for the answers — never skip a
phase because the tool failed.
Phase 0 — Preconditions
- Confirm the target is a git repository (offer
git init if not).
- Check existence (existence only — do not read to guess the stack) of:
CLAUDE.md, .claude/settings.json, .claude/hooks/,
.claude/rules/dev-skills-cycle.md, .claude/skills/.
- Tell the user: existing files will each get an overwrite/merge/skip
question in Phase 3.
Phase 1 — Project skeleton (required)
- Q1. Project name — options: "Use directory name: (Recommended)" /
"Use repository name" (custom names come via Other).
- Q2. Primary language (choose exactly one):
Go / Python / TypeScript / JavaScript.
- Q3. Additional languages (multi-select) — none, or any others from the
same list.
- Q4. Default branch — options:
main (Recommended) / master
(anything else via Other).
Phase 2 — Per-language commands
Ask for the primary language in full; for additional languages a quick
confirm of the defaults is enough. Propose these defaults:
| Language |
Install |
Test |
Lint |
Format (hook) |
| Go |
go mod download |
go test ./... |
golangci-lint run (fallback go vet ./...) |
goimports (fallback gofmt) |
| Python (uv) |
uv sync |
uv run pytest |
uv run ruff check |
uv run ruff format |
| Python (pip) |
pip install -e . |
pytest |
ruff check |
ruff format |
| Python (poetry) |
poetry install |
poetry run pytest |
poetry run ruff check |
poetry run ruff format |
| TypeScript |
{pm} install |
{pm} test |
{pm} run lint |
Prettier |
| JavaScript |
{pm} install |
{pm} test |
{pm} run lint |
Prettier |
- Node projects: ask the package manager first (pnpm / npm / yarn / bun;
propose pnpm), then substitute
{pm}.
- TypeScript only: also ask about typecheck (
{pm} exec tsc --noEmit /
a script name / none).
- Python only: ask the package manager (uv / pip / poetry; propose uv).
If uv, ask: "Enable a hook that blocks
pip install in favor of
uv add?" (Y/n).
Phase 3 — Harness scope
- Q-H1. Components (multi-select, every entry recommended ON by default):
CLAUDE.md / skills (
npx skills add ymd38/dev-skills --skill '*' --agent claude-code -y --copy) /
format hook / bash-guard hook / SessionStart + Stop guidance hooks /
.claude/rules/ (cycle contract + score-aligned coding principles +
per-language rules for the chosen languages) /
GitHub Actions CI (ci.yml per language + security-scan.yml +
.gitleaks.toml + .semgrepignore; gitleaks and semgrep are hard
gates from day one — shift-left — while trivy starts as informational
continue-on-error) /
.env guard (.gitignore entries + .env.example).
- Q-H1b. Optional paid add-on (default OFF; independent of the CI
answer — it composes with a project's existing CI): PR Agent
(
.github/workflows/pr-agent.yml + .pr_agent.toml; advisory
qodo-ai/pr-agent review — describe / review / improve when a PR opens,
/review on each push, slash commands for repository members). Needs an
OPENAI_KEY repository secret and API billing; it is advice, never a
required status check.
- Q-H2. Per existing file: merge (append only the missing sections) /
back up then replace / skip.
- Q-H3. Bash guard strength: standard (rm -rf /, force-push to the
default branch, redirects into
.env) / standard + pip guard (uv
projects) / none.
Phase 4 — Confirm, then apply
Show a summary of every answer and every file that will be created or
modified. Wait for explicit approval. On approval, apply as follows.
Preferred path — run the installer, then refine:
Locate harness/scripts/setup.sh:
in this repo if it is dev-skills or contains a clone/submodule, else
fetch via the official one-liner (network required):
curl -fsSL https://raw.githubusercontent.com/ymd38/dev-skills/main/harness/scripts/install.sh \
| bash -s -- --langs <langs> --pm <pm> --python-pm <py-pm> --branch <branch> --name <name> [--guard-pip] [--with-skills] [--pr-agent]
Map EVERY Phase 3 answer to a flag — the applied changes must equal the
approved summary exactly: languages (primary first) → --langs,
Node PM → --pm, Python PM → --python-pm, pip guard → --guard-pip,
skills ON → --with-skills, CI OFF → --no-ci, format hook OFF →
--no-format-hook, bash guard OFF → --no-bash-guard, guidance hooks
OFF → --no-guidance-hooks, rules OFF → --no-rules, .env guard OFF →
--no-env-guard, PR Agent ON → --pr-agent (allowed with --no-ci,
never with --minimal). If the user wants branch protection applied and gh
is authenticated with admin rights, add --protect.
The installer never overwrites existing files, which is exactly the
merge-safe behavior wanted here.
Then reconcile whatever the installer reported as "kept existing" or
"proposed" against the user's Phase 3 answers:
- The installer never overwrites: files that differ from the incoming
version are written as
<file>.new. For each one, show the user the
diff and offer to merge it (or discard the .new) — apply only what
they approve, then delete the .new file.
- CLAUDE.md kept + user chose merge → append only the missing
sections (Stack & commands for the chosen languages, the cycle
section, Hard rules), following
harness/templates/CLAUDE.md.template.
- settings kept unmerged (no jq) → merge the
hooks block by hand,
preserving every existing user hook.
- Any file the user chose to skip → leave untouched even if the
installer would have created it (delete nothing; just don't add).
Adjust generated CLAUDE.md commands to any non-default answers from
Phase 2 (e.g. a custom test script name).
Fallback (no network, no local copy): report that the harness
templates are unavailable and stop after writing only what can be
written faithfully from this document — do not improvise hook scripts
from memory.
Phase 5 — Verify and report
Print a final checklist:
[dev-skills harness]
skills: OK (N) / MISSING
CLAUDE.md: CREATED / MERGED / SKIPPED
hooks: OK (selected scripts, executable)
settings: OK / MERGED / needs manual merge
rules: OK / skipped
CI: OK / skipped
protection: configured / NOT CONFIGURED / applied
pr-agent: disabled / written (OPENAI_KEY secret required)
next: restart Claude Code to load hooks, then try /yds-software-evaluation .
Two follow-ups matter for the gates to actually gate:
Branch protection. A CI check only blocks merges once it is a
required status check. The installer reports the state; if it says
NOT CONFIGURED, treat setup as incomplete and either re-run with
--protect (needs gh auth + admin + a pushed default branch) or walk
the user through GitHub settings. Do not report overall success while
protection is unconfigured — report it as an explicit remaining step.
Strict CI. The generated jobs intentionally fail when lint /
typecheck / test scripts (or any tests) are missing. Tell the user the
first code PR must land with those in place — that is the shift-left
contract, not a bug.
PR Agent secret. If --pr-agent was applied, the PR Agent workflow
fails on every PR until the OPENAI_KEY repository secret exists. Report
it as an explicit remaining step; it is advisory and must never be added
to required status checks.
Remind the user that hooks load at session start — a restart (or new
session) is needed before the guard/format hooks take effect.
Stop conditions
- User declines the Phase 4 summary → stop after reporting what would
have changed. Write nothing.
- User declines an overwrite → keep the file, note it in the checklist.
- Unknown/other language requested → set up the supported languages,
leave a
# TODO stack block for the rest, and say so.
Non-goals
- No scheduled loops or cron (L4) — separate task only. Event-driven GitHub
Actions (CI, PR Agent) are in scope.
- No Semgrep / gh installation — mention prerequisites, don't install.
- No rewriting of existing architecture docs or unrelated refactors.
1---2name: yds-setup3description: Install the full dev-skills harness into the current project through a short interview: CLAUDE.md, hooks, .claude/settings.json, rules, and skill wiring. Asks — never auto-detects — the languages (Go / Python / TypeScript / JavaScript) and commands, then writes files only after an approved summary. Use when the user asks to set up / install / bootstrap dev-skills, the harness, or the continuous improvement cycle. Triggers: セットアップして, ハーネスを入れて, harnessを入れて, dev-skillsを導入して, プロジェクトを初期化して, '/yds-setup', 'set up the harness', 'install dev-skills', 'bootstrap this project'.4---56# dev-skills Full Harness Setup (Interview Mode)78## Goal910Turn the current repository into a project that runs the11**Diagnose → Register/Draft → Plan → Resolve ⇄ Verify** cycle with12mechanical guardrails (hooks) and a lean CLAUDE.md.1314Skills alone are L1. This setup adds L2–L3: a short project brain15(CLAUDE.md), hard rails (hooks + settings), and cycle guidance (rules).16It never creates scheduled or cron-driven automation (L4); event-driven17GitHub Actions — strict CI and the opt-in PR Agent review — are L2–L3 and18in scope.1920## Principles2122- **Interview, no auto-detection.** Do NOT infer languages from `go.mod`,23 `package.json`, etc., even when they exist. This setup targets24 pre-development projects where detection misleads. File existence is25 used only for overwrite/merge prompts.26- **Never overwrite** existing CLAUDE.md / settings / hooks without27 explicit per-file approval. Prefer merge (append missing sections).28- Hooks enforce hard rules; CLAUDE.md holds soft guidance. Keep29 CLAUDE.md short — detail lives in skills and `.claude/rules/`.30- Write files **only after** the user approves the Phase 4 summary.3132## Workflow3334Ask one phase at a time and wait for answers. If the user says35"use defaults", still require the primary language choice, then apply36the defaults table below to everything else.3738### How to ask (question-tool contract)3940When a structured question tool (e.g. AskUserQuestion) is available, use one41call per phase, and keep every call within the tool's contract — violating it42aborts the turn with "Invalid tool parameters":4344- At most 4 questions per call; **every question needs 2–4 predefined45 options** — never an empty or single-option list. A free-text "Other"46 choice is provided by the tool automatically; rely on it for custom values47 instead of inventing an "enter manually" option list.48- Free-form items (project name, custom commands) must still offer 2+49 options: make option 1 the recommended default (e.g. "Use directory name:50 <dir> (Recommended)") and a sensible alternative; custom values arrive via51 the built-in Other.52- Multi-choice items (additional languages, components) use the tool's53 multi-select mode.54- If the tool is unavailable or returns an error, fall back to asking the55 same questions as plain chat text and wait for the answers — never skip a56 phase because the tool failed.5758### Phase 0 — Preconditions59601. Confirm the target is a git repository (offer `git init` if not).612. Check existence (existence only — do not read to guess the stack) of:62 `CLAUDE.md`, `.claude/settings.json`, `.claude/hooks/`,63 `.claude/rules/dev-skills-cycle.md`, `.claude/skills/`.643. Tell the user: existing files will each get an overwrite/merge/skip65 question in Phase 3.6667### Phase 1 — Project skeleton (required)6869- **Q1. Project name** — options: "Use directory name: <dir> (Recommended)" /70 "Use repository name" (custom names come via Other).71- **Q2. Primary language (choose exactly one):**72 Go / Python / TypeScript / JavaScript.73- **Q3. Additional languages** (multi-select) — none, or any others from the74 same list.75- **Q4. Default branch** — options: `main` (Recommended) / `master`76 (anything else via Other).7778### Phase 2 — Per-language commands7980Ask for the primary language in full; for additional languages a quick81confirm of the defaults is enough. Propose these defaults:8283| Language | Install | Test | Lint | Format (hook) |84| --------------- | ------------------ | ------------------- | --------------------------------------------- | ------------------------------ |85| Go | `go mod download` | `go test ./...` | `golangci-lint run` (fallback `go vet ./...`) | `goimports` (fallback `gofmt`) |86| Python (uv) | `uv sync` | `uv run pytest` | `uv run ruff check` | `uv run ruff format` |87| Python (pip) | `pip install -e .` | `pytest` | `ruff check` | `ruff format` |88| Python (poetry) | `poetry install` | `poetry run pytest` | `poetry run ruff check` | `poetry run ruff format` |89| TypeScript | `{pm} install` | `{pm} test` | `{pm} run lint` | Prettier |90| JavaScript | `{pm} install` | `{pm} test` | `{pm} run lint` | Prettier |9192- Node projects: ask the package manager first (pnpm / npm / yarn / bun;93 propose pnpm), then substitute `{pm}`.94- TypeScript only: also ask about typecheck (`{pm} exec tsc --noEmit` /95 a script name / none).96- Python only: ask the package manager (uv / pip / poetry; propose uv).97 If uv, ask: "Enable a hook that blocks `pip install` in favor of98 `uv add`?" (Y/n).99100### Phase 3 — Harness scope101102- **Q-H1. Components** (multi-select, every entry recommended ON by default):103 CLAUDE.md / skills (`npx skills add ymd38/dev-skills --skill '*' --agent claude-code -y --copy`) /104 format hook / bash-guard hook / SessionStart + Stop guidance hooks /105 `.claude/rules/` (cycle contract + score-aligned coding principles +106 per-language rules for the chosen languages) /107 GitHub Actions CI (`ci.yml` per language + `security-scan.yml` +108 `.gitleaks.toml` + `.semgrepignore`; gitleaks and semgrep are hard109 gates from day one — shift-left — while trivy starts as informational110 `continue-on-error`) /111 .env guard (`.gitignore` entries + `.env.example`).112- **Q-H1b. Optional paid add-on** (default OFF; independent of the CI113 answer — it composes with a project's existing CI): PR Agent114 (`.github/workflows/pr-agent.yml` + `.pr_agent.toml`; advisory115 qodo-ai/pr-agent review — describe / review / improve when a PR opens,116 `/review` on each push, slash commands for repository members). Needs an117 `OPENAI_KEY` repository secret and API billing; it is advice, never a118 required status check.119- **Q-H2. Per existing file**: merge (append only the missing sections) /120 back up then replace / skip.121- **Q-H3. Bash guard strength**: standard (rm -rf /, force-push to the122 default branch, redirects into `.env`) / standard + pip guard (uv123 projects) / none.124125### Phase 4 — Confirm, then apply126127Show a summary of every answer and every file that will be created or128modified. Wait for explicit approval. On approval, apply as follows.129130**Preferred path — run the installer, then refine:**1311321. Locate `harness/scripts/setup.sh`:133 - in this repo if it _is_ dev-skills or contains a clone/submodule, else134 - fetch via the official one-liner (network required):135136 ```bash137 curl -fsSL https://raw.githubusercontent.com/ymd38/dev-skills/main/harness/scripts/install.sh \138 | bash -s -- --langs <langs> --pm <pm> --python-pm <py-pm> --branch <branch> --name <name> [--guard-pip] [--with-skills] [--pr-agent]139 ```140141 Map EVERY Phase 3 answer to a flag — the applied changes must equal the142 approved summary exactly: languages (primary first) → `--langs`,143 Node PM → `--pm`, Python PM → `--python-pm`, pip guard → `--guard-pip`,144 skills ON → `--with-skills`, CI OFF → `--no-ci`, format hook OFF →145 `--no-format-hook`, bash guard OFF → `--no-bash-guard`, guidance hooks146 OFF → `--no-guidance-hooks`, rules OFF → `--no-rules`, .env guard OFF →147 `--no-env-guard`, PR Agent ON → `--pr-agent` (allowed with `--no-ci`,148 never with `--minimal`). If the user wants branch protection applied and `gh`149 is authenticated with admin rights, add `--protect`.150 The installer never overwrites existing files, which is exactly the151 merge-safe behavior wanted here.1521532. Then reconcile whatever the installer reported as "kept existing" or154 "proposed" against the user's Phase 3 answers:155 - The installer never overwrites: files that differ from the incoming156 version are written as `<file>.new`. For each one, show the user the157 diff and offer to merge it (or discard the `.new`) — apply only what158 they approve, then delete the `.new` file.159 - CLAUDE.md kept + user chose **merge** → append only the missing160 sections (Stack & commands for the chosen languages, the cycle161 section, Hard rules), following `harness/templates/CLAUDE.md.template`.162 - settings kept unmerged (no jq) → merge the `hooks` block by hand,163 preserving every existing user hook.164 - Any file the user chose to **skip** → leave untouched even if the165 installer would have created it (delete nothing; just don't add).1663. Adjust generated CLAUDE.md commands to any non-default answers from167 Phase 2 (e.g. a custom test script name).168169**Fallback (no network, no local copy):** report that the harness170templates are unavailable and stop after writing only what can be171written faithfully from this document — do not improvise hook scripts172from memory.173174### Phase 5 — Verify and report175176Print a final checklist:177178```179[dev-skills harness]180 skills: OK (N) / MISSING181 CLAUDE.md: CREATED / MERGED / SKIPPED182 hooks: OK (selected scripts, executable)183 settings: OK / MERGED / needs manual merge184 rules: OK / skipped185 CI: OK / skipped186 protection: configured / NOT CONFIGURED / applied187 pr-agent: disabled / written (OPENAI_KEY secret required)188 next: restart Claude Code to load hooks, then try /yds-software-evaluation .189```190191Two follow-ups matter for the gates to actually gate:192193- **Branch protection.** A CI check only blocks merges once it is a194 required status check. The installer reports the state; if it says195 NOT CONFIGURED, treat setup as incomplete and either re-run with196 `--protect` (needs `gh` auth + admin + a pushed default branch) or walk197 the user through GitHub settings. Do not report overall success while198 protection is unconfigured — report it as an explicit remaining step.199- **Strict CI.** The generated jobs intentionally fail when lint /200 typecheck / test scripts (or any tests) are missing. Tell the user the201 first code PR must land with those in place — that is the shift-left202 contract, not a bug.203204- **PR Agent secret.** If `--pr-agent` was applied, the `PR Agent` workflow205 fails on every PR until the `OPENAI_KEY` repository secret exists. Report206 it as an explicit remaining step; it is advisory and must never be added207 to required status checks.208209Remind the user that hooks load at session start — a restart (or new210session) is needed before the guard/format hooks take effect.211212## Stop conditions213214- User declines the Phase 4 summary → stop after reporting what _would_215 have changed. Write nothing.216- User declines an overwrite → keep the file, note it in the checklist.217- Unknown/other language requested → set up the supported languages,218 leave a `# TODO` stack block for the rest, and say so.219220## Non-goals221222- No scheduled loops or cron (L4) — separate task only. Event-driven GitHub223 Actions (CI, PR Agent) are in scope.224- No Semgrep / gh installation — mention prerequisites, don't install.225- No rewriting of existing architecture docs or unrelated refactors.