--- name: goals description: 'Maintain GOALS.yaml fitness specification. Generate new goals from repo state, prune stale goals, update drifted checks. Triggers: "goals", "goal status", "show goals", "generate goals", "add goals", "prune goals", "update goals", "clean goals".' metadata: tier: solo dependencies: [] --- # /goals — Fitness Goal Maintenance > Maintain the GOALS.yaml that `/evolve` consumes. Run checks, generate new goals from repo state, prune stale ones. **YOU MUST EXECUTE THIS WORKFLOW. Do not just describe it.** ## Quick Start ```bash /goals # Status dashboard (default) /goals generate # Scan repo, propose new goals /goals prune # Find stale/broken goals, propose fixes ``` --- ## Mode Selection Parse the user's input to determine the mode: | Input | Mode | |-------|------| | `/goals`, `/goals status`, "goal status", "show goals" | **status** | | `/goals generate`, "generate goals", "add goals" | **generate** | | `/goals prune`, "prune goals", "update goals", "clean goals" | **prune** | --- ## Status Mode (default) ### Step 1: Parse GOALS.yaml Read `GOALS.yaml` from the repo root. Extract: - `version`, `mission`, `pillars` - All goals with `id`, `description`, `check`, `weight`, `pillar` (optional) ### Step 2: Run All Checks For each goal, execute the `check` command using Bash: - **Exit 0** = PASS - **Non-zero exit** = FAIL - **Command error** (command not found, syntax error) = ERROR Capture exit code and stderr for each. Run in parallel where possible (independent checks). ### Step 3: Group and Report Group results by category: 1. **Pillar goals** — grouped by pillar, sorted by weight (highest first) 2. **Infrastructure goals** — sorted by weight 3. **Cross-runtime goals** — sorted by weight For each goal, show: ``` [PASS] id (weight N) — description [FAIL] id (weight N) — description └─ stderr: [ERROR] id (weight N) — description └─ error: ``` ### Step 4: Summary ``` Fitness: 52/65 passing (80%) By pillar: knowledge-compounding: 9/11 (82%) weight: 45/51 validated-acceleration: 4/5 (80%) weight: 13/17 goal-driven-automation: 5/5 (100%) weight: 17/17 zero-friction-workflow: 8/10 (80%) weight: 25/34 Infrastructure: 20/25 (80%) Cross-runtime: 6/9 (67%) ``` ### Step 5: Staleness Check Flag goals whose `check` references paths that don't exist: - Extract file paths from check commands (patterns: `test -f `, `grep ... `, `cat `) - Check each path with `test -e` - Report stale references --- ## Generate Mode ### Step 1: Read Context Read these files (in parallel): - `GOALS.yaml` — existing goal IDs - `PRODUCT.md` — design principles, value props, pillars - `README.md` — claims, badges, features - `skills/SKILL-TIERS.md` — full skill list ### Step 2: Identify Coverage Gaps **Uncovered skills:** For each skill in `skills/*/SKILL.md`, check if any existing goal's `check` field references that skill directory. List skills with no goal. **Uncovered infrastructure:** Scan `tests/`, `hooks/`, `scripts/` for scripts not referenced by any goal's `check`. **Pillar coverage:** Check each of the 4 pillars has adequate goals. Reference the theoretical pillar mapping in `references/generation-heuristics.md`. **Claim verification:** Scan README.md for quantitative claims (numbers, "all", "every") that have no corresponding goal verifying them. ### Step 3: Propose Goals For each gap, draft a goal: ```yaml - id: description: "" check: "" weight: <1-5> pillar: # omit for infrastructure ``` Apply quality criteria from `references/generation-heuristics.md`: - Mechanically verifiable (shell command) - Not trivially true - Not duplicative of existing goals - Weighted by impact ### Step 4: User Selection Present proposals via `AskUserQuestion`. Group by category: - "Which pillar goals should be added?" - "Which infrastructure goals should be added?" Allow multi-select. User can also provide custom edits. ### Step 5: Write Accepted Goals Append accepted goals to `GOALS.yaml` in the appropriate section (pillar or infrastructure). Update the header comment counts: ```yaml # Total: N goals (X pillar + Y infrastructure + Z cross-runtime) ``` Count mechanically — `grep -c '^ *- id:' GOALS.yaml` — don't estimate. --- ## Prune Mode ### Step 1: Run All Checks Same as Status Mode Step 2. Collect exit codes, stderr, and timing. ### Step 2: Classify Issues For each goal, check for: **Broken checks** (ERROR status): - Command not found - Syntax error in check - References deleted files/directories **Orphaned references:** - Check references skills (`skills//`) that don't exist - Check references files that don't exist - Check references CLI commands that aren't installed **Count drift:** - Header comment says `N goals` but actual count differs - Pillar sub-counts don't match actual **Trivially true** (heuristic): - Check is `test -f ` for a file that's been in git for 6+ months unchanged - Check is `grep -q ` for content that hasn't changed in 6+ months ### Step 3: Propose Actions For each issue, propose one of: - **Remove** — goal is obsolete or duplicative - **Update check** — fix the command to reference correct paths/patterns - **Keep** — acknowledge the issue but justify keeping the goal Present via `AskUserQuestion` with multi-select. ### Step 4: Apply Changes For accepted removals: delete the goal entry from GOALS.yaml. For accepted updates: replace the check command. ### Step 5: Update Counts Recount all goals mechanically and update the header comment. --- ## See Also - `/evolve` — consumes GOALS.yaml for fitness-scored improvement loops - `skills/evolve/references/goals-schema.md` — GOALS.yaml schema definition - `references/generation-heuristics.md` — goal quality criteria and scan sources