diff --git a/agents/gsd-executor.md b/agents/gsd-executor.md index 89980da5c..7fc58e8f8 100644 --- a/agents/gsd-executor.md +++ b/agents/gsd-executor.md @@ -342,6 +342,9 @@ git add src/types/user.ts | `fix` | Bug fix, error correction | | `test` | Test-only changes (TDD RED) | | `refactor` | Code cleanup, no behavior change | +| `perf` | Performance improvement, no behavior change | +| `docs` | Documentation only | +| `style` | Formatting, whitespace, no logic change | | `chore` | Config, tooling, dependencies | **4. Commit:** diff --git a/get-shit-done/workflows/execute-plan.md b/get-shit-done/workflows/execute-plan.md index f9de1aebc..99aa9da1c 100644 --- a/get-shit-done/workflows/execute-plan.md +++ b/get-shit-done/workflows/execute-plan.md @@ -188,32 +188,12 @@ Auth errors during execution are NOT failures — they're expected interaction p ## Deviation Rules -You WILL discover unplanned work. Apply automatically, track all for Summary. - -| Rule | Trigger | Action | Permission | -|------|---------|--------|------------| -| **1: Bug** | Broken behavior, errors, wrong queries, type errors, security vulns, race conditions, leaks | Fix → test → verify → track `[Rule 1 - Bug]` | Auto | -| **2: Missing Critical** | Missing essentials: error handling, validation, auth, CSRF/CORS, rate limiting, indexes, logging | Add → test → verify → track `[Rule 2 - Missing Critical]` | Auto | -| **3: Blocking** | Prevents completion: missing deps, wrong types, broken imports, missing env/config/files, circular deps | Fix blocker → verify proceeds → track `[Rule 3 - Blocking]` | Auto | -| **4: Architectural** | Structural change: new DB table, schema change, new service, switching libs, breaking API, new infra | STOP → present decision (below) → track `[Rule 4 - Architectural]` | Ask user | - -**Rule 4 format:** -``` -⚠️ Architectural Decision Needed - -Current task: [task name] -Discovery: [what prompted this] -Proposed change: [modification] -Why needed: [rationale] -Impact: [what this affects] -Alternatives: [other approaches] - -Proceed with proposed change? (yes / different approach / defer) -``` - -**Priority:** Rule 4 (STOP) > Rules 1-3 (auto) > unsure → Rule 4 -**Edge cases:** missing validation → R2 | null crash → R1 | new table → R4 | new column → R1/2 -**Heuristic:** Affects correctness/security/completion? → R1-3. Maybe? → R4. +Apply deviation rules from the gsd-executor agent definition (single source of truth): +- **Rules 1-3** (bugs, missing critical, blockers): auto-fix, test, verify, track as deviations +- **Rule 4** (architectural changes): STOP, present decision to user, await approval +- **Scope boundary**: do not auto-fix pre-existing issues unrelated to current task +- **Fix attempt limit**: max 3 retries per deviation before escalating +- **Priority**: Rule 4 (STOP) > Rules 1-3 (auto) > unsure → Rule 4 @@ -266,59 +246,13 @@ If a commit is BLOCKED by a hook: ## Task Commit Protocol -After each task (verification passed, done criteria met), commit immediately. - -**1. Check:** `git status --short` - -**2. Stage individually** (NEVER `git add .` or `git add -A`): -```bash -git add src/api/auth.ts -git add src/types/user.ts -``` - -**3. Commit type:** - -| Type | When | Example | -|------|------|---------| -| `feat` | New functionality | feat(08-02): create user registration endpoint | -| `fix` | Bug fix | fix(08-02): correct email validation regex | -| `test` | Test-only (TDD RED) | test(08-02): add failing test for password hashing | -| `refactor` | No behavior change (TDD REFACTOR) | refactor(08-02): extract validation to helper | -| `perf` | Performance | perf(08-02): add database index | -| `docs` | Documentation | docs(08-02): add API docs | -| `style` | Formatting | style(08-02): format auth module | -| `chore` | Config/deps | chore(08-02): add bcrypt dependency | - -**4. Format:** `{type}({phase}-{plan}): {description}` with bullet points for key changes. - - -**Sub-repos mode:** If `sub_repos` is configured (non-empty array from init context), use `commit-to-subrepo` instead of standard git commit. This routes files to their correct sub-repo based on path prefix. - -```bash -node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit-to-subrepo "{type}({phase}-{plan}): {description}" --files file1 file2 ... -``` - -The command groups files by sub-repo prefix and commits atomically to each. Returns JSON: `{ committed: true, repos: { "backend": { hash: "abc", files: [...] }, ... } }`. - -Record hashes from each repo in the response for SUMMARY tracking. - -**If `sub_repos` is empty or not set:** Use standard git commit flow below. - - -**5. Record hash:** -```bash -TASK_COMMIT=$(git rev-parse --short HEAD) -TASK_COMMITS+=("Task ${TASK_NUM}: ${TASK_COMMIT}") -``` - -**6. Check for untracked generated files:** -```bash -git status --short | grep '^??' -``` -If new untracked files appeared after running scripts or tools, decide for each: -- **Commit it** — if it's a source file, config, or intentional artifact -- **Add to .gitignore** — if it's a generated/runtime output (build artifacts, `.env` files, cache files, compiled output) -- Do NOT leave generated files untracked +Follow the task commit protocol from the gsd-executor agent definition (single source of truth): +- Stage files individually (NEVER `git add .` or `git add -A`) +- Format: `{type}({phase}-{plan}): {concise description}` with bullet points for key changes +- Types: feat, fix, test, refactor, perf, docs, style, chore +- Sub-repos: use `commit-to-subrepo` when `sub_repos` is configured +- Record commit hash for SUMMARY tracking +- Check for untracked generated files after each commit