Commit Graph

615 Commits

Author SHA1 Message Date
Lex Christopherson
d1fda80c7f revert: remove codebase intelligence system
Rolled back the intel system due to overengineering concerns:
- 1200+ line hook with SQLite graph database
- 21MB sql.js dependency
- Entity generation spawning additional Claude calls
- Complex system with unclear value

Removed:
- /gsd:analyze-codebase command
- /gsd:query-intel command
- gsd-intel-index.js, gsd-intel-session.js, gsd-intel-prune.js hooks
- gsd-entity-generator, gsd-indexer agents
- entity.md template
- sql.js dependency

Preserved:
- Model profiles feature
- Statusline hook
- All other v1.9.x improvements

-3,065 lines removed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 10:28:53 -06:00
Lex Christopherson
93b963c3fe chore: remove old planning files 2026-01-21 10:17:14 -06:00
Lex Christopherson
e7ceaf6483 fix(new-project): add model_profile config and clarify workflow questions
- Add model_profile question (balanced/quality/budget) to Round 2
- Add model_profile to config.json schema
- Reword agent questions to be clearer:
  - "Spawn Plan Researcher?" → "Research before planning each phase?"
  - "Spawn Plan Checker?" → "Verify plans will achieve their goals?"
  - "Spawn Execution Verifier?" → "Verify work satisfies requirements after each phase?"
- Update descriptions to explain value, not mechanics

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 09:44:12 -06:00
Lex Christopherson
f64e066892 refactor(05-04): delegate indexing to gsd-indexer subagent
- Replace inline file reading in Steps 2-3 with subagent spawn
- Step 2 now outputs file_paths array (no content reading)
- Step 3 spawns gsd-indexer with Task tool
- Step 5 reads index.json written by subagent (not writes it)
- Add context section documenting indexing subagent delegation
- Prevents context exhaustion on 500+ file codebases

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 09:31:29 -06:00
Lex Christopherson
955eaa52ef docs(05-03): complete gsd-indexer plan
Tasks completed: 1/1
- Create gsd-indexer agent definition

SUMMARY: .planning/phases/05-subagent-codebase-analysis/05-03-SUMMARY.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 09:28:20 -06:00
Lex Christopherson
5d03e14f89 feat(05-03): add gsd-indexer subagent definition
- Create indexer agent for Steps 2-3 file indexing
- Uses exact regex patterns from analyze-codebase Step 3
- Writes index.json directly to disk (context preservation)
- Returns statistics only to orchestrator

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 09:27:14 -06:00
Lex Christopherson
a686d28669 docs(05): create gap closure plans for Steps 2-3 subagent delegation
Phase 05: Subagent Codebase Analysis
- 05-03: gsd-indexer subagent for file reading and export/import extraction
- 05-04: Refactor analyze-codebase Steps 2-3 to use indexer subagent

Gap closure addresses context exhaustion during indexing phase (Steps 2-3),
not just entity generation (Step 9).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 21:46:14 -06:00
Lex Christopherson
6027b5e4d8 1.9.1 2026-01-20 12:11:12 -06:00
Lex Christopherson
cdad7b8ad7 fix: update build script to use gsd-statusline.js
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 12:11:08 -06:00
Lex Christopherson
c0330e48f8 refactor(05-02): replace batch entity generation with subagent delegation
- Step 9.3 now spawns gsd-entity-generator subagent instead of Task batches
- Subagent receives file paths only (preserves orchestrator context)
- Subagent reads files in fresh 200k context, writes entities to disk
- Returns statistics only (not entity contents)
- Updated context section to document subagent execution model
- Fixed slug examples to use single hyphen format (matches hook)
- Simplified Steps 9.4-9.5 for new flow
2026-01-20 12:08:47 -06:00
Lex Christopherson
84a633f487 docs(05-01): complete gsd-entity-generator plan
Tasks completed: 1/1
- Create gsd-entity-generator agent definition

