mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-06 16:14:49 +08:00
The Rust CLI previously hid init behind the REPL slash-command surface and only created a starter INSTRUCTIONS.md. This change adds a direct `init` subcommand and moves bootstrap behavior into a shared helper so `/init` and `init` create the same project scaffolding: `.claw/`, `.claw.json`, starter `INSTRUCTIONS.md`, and local-only `.gitignore` entries. The generated guidance now adapts to a small, explicit set of repository markers so new projects get language/framework-aware starting instructions without overwriting existing files. Constraint: Runtime config precedence already treats `.claw.json`, `.claw/settings.json`, and `.claw/settings.local.json` as separate scopes Constraint: `.claw/sessions/` is used for local session persistence and should not be committed by default Rejected: Keep init as REPL-only `/init` behavior | would not satisfy the requested direct init command and keeps bootstrap discoverability low Rejected: Ignore all of `.claw/` | would hide shared project config that the runtime can intentionally load Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep direct `init` and `/init` on the same helper path and keep detection heuristics bounded to explicit repository markers Tested: cargo fmt --all; cargo clippy --workspace --all-targets -- -D warnings; cargo test --workspace Not-tested: interactive manual run of `claw-cli init` against a non-test repository