Add /compact skill for manual context compaction (#817)

* feat: add /compact skill for manual context compaction

added /compact session command to fight context rot in long-running sessions. Uses Claude Agent SDK's built-in /compact command with auth gating (main-group or is_from_me only).

* simplify: remove group-queue modification, streamline denied path confirmed against fresh-clone merge.

* refactor: extract handleSessionCommand from index.ts into session-commands.ts

Verified: 345/345 tests pass on fresh-clone merge.
This commit is contained in:
Akshan Krithick
2026-03-08 14:59:17 -07:00
committed by GitHub
parent 4ccc5c57f2
commit 8521e42f7b
9 changed files with 2082 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
skill: add-compact
version: 1.0.0
description: "Add /compact command for manual context compaction via Claude Agent SDK"
core_version: 1.2.10
adds:
- src/session-commands.ts
- src/session-commands.test.ts
modifies:
- src/index.ts
- container/agent-runner/src/index.ts
structured:
npm_dependencies: {}
env_additions: []
conflicts: []
depends: []
test: "npx vitest run --config vitest.skills.config.ts .claude/skills/add-compact/tests/add-compact.test.ts"