SUMMARY: .planning/phases/05-subagent-codebase-analysis/05-01-SUMMARY.md
2026-01-20 12:06:31 -06:00
Lex Christopherson
f4c5817838 feat(05-01): create gsd-entity-generator subagent definition
- Add agent for semantic entity generation from source files
- Include entity template with frontmatter, purpose, exports, deps
- Define type heuristics table for module classification
- Specify wiki-link rules for internal vs external dependencies
- Agent writes directly to .planning/intel/entities/
- Returns statistics only (not entity contents)
2026-01-20 12:05:27 -06:00
Lex Christopherson
d7754b9066 1.9.0 2026-01-20 11:56:13 -06:00
Lex Christopherson
900fc95efc fix: rename statusline.js to gsd-statusline.js for consistent hook naming
All GSD hooks now use gsd- prefix. Installer updated to clean up old
statusline.js file and hook registration from previous installs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 11:55:59 -06:00
Lex Christopherson
9a3a394f79 docs: update changelog and documentation for v1.9.0 2026-01-20 11:53:21 -06:00
Lex Christopherson
6e757aaa77 fix(05): revise plan 05-02 based on checker feedback
- Reframe must_haves truths to outcome-focused (scalability, UX)
- Add instruction to fix outdated slug documentation (-- to -)
- Add slug verification to task verify checklist

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 11:47:43 -06:00
Lex Christopherson
d994732a45 docs(05): create phase plan for subagent codebase analysis
Phase 05: Subagent Codebase Analysis
- 2 plans in 2 waves
- Plan 05-01: Create gsd-entity-generator subagent (Wave 1)
- Plan 05-02: Refactor analyze-codebase to use subagent (Wave 2)
- Ready for execution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 11:44:32 -06:00
Lex Christopherson
701b10d5f9 docs(05): research subagent codebase analysis
Phase 5: Subagent Codebase Analysis
- Refactor entity generation from main context to subagent delegation
- Follow gsd-codebase-mapper pattern
- Prevent context exhaustion on 500+ file codebases
- Single subagent with full file list (not multiple batches)
- Subagent writes entities directly, returns statistics only
2026-01-20 11:40:58 -06:00
Lex Christopherson
aa63054dd3 feat(04): add /gsd:query-intel command
Exposes graph database queries to users:
- dependents <file> - what depends on this file (blast radius)
- hotspots - most-depended-on files

Closes tech debt item from v1.9.0 audit.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 10:58:10 -06:00
Lex Christopherson
c1a86cadee fix(04): address tech debt from milestone audit
- Wrap intel content in <codebase-intel> tags in plan-phase.md
- Use ENTITY_DIR constant in isEntityFile() instead of hardcoded path

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 10:42:43 -06:00
Lex Christopherson
1c746a548a docs(04-05): complete intel injection into planner plan
Tasks completed: 2/2
- Add intel file read to Step 7
- Add intel section to planner prompt template

SUMMARY: .planning/phases/04-semantic-intelligence/04-05-SUMMARY.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 10:25:35 -06:00
Lex Christopherson
61d1e91013 feat(04-05): wire codebase intel injection into planner
- Read .planning/intel/summary.md into INTEL_CONTENT in Step 7
- Add {intel_content} placeholder to planning_context in Step 8
- Planner now receives dependency hotspots, module types at planning time

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 10:24:09 -06:00
Lex Christopherson
fe72ca41bd docs(04-04): complete CLI query interface plan
Tasks completed: 2/2
- Add query action routing to stdin handler
- Add usage documentation as code comment

SUMMARY: .planning/phases/04-semantic-intelligence/04-04-SUMMARY.md
2026-01-20 10:15:00 -06:00
Lex Christopherson
791265af29 docs(04-04): add CLI query interface documentation
- Document query interface in file header
- Include usage examples for dependents and hotspots queries
- List available options and output format
2026-01-20 10:13:35 -06:00
Lex Christopherson
f46327a4bf feat(04-04): add CLI query interface to graph database
- Add handleQuery() function to route query actions
- Support dependents and hotspots query types
- Route query actions via stdin handler before Write/Edit
- Return JSON results to stdout for Claude consumption
2026-01-20 10:13:15 -06:00
Lex Christopherson
04d296471d docs(04): create gap closure plan for CLI query interface
Phase 04-04: Expose orphaned getDependents() function
- Add handleQuery() routing for stdin query actions
- Enable "what uses this file?" queries via CLI
- Closes verification gap for INTEL-05

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 10:09:31 -06:00
Lex Christopherson
28c4c19112 docs(04-02): complete query interface plan
Tasks completed: 3/3
- Add graph query helpers
- Create graph-backed summary generator
- Integrate graph summary into regeneration flow

SUMMARY: .planning/phases/04-semantic-intelligence/04-02-SUMMARY.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 10:00:21 -06:00
Lex Christopherson
9d9d7622d9 docs(04-03): complete entity generation instructions plan
Tasks completed: 3/3
- Add @anthropic-ai/sdk dependency
- Add semantic entity generation to analyze-codebase
- Add context section explaining execution model

SUMMARY: .planning/phases/04-semantic-intelligence/04-03-SUMMARY.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 09:59:08 -06:00
Lex Christopherson
101bc58795 feat(04-02): integrate graph summary into regeneration flow
- regenerateEntitySummary() now async, prefers graph when available
- Falls back to entity-file-based summary if no graph.db
- Stdin handler properly awaits async regeneration
- SessionStart hook injects graph-backed summary into context

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 09:59:01 -06:00
Lex Christopherson
b3db2ff909 feat(04-03): add semantic entity generation to analyze-codebase
- Add Step 9 for semantic entity file generation
- Task tool batching for 100+ file codebases (10 files per batch)
- 50 file limit per run to manage context
- File selection criteria: 3+ exports, 5+ dependents, key directories
- Entity slug convention: path--segments--filename-ext.md
- Entity template with Purpose, Exports, Dependencies, Used By sections
- Update objective, output, and success criteria for entities
- Add context section explaining execution model

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 09:57:57 -06:00
Lex Christopherson
3d8cf70643 feat(04-02): create graph-backed summary generator
- generateGraphSummary() queries SQLite graph for rich summary
- Includes dependency hotspots with accurate counts from edges
- Groups nodes by type for module overview
- Tracks total relationships
- Target < 500 tokens for context injection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 09:57:37 -06:00
Lex Christopherson
5824196e4b feat(04-02): add graph query helpers for hotspots and dependents
- getHotspots() queries top N files by dependent count
- getNodesByType() groups nodes by type with counts
- getDependents() uses recursive CTE for transitive traversal

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 09:57:07 -06:00
Lex Christopherson
8d33ae7686 chore(04-03): add @anthropic-ai/sdk dependency
- Add @anthropic-ai/sdk ^0.52.0 for entity generation API calls
- Required for semantic entity file creation in analyze-codebase

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 09:56:49 -06:00
Lex Christopherson
0837278d60 docs(04-01): complete SQLite graph layer plan
Tasks completed: 3/3
- Add sql.js dependency and graph schema
- Implement graph database helpers
- Sync entity files to graph on write

SUMMARY: .planning/phases/04-semantic-intelligence/04-01-SUMMARY.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 09:54:35 -06:00
Lex Christopherson
a39988e8f6 feat(04-01): sync entity files to SQLite graph database
- Add syncEntityToGraph() to upsert nodes and edges on entity write
- Entity id derived from filename, node body contains metadata as JSON
- Wiki-links [[target]] become edges with depends_on relationship
- Delete old edges before inserting new ones for clean updates
- Graph sync runs before summary regeneration
- Silent failures ensure Claude is never blocked

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 09:53:33 -06:00
Lex Christopherson
ec038e7240 feat(04-01): implement graph database helpers
- Add getSQL() for cached sql.js WASM initialization
- Add loadGraphDatabase() to create or load graph.db
- Add persistDatabase() to export in-memory DB to disk
- Singleton pattern avoids repeated WASM init overhead

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 09:52:24 -06:00
Lex Christopherson
11ab4a9218 feat(04-01): add sql.js dependency and graph schema
- Add sql.js ^1.12.0 dependency for WASM SQLite
- Add GRAPH_SCHEMA constant with nodes/edges tables
- Nodes use virtual id from JSON body for upserts
- Edges indexed by source and target for relationship queries

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 09:51:59 -06:00
Lex Christopherson
3230fdfd2b fix(04): revise plans based on checker feedback
04-02: Added SessionStart hook wiring verification to Task 3 and
key_links. The hook already exists from Phase 2 - plan now verifies
it correctly injects the new graph-backed summary format.

04-03: Removed embedded JavaScript execution pattern. Commands are
instructions Claude follows, not scripts. Entity generation now uses
Task tool to spawn subagents for batch processing instead of pretending
markdown can execute JS.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 09:43:37 -06:00
Lex Christopherson
e3d39c09e6 docs(04): create phase 4 plans for semantic intelligence
Phase 4: Semantic Intelligence & Scale
- 3 plans in 2 waves
- Wave 1: 04-01 SQLite graph layer (sql.js WASM)
- Wave 2: 04-02 Rich summary generation, 04-03 Semantic entity generation

