- Read: ARCHITECTURE.md, PROCESS.md, DECISIONS.md, CHANGELOG.md, RISK_REGISTER.md.
- Create worktree:
.worktrees/task-<ID>(newtask-<ID>branch).gralph startauto-creates a worktree under.worktrees/<unique-worktree>per PRD run unless--no-worktreeis set ordefaults.auto_worktreeis false.- Auto worktree resolves the repo from the target run directory and preserves subdirectory paths inside the worktree.
- Auto worktree skips when the target is not in a git repo or the repo has no commits; if the repo is dirty, gralph commits changes before creating the worktree.
- Implement ONLY the assigned task in the Rust codebase (
src/) or scoped docs. - Update:
- CHANGELOG.md (include Task ID)
- DECISIONS.md (if decision made)
- RISK_REGISTER.md (if new risk found)
- ARCHITECTURE.md (delta update)
- Run checklist + verification:
cargo build --workspacecargo test --workspacecargo tarpaulin --workspace --fail-under 60(must compile and run to completion)- CI/CD preflight matches
.github/workflows/ci.yml - Worktree is clean
- On loop completion,
gralphrunsgralph verifierautomatically unlessverifier.auto_runis false. The verifier runs tests, coverage, and static checks, creates a PR viagh(using the repo template), and waits for the configured review gate (greptile by default) plus green checks.- By default the review gate requires explicit approval; set
verifier.review.require_approval: falseto allow auto-merge without an approval requirement. - If auto-run is disabled, run
gralph verifiermanually in the worktree.
- By default the review gate requires explicit approval; set
- Verifier merges the PR via
ghafter the review gate passes.
gralph cleanup marks stale sessions by default (running sessions with dead PIDs)
using the state store. Use --remove to delete stale sessions from state. Use
--purge to delete all sessions from state; it is explicit opt-in.
- Ensure you are on a new task branch/worktree; never finish the last PRD task on main.
- Run
cargo test --workspaceand confirm coverage >= 90% with: - Run
cargo test --workspaceandcargo tarpaulin --workspace --fail-under 60 - Ensure CI/CD will pass (run the same checks as
.github/workflows/ci.ymlor confirm a green CI run). - Open a PR with
ghbefore merging the final task and ensure the review gate passes.
- Any task lacking Context Bundle or DoD is invalid.
- If conflicts occur, record in CHANGELOG.
- New risks must be added to RISK_REGISTER.md with mitigation.
- Rust CLI is the source of truth; do not reintroduce shell scripts.
- Test coverage must remain >= 90%.
- Update checks are best-effort; disable with
defaults.check_updates: falseorGRALPH_NO_UPDATE_CHECK=1. - Background runs write logs to
.gralph/<session>.log; tail withgralph logs <name> --follow. - The soft coverage target (
verifier.coverage_warn) is a warning-only signal set to 80 percent; it does not block merges or changeverifier.coverage_min. - It was raised after coverage stayed stable for at least two consecutive cycles.
- Final PRD task requires a PR, review gate approval, and green CI before merge.
- Use
ghfor PR creation, review checks, and merges. - Commit messages must be lower-case conventional commits (for example:
feat: add verifier pipeline). - Env var mutation in tests must use the local helpers guarded by
ENV_LOCK; never callstd::env::set_varorstd::env::remove_vardirectly.