You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agents/rules/codemap.mdc
+7-6Lines changed: 7 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -8,17 +8,18 @@ alwaysApply: true
8
8
9
9
A local database (default **`.codemap.db`**) indexes structure: symbols, imports, exports, components, dependencies, markers, CSS variables, CSS classes, CSS keyframes.
10
10
11
-
**Generic defaults:** This rule is **project-agnostic**. After you vendor or symlink it (or use a future `codemap` CLI that writes agent files), **edit your copy** to add app-specific triggers and SQL — upstream text is only a baseline.
11
+
**This file** is for **developing Codemap** in this clone. **End users** of the published package get the agent rule from **`templates/agents/`** (via **`codemap agents init`**). **Generic defaults:** SQL and triggers stay project-agnostic — **edit** this rule for repo-specific paths and queries.
12
12
13
-
## CLI (this repo vs installed package)
13
+
## CLI (this repository)
14
14
15
15
| Context | Incremental index | Query |
16
16
| ------- | ----------------- | ----- |
17
-
| Developing in this repo | `bun src/index.ts` | `bun src/index.ts query "<SQL>"` |
18
-
| After `bun link` / global `codemap` | `codemap` | `codemap query "<SQL>"` |
| **Default** — from this clone | `bun src/index.ts` | `bun src/index.ts query "<SQL>"` |
18
+
| Same entry | `bun run dev` | (same as first row) |
20
19
21
-
Index another project: **`--root /path/to/repo`**, or set **`CODEMAP_ROOT`** or **`CODEMAP_TEST_BENCH`** (e.g. in **`.env`** in this repo — see [docs/benchmark.md § Indexing another project](../../docs/benchmark.md#indexing-another-project)). Full rebuild: **`--full`**. Targeted re-index: **`--files path/to/a.ts path/to/b.tsx`**.
20
+
After **`bun run build`**, **`node dist/index.mjs`** matches the published **`codemap`** binary (same flags). **`bun link`** / global **`codemap`** also work when testing the packaged CLI.
21
+
22
+
Index another project: **`--root /path/to/repo`**, or set **`CODEMAP_ROOT`** or **`CODEMAP_TEST_BENCH`** (e.g. in **`.env`** — see [docs/benchmark.md § Indexing another project](../../docs/benchmark.md#indexing-another-project)). Full rebuild: **`--full`**. Targeted re-index: **`--files path/to/a.ts path/to/b.tsx`**.
Copy file name to clipboardExpand all lines: .agents/skills/codemap/SKILL.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,15 @@ Query codebase structure via SQLite instead of scanning files. Use when explorin
6
6
7
7
Examples below use **placeholders** (`'...'`, `getConfig`, `~/lib/api`, etc.) — not a real product tree. **Shipped skill and rules stay generic** so they apply to any repo.
8
8
9
-
**In your project:**copy or symlink these files into `.agents/` / `.cursor/` (see **`.github/CONTRIBUTING.md`**), or use a future **`codemap` CLI**that vendors agent files. Then **edit your copy** to add your team’s tsconfig aliases, directory conventions, and SQL snippets you reuse. Treat upstream updates as a reference; merge deliberately.
9
+
**This repository:**run the CLI with **`bun src/index.ts`** (same as **`bun run dev`**). **Consumer / npm** copy of this skill lives under **`templates/agents/skills/codemap/`**(installed with **`codemap agents init`**). Edit **`.agents/`** here for Codemap development; **do not** treat it as the published package layout.
10
10
11
-
**Run queries**
11
+
**Run queries:**
12
12
13
13
```bash
14
14
bun src/index.ts query "<SQL>"
15
15
```
16
16
17
-
When the package is installed globally or via `bunx`: `codemap query "<SQL>"` or `bunx @stainless-code/codemap query "<SQL>"`. Use **`--root`**to point at another project.
17
+
After **`bun run build`**, **`node dist/index.mjs query …`**or a linked **`codemap`** binary matches the published CLI. Use **`--root`**/ **`CODEMAP_ROOT`** to index another tree.
18
18
19
19
## Schema
20
20
@@ -282,7 +282,7 @@ SELECT kind, COUNT(*) as count FROM markers GROUP BY kind;
282
282
283
283
## Maintenance
284
284
285
-
From this repository:
285
+
From this repository (same flags as the published **`codemap`** binary):
286
286
287
287
```bash
288
288
# Targeted — re-index only specific files you just modified
@@ -300,13 +300,13 @@ bun src/index.ts query "SELECT key, value FROM meta"
300
300
301
301
**Prefer `--files`** when you know which files you changed — it skips git diff and filesystem scanning for the rest of the tree. Deleted files passed to `--files` are auto-removed from the index.
302
302
303
-
When Codemap is installed as a package: `codemap`, `codemap --root /path/to/project`, or `bunx @stainless-code/codemap …` (same flags).
Align shipped agent templates with the published CLI (`codemap`, `npx @stainless-code/codemap`, …). Keep this repository’s `.agents/` rule and skill dev-oriented (`bun src/index.ts`). Remove the redundant `agents-first-convention` template. Document the dev vs `templates/agents/` split in `templates/agents/README.md` and `docs/agents.md`.
| Runtime splits (SQLite, workers, globs, JSON config I/O) |[packaging § Node vs Bun](./packaging.md#node-vs-bun) — **the table lives here**|[architecture § Runtime](./architecture.md#runtime-and-database) links here; do not copy the table |
21
-
|**`codemap.config.*`** shape / Zod validation |[architecture § User config](./architecture.md#user-config)| Root [README § Configuration](../README.md#configuration) points here |
22
-
|**`codemap agents init`**: **`--force`** on **`.agents/`** (template file paths only), IDE matrix, per-file symlink/copy, **`templates/agents`**|[agents.md](./agents.md)| Link here; do not paste the integration table into README or packaging |
23
-
|**`CLAUDE.md` / `AGENTS.md` / `GEMINI.md` / Copilot** — managed **`codemap-pointer`** sections, merge vs **`--force`**|[agents.md § Pointer files](./agents.md#pointer-files)| Link here; do not duplicate the situation table |
24
-
| End-user CLI (index, query, agents, flags, env) |[../README.md § CLI](../README.md#cli)|[architecture § CLI usage](./architecture.md#cli-usage) summarizes and links back |
| Runtime splits (SQLite, workers, globs, JSON config I/O) |[packaging § Node vs Bun](./packaging.md#node-vs-bun) — **the table lives here**|[architecture § Runtime](./architecture.md#runtime-and-database) links here; do not copy the table |
21
+
|**`codemap.config.*`** shape / Zod validation |[architecture § User config](./architecture.md#user-config)| Root [README § Configuration](../README.md#configuration) points here |
22
+
|**`codemap agents init`**: **`--force`** on **`.agents/`**in **consumer projects**(template file paths only), IDE matrix, per-file symlink/copy, **`templates/agents`**|[agents.md](./agents.md)| Link here; do not paste the integration table into README or packaging |
23
+
|**`CLAUDE.md` / `AGENTS.md` / `GEMINI.md` / Copilot** — managed **`codemap-pointer`** sections, merge vs **`--force`**|[agents.md § Pointer files](./agents.md#pointer-files)| Link here; do not duplicate the situation table |
24
+
| End-user CLI (index, query, agents, flags, env) |[../README.md § CLI](../README.md#cli)|[architecture § CLI usage](./architecture.md#cli-usage) summarizes and links back |
Copy file name to clipboardExpand all lines: docs/agents.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
## What it does
6
6
7
-
The published package ships **`templates/agents/`** (rules + skills; mirrored in this repo under [`.agents/`](../.agents/)). The command **`codemap agents init`** writes each bundled file into **`<project>/.agents/`** with per-file copies (not a wholesale directory sync) — the **canonical** copy consumers edit (SQL, team conventions, paths).
7
+
The published package ships **`templates/agents/`** (rules + skills). This repo also has [`.agents/`](../.agents/) for **Codemap development** (CLI from source); it is **not** identical to **`templates/agents/`** for every file (e.g. the **codemap** rule/skill). The command **`codemap agents init`** writes each bundled template file into **`<project>/.agents/`** with per-file copies (not a wholesale directory sync) — the **canonical** copy consumers edit (SQL, team conventions, paths).
These files are **copies** of the upstream [`.agents/`](../../.agents/) rules and skills shipped with **`@stainless-code/codemap`** for **`codemap agents init`**.
3
+
These files ship with **`@stainless-code/codemap`** for **`codemap agents init`** — written for **npm consumers** ( **`codemap`**, **`npx @stainless-code/codemap`**, etc.).
4
+
5
+
In **this** repository, **`.agents/`** (and **`.cursor/`** symlinks) are **maintainer / dev** copies: examples use **`bun src/index.ts`** where that matters. **`templates/agents/`** is the **published** agent surface and is **not** required to match **`.agents/`** byte-for-byte (the **codemap** rule and skill intentionally differ).
4
6
5
7
**Documentation:**[docs/agents.md](../../docs/agents.md) — interactive setup, **`.gitignore`**, and optional IDE wiring (Cursor, Copilot, …).
6
8
7
-
After running the command, **edit**`.agents/` in your project (paths, SQL, team conventions). Treat updates here as a reference when refreshing your copy.
9
+
After running the command in **your** project, **edit****`.agents/`** there (paths, SQL, team conventions). Treat updates here as a reference when refreshing your copy.
0 commit comments