Think of this system as a pre-computed index for your AI agent — exactly like a search engine index. You build it once, keep it updated, and queries are instant and cheap.
Wrong approach: Ask the agent to read files and figure things out. Right approach: Build the graph first, then ask the agent questions.
wednesday-skills map --full # initial + after big mergesThe post-commit hook runs incremental updates automatically after every commit. You only need to run map --full manually when:
- First time setup
- After a large merge (hundreds of files changed)
- After pulling significant upstream changes
- After updating the skill package
wednesday-skills analyze --git-historyanalyze adds the intelligence layer on top of the graph: risk scores, dead code, legacy health, comment intel. The --git-history flag adds git bug-fix signal to risk scoring — worth the extra time.
Run this:
- After
mapon a new codebase - Before a major refactor
- Before generating tests
wednesday-skills summarizeSummaries are cached by file hash. Only changed files are re-summarized. After the first run, subsequent runs are fast and cheap. Run it:
- Once after initial setup
- Before onboarding a new developer
- Before generating a refactor plan
- When
MASTER.mdfeels stale
wednesday-skills fill-gaps --min-risk 70Dynamic patterns (event emitters, dynamic require, global injection) can't be statically parsed. Gap filling resolves them via Haiku subagents. Only do this for files you're about to edit heavily — it's not necessary for all files.
Always run the brownfield-fix skill before touching files with unknown blast radius:
"Run brownfield-fix before I edit src/payments/processor.ts"
This forces the agent to check the risk score and blast radius before writing any code. If the risk is Critical (>80), the agent will pause and show you all affected files before proceeding.
Use brownfield-chat for any structural question:
"What modules does auth.ts export?"
"What breaks if I rename createOrder in order-service.ts?"
"Which files have the highest risk score?"
"What's the blast radius of the database adapter?"
These return answers from the pre-computed graph — no LLM tokens spent.
"What does the payments module do?"
"What is src/core/engine.js responsible for?"
These hit summaries.json first. If missing, the agent reads MASTER.md. Only synthesizes via LLM if neither source has an answer.
Run brownfield-drift before merging any PR that crosses module boundaries:
"Check if this PR follows the architecture in PLAN.md"
Or in CI:
wednesday-skills drift --since HEAD~1The biggest cost saving comes from using gemini-2.5-flash-lite for summarization and gap-filling instead of Claude Sonnet. Set this in .env:
OPENROUTER_MODEL_HAIKU=google/gemini-2.5-flash-liteTypical savings: 98% vs Claude Sonnet reading raw files.
The system caches summaries by file hash + exports hash. Never delete .wednesday/cache/hashes.json unless you want to force a full rebuild. The cache is what makes subsequent summarize runs cheap.
Don't fill gaps on every file — only on the ones you're about to touch:
wednesday-skills fill-gaps --file "src/payments/**" --min-risk 60Every command prints a cost report. If the cost seems high for the work done, check:
- Are summaries being re-computed for unchanged files? (cache miss — check hashes.json)
- Is the fallback chain hitting rate limits? (shows in logs as model switches)
- Is
--fullbeing used when--incrementalwould work?
Run map from the monorepo root. Use --ignore to exclude generated and vendor directories:
wednesday-skills map --full \
--ignore "**/generated/**" \
--ignore "**/vendor/**" \
--ignore "**/.next/**" \
--ignore "**/dist/**"The graph will cover all packages. Cross-package imports are tracked as edges, so blast radius works across package boundaries.
# .github/workflows/drift.yml
- name: Check architecture drift
run: wednesday-skills drift --since origin/mainThis fails the CI run if any commit in the PR introduces an architecture violation defined in PLAN.md.
# .github/workflows/graph-update.yml
- name: Update dependency graph
run: wednesday-skills map --incrementalRun this on merges to main to keep graph.db in sync for all agents that query it.
The best way to onboard a developer to an unfamiliar codebase:
- Make sure
mapandsummarizehave been run - Have them run:
wednesday-skills onboard - Or in the agent: "Generate an onboarding guide for the backend auth layer"
The onboarding flow traces call chains from entry points down to the domain logic the developer needs to touch, and produces a Mermaid diagram of the execution flow.
Before starting a large refactor:
- Check the blast radius:
wednesday-skills blast <file> - Check the risk score:
wednesday-skills score <file> - If risk is High or Critical, ask the agent to plan the refactor using the graph:
This uses
"Plan a refactor to split payments/processor.ts into smaller modules"refactor-planner.jswhich generates a GIT-OS-compliant multi-step plan with independent PRs — without reading raw source.
The graph is only as good as the data fed to it. Common issues:
Problem: A file shows 0 importers but you know it's used.
Fix: Check if it uses dynamic imports. Run fill-gaps --file <that-file>.
Problem: Risk scores seem too low.
Fix: Run analyze --git-history to include git bug-fix signals.
Problem: Summaries are stale after a major refactor.
Fix: Run summarize again. Only changed files will be re-summarized.
Problem: Architecture drift is showing false positives.
Fix: Review PLAN.md boundary rules. Constraints may need updating to reflect legitimate architectural changes.