Skip to content

Feat/oracle scan inventory#605

Draft
rafiulnakib wants to merge 6 commits intogarrytan:mainfrom
rafiulnakib:feat/oracle-scan-inventory
Draft

Feat/oracle scan inventory#605
rafiulnakib wants to merge 6 commits intogarrytan:mainfrom
rafiulnakib:feat/oracle-scan-inventory

Conversation

@rafiulnakib
Copy link
Copy Markdown

Summary

Every gstack skill now has product memory. /oracle bootstraps a product map from your codebase, then every planning skill reads it for context and every post-work skill silently writes back. The map lives in your repo at docs/oracle/ so you can verify every claim.

What this adds:

  • Product Conscience across 19 skills. PRODUCT_CONSCIENCE_READ and PRODUCT_CONSCIENCE_WRITE resolvers inject ~10 lines each into 19 skill templates. Planning skills (/office-hours, /plan-ceo-review, /plan-eng-review, etc.) automatically read the product map. Post-work skills (/ship, /review, /qa) silently update it.

  • /oracle skill with 6 modes. Bootstrap (generate product map from codebase), inventory (budgeted deep page-by-page scan with checkpointing), refresh (full re-analysis), update (lightweight git sync), stats (product + codebase health dashboard), query (answer product questions with context).

  • AST-powered codebase scanner. TypeScript compiler API for 100% static import resolution. 10 frameworks: React Router, Next.js, SvelteKit, Nuxt, Remix, Astro, TanStack Router, Vue Router, Wouter, plus file-based routing. Git co-change classification (EASY/MEDIUM/HARD/MEGA). Tarjan's SCC for circular deps. Dead code detection with .oracleignore and multi-level confidence.

  • HTML import graph visualizer. --visualize generates a self-contained HTML file with color-coded nodes, collapsible subtrees, and circular dependency highlighting.

  • Terminal ASCII graph. ANSI-colored tree with --max-depth, --no-color, --compact flags.

  • Scanner CLI flags. --diff (compare against previous scan), --dry-run (preview without writing), --git-frequency (sort by recent commit activity), --visualize (HTML graph).

  • Self-describing product map. The map header contains its own schema. Skills follow the header, not hardcoded format knowledge. Schema changes update the map, not 19 templates.

Documentation

Updated: README.md, CLAUDE.md, ARCHITECTURE.md, docs/skills.md, TODOS.md

Test plan

  • 186 oracle tests pass (0 failures)
  • bun run gen:skill-docs compiles all templates (0 errors)
  • Scanner runs on gstack itself (38KB manifest, exit code 0)
  • Visualizer generates valid HTML (11KB self-contained file)
  • Terminal graph renders colored ASCII output
  • All 10 framework fixtures detect correctly

🤖 Generated with Claude Code

Rafiul Nakib and others added 6 commits March 28, 2026 23:38
Import graph construction via TypeScript compiler API, git co-change
classification (EASY/MEDIUM/HARD/MEGA), Tarjan's SCC for circular deps,
dead code detection, and route discovery for React Router, Next.js,
SvelteKit, Nuxt, Remix, Astro, TanStack Router, Vue Router, and Wouter.
Includes --diff, --dry-run, --git-frequency, --visualize flags and
head_sha staleness detection. 14 fixture directories.
Self-contained HTML import graph at /tmp/oracle-scan-{slug}.html with
color-coded nodes, collapsible subtrees, circular dep highlighting.
ANSI terminal ASCII tree with --max-depth, --no-color, --compact flags.
Plus utils.test.ts for shared scanner utilities.
PRODUCT_CONSCIENCE_READ and PRODUCT_CONSCIENCE_WRITE resolvers inject
~10 lines each into 19 skill templates. Planning skills read the product
map for context. Post-work skills silently update it. oracle/SKILL.md.tmpl
compiles through gen-skill-docs like every other skill.
…lding

Adds typescript to dependencies (gstack's own, not user's project).
Wires oracle scanner into build script. Adds oracle/bin/dist/ to .gitignore.
E2E test scaffolding with touchfile declarations. Documentation updates
across README, CLAUDE.md, ARCHITECTURE.md, docs/skills.md, TODOS.md.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant