Skip to content

docs: codemap-audit (B.5) plan + adopt grill-me & improve-codebase-architecture skills#32

Merged
SutuSebastian merged 4 commits intomainfrom
docs/plans-codemap-audit
May 1, 2026
Merged

docs: codemap-audit (B.5) plan + adopt grill-me & improve-codebase-architecture skills#32
SutuSebastian merged 4 commits intomainfrom
docs/plans-codemap-audit

Conversation

@SutuSebastian
Copy link
Copy Markdown
Contributor

@SutuSebastian SutuSebastian commented May 1, 2026

Two unrelated docs changes batched:

1. Plan: codemap audit --base <ref> (B.5)

Per docs/README.md Rule 3 (plans live in plans/<feature-name>.md, link from roadmap.md), drafts the design for B.5 before writing any code. The research note explicitly calls this "the single highest-leverage candidate this refresh."

Decision v1
Snapshot strategy Temp worktree + full reindex under .codemap.audit-<sha>/ (gitignored by the existing .codemap.* glob). Defers caching / perf-tuning until a real consumer hits the wall.
Built-in deltas files, dependencies, deprecated, visibility, barrels, hot_files. Each wraps an existing recipe — no new analysis layer.
Verdict pass / warn / fail with thresholds opt-in via codemap.config.audit. v1 emits raw deltas only (default pass).
Exit codes 0 / 1 / 2 — mirrors git diff --exit-code.
Composition --json / --summary work; --changed-since / --group-by / --save-baseline / --baseline are mutex (different shapes / semantics).
Tracer-bullet sequence 7 commits: scaffold → worktree → first delta → remaining deltas → threshold config → docs+agents (Rule 10) → changeset.

