ECC/commands
Chris Yau 0e733753e0
feat: pending instinct TTL pruning and /prune command (#725)
* feat: add pending instinct TTL pruning and /prune command

Pending instincts generated by the observer accumulate indefinitely
with no cleanup mechanism. This adds lifecycle management:

- `instinct-cli.py prune` — delete pending instincts older than 30 days
  (configurable via --max-age). Supports --dry-run and --quiet flags.
- Enhanced `status` command — shows pending count, warns at 5+,
  highlights instincts expiring within 7 days.
- `observer-loop.sh` — runs prune before each analysis cycle.
- `/prune` slash command — user-facing command for manual pruning.

Design rationale: council consensus (4/4) rejected auto-promote in
favor of TTL-based garbage collection. Frequency of observation does
not establish correctness. Unreviewed pending instincts auto-delete
after 30 days; if the pattern is real, the observer will regenerate it.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* fix: remove duplicate functions, broaden extension filter, fix prune output

- Remove duplicate _collect_pending_dirs and _parse_created_date defs
- Use ALLOWED_INSTINCT_EXTENSIONS (.md/.yaml/.yml) instead of .md-only
- Track actually-deleted items separately from expired for accurate output
- Update README.md and AGENTS.md command counts: 59 → 60

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* fix: address Copilot and CodeRabbit review findings

- Use is_dir() instead of exists() for pending path checks
- Change > to >= for --max-age boundary (--max-age 0 now prunes all)
- Use CLV2_PYTHON_CMD env var in observer-loop.sh prune call
- Remove unused source_dupes variable
- Remove extraneous f-string prefix on static string

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* fix: update AGENTS.md project structure command count 59 → 60

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: address cubic and coderabbit review findings

- Fix status early return skipping pending instinct warnings (cubic #1)
- Exclude already-expired items from expiring-soon filter (cubic #2)
- Warn on unparseable pending instinct age instead of silent skip (cubic #4)
- Log prune failures to observer.log instead of silencing (cubic #5)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: YAML single-quote unescaping, f-string cleanup, add /prune to README

- Fix single-quoted YAML unescaping: use '' doubling (YAML spec) not
  backslash escaping which only applies to double-quoted strings (greptile P1)
- Remove extraneous f-string prefix on static string (coderabbit)
- Add /prune to README command catalog and file tree (cubic)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Happy <yesreply@happy.engineering>
2026-03-22 15:40:58 -07:00
..
aside.md feat: add /aside command (#407) 2026-03-12 23:52:46 -07:00
build-fix.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
checkpoint.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
claw.md feat: deliver v1.8.0 harness reliability and parity updates 2026-03-04 14:48:06 -08:00
code-review.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
context-budget.md feat(commands): add /context-budget optimizer command (#554) 2026-03-20 00:20:23 -07:00
cpp-build.md feat: add C++ language support and hook tests (#539) 2026-03-16 14:31:49 -07:00
cpp-review.md feat: add C++ language support and hook tests (#539) 2026-03-16 14:31:49 -07:00
cpp-test.md feat: add C++ language support and hook tests (#539) 2026-03-16 14:31:49 -07:00
devfleet.md Add Claude DevFleet multi-agent orchestration skill (#505) 2026-03-16 13:35:50 -07:00
docs.md feat(commands): add /docs; feat(mcp-configs): document Context7 (#530) 2026-03-16 13:35:05 -07:00
e2e.md fix: harden hook portability and plugin docs 2026-03-09 22:49:43 -07:00
eval.md feat: package as Claude Code plugin with marketplace distribution 2026-01-22 04:16:49 -08:00
evolve.md feat: project-scoped instinct isolation 2026-03-01 12:07:13 -08:00
go-build.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
go-review.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
go-test.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
gradle-build.md feat: add Kotlin, Android, and KMP rules, agent, skills, and command 2026-03-10 20:53:39 -07:00
harness-audit.md fix(harness-audit): make scoring deterministic with scripted rubric (#524) 2026-03-16 13:34:30 -07:00
instinct-export.md feat: project-scoped instinct isolation 2026-03-01 12:07:13 -08:00
instinct-import.md feat: project-scoped instinct isolation 2026-03-01 12:07:13 -08:00
instinct-status.md feat: project-scoped instinct isolation 2026-03-01 12:07:13 -08:00
kotlin-build.md fix: align kotlin diagnostics and heading hierarchy 2026-03-12 23:53:23 -07:00
kotlin-review.md feat: add kotlin commands and skill pack 2026-03-10 21:25:52 -07:00
kotlin-test.md feat: add kotlin commands and skill pack 2026-03-10 21:25:52 -07:00
learn-eval.md docs: clarify learn-eval verdict flow 2026-03-10 20:14:19 -07:00
learn.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
loop-start.md feat: deliver v1.8.0 harness reliability and parity updates 2026-03-04 14:48:06 -08:00
loop-status.md feat: deliver v1.8.0 harness reliability and parity updates 2026-03-04 14:48:06 -08:00
model-route.md feat: deliver v1.8.0 harness reliability and parity updates 2026-03-04 14:48:06 -08:00
multi-backend.md fix(commands): make ace-tool MCP optional in multi-* commands with built-in fallbacks 2026-03-04 14:49:53 -08:00
multi-execute.md fix(commands): make ace-tool MCP optional in multi-* commands with built-in fallbacks 2026-03-04 14:49:53 -08:00
multi-frontend.md fix(commands): make ace-tool MCP optional in multi-* commands with built-in fallbacks 2026-03-04 14:49:53 -08:00
multi-plan.md fix(commands): make ace-tool MCP optional in multi-* commands with built-in fallbacks 2026-03-04 14:49:53 -08:00
multi-workflow.md feat: add orchestration workflows and harness skills 2026-03-12 14:49:05 -07:00
orchestrate.md fix: refresh orchestration follow-up after #414 (#430) 2026-03-16 14:29:28 -07:00
plan.md fix: harden hook portability and plugin docs 2026-03-09 22:49:43 -07:00
pm2.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
projects.md fix: resolve CI failures on main — lint, hooks validator, and test alignment 2026-03-02 22:15:46 -08:00
promote.md fix: resolve CI failures on main — lint, hooks validator, and test alignment 2026-03-02 22:15:46 -08:00
prompt-optimize.md feat(skills): add prompt-optimizer skill and /prompt-optimize command (#418) 2026-03-12 23:40:02 -07:00
prune.md feat: pending instinct TTL pruning and /prune command (#725) 2026-03-22 15:40:58 -07:00
python-review.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
quality-gate.md feat: deliver v1.8.0 harness reliability and parity updates 2026-03-04 14:48:06 -08:00
refactor-clean.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
resume-session.md docs: align session commands with session manager 2026-03-10 20:24:15 -07:00
rules-distill.md feat(skills): add rules-distill skill (rebased #561) (#678) 2026-03-20 01:44:55 -07:00
rust-build.md feat(agents): add Rust language support (#523) 2026-03-16 13:34:25 -07:00
rust-review.md feat(agents): add Rust language support (#523) 2026-03-16 13:34:25 -07:00
rust-test.md feat(agents): add Rust language support (#523) 2026-03-16 13:34:25 -07:00
save-session.md docs: align session commands with session manager 2026-03-10 20:24:15 -07:00
sessions.md fix: auto-detect ECC root from plugin cache when CLAUDE_PLUGIN_ROOT is unset (#547) (#691) 2026-03-20 01:38:15 -07:00
setup-pm.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
skill-create.md feat: add skill-create and continuous-learning-v2 commands 2026-01-27 04:01:06 -08:00
skill-health.md fix: auto-detect ECC root from plugin cache when CLAUDE_PLUGIN_ROOT is unset (#547) (#691) 2026-03-20 01:38:15 -07:00
tdd.md fix: harden hook portability and plugin docs 2026-03-09 22:49:43 -07:00
test-coverage.md docs: enhance 5 thin commands and add Rust API example 2026-02-12 15:38:27 -08:00
update-codemaps.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
update-docs.md Revert "feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)" 2026-02-20 01:11:30 -08:00
verify.md feat: package as Claude Code plugin with marketplace distribution 2026-01-22 04:16:49 -08:00