feat: /oracle — Product Conscience with AST-powered codebase scanner#671
Open
rafiulnakib wants to merge 13 commits intogarrytan:mainfrom
Open
feat: /oracle — Product Conscience with AST-powered codebase scanner#671rafiulnakib wants to merge 13 commits intogarrytan:mainfrom
rafiulnakib wants to merge 13 commits intogarrytan:mainfrom
Conversation
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>
Merges 9 upstream commits including: - /design-html skill (v0.14.0.0) - Composable skills + INVOKE_SKILL resolver (v0.13.7.0) - GStack Learns infrastructure (v0.13.4.0) - Factory Droid compatibility (v0.13.5.0) - Security audit round 2 (v0.13.4.0) - Sidebar prompt injection defense - Community wave fixes - Rotating founder resources in /office-hours - .factory gitignore Oracle scanner build step preserved in package.json. Oracle resolvers (PRODUCT_CONSCIENCE_READ/WRITE) merged alongside new upstream resolvers (LEARNINGS, CONFIDENCE, INVOKE_SKILL, CHANGELOG_WORKFLOW). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PRODUCT_CONSCIENCE_READ now auto-bootstraps a minimal product map when: - No docs/oracle/PRODUCT_MAP.md exists - No prior auto-bootstrap breadcrumb - Repo has >=20 commits The bootstrap is silent (no user prompt), lightweight (git log only, under 60 seconds), and produces compressed one-liner feature entries. PRODUCT_CONSCIENCE_WRITE now progressively enriches compressed entries into full entries as skills run, plus a one-time /oracle inventory nudge. Split "found" path handles both full and compressed entry formats. 35 tests (was 21), all passing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Mechanical regeneration via bun run gen:skill-docs. All 20 skills with PRODUCT_CONSCIENCE_READ/WRITE blocks updated. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/oracleskill — Product memory and intelligence layer. Bootstraps a product map from any codebase, tracks features across sessions, surfaces connections during planning, and warns about anti-patterns.oracle/bin/scan-imports.ts) — Builds import graphs using the TypeScript compiler API. Discovers routes across 10 frameworks (Next.js App/Pages, React Router, SvelteKit, Nuxt, Remix, TanStack Router, Vue Router, Wouter, Astro, Supabase Edge Functions). Classifies route complexity (EASY/MEDIUM/HARD/MEGA), detects circular dependencies via Tarjan's SCC, finds dead code via reachability analysis.{{PRODUCT_CONSCIENCE_READ}}and{{PRODUCT_CONSCIENCE_WRITE}}blocks injected into 19+ skill templates. Every skill silently reads the product map for context and updates it after work completes.docs/oracle/inventory/What it does for the user
Run
/oracleonce on any project. The product conscience activates and silently runs through every gstack skill from that point on — warning about anti-patterns, tracking feature lifecycle, and surfacing connections between features during planning and review.Key files
oracle/bin/scan-imports.ts,oracle/bin/scanner/*.tsoracle/SKILL.md.tmplscripts/resolvers/oracle.tsscripts/resolvers/index.tspackage.jsontest/skill-e2e-oracle.test.tsoracle/bin/scan-imports.test.ts,oracle/bin/scanner/*.test.tstest/helpers/touchfiles.ts*/SKILL.md.tmplTest plan
skill-e2e-oracle.test.ts— end-to-end oracle bootstrap viaclaude -pbun testpasses (free tests, <2s)bun run test:evals— E2E eval suite🤖 Generated with Claude Code