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>
This commit is contained in:
Lex Christopherson
2026-01-21 10:28:53 -06:00
parent 93b963c3fe
commit d1fda80c7f
20 changed files with 17 additions and 3065 deletions

View File

@@ -483,70 +483,6 @@ How to make tests pass
---
## Codebase Intelligence
GSD includes an automatic codebase learning system that indexes code and detects patterns.
### Files
| File | Purpose | Updated By |
|------|---------|------------|
| `.planning/intel/index.json` | File exports/imports index | PostToolUse hook |
| `.planning/intel/conventions.json` | Detected naming/directory/suffix patterns | PostToolUse hook |
| `.planning/intel/summary.md` | Concise context for injection | PostToolUse hook |
### Index Schema
```json
{
"version": 1,
"updated": 1234567890,
"files": {
"/absolute/path/to/file.ts": {
"exports": ["functionA", "ClassB", "default"],
"imports": ["react", "./utils", "@org/pkg"],
"indexed": 1234567890
}
}
}
```
### Convention Detection
**Naming conventions** (requires 5+ exports, 70%+ match rate):
- camelCase, PascalCase, snake_case, SCREAMING_SNAKE
- 'default' is skipped (keyword, not naming indicator)
**Directory purposes** (lookup table):
- components, hooks, utils, lib, services, api, routes, types, models, tests, etc.
**Suffix patterns** (requires 5+ files):
- .test.*, .spec.*, .service.*, .controller.*, etc.
### Hook Patterns
**PostToolUse hook (intel-index.js):**
- Triggers on Write/Edit of JS/TS files
- Incremental update (single file per invocation)
- Silent failure (never blocks Claude)
- Regenerates conventions.json and summary.md on every update
**SessionStart hook (intel-session.js):**
- Triggers on startup/resume
- Reads index.json and conventions.json
- Outputs `<codebase-intelligence>` wrapped summary
- Silent failure if intel files missing
### Commands
**`/gsd:analyze-codebase`** — Bulk scan for brownfield projects:
- Creates .planning/intel/ directory
- Scans all JS/TS files (excludes node_modules, dist, build, .git, vendor, coverage)
- Uses same extraction logic as PostToolUse hook
- Works standalone (no /gsd:new-project required)
---
## Summary: Core Meta-Patterns
1. **XML for semantic structure, Markdown for content**