Key additions:
- sql.js for zero-native-deps graph database
- @anthropic-ai/sdk for Claude API entity generation
- Recursive CTEs for dependency queries ("what uses X")
- Graph-backed summaries with hotspots

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 09:39:22 -06:00
Lex Christopherson
3a82930579 feat(intel): add self-evolving codebase intelligence
- Add entity.md template for documenting code understanding
- Add update_intel_entity step to executor workflow
- Modify gsd-intel-index.js to parse [[wiki-links]] from entities
- Hook regenerates summary.md with hotspots, modules, recent updates

Executor now creates/updates entity files after each task completion.
Summary automatically reflects accumulated semantic understanding.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 02:05:10 -06:00
Lex Christopherson
4218f8666a feat(profiles): add model profiles for GSD agents
Adds switchable model profiles (quality/balanced/budget) to control
which Claude model each agent uses, balancing quality vs token spend.

New files:
- get-shit-done/references/model-profiles.md - profile lookup table
- commands/gsd/set-profile.md - runtime profile switching

Updated orchestrators to resolve model before spawning agents:
- new-project, new-milestone (7 calls each)
- plan-phase (4 calls)
- execute-phase (3 calls)
- audit-milestone, debug, research-phase, quick (1-2 calls each)
- workflows: execute-phase, execute-plan, verify-work, map-codebase

Profile stored in .planning/config.json as model_profile.
Default: "balanced" (Opus for planning, Sonnet for execution).

Closes #160

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 01:29:04 -06:00
Lex Christopherson
9099d48495 perf(intel): simplify SessionStart hook + gitignore intel/
- SessionStart now reads pre-generated summary.md directly
- No more JSON parsing of potentially large index.json
- Added guidance: .planning/intel/ should always be gitignored
  (changes constantly, can be regenerated with /gsd:analyze-codebase)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 01:01:16 -06:00
Lex Christopherson
39ea6f4457 refactor(hooks): rename intel hooks with gsd- prefix
- intel-index.js → gsd-intel-index.js
- intel-session.js → gsd-intel-session.js
- intel-prune.js → gsd-intel-prune.js

Consistent naming allows installer to manage GSD hooks easily.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 00:50:09 -06:00
Lex Christopherson
fa48a13c9c feat(intel): add Stop hook to prune deleted files
New intel-prune.js hook runs after each Claude response.
Checks if indexed files still exist, removes stale entries.

Fast (only fs.existsSync checks) and silent (never blocks).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 00:49:07 -06:00
Lex Christopherson
f0b8afe7cc fix(intel): make PostToolUse hook opt-in only
Hook now checks if .planning/intel/ exists before indexing.
This prevents polluting non-GSD projects with intel files.

Directory is created by:
- /gsd:new-project (during setup)
- /gsd:analyze-codebase (explicit user action)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 00:36:47 -06:00
Lex Christopherson
9d129efaf6 docs(03-03): add codebase intelligence section to GSD-STYLE.md
- Document intel files and their purposes
- Add index.json schema reference
- Explain convention detection thresholds
- Document PostToolUse and SessionStart hook patterns
- Reference /gsd:analyze-codebase command

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 00:11:28 -06:00
Lex Christopherson
0898a705c5 docs(03-03): add analyze-codebase command to help.md
- Add /gsd:analyze-codebase command reference
- Add intel/ directory to Files & Structure section
- Document PostToolUse hook incremental learning

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 00:11:05 -06:00
Lex Christopherson
9c239e4b15 docs(03-03): add codebase intelligence section to README
- Add Codebase Intelligence section explaining automatic learning
- Document convention detection and context injection
- Add /gsd:analyze-codebase to Brownfield commands table
- List intel files and their purposes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 00:10:42 -06:00
Lex Christopherson
4b686d17f4 feat(03-01): add summary.md generation to intel-index hook
- Add generateSummary() function for context injection content
- Write summary.md alongside conventions.json on every update
- Target < 500 tokens (top 5 dirs, top 3 suffixes)
- Exclude 'default' from export count
2026-01-20 00:07:08 -06:00
Lex Christopherson
8bb9cc7466 feat(03-02): add codebase intelligence to subagent prompts
- Add load_codebase_intelligence step to gsd-planner.md
- Add load_codebase_intelligence step to gsd-executor.md
- Include .planning/intel/summary.md in plan context template
- Subagents now use detected conventions during planning/execution
2026-01-20 00:06:57 -06:00