From f1dc05a1737dde92ce329915bf2c24283bd7aedd Mon Sep 17 00:00:00 2001 From: Shay Date: Wed, 17 Jun 2026 11:17:55 -0700 Subject: [PATCH] docs(agent-governance): require workspace hygiene in Grok bootstrap --- skills/core-bootstrap.md | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/skills/core-bootstrap.md b/skills/core-bootstrap.md index 4def1845..799c0fd3 100644 --- a/skills/core-bootstrap.md +++ b/skills/core-bootstrap.md @@ -1,17 +1,38 @@ --- name: core-bootstrap -description: Mandatory statelessness compensation + smoke test + recent handoff check for CORE. Auto-invoked on session/subagent start. +description: Mandatory statelessness compensation, workspace hygiene, clean-baseline setup, smoke test, and recent handoff check for CORE. Auto-invoked on session/subagent start. triggers: ["session_start", "new_subagent", "arena_spawn"] auto_invoke: true --- -Execute the full **Session Start Checklist** from GROK.md in strict order: +Execute the full **Session Start Checklist** from GROK.md in strict order, including the **Workspace Hygiene + Branch/Worktree Protocol**: 1. Read GROK.md in full. 2. Read AGENTS.md in full. 3. Read docs/runtime_contracts.md in full. -4. Run `core test --suite smoke -q` and report pass/fail. -5. Check for and read any HANDOFF-*-YYYY-MM-DD.md from the last 3 days. -6. State task scope in one clear sentence before any further action. +4. Confirm project root: + - `pwd` + - `git rev-parse --show-toplevel` + - verify `GROK.md` and `AGENTS.md` exist. +5. Inspect local state before any branch movement: + - `git status --short --branch` + - `git diff --stat` + - `git diff --name-status` + - `git diff --cached --name-status` + - `git stash list` + - `git worktree list` +6. If dirty, classify every changed or untracked file before switching branches. Unknown work must be preserved with a descriptive stash, not destroyed. +7. Fetch current repository state: + - `git fetch origin --prune` +8. If starting new work, establish clean current main: + - `git switch main` + - `git pull --ff-only origin main` +9. For non-trivial implementation, create a fresh worktree from `origin/main` unless the user explicitly requests same-worktree work. +10. Run `core test --suite smoke -q` and report pass/fail. If unavailable, report the exact failure and use repo-native pytest lanes. +11. Check for and read any `HANDOFF-*-YYYY-MM-DD.md` from the last 3 days. +12. Check recent open PRs if local changes or task continuity are ambiguous: + - `gh pr list --state open --limit 20` + - `gh pr status` +13. State task scope in one clear sentence before any further action. -This skill must complete successfully before any editing, proposal, or subagent work. It is non-bypassable for Grok 4.3 / Grok Build sessions on CORE. \ No newline at end of file +This skill must complete successfully before any editing, proposal, or subagent work. It is non-bypassable for Grok 4.3 / Grok Build sessions on CORE.