Both prerequisites just merged on main: B.6 (PR #30) proves the snapshot-in-DB primitive; B.7 (PR #28) provides the symbols.visibility column the visibility delta needs.

2. Adopt two Tier 3 skills from mattpocock/skills

Sourced after evaluating three skills mid-thread; the two adopted ones earn their always-zero-cost slot:

Skill What
grill-me 8-line interview-pattern skill. Walk a design tree branch by branch, recommend an answer per question, ask one at a time. Filled the gap visible in commit 1's plan: I made many decisions by myself; grill-me would have surfaced them for second opinion before they crystallised.
improve-codebase-architecture Ousterhout-style deepening vocabulary (module / interface / seam / adapter / depth / leverage / locality), the deletion test, "one adapter = hypothetical seam, two = real," dependency categories (DEEPENING.md), and parallel-sub-agent "Design It Twice" interface exploration (INTERFACE-DESIGN.md).

Both are maintainer-only (under .agents/skills/ + .cursor/skills/ symlinks per agents-first-convention). Not added to templates/agents/ — same precedent as PR #25 (consumer surface ships only the codemap rule + skill).

Translation notes

improve-codebase-architecture/SKILL.md adapted at three points to fit codemap's docs framework (the upstream version assumes CONTEXT.md + docs/adr/; we have neither):

  • CONTEXT.md references → docs/glossary.md (Rule 9 already enforces glossary updates per PR).
  • docs/adr/ references → docs/plans/<topic>.md (Rule 3 — but plans are mortal; decisions of record lift to architecture.md per Rule 2 then the plan is deleted).
  • "Offer ADR on rejection" step → dropped. Codemap doesn't keep decision records; the closest is "lift to architecture.md."

Companion files (LANGUAGE.md, DEEPENING.md, INTERFACE-DESIGN.md) ship verbatim — none reference CONTEXT.md or ADRs.

grill-me/SKILL.md extended with two short codemap-specific notes: prefer codemap over Grep when exploring (per the codemap rule), and write crystallised answers into the in-flight docs/plans/<name>.md inline (Rule 3).

Skipped

  • grill-with-docs (the third skill in the upstream "grill" family) — requires standing up CONTEXT.md / docs/adr/ infrastructure that conflicts with the lift-to-architecture-then-delete-the-plan lifecycle codemap already runs. The salvageable ADR 3-criteria gate is recorded in this conversation; lift if codemap ever needs ADRs.

Tier 3 list updated

.agents/rules/agents-tier-system.md Tier 3 list extended with both new skills, and the previously-missing docs-governance + docs-lifecycle-sweep entries from PR #25.

Test plan

  • bun run check green (no behavior changed; pure docs + skills).
  • All cross-references resolve (plan → research → architecture / lessons; skill files → glossary.md / architecture.md / codemap rule / each other).
  • .cursor/skills/{grill-me,improve-codebase-architecture} symlinks resolve.
  • Plan calls itself out as Plan type per docs/README.md § Document Lifecycle — delete on ship, lift to architecture.md.
  • CI green.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added diagnose skill for structured debugging and performance regression analysis.
    • Added grill-me skill for interactive step-by-step decision-tree interviews.
    • Added improve-codebase-architecture skill for identifying and deepening module designs.
    • Added write-a-skill skill for authoring new agent capabilities.
    • Updated tier system to support these skills under explicit invocation.
  • Documentation

    • Added comprehensive skill guides and architectural reference materials.
    • Added planned roadmap entry for upcoming codemap audit command.

Per docs/README.md Rule 3 (plans/<feature-name>.md, link from roadmap),
draft the design pass for the highest-leverage Tier B candidate from
docs/research/fallow.md before writing any code.

Plan covers:

- Snapshot-strategy trade-offs (worktree+full-index vs. B.6 baseline
  reuse vs. on-demand snapshot table) — recommends Option A (temp
  worktree under .codemap.audit-<sha>/) for v1; defers caching and
  perf optimization until a real consumer hits the wall.
- Built-in deltas for v1: files, dependencies, deprecated, visibility,
  barrels (top-N membership change), hot files (fan-in/fan-out top-N
  movement). Out: cycles, boundary crossings, markers, css_*.
- Verdict shape: pass/warn/fail with thresholds opt-in via
  codemap.config.audit; v1 emits raw deltas only (default pass).
  Exit codes 0/1/2 mirror `git diff --exit-code`.
- Composition table: --json / --summary work; --changed-since /
  --group-by / --baseline are mutex (different output shapes or
  semantics).
- Tracer-bullet sequence: 7 commits for end-to-end ship.
- Open questions surfaced rather than guessed — worktree location,
  empty-diff warning, per-delta actions, perf ceiling.

Roadmap entry added pointing at the plan; backlog item moved to top
since it's now actively designed.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 1, 2026

⚠️ No Changeset found

Latest commit: c2b16c2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR introduces four new agent skills (diagnose, grill-me, improve-codebase-architecture, write-a-skill) with comprehensive skill definition documents, supporting guidance files, and Cursor integration. It updates the tier system to reflect these new rule-less skills and adds planning documentation for the codemap audit command.

Changes

Cohort / File(s) Summary
Tier System Update
.agents/rules/agents-tier-system.md
Updated Tier-3 guidance with new skill examples (audit-pr-architecture, diagnose, docs-governance, docs-lifecycle-sweep, grill-me, improve-codebase-architecture, write-a-skill) and notation for two conditionally-qualifying skills.
Diagnose Skill
.agents/skills/diagnose/SKILL.md, .agents/skills/diagnose/scripts/hitl-loop.template.sh
New structured debugging skill defining deterministic feedback loops, hypothesis generation, instrumentation strategy, and regression test discipline. Includes Bash HITL template for guided user prompts and variable capture.
Grill-me Skill
.agents/skills/grill-me/SKILL.md
New interview skill that guides step-by-step questioning with decision-tree resolution, codemap-first codebase exploration, and inline plan document recording as decisions crystallize.
Improve-codebase-architecture Skill
.agents/skills/improve-codebase-architecture/SKILL.md, DEEPENING.md, INTERFACE-DESIGN.md, LANGUAGE.md
New architecture-improvement skill with multi-part guidance: core skill for friction identification and deepening opportunities, vocabulary standardization, deepening framework based on dependency categories, and interface design workflow for parallel proposal generation.
Write-a-skill Skill
.agents/skills/write-a-skill/SKILL.md
New maintainer-only skill documenting conventions, step-by-step authoring workflow, SKILL.md template, operational guidance for scripts and companion files, and durability discipline with comprehensive review checklist.
Cursor Skill Entries
.cursor/skills/diagnose, .cursor/skills/grill-me, .cursor/skills/improve-codebase-architecture, .cursor/skills/write-a-skill
Symlink references enabling Cursor integration for the four new shared skills.
Planning & Roadmap
docs/plans/codemap-audit.md, docs/roadmap.md
New planning document for codemap audit --base command detailing snapshot-diff modes, delta sets, output structure, and implementation sequence. Roadmap entry linking to plan.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

documentation

Poem

🐰 Four skills now bloom in structured grace,
Diagnose the bug, grill the case,
Deepen the code, write skills with care,
From agents to Cursor, wisdom to share! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main changes: adding a codemap-audit plan and adopting two key agent skills (grill-me and improve-codebase-architecture), which aligns with the primary objectives documented in the PR summary.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/plans-codemap-audit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

…mattpocock)

Two Tier 3 maintainer-only skills sourced from mattpocock/skills:

grill-me — pure interview pattern. Walk a design tree branch by branch,
recommend an answer per question, ask one at a time. 8-line skill, zero
cost when not invoked. Filled a gap visible in the codemap-audit plan
(this PR's first commit): I made many decisions by myself; grill-me would
have surfaced them for second opinion before they crystallised in the doc.

improve-codebase-architecture — Ousterhout-style deepening vocabulary
(module / interface / seam / adapter / depth / leverage / locality), the
deletion test, "one adapter = hypothetical seam, two = real," dependency
categories (DEEPENING.md), and parallel-sub-agent "Design It Twice"
interface exploration (INTERFACE-DESIGN.md). Translated CONTEXT.md /
docs/adr/ references → docs/glossary.md / docs/plans/ to fit codemap's
existing docs framework (per Rule 9 + Rule 3); ADR-offer flow dropped
since codemap lifts decisions from plans into architecture.md per Rule 2.
Companion files (LANGUAGE.md, DEEPENING.md, INTERFACE-DESIGN.md) are
verbatim — they don't reference CONTEXT.md / ADRs.

Both adopted as maintainer-only (under .agents/skills/ + .cursor/skills/
symlinks per agents-first-convention). Not added to templates/agents/
since that surface ships only the codemap rule + skill — same precedent
as PR #25 for audit-pr-architecture / docs-governance / etc.

agents-tier-system Tier 3 list updated with both skills + the existing
docs-governance and docs-lifecycle-sweep entries that were missing.

Composes with grill-me from improve-codebase-architecture's grilling-loop
step (deepening candidates get grilled, not auto-accepted). Skipped
grill-with-docs (the third skill in the upstream "grill" family) — it
requires standing up CONTEXT.md / docs/adr/ infrastructure that conflicts
with codemap's lift-to-architecture-then-delete-the-plan lifecycle.
@SutuSebastian SutuSebastian changed the title docs(plans): draft codemap-audit (B.5) plan docs: codemap-audit (B.5) plan + adopt grill-me & improve-codebase-architecture skills May 1, 2026
Two more Tier 3 maintainer-only skills sourced from mattpocock/skills:

diagnose — disciplined 6-phase loop for hard bugs and perf regressions
(reproduce → minimise → hypothesise → instrument → fix → cleanup). Core
thesis: "build the right feedback loop, and the bug is 90% fixed."
Translation: explore-the-codebase step now points at codemap (per the
codemap rule's STOP-before-grep) and docs/glossary.md (per Rule 9
canonical terms); ADR mention dropped (no ADR infra in this repo);
Phase-5 seam discipline cross-references improve-codebase-architecture
(adopted in 906ecba); Phase-6 cleanup includes a one-line lessons.md
append per the lessons-rule discipline. scripts/hitl-loop.template.sh
ships verbatim — no codemap-specific assumptions.

write-a-skill — meta-skill for creating new skills. Translation: front
section explicitly cites our agents-first-convention (file layout) and
agents-tier-system (tier choice + durability), plus the
maintainer-only-vs-shipped distinction (precedent: PR #25). Examples
cite codemap precedents (improve-codebase-architecture for the
companion-files split; pr-comment-fact-check for single-file). Review
checklist adapted: tier choice + rule-pairing decision + tier-list
update added.

Both adopted as maintainer-only (.agents/skills/ + .cursor/skills/
symlinks per agents-first-convention). Not added to templates/agents/
— consumer surface stays codemap-skill-only.

agents-tier-system Tier 3 list updated: diagnose, write-a-skill added
(alongside grill-me + improve-codebase-architecture from the prior
commit). Skipped grill-with-docs (requires standing up CONTEXT.md /
docs/adr/ infra; conflicts with codemap's lift-to-architecture-and-
delete-the-plan lifecycle).
…olved)

Used the just-adopted grill-me skill against the plan to surface
decisions I'd waved away in the first draft. Eight Qs walked, all
agreed answers written into the plan inline (per grill-me discipline).

Q1 Snapshot strategy → ship BOTH modes; v1 = --baseline <name>
   (B.6 reuse), v1.x = --base <ref> (worktree+reindex). Mutex.
   Was: Option A only. Now: both shipped, B first because it's the
   real use case (delta-against-saved-state) and reuses existing
   infra without worktree code.

Q2 Built-in deltas → 3 deltas in v1 (files / dependencies /
   deprecated), not 6. visibility / barrels / hot_files / cycles /
   boundary_crossings / markers / css_* deferred with explicit
   triggers to revisit. Was: padding the v1 surface.

Q3 Verdict shape → DROPPED from v1 entirely. No `verdict` field, no
   exit codes 1/2, no codemap.config.audit schema. Raw deltas only.
   Consumers compose --json + jq for CI exit codes; v1.x ships
   verdict + thresholds when real consumer config patterns emerge.
   Was: opt-in thresholds with always-pass default (placeholder).

Q4 Diff identity → each delta defines its own canonical projection
   (fixed SELECT … ORDER BY) and validates baseline column-set
   membership before diffing. Baseline's stored `sql` is informational.
   Isolates audit from underlying-table schema drift (e.g. the v4→v5
   visibility column bump).

Q5 Terminal output → `git status`-style: terse on no-drift, per-delta
   tables only when non-empty. --summary collapses to one line.
   Mirrors the JSON shape with row-arrays-vs-counts distinction.

Q6 File layout → split src/cli/cmd-audit.ts (CLI) + src/application/
   audit-engine.ts (engine). Mirrors existing cmd-index.ts ↔
   index-engine.ts seam. Engine testable independent of CLI shape;
   v1.x --base <ref> slice becomes mechanical.

Q7 Same-SHA warning → NO. Renderer's metadata header already exposes
   baseline.git_ref so user can spot the case. Adding a heuristic
   warning would be noise + meaningful code for low signal. Settled
   open question struck from §9.

Q8 Index freshness → audit auto-runs `runCodemapIndex({mode:
   "incremental"})` as a prelude. Same discipline as the codemap
   rule's "re-index after editing source." Sub-second when no source
   changed. --no-index opts out for the rare frozen-DB CI case.

Net result: v1 is meaningfully smaller (3 deltas, no verdict, no
schema additions, no worktree code) and ships faster (~½ day across
~6 commits). Each deferred piece has an explicit trigger so the
deferral isn't open-ended hand-waving.
@SutuSebastian SutuSebastian merged commit 035ee23 into main May 1, 2026
8 of 9 checks passed
@SutuSebastian SutuSebastian deleted the docs/plans-codemap-audit branch May 1, 2026 09:42
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