mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-02 11:45:20 +02:00
feat: add context intelligence, health, swarm, and refactoring to roadmap
9 new TODOS across 4 sections based on Claude Code ecosystem research: - Context Intelligence (P1): preamble artifact recovery, session timeline, cross-session injection, /checkpoint skill, vision doc - Health (P1): /health dashboard with CodeScene MCP integration option, /health as /ship quality gate - Swarm (P2): extract Review Army into reusable multi-agent primitive - Refactoring (P2): /refactor-prep for pre-refactor token hygiene Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -646,6 +646,116 @@ Shipped in v0.6.5. TemplateContext in gen-skill-docs.ts bakes skill name into pr
|
||||
**Priority:** P3
|
||||
**Depends on:** Telemetry data showing freeze hook fires in real /investigate sessions
|
||||
|
||||
## Context Intelligence
|
||||
|
||||
### Context recovery preamble
|
||||
|
||||
**What:** Add ~10 lines of prose to the preamble telling the agent to re-read gstack artifacts (CEO plans, design reviews, eng reviews, checkpoints) after compaction or context degradation.
|
||||
|
||||
**Why:** gstack skills produce valuable artifacts stored at `~/.gstack/projects/$SLUG/`. When Claude's auto-compaction fires, it preserves a generic summary but doesn't know these artifacts exist. The plans and reviews that shaped the current work silently vanish from context, even though they're still on disk. This is the thing nobody else in the Claude Code ecosystem is solving, because nobody else has gstack's artifact architecture.
|
||||
|
||||
**Context:** Inspired by Anthropic's `claude-progress.txt` pattern for long-running agents. Also informed by claude-mem's "progressive disclosure" approach. See `docs/designs/SESSION_INTELLIGENCE.md` for the broader vision. CEO plan: `~/.gstack/projects/garrytan-gstack/ceo-plans/2026-03-31-session-intelligence-layer.md`.
|
||||
|
||||
**Effort:** S (human: ~30 min / CC: ~5 min)
|
||||
**Priority:** P1
|
||||
**Depends on:** None
|
||||
**Key files:** `scripts/resolvers/preamble.ts`
|
||||
|
||||
### Session timeline
|
||||
|
||||
**What:** Append one-line JSONL entry to `~/.gstack/projects/$SLUG/timeline.jsonl` after every skill run (timestamp, skill, branch, outcome). `/retro` renders the timeline.
|
||||
|
||||
**Why:** Makes AI-assisted work history visible. `/retro` can show "this week: 3 /review, 2 /ship, 1 /investigate." Provides the observability layer for the session intelligence architecture.
|
||||
|
||||
**Effort:** S (human: ~1h / CC: ~5 min)
|
||||
**Priority:** P1
|
||||
**Depends on:** None
|
||||
**Key files:** `scripts/resolvers/preamble.ts`, `retro/SKILL.md.tmpl`
|
||||
|
||||
### Cross-session context injection
|
||||
|
||||
**What:** When a new gstack session starts on a branch with recent checkpoints or plans, the preamble prints a one-line summary: "Last session: implemented JWT auth, 3/5 tasks done." Agent knows where you left off before reading any files.
|
||||
|
||||
**Why:** Claude starts every session fresh. This one-liner orients the agent immediately. Similar to claude-mem's SessionStart hook pattern but simpler and integrated.
|
||||
|
||||
**Effort:** S (human: ~2h / CC: ~10 min)
|
||||
**Priority:** P2
|
||||
**Depends on:** Context recovery preamble
|
||||
|
||||
### /checkpoint skill
|
||||
|
||||
**What:** Manual skill to snapshot current working state: what's being done and why, files being edited, decisions made (and rationale), what's done vs. remaining, critical types/signatures. Saved to `~/.gstack/projects/$SLUG/checkpoints/<timestamp>.md`.
|
||||
|
||||
**Why:** Useful before stepping away from a long session, before known-complex operations that might trigger compaction, for handing off context to a different agent/workspace, or coming back to a project after days away.
|
||||
|
||||
**Effort:** M (human: ~1 week / CC: ~30 min)
|
||||
**Priority:** P2
|
||||
**Depends on:** Context recovery preamble
|
||||
**Key files:** New `checkpoint/SKILL.md.tmpl`, `scripts/gen-skill-docs.ts`
|
||||
|
||||
### Session Intelligence Layer design doc
|
||||
|
||||
**What:** Write `docs/designs/SESSION_INTELLIGENCE.md` describing the architectural vision: gstack as the persistent brain that survives Claude's ephemeral context. Every skill writes to `~/.gstack/projects/$SLUG/`, preamble re-reads, `/retro` rolls up.
|
||||
|
||||
**Why:** Connects context recovery, health, checkpoint, and timeline features into a coherent architecture. Nobody else in the ecosystem is building this.
|
||||
|
||||
**Effort:** S (human: ~2h / CC: ~15 min)
|
||||
**Priority:** P1
|
||||
**Depends on:** None
|
||||
|
||||
## Health
|
||||
|
||||
### /health — Project Health Dashboard
|
||||
|
||||
**What:** Skill that runs type-check, lint, test suite, and dead code scan, then reports a composite 0-10 health score with breakdown by category. Tracks over time in `~/.gstack/health/<project-slug>/` for trend detection. Optionally integrates CodeScene MCP for deeper complexity/cohesion/coupling analysis.
|
||||
|
||||
**Why:** No quick way to get "state of the codebase" before starting work. CodeScene peer-reviewed research shows AI-generated code increases static analysis warnings by 30%, code complexity by 41%, and change failure rates by 30%. Users need guardrails. Like `/qa` but for code quality rather than browser behavior.
|
||||
|
||||
**Context:** Reads CLAUDE.md for project-specific commands (platform-agnostic principle). Runs checks in parallel. `/retro` can pull from health history for trend sparklines.
|
||||
|
||||
**Effort:** M (human: ~1 week / CC: ~30 min)
|
||||
**Priority:** P1
|
||||
**Depends on:** None
|
||||
**Key files:** New `health/SKILL.md.tmpl`, `scripts/gen-skill-docs.ts`
|
||||
|
||||
### /health as /ship gate
|
||||
|
||||
**What:** If health score exists and drops below a configurable threshold, `/ship` warns before creating the PR: "Health dropped from 8/10 to 5/10 this branch — 3 new lint warnings, 1 test failure. Ship anyway?"
|
||||
|
||||
**Why:** Quality gate that prevents shipping degraded code. Configurable threshold so it's not blocking for teams that don't use `/health`.
|
||||
|
||||
**Effort:** S (human: ~1h / CC: ~5 min)
|
||||
**Priority:** P2
|
||||
**Depends on:** /health skill
|
||||
|
||||
## Swarm
|
||||
|
||||
### Swarm primitive — reusable multi-agent dispatch
|
||||
|
||||
**What:** Extract Review Army's dispatch pattern into a reusable resolver (`scripts/resolvers/swarm.ts`). Wire into `/ship` for parallel pre-ship checks (type-check + lint + test in parallel sub-agents). Make available to `/qa`, `/investigate`, `/health`.
|
||||
|
||||
**Why:** Review Army proved parallel sub-agents work brilliantly (5 agents = 835K tokens of working memory vs. 167K for one). The pattern is locked inside `review-army.ts`. Other skills need it too. Claude Code Agent Teams (official, Feb 2026) validates the team-lead-delegates-to-specialists pattern. Gartner: multi-agent inquiries surged 1,445% in one year.
|
||||
|
||||
**Context:** Start with the specific `/ship` use case. Extract shared parts only after 2+ consumers reveal what config parameters are actually needed. Avoid premature abstraction. Can leverage existing WorktreeManager for isolation.
|
||||
|
||||
**Effort:** L (human: ~2 weeks / CC: ~2 hours)
|
||||
**Priority:** P2
|
||||
**Depends on:** None
|
||||
**Key files:** `scripts/resolvers/review-army.ts`, new `scripts/resolvers/swarm.ts`, `ship/SKILL.md.tmpl`, `lib/worktree.ts`
|
||||
|
||||
## Refactoring
|
||||
|
||||
### /refactor-prep — Pre-Refactor Token Hygiene
|
||||
|
||||
**What:** Skill that detects project language/framework, runs appropriate dead code detection (knip/ts-prune for TS/JS, vulture/autoflake for Python, staticcheck/deadcode for Go, cargo udeps for Rust), strips dead imports/exports/props/console.logs, and commits cleanup separately.
|
||||
|
||||
**Why:** Dirty codebases accelerate context compaction. Dead imports, unused exports, and orphaned code eat tokens that contribute nothing but everything to triggering compaction mid-refactor. Cleaning first buys back 20%+ of context budget. Reports lines removed and estimated token savings.
|
||||
|
||||
**Effort:** M (human: ~1 week / CC: ~30 min)
|
||||
**Priority:** P2
|
||||
**Depends on:** None
|
||||
**Key files:** New `refactor-prep/SKILL.md.tmpl`, `scripts/gen-skill-docs.ts`
|
||||
|
||||
## Factory Droid
|
||||
|
||||
### Browse MCP server for Factory Droid
|
||||
|
||||
Reference in New Issue
Block a user