Skip to content

Commit e6ab158

Browse files
committed
docs: fact-check and correct markdown across repo
Audit verified docs against src/, recipes, and CI. Fixes stale glob/batchInsert claims, audit --base git archive wording, MCP vs HTTP resources, plan status headers, agent-content paths, and low-priority drift in rules/skills/templates.
1 parent f25f8a6 commit e6ab158

29 files changed

Lines changed: 101 additions & 94 deletions

.agents/rules/agents-tier-system.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Today's Tier-2 rules:
5151

5252
Pure intent-triggered. The skill description is detailed enough that Cursor surfaces it on relevant phrases. No always-on cost.
5353

54-
Skills stay rule-less when the work is **explicitly invoked** by the user, not pattern-triggered. Today: `audit-pr-architecture`, `diagnose`, `docs-governance`, `docs-lifecycle-sweep`, `grill-me`, `improve-codebase-architecture`, `pr-comment-fact-check`, `write-a-skill`. (Skills like `gritql-codemods` and `ubiquitous-language` would also fit this tier if adopted.)
54+
Skills stay rule-less when the work is **explicitly invoked** by the user, not pattern-triggered. Today: `audit-pr-architecture`, `codemap` (consumer pointer), `diagnose`, `docs-governance`, `docs-lifecycle-sweep`, `grill-me`, `improve-codebase-architecture`, `pr-comment-fact-check`, `write-a-skill`. (Skills like `gritql-codemods` and `ubiquitous-language` would also fit this tier if adopted.)
5555

5656
## Authoring guidelines
5757

.agents/rules/concise-comments.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
description: Sweep your own new comments at the end of every change. Keep what code can't say; cut the rest.
3-
globs: "**/*.{ts,tsx,css,html,md}"
43
alwaysApply: true
54
---
65

.agents/rules/docs-governance.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ alwaysApply: false
88

99
Before authoring or editing any doc in this repo, **read the [`docs-governance` skill](../skills/docs-governance/SKILL.md)** for the full reference. This rule is the priming layer.
1010

11-
The canonical Rules (1–9) live in [`docs/README.md`](../../docs/README.md) — cite them by number; never restate them.
11+
The canonical Rules (1–10) live in [`docs/README.md`](../../docs/README.md) — cite them by number; never restate them.
1212

1313
## Surface tiers (which subset of governance applies)
1414

@@ -51,6 +51,6 @@ If none → fold + delete.
5151
- Full reference: [`.agents/skills/docs-governance/SKILL.md`](../skills/docs-governance/SKILL.md)
5252
- Doc janitor (operational sweep — apply the spec mechanically, classify Tier A / B / C, delete dead weight): [`.agents/skills/docs-lifecycle-sweep/SKILL.md`](../skills/docs-lifecycle-sweep/SKILL.md). Fire on intent ("clean up stale docs", "compact audits") or proactively after closing a Plan / Audit / Research file.
5353
- Audit framework: [`.agents/skills/audit-pr-architecture/SKILL.md`](../skills/audit-pr-architecture/SKILL.md). Fire on intent ("audit this PR's architecture", "structural review of #N") or proactively when a PR moves ≥5 files between top-level `src/` modules.
54-
- Canonical Rules: [`docs/README.md`](../../docs/README.md) — Rules 1–9 cited from across `docs/` and `.agents/`. Don't renumber without a coordinated re-grep + edit pass.
54+
- Canonical Rules: [`docs/README.md`](../../docs/README.md) — Rules 1–10 cited from across `docs/` and `.agents/`. Don't renumber without a coordinated re-grep + edit pass.
5555
- File-layout: [`agents-first-convention`](./agents-first-convention.md)
5656
- Rules vs skills tier system: [`agents-tier-system`](./agents-tier-system.md)

.agents/rules/lessons.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
description: Read lessons at session start; append after corrections
3+
alwaysApply: true
4+
---
5+
16
# Lessons Convention
27

38
## Rules

.agents/rules/preserve-comments.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
description: Never remove comments, TODOs, or commented-out code without explicit confirmation
3-
globs: "**/*.{ts,tsx,css,html}"
43
alwaysApply: true
54
---
65

.agents/skills/audit-pr-architecture/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Audit a PR's structural choices against architecture-priming, the r
55

66
# Audit a PR's architecture
77

8-
Mid-flight or post-merge structural review of a PR against the repo's own architecture and boundary conventions. Sister skill to [`pr-comment-fact-check`](../pr-comment-fact-check/SKILL.md) when codemap adopts that one (reviewer-comment-driven).
8+
Mid-flight or post-merge structural review of a PR against the repo's own architecture and boundary conventions. Sister skill to [`pr-comment-fact-check`](../pr-comment-fact-check/SKILL.md) (reviewer-comment-driven triage).
99

1010
This skill exists because:
1111

@@ -34,7 +34,7 @@ Also fire **proactively** when:
3434
### 1. Reindex codemap and identify the diff scope
3535

3636
```bash
37-
bun run codemap # or: codemap (from outside the repo)
37+
bun src/index.ts # or: codemap (from outside the repo)
3838
git diff --name-status origin/main...HEAD
3939
```
4040

@@ -148,7 +148,7 @@ Doc shape — mirror the most recent audit under `docs/audits/` (or — if this
148148
**Scope:** <one paragraph: what diff, what HEAD, what subtree(s)>.
149149
**Method:** <codemap audit + structural-smell recipes + cross-check; cite which queries>.
150150

151-
This audit follows [docs/README.md Rule 6](../README.md) (no inventory counts in evergreen prose) and [docs/README.md Rule 7](../README.md) (no line-number references). All numbers below are flagged "at audit time."
151+
This audit follows [docs/README.md Rule 6](../../../docs/README.md) (no inventory counts in evergreen prose) and [docs/README.md Rule 7](../../../docs/README.md) (no line-number references). All numbers below are flagged "at audit time."
152152

153153
---
154154

.agents/skills/docs-governance/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Every doc in this repo lives in one of **two surface tiers** (codemap is small e
2020

2121
The same shared spine applies to both. The differences are what subset each tier needs.
2222

23-
> **Why no Tier C / Tier A in codemap?** Tier C (per-feature governance) only kicks in when a codebase grows independently-evolving feature folders (`app/features/<f>/`). Tier A (per-shared-component) only kicks in when shared components accumulate enough rationale to need a `README.md` next to the source. Codemap has neither today — the source tree is `src/cli/`, `src/application/`, `src/adapters/`, `src/parsers/`, `src/db.ts`, etc., all governed by the central `docs/` surface. If codemap ever grows a `src/<feature>/` partition or a `src/components/<x>/` shared-component substrate worth documenting in-place, this skill grows the corresponding tier rows then — not before (per § 5 anti-bloat).
23+
> **Why no Tier C / Tier A in codemap?** Tier C (per-feature governance) only kicks in when a codebase grows independently-evolving feature folders (`app/features/<f>/`). Tier A (per-shared-component) only kicks in when shared components accumulate enough rationale to need a `README.md` next to the source. Codemap has neither today — the source tree is `src/cli/`, `src/application/`, `src/adapters/`, `src/parser.ts`, `src/db.ts`, etc., all governed by the central `docs/` surface. If codemap ever grows a `src/<feature>/` partition or a `src/components/<x>/` shared-component substrate worth documenting in-place, this skill grows the corresponding tier rows then — not before (per § 5 anti-bloat).
2424
2525
---
2626

.agents/skills/pr-comment-fact-check/SKILL.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,11 @@ When this exception applies, drop a one-line summary of contested rebuttals into
137137
### Commands
138138

139139
```bash
140-
# Reply to a thread
140+
# Reply to a thread — write body to a temp file first (heredocs mangle backticks in markdown)
141+
printf '%s' '<reply text>' > /tmp/pr-<number>-reply.md
141142
gh api "repos/{owner}/{repo}/pulls/<number>/comments" \
142-
-f body="$(cat <<'EOF'
143-
<reply text>
144-
EOF
145-
)" -F in_reply_to=<comment_id>
143+
--field body=@/tmp/pr-<number>-reply.md \
144+
-F in_reply_to=<comment_id>
146145

147146
# Resolve a thread (GraphQL only — REST endpoints don't support resolve)
148147
gh api graphql -f query='mutation($id: ID!) {
@@ -156,7 +155,7 @@ The thread node ID (`PRRT_…`) comes from the GraphQL `reviewThreads` query in
156155

157156
These come up repeatedly with LLM reviewers and warrant extra scrutiny. The codemap-shape ones (1–4) come from the codemap thesis — what Codemap deliberately is and isn't (per [`docs/why-codemap.md` § When to reach for something else](../../../docs/why-codemap.md#when-to-reach-for-something-else) and [`docs/roadmap.md` § Non-goals](../../../docs/roadmap.md#non-goals-v1)). The shape-5+ ones are universal across TS projects:
158157

159-
1. **"Just regex this"** when the file is in `src/parsers/` or `src/adapters/` — codemap is AST-backed by design (oxc for TS, lightningcss for CSS). Suggesting a regex replacement undoes the architectural choice. Verify against [`docs/architecture.md` § Parsers / Adapters](../../../docs/architecture.md) before accepting.
158+
1. **"Just regex this"** when the file is in `src/parser.ts`, `src/css-parser.ts`, or `src/adapters/` — codemap is AST-backed by design (oxc for TS, lightningcss for CSS). Suggesting a regex replacement undoes the architectural choice. Verify against [`docs/architecture.md` § Parsers](../../../docs/architecture.md#parsers) before accepting.
160159
2. **"Add full-text search"** — explicitly a non-goal per [`docs/roadmap.md` § Non-goals (v1)](../../../docs/roadmap.md#non-goals-v1). Push back with that anchor.
161160
3. **"Add a daemon for performance"** — same; one-shot CLI is intentional, sub-100ms cold start makes a daemon unnecessary. Same non-goal anchor.
162161
4. **"Index this column"** in `src/db.ts` — Codemap's SQLite schema is intentionally lean. Indexes are added when a query benchmark proves them necessary, not pre-emptively. Push back: ask for the query that's slow.

.github/CONTRIBUTING.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ bun run dev # same as `bun src/index.ts` — CLI from source
1313
bun test
1414
bun run test:golden # golden SQL vs fixtures/minimal (also runs at end of `bun run check`)
1515
bun run test:golden:external # Tier B: local tree via CODEMAP_ROOT / --root (not in CI)
16-
bun run check # format + lint + tests + typecheck + build + test:golden
16+
bun run check # build, then format:check + lint:ci + test + typecheck, then test:golden
1717
bun run clean # remove untracked/ignored build artifacts (keeps `.env`, `.codemap/`)
1818
bun run check-updates # interactive dependency updates (`bun update -i --latest`)
1919
```
@@ -60,7 +60,9 @@ Releases: **[@changesets/cli](https://github.com/changesets/changesets)** — ru
6060

6161
**Upstream** skill and rules in this repo (e.g. `codemap`) stay **generic** — placeholder SQL and triggers, no product-specific paths. Consumer projects can run **`codemap agents init`** (ships **`templates/agents`** on npm; see [docs/agents.md](../docs/agents.md)) or **copy/symlink** manually, then **edit their copy** for team aliases and queries. Customization always belongs in the **consumer** repo.
6262

63-
Rules live under **`.agents/rules/`** as `.md` files; skills under **`.agents/skills/<name>/SKILL.md`**. Symlink into **`.cursor/`** with `.mdc` extension (Cursor requires `.mdc` for frontmatter parsing; see [agents-first-convention.md](../.agents/rules/agents-first-convention.md)):
63+
Rules live under **`.agents/rules/`** as `.md` files; skills under **`.agents/skills/<name>/SKILL.md`**. Symlink into **`.cursor/`** with `.mdc` extension (Cursor requires `.mdc` for frontmatter parsing; see [agents-first-convention.md](../.agents/rules/agents-first-convention.md)). Full rule inventory and tier system: [docs/agents.md](../docs/agents.md) and [agents-tier-system.md](../.agents/rules/agents-tier-system.md).
64+
65+
Example minimum symlink set:
6466

6567
```bash
6668
mkdir -p .cursor/rules .cursor/skills
@@ -70,13 +72,4 @@ done
7072
ln -sf ../../.agents/skills/codemap .cursor/skills/codemap
7173
```
7274

73-
| Rule | Purpose |
74-
| ---------------------------- | ----------------------------------------- |
75-
| `codemap.md` | Query SQLite index before structural grep |
76-
| `agents-first-convention.md` | `.agents/` source + `.cursor/` symlinks |
77-
| `no-bypass-hooks.md` | Never `--no-verify` on commit |
78-
| `verify-after-each-step.md` | Run checks between milestones |
79-
| `tracer-bullets.md` | Vertical slices end-to-end |
80-
| `concise-reporting.md` | Short agent replies |
81-
8275
Thank you for helping make structural codebase queries fast and reusable for agents.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Checklist
66

7-
- [ ] `bun run check` passes (format, lint, test, typecheck, build)
7+
- [ ] `bun run check` passes (build, format, lint, test, typecheck, golden queries)
88
- [ ] User-facing change? **Add a [Changeset](https://github.com/changesets/changesets)** (`bun run changeset`) and commit the `.changeset/*.md` file
99
- [ ] Docs updated if behavior or public API changed — hub: [`docs/README.md`](../docs/README.md); CLI/agents: [`docs/agents.md`](../docs/agents.md)
1010

0 commit comments

Comments
 (0)