@codemap-ai/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +12 -0
- package/.codex-plugin/plugin.json +35 -0
- package/.cursor-plugin/plugin.json +16 -0
- package/agent-pack/README.md +44 -0
- package/agent-pack/agents/codemap-explorer.md +12 -0
- package/agent-pack/commands/feature-area.md +8 -0
- package/agent-pack/rules/install.md +35 -0
- package/agent-pack/rules/mcp-first.md +18 -0
- package/agent-pack/rules/task-lifecycle.md +11 -0
- package/agent-pack/rules/workflow-skills.md +97 -0
- package/agent-pack/skills/brainstorming/SKILL.md +41 -0
- package/agent-pack/skills/executing-plans/SKILL.md +26 -0
- package/agent-pack/skills/feature-area-investigation/SKILL.md +15 -0
- package/agent-pack/skills/interpreting-codemap-output/SKILL.md +29 -0
- package/agent-pack/skills/mcp-first-exploration/SKILL.md +10 -0
- package/agent-pack/skills/safe-edit-and-reimport/SKILL.md +18 -0
- package/agent-pack/skills/symbol-level-debugging/SKILL.md +15 -0
- package/agent-pack/skills/test-driven-development/SKILL.md +36 -0
- package/agent-pack/skills/token-efficient-code-review/SKILL.md +15 -0
- package/agent-pack/skills/verification-before-completion/SKILL.md +25 -0
- package/agent-pack/skills/writing-plans/SKILL.md +32 -0
- package/agent-pack/templates/AGENTS.md +21 -0
- package/agent-pack/templates/CLAUDE.md +19 -0
- package/agent-pack/templates/COPILOT.md +75 -0
- package/agent-pack/templates/GEMINI.md +77 -0
- package/agent-pack/templates/design-spec.md +34 -0
- package/agent-pack/templates/implementation-plan.md +26 -0
- package/agent-pack/templates/opencode-AGENTS.md +76 -0
- package/agent-pack/templates/opencode-INSTALL.md +5 -0
- package/agent-pack/templates/verification-report.md +18 -0
- package/dist/chat-terminal-DFFYQ6AF.js +1743 -0
- package/dist/chunk-A2QHID6K.js +34 -0
- package/dist/chunk-AXGGL47C.js +457 -0
- package/dist/chunk-FFFJKKKM.js +218262 -0
- package/dist/chunk-KWYP3ADN.js +1742 -0
- package/dist/chunk-WNJNT3FC.js +216 -0
- package/dist/chunk-YRXVMFXS.js +99 -0
- package/dist/index.js +9225 -0
- package/dist/login-screen-2DJBDM47.js +143 -0
- package/dist/pi-tui-app-GVZ3AN42.js +2073 -0
- package/package.json +59 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "codemap-agent-pack",
|
|
3
|
+
"description": "CodeMap MCP-first skills and workflows for Claude Code.",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "CodeMap"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://codemap.dev",
|
|
9
|
+
"repository": "https://github.com/trieuluan/codemap",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": ["codemap", "mcp", "skills", "workflow", "codebase"]
|
|
12
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "codemap-agent-pack",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "CodeMap MCP-first workflows, skills, and rules for token-efficient codebase exploration.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "CodeMap"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://codemap.dev",
|
|
9
|
+
"repository": "https://github.com/trieuluan/codemap",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"codemap",
|
|
13
|
+
"mcp",
|
|
14
|
+
"codebase",
|
|
15
|
+
"skills",
|
|
16
|
+
"workflow",
|
|
17
|
+
"context"
|
|
18
|
+
],
|
|
19
|
+
"skills": "./agent-pack/skills/",
|
|
20
|
+
"interface": {
|
|
21
|
+
"displayName": "CodeMap Agent Pack",
|
|
22
|
+
"shortDescription": "MCP-first codebase workflows for CodeMap",
|
|
23
|
+
"longDescription": "Use CodeMap Agent Pack to guide coding agents through MCP-first exploration, feature investigation, symbol debugging, CodeMap output interpretation, safe edits, reimport, and token-efficient review.",
|
|
24
|
+
"developerName": "CodeMap",
|
|
25
|
+
"category": "Coding",
|
|
26
|
+
"capabilities": ["Interactive", "Read", "Write"],
|
|
27
|
+
"defaultPrompt": [
|
|
28
|
+
"Use CodeMap to investigate this feature area.",
|
|
29
|
+
"Use CodeMap MCP-first workflow before editing this codebase."
|
|
30
|
+
],
|
|
31
|
+
"websiteURL": "https://codemap.dev",
|
|
32
|
+
"brandColor": "#2563EB",
|
|
33
|
+
"screenshots": []
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "codemap-agent-pack",
|
|
3
|
+
"displayName": "CodeMap Agent Pack",
|
|
4
|
+
"description": "CodeMap MCP-first skills, rules, and commands for Cursor.",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "CodeMap"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://codemap.dev",
|
|
10
|
+
"repository": "https://github.com/trieuluan/codemap",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": ["codemap", "mcp", "skills", "workflow", "codebase"],
|
|
13
|
+
"skills": "./agent-pack/skills/",
|
|
14
|
+
"agents": "./agent-pack/agents/",
|
|
15
|
+
"commands": "./agent-pack/commands/"
|
|
16
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# CodeMap Agent Pack
|
|
2
|
+
|
|
3
|
+
CodeMap Agent Pack is a workflow layer for AI coding agents. It teaches agents to use CodeMap MCP as a context engine before reading raw files.
|
|
4
|
+
|
|
5
|
+
It includes skills, rules, agent roles, plugin metadata, and installer templates for Codex, Claude, Cursor, Gemini, OpenCode, and GitHub Copilot CLI style workflows.
|
|
6
|
+
|
|
7
|
+
For broad tasks, agents should choose the narrowest CodeMap context tool first: `explore_task` when files are unclear, `search_codebase` for known names, `find_related_files` for related-file questions, or `get_file` for known paths.
|
|
8
|
+
|
|
9
|
+
Install locally with:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
codemap init-agent-pack --target all
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Install one target:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
codemap init-agent-pack --target codex
|
|
19
|
+
codemap init-agent-pack --target claude
|
|
20
|
+
codemap init-agent-pack --target cursor
|
|
21
|
+
codemap init-agent-pack --target gemini
|
|
22
|
+
codemap init-agent-pack --target opencode
|
|
23
|
+
codemap init-agent-pack --target copilot
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Print the local plugin root path:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
codemap agent-pack-path
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Register a local Codex-style marketplace entry:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
codemap init-agent-pack --target marketplace --plugin-path ./packages/mcp-server
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Preview or test in another directory:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
codemap init-agent-pack --target all --root /path/to/project --dry-run
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Official `/plugin install codemap-agent-pack` requires later marketplace publishing. This pack provides the local/plugin-compatible assets first.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# CodeMap Explorer Agent
|
|
2
|
+
|
|
3
|
+
Use this agent role for codebase orientation tasks.
|
|
4
|
+
|
|
5
|
+
Responsibilities:
|
|
6
|
+
|
|
7
|
+
- Start with CodeMap MCP tools.
|
|
8
|
+
- Return compact file shortlists with reasons.
|
|
9
|
+
- Prefer outlines and symbol context over full files.
|
|
10
|
+
- Identify entrypoints, services, shared schema/types, and verification targets.
|
|
11
|
+
|
|
12
|
+
Do not edit files in this role.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Installing CodeMap Agent Pack
|
|
2
|
+
|
|
3
|
+
The Agent Pack is bundled with `@codemap/cli`.
|
|
4
|
+
|
|
5
|
+
Use:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
codemap init-agent-pack --target codex
|
|
9
|
+
codemap init-agent-pack --target claude
|
|
10
|
+
codemap init-agent-pack --target cursor
|
|
11
|
+
codemap init-agent-pack --target gemini
|
|
12
|
+
codemap init-agent-pack --target opencode
|
|
13
|
+
codemap init-agent-pack --target copilot
|
|
14
|
+
codemap init-agent-pack --target all
|
|
15
|
+
codemap init-agent-pack --target marketplace --plugin-path ./packages/mcp-server
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Add `--dry-run` to preview writes. Add `--force` to overwrite existing files.
|
|
19
|
+
Add `--root <path>` to install into a specific project directory for testing or scripted setup.
|
|
20
|
+
|
|
21
|
+
After install, verify the harness files and skills:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
codemap doctor-agent-pack --target auto
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The installer writes workflow rules and skills for the chosen agent harness. Conflicting files are backed up unless `--force` is used.
|
|
28
|
+
|
|
29
|
+
Codex installs `AGENTS.md`, `.codex/codemap-agent-pack.md`, and CodeMap skills under `.codex/skills/codemap-*`.
|
|
30
|
+
Claude installs `CLAUDE.md`, `.claude/rules/codemap-*`, and CodeMap skills under `.claude/skills/codemap-*`.
|
|
31
|
+
Cursor installs `.cursor/rules/codemap.mdc` with MCP-first, lifecycle, and workflow-skill routing guidance.
|
|
32
|
+
|
|
33
|
+
For broad implementation/debug/review/refactor/test/research work, installed guidance tells agents to use CodeMap context tools before editing and to follow the relevant skills, hard gates, artifact templates, and verification checks.
|
|
34
|
+
|
|
35
|
+
Use `codemap agent-pack-path` to print the local plugin root path for Codex-style plugin registration.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# CodeMap MCP-First Rule
|
|
2
|
+
|
|
3
|
+
When CodeMap MCP is available, use CodeMap tools before raw file reads or grep.
|
|
4
|
+
|
|
5
|
+
## Default Tool Routing
|
|
6
|
+
|
|
7
|
+
- New CodeMap session: `get_project`.
|
|
8
|
+
- Broad task: `explore_task`.
|
|
9
|
+
- Related-file question: `find_related_files`.
|
|
10
|
+
- Known symbol/file/export: `search_codebase`.
|
|
11
|
+
- Several candidates: `get_file`.
|
|
12
|
+
- Specific body: `symbol`.
|
|
13
|
+
- Impact analysis: `symbol`.
|
|
14
|
+
- After edits: `diff(mode="working")`, build/test, then reimport when needed.
|
|
15
|
+
|
|
16
|
+
Read MCP output in this order: summary, ranked files/symbols, score reasons, next steps, and resource URIs. Expand to raw files only when the ranked context is not enough to answer or edit safely.
|
|
17
|
+
|
|
18
|
+
Raw reads and grep are fallback tools for unindexed files, dynamic searches, or MCP gaps.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# CodeMap Task Lifecycle
|
|
2
|
+
|
|
3
|
+
1. Orient with `get_project`.
|
|
4
|
+
2. Explore with the narrowest useful CodeMap tool.
|
|
5
|
+
3. Read outlines and symbol bodies before full files.
|
|
6
|
+
4. Edit only the files needed for the task.
|
|
7
|
+
5. Verify with the smallest sufficient build/test.
|
|
8
|
+
6. Inspect the diff.
|
|
9
|
+
7. Call `refresh_local_index` after local edits.
|
|
10
|
+
8. Call `reimport` only when cloud graph/insights should refresh.
|
|
11
|
+
9. Summarize changes, verification, blockers, and remaining risks.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# CodeMap Workflow Skills
|
|
2
|
+
|
|
3
|
+
## Start Here: Context Routing
|
|
4
|
+
|
|
5
|
+
For broad work, choose the narrowest CodeMap context tool before implementing. Use `explore_task` when files are unclear, `search_codebase` for known names, `find_related_files` for related-file questions, and `get_file` for known paths.
|
|
6
|
+
|
|
7
|
+
## Brainstorming (design before code)
|
|
8
|
+
|
|
9
|
+
For new features or vague requirements, design first — never write production code before the design is approved.
|
|
10
|
+
|
|
11
|
+
1. Call `explore_task` to gather real codebase context.
|
|
12
|
+
2. Ask clarifying questions one at a time until scope is clear.
|
|
13
|
+
3. Propose 2–3 approaches with trade-offs, referencing real files from CodeMap.
|
|
14
|
+
4. Write a design doc (`docs/specs/YYYY-MM-DD-<topic>.md`) covering goal, approach, affected files, and open questions.
|
|
15
|
+
5. Self-review the spec, then wait for user approval before touching any file.
|
|
16
|
+
|
|
17
|
+
## Test-Driven Development
|
|
18
|
+
|
|
19
|
+
For new functionality or bug fixes, follow RED → GREEN → REFACTOR strictly.
|
|
20
|
+
|
|
21
|
+
- **RED**: `search_codebase("test <feature>")` to find patterns, write a minimal failing test, run with the host agent test runner and confirm it **fails**.
|
|
22
|
+
- **GREEN**: Use `symbol` to read the target, implement only the minimum to pass, run with the host agent test runner and confirm it **passes**.
|
|
23
|
+
- **REFACTOR**: Clean up, run the host agent test runner again, then call `diff(mode="working")` before declaring done.
|
|
24
|
+
|
|
25
|
+
No production code before a failing test exists.
|
|
26
|
+
|
|
27
|
+
## Writing Plans
|
|
28
|
+
|
|
29
|
+
Use after a design is approved and before implementation begins.
|
|
30
|
+
|
|
31
|
+
1. Re-ground with CodeMap using the narrowest context tool for the task.
|
|
32
|
+
2. Use `codemap://agent-pack/templates/implementation-plan`.
|
|
33
|
+
3. Write exact steps, files/modules, interfaces, edge cases, and verification commands.
|
|
34
|
+
4. Remove decisions from the implementer; record assumptions explicitly.
|
|
35
|
+
5. Wait for approval when the task is high-risk or product-facing.
|
|
36
|
+
|
|
37
|
+
## Executing Plans
|
|
38
|
+
|
|
39
|
+
Use when implementing an approved plan.
|
|
40
|
+
|
|
41
|
+
1. Call `diff(mode="working")` before edits and preserve unrelated user changes.
|
|
42
|
+
2. Execute one plan step at a time.
|
|
43
|
+
3. If reality contradicts the plan, revise the plan instead of broad improvisation.
|
|
44
|
+
4. Run planned verification, inspect diff, then refresh local index.
|
|
45
|
+
|
|
46
|
+
## Verification Before Completion
|
|
47
|
+
|
|
48
|
+
Use after every file-changing task.
|
|
49
|
+
|
|
50
|
+
1. Call `diff(mode="working")`.
|
|
51
|
+
2. Run the smallest relevant build/test command.
|
|
52
|
+
3. Call `refresh_local_index` after local edits.
|
|
53
|
+
4. Decide whether `reimport` and `reimport(wait=true)` are needed for cloud graph/insights.
|
|
54
|
+
5. Report changed behavior, verification results, skipped checks, and residual risk.
|
|
55
|
+
|
|
56
|
+
## Feature Area Investigation
|
|
57
|
+
|
|
58
|
+
Use when the task involves a named feature (billing, auth, admin, graph, etc.).
|
|
59
|
+
|
|
60
|
+
1. Call `explore_task(query)` — review likely files, entrypoints, and recommended reads.
|
|
61
|
+
2. Call `get_file(path=[...])` on the top results to survey outlines without loading full files.
|
|
62
|
+
3. Use `symbol` for the most relevant component, service, or controller.
|
|
63
|
+
4. If still unclear, call `find_related_files` anchored to the best file found.
|
|
64
|
+
|
|
65
|
+
## Symbol-Level Debugging
|
|
66
|
+
|
|
67
|
+
Use when a bug or behavior centers on a specific function, class, component, or method.
|
|
68
|
+
|
|
69
|
+
1. `search_codebase(symbol_name)` if the file is unknown.
|
|
70
|
+
2. `symbol(action="context", symbol_name, file_path)` for the exact body.
|
|
71
|
+
3. `symbol` when call flow or impact matters.
|
|
72
|
+
4. Read only adjacent files needed to explain or change the behavior.
|
|
73
|
+
|
|
74
|
+
Do not read an entire large file to inspect one symbol when CodeMap can return symbol context.
|
|
75
|
+
|
|
76
|
+
## Interpreting CodeMap Output
|
|
77
|
+
|
|
78
|
+
After any CodeMap tool returns ranked files, symbols, or related files:
|
|
79
|
+
|
|
80
|
+
1. Read the summary first — decide if it is enough to act before expanding.
|
|
81
|
+
2. Prefer high-ranked results before low-ranked ones.
|
|
82
|
+
3. Follow `nextSteps`, `resourceUris`, and suggested tool calls before opening raw files.
|
|
83
|
+
4. Use ranking signals to filter: exact path/symbol match = strong; fuzzy keyword = weak.
|
|
84
|
+
5. Stop expanding context once the edit or answer is grounded enough.
|
|
85
|
+
|
|
86
|
+
When results look weak or noisy, refine the query, anchor to a known file or symbol, or switch tool.
|
|
87
|
+
|
|
88
|
+
## Token-Efficient Code Review
|
|
89
|
+
|
|
90
|
+
Use when reviewing changes in a CodeMap-indexed repository.
|
|
91
|
+
|
|
92
|
+
1. Start with `diff(mode="working")` or `diff(mode="refs")`.
|
|
93
|
+
2. For changed symbols, use `symbol` instead of full-file reads.
|
|
94
|
+
3. Use `symbol` for risky public API or shared behavior changes.
|
|
95
|
+
4. Lead findings by severity. Mention test gaps and residual risk.
|
|
96
|
+
|
|
97
|
+
Review behavior and integration risks — avoid summarizing broad context unless it supports a finding.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Brainstorming
|
|
2
|
+
|
|
3
|
+
Use this skill when the user describes a new feature, a vague requirement, or says "design X", "plan X", or "how should we approach X". Do not write any code until the design is approved.
|
|
4
|
+
|
|
5
|
+
## Hard Gate
|
|
6
|
+
|
|
7
|
+
**Never write production code before completing this skill.** The design must be written and approved first, even for simple tasks.
|
|
8
|
+
|
|
9
|
+
## Process
|
|
10
|
+
|
|
11
|
+
1. **Gather real context with CodeMap**
|
|
12
|
+
- `explore_task("feature or problem description")` — get likely files, entrypoints, risks
|
|
13
|
+
- `get_project_insights()` — understand codebase size, language breakdown, patterns
|
|
14
|
+
|
|
15
|
+
2. **Ask clarifying questions** — one at a time, stop when the scope is unambiguous:
|
|
16
|
+
- What is the expected input and output?
|
|
17
|
+
- What edge cases or failure modes matter?
|
|
18
|
+
- Are there existing patterns in the codebase to follow?
|
|
19
|
+
|
|
20
|
+
3. **Propose 2–3 approaches** with real file references from step 1:
|
|
21
|
+
- State the trade-offs (complexity, blast radius, consistency with existing patterns)
|
|
22
|
+
- Use `find_related_files` or `get_file(include=["outline"])` to back claims
|
|
23
|
+
|
|
24
|
+
4. **Write a design doc** to `docs/specs/YYYY-MM-DD-<topic>.md`:
|
|
25
|
+
- Goal and non-goals
|
|
26
|
+
- Chosen approach and why
|
|
27
|
+
- Files to create/modify (with paths from CodeMap)
|
|
28
|
+
- Data flow or API contract
|
|
29
|
+
- Open questions
|
|
30
|
+
|
|
31
|
+
5. **Self-review the spec** — check for missing edge cases, unclear interfaces, or scope creep
|
|
32
|
+
|
|
33
|
+
6. **Wait for user approval** before proceeding to implementation
|
|
34
|
+
|
|
35
|
+
## After Approval
|
|
36
|
+
|
|
37
|
+
Invoke the task-lifecycle workflow: explore → confirm edit plan → implement → verify → diff → reimport.
|
|
38
|
+
|
|
39
|
+
## Rule
|
|
40
|
+
|
|
41
|
+
If the user skips design and asks to implement directly, acknowledge the risk and offer a one-paragraph lightweight design summary before touching any file.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Executing Plans
|
|
2
|
+
|
|
3
|
+
Use this skill when implementing an approved plan. Follow the plan in order and keep the edit surface narrow.
|
|
4
|
+
|
|
5
|
+
## Process
|
|
6
|
+
|
|
7
|
+
1. **Before edits**
|
|
8
|
+
- Read the approved plan.
|
|
9
|
+
- Call `diff(mode="working")` and note unrelated dirty files.
|
|
10
|
+
- Read only the CodeMap context needed for the next step.
|
|
11
|
+
|
|
12
|
+
2. **During implementation**
|
|
13
|
+
- Execute one logical plan step at a time.
|
|
14
|
+
- Keep behavior and file ownership aligned with the plan.
|
|
15
|
+
- If reality contradicts the plan, pause to revise the plan instead of improvising a broad rewrite.
|
|
16
|
+
|
|
17
|
+
3. **After edits**
|
|
18
|
+
- Run the planned checks.
|
|
19
|
+
- Call `diff(mode="working")` to inspect the actual changed files.
|
|
20
|
+
- Use `refresh_local_index` after local edits.
|
|
21
|
+
- Use `reimport` only when cloud graph, web insights, or paid cloud indexing should refresh.
|
|
22
|
+
|
|
23
|
+
## Rule
|
|
24
|
+
|
|
25
|
+
Do not declare completion until `verification-before-completion` is satisfied.
|
|
26
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Feature Area Investigation
|
|
2
|
+
|
|
3
|
+
Use this skill for feature questions like billing, auth redirect, admin project detail, import history, or graph canvas.
|
|
4
|
+
|
|
5
|
+
## Process
|
|
6
|
+
|
|
7
|
+
1. Call `explore_task(query)`.
|
|
8
|
+
2. Review likely files, entrypoints, and recommended reads.
|
|
9
|
+
3. Call the suggested `get_file(path=[...])` to inspect outlines without loading full files.
|
|
10
|
+
4. Use `symbol` for the most relevant component/service/controller.
|
|
11
|
+
5. If the area is still unclear, call `find_related_files` with the best anchor file.
|
|
12
|
+
|
|
13
|
+
## Output Expectation
|
|
14
|
+
|
|
15
|
+
Identify primary entrypoints, backend services/routes, frontend components/API clients, shared schema/types, and any secondary matches.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Interpreting CodeMap Output
|
|
2
|
+
|
|
3
|
+
Use this skill after a CodeMap MCP tool returns ranked files, symbol context, related files, usages, callers, workflow guidance, or diff output.
|
|
4
|
+
|
|
5
|
+
## Reading Order
|
|
6
|
+
|
|
7
|
+
1. Read the summary first and decide whether the result is enough to act.
|
|
8
|
+
2. Prefer high-ranked files and symbols before expanding to lower-ranked matches.
|
|
9
|
+
3. Follow `nextSteps`, `resourceUris`, and related tool hints before opening raw files.
|
|
10
|
+
4. Treat snippets, outlines, symbol ranges, and score reasons as filters, not as a full substitute for code needed before editing.
|
|
11
|
+
|
|
12
|
+
## Token Discipline
|
|
13
|
+
|
|
14
|
+
- Use `get_file` for several candidate files instead of opening each file.
|
|
15
|
+
- Use `symbol` for a known function, component, class, or method body.
|
|
16
|
+
- Use `get_file` with line ranges when the tool output points to a precise span.
|
|
17
|
+
- Stop expanding context once the edit or answer is grounded enough.
|
|
18
|
+
|
|
19
|
+
## Ranking Signals
|
|
20
|
+
|
|
21
|
+
- Strong signals: exact file path, exact symbol name, direct export, direct import, caller/callee, route/API handler match.
|
|
22
|
+
- Medium signals: feature-area summary rank, related-file edge, same directory, shared service/component.
|
|
23
|
+
- Weak signals: fuzzy name match, generic loading/error files, broad utility files, low-score keyword-only hits.
|
|
24
|
+
|
|
25
|
+
When results look weak or noisy, refine the query, anchor it to a file or symbol, or switch from feature search to symbol/file search.
|
|
26
|
+
|
|
27
|
+
## Before Answering
|
|
28
|
+
|
|
29
|
+
Mention only the CodeMap result details that changed the decision: selected files, key symbols, and whether more raw reading was needed.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# MCP-First Exploration
|
|
2
|
+
|
|
3
|
+
Use this skill when the task starts with unclear files, a broad bug/feature request, or a question like "where should I look?"
|
|
4
|
+
|
|
5
|
+
## Process
|
|
6
|
+
|
|
7
|
+
1. Ask CodeMap for a ranked shortlist using the narrowest fitting tool.
|
|
8
|
+
2. Read outlines before full files.
|
|
9
|
+
3. Prefer symbol bodies over whole-file reads.
|
|
10
|
+
4. Fall back to raw search only for unindexed files, dynamic string searches, or MCP gaps.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Safe Edit And Reimport
|
|
2
|
+
|
|
3
|
+
Use this skill when making code changes in a CodeMap-indexed repository.
|
|
4
|
+
|
|
5
|
+
## Process
|
|
6
|
+
|
|
7
|
+
1. Narrow the affected files with CodeMap before editing.
|
|
8
|
+
2. Keep edits scoped to the user request and existing local patterns.
|
|
9
|
+
3. Run the smallest sufficient build/test:
|
|
10
|
+
- shared package changes before API/web consumers.
|
|
11
|
+
- API build/tests for backend behavior.
|
|
12
|
+
- web build/tests for frontend behavior.
|
|
13
|
+
4. Call `diff(mode="working")` or use git diff to review scope.
|
|
14
|
+
5. Call `refresh_local_index` after local code/index/rule changes. Call `reimport` and `reimport(wait=true)` only when cloud/web graph and insights should refresh or when asked.
|
|
15
|
+
|
|
16
|
+
## Rule
|
|
17
|
+
|
|
18
|
+
Never declare the task complete without saying what was verified or why verification was skipped.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Symbol-Level Debugging
|
|
2
|
+
|
|
3
|
+
Use this skill when a bug or behavior centers on a specific function, class, component, method, or export.
|
|
4
|
+
|
|
5
|
+
## Process
|
|
6
|
+
|
|
7
|
+
1. Call `search_codebase` with the symbol name if the file is unknown.
|
|
8
|
+
2. Call `symbol(action="context", symbol_name, file_path?)` for the exact body.
|
|
9
|
+
3. Call `symbol` when impact or call flow matters.
|
|
10
|
+
4. Read only the adjacent files needed to explain or change behavior.
|
|
11
|
+
5. After editing, run targeted verification and inspect the diff.
|
|
12
|
+
|
|
13
|
+
## Rule
|
|
14
|
+
|
|
15
|
+
Do not read an entire large file just to inspect one symbol when CodeMap can return symbol context.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Test-Driven Development
|
|
2
|
+
|
|
3
|
+
Use this skill when implementing new functionality or fixing a bug where tests are expected. Follow the RED → GREEN → REFACTOR cycle strictly.
|
|
4
|
+
|
|
5
|
+
## Hard Gate
|
|
6
|
+
|
|
7
|
+
**No production code before a failing test.** If you write implementation first, tests written afterward will pass immediately and prove nothing.
|
|
8
|
+
|
|
9
|
+
## Cycle
|
|
10
|
+
|
|
11
|
+
### RED — Write a failing test first
|
|
12
|
+
|
|
13
|
+
1. `search_codebase("test <feature>")` — find existing test files and patterns for this area
|
|
14
|
+
2. `get_file(test_file, include=["outline"])` — understand test structure and helpers
|
|
15
|
+
3. Write the minimal test that describes the desired behavior
|
|
16
|
+
4. Run tests using the host agent test runner (e.g. `npm test`, `vitest`, `pytest`, etc.) — confirm the test **fails** before proceeding
|
|
17
|
+
- If the test passes immediately: it is testing existing behavior, not new behavior — revise it
|
|
18
|
+
|
|
19
|
+
### GREEN — Implement the minimum to pass
|
|
20
|
+
|
|
21
|
+
1. `symbol(action="context", symbol, file_path)` — read the exact function/class to modify
|
|
22
|
+
2. `symbol(action="callers", path, symbol)` — understand call context before changing signatures
|
|
23
|
+
3. Write only the code needed to make the failing test pass — no extra logic
|
|
24
|
+
4. Run tests using the host agent test runner (e.g. `npm test`, `vitest`, `pytest`, etc.) — confirm the test now **passes**
|
|
25
|
+
|
|
26
|
+
### REFACTOR — Clean up without breaking
|
|
27
|
+
|
|
28
|
+
1. Improve naming, extract helpers, remove duplication
|
|
29
|
+
2. Run tests using the host agent test runner (e.g. `npm test`, `vitest`, `pytest`, etc.) — confirm all tests still pass after cleanup
|
|
30
|
+
3. `diff(mode="working")` — review final scope of changes
|
|
31
|
+
|
|
32
|
+
## Rules
|
|
33
|
+
|
|
34
|
+
- One behavior per test — keep tests minimal and named after the behavior, not the implementation
|
|
35
|
+
- Prefer real code over mocks when the actual module is fast enough to call
|
|
36
|
+
- Never declare the task complete without showing that tests pass
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Token-Efficient Code Review
|
|
2
|
+
|
|
3
|
+
Use this skill when reviewing changes in a CodeMap-indexed repository.
|
|
4
|
+
|
|
5
|
+
## Process
|
|
6
|
+
|
|
7
|
+
1. Start with `diff(mode="working")` or `diff(mode="refs")`.
|
|
8
|
+
2. For changed symbols, use `symbol` instead of full-file reads.
|
|
9
|
+
3. Use `symbol` for risky public API, shared behavior, or call-flow changes.
|
|
10
|
+
4. Lead with concrete findings ordered by severity.
|
|
11
|
+
5. Mention test gaps and residual risk.
|
|
12
|
+
|
|
13
|
+
## Rule
|
|
14
|
+
|
|
15
|
+
Review behavior, integration risks, and missing verification. Avoid summarizing broad context unless it supports a finding.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Verification Before Completion
|
|
2
|
+
|
|
3
|
+
Use this skill after any task that changed files. It is the final gate before telling the user the work is done.
|
|
4
|
+
|
|
5
|
+
## Checklist
|
|
6
|
+
|
|
7
|
+
1. **Inspect changes**
|
|
8
|
+
- Call `diff(mode="working")`.
|
|
9
|
+
- Confirm only intended files changed.
|
|
10
|
+
- Mention unrelated dirty files if present.
|
|
11
|
+
|
|
12
|
+
2. **Run checks**
|
|
13
|
+
- Run the smallest sufficient build or test command.
|
|
14
|
+
- For shared package changes, build shared before dependents.
|
|
15
|
+
- If a check cannot run, explain why and what risk remains.
|
|
16
|
+
|
|
17
|
+
3. **Refresh indexes**
|
|
18
|
+
- Call `refresh_local_index` after local code edits.
|
|
19
|
+
- Use `reimport` and `reimport(wait=true)` only when cloud graph, web insights, or paid workspace cloud indexing should update.
|
|
20
|
+
|
|
21
|
+
4. **Final response**
|
|
22
|
+
- Summarize changed behavior.
|
|
23
|
+
- List verification results.
|
|
24
|
+
- Call out skipped checks, blockers, or residual risk.
|
|
25
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Writing Plans
|
|
2
|
+
|
|
3
|
+
Use this skill after a design is approved and before implementation begins. The goal is a decision-complete plan that another agent can execute without guessing.
|
|
4
|
+
|
|
5
|
+
## Hard Gate
|
|
6
|
+
|
|
7
|
+
Do not edit production files while writing the plan. Implementation starts only after the plan is accepted or the user explicitly asks to execute it.
|
|
8
|
+
|
|
9
|
+
## Process
|
|
10
|
+
|
|
11
|
+
1. **Re-ground in CodeMap context**
|
|
12
|
+
- Use the narrowest CodeMap context tool to confirm affected files, symbols, and risks.
|
|
13
|
+
- Inspect only the outlines or symbols needed to make implementation decisions.
|
|
14
|
+
|
|
15
|
+
2. **Write a concrete implementation plan**
|
|
16
|
+
- Use `codemap://agent-pack/templates/implementation-plan`.
|
|
17
|
+
- Include exact files or modules to touch when they are known.
|
|
18
|
+
- Include ordered steps, interfaces, edge cases, and verification commands.
|
|
19
|
+
- State assumptions clearly instead of leaving choices for the implementer.
|
|
20
|
+
|
|
21
|
+
3. **Check execution safety**
|
|
22
|
+
- Confirm no unrelated refactors are included.
|
|
23
|
+
- Confirm how to preserve user changes in a dirty worktree.
|
|
24
|
+
- Confirm the smallest sufficient test/build command.
|
|
25
|
+
|
|
26
|
+
4. **Wait for approval when required**
|
|
27
|
+
- New features and high-risk changes require user approval before implementation.
|
|
28
|
+
- Low-risk fixes may proceed after a lightweight plan if the user has already asked for execution.
|
|
29
|
+
|
|
30
|
+
## Output
|
|
31
|
+
|
|
32
|
+
Return a concise plan with: summary, key edits, verification, and assumptions.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
Use CodeMap MCP before raw file reads or grep.
|
|
4
|
+
|
|
5
|
+
- Start with `get_project`.
|
|
6
|
+
- Broad implementation/debug/review/refactor/test/research tasks with unclear files: `explore_task`.
|
|
7
|
+
- Follow relevant skills, hard gates, artifact templates, and verification checklist.
|
|
8
|
+
- Related files: `find_related_files`.
|
|
9
|
+
- Known symbols/files: `search_codebase`.
|
|
10
|
+
- Several candidates: `get_file`.
|
|
11
|
+
- Exact body: `symbol`.
|
|
12
|
+
- Impact analysis: `symbol`.
|
|
13
|
+
- Read MCP output by summary, ranking reasons, next steps, and resource URIs before expanding context.
|
|
14
|
+
- After edits: build/test, inspect diff, then reimport when needed.
|
|
15
|
+
|
|
16
|
+
Installed CodeMap skills live under `.codex/skills/codemap-*`:
|
|
17
|
+
- `codemap-brainstorming` — design-first workflow with hard gate before implementation
|
|
18
|
+
- `codemap-writing-plans` — decision-complete plan after approved design
|
|
19
|
+
- `codemap-executing-plans` — execute approved plans in scoped steps
|
|
20
|
+
- `codemap-test-driven-development` — RED → GREEN → REFACTOR using CodeMap tools
|
|
21
|
+
- `codemap-verification-before-completion` — final diff/build/index/reimport gate
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
Use CodeMap MCP-first workflow for this repository.
|
|
4
|
+
|
|
5
|
+
For broad implementation/debug/review/refactor/test/research tasks, use CodeMap MCP tools to gather repo context before editing. Start with `explore_task` when files are unclear, or inspect exact files/symbols directly when the user already named them.
|
|
6
|
+
|
|
7
|
+
Must read:
|
|
8
|
+
|
|
9
|
+
- `.claude/rules/codemap-mcp-first.md`
|
|
10
|
+
- `.claude/rules/codemap-task-lifecycle.md`
|
|
11
|
+
|
|
12
|
+
Relevant skills live under `.claude/skills/codemap-*`:
|
|
13
|
+
- `codemap-brainstorming` — design-first workflow with hard gate before implementation
|
|
14
|
+
- `codemap-writing-plans` — decision-complete plan after approved design
|
|
15
|
+
- `codemap-executing-plans` — execute approved plans in scoped steps
|
|
16
|
+
- `codemap-test-driven-development` — RED → GREEN → REFACTOR using CodeMap tools
|
|
17
|
+
- `codemap-verification-before-completion` — final diff/build/index/reimport gate
|
|
18
|
+
|
|
19
|
+
When a CodeMap MCP tool returns ranked files, symbol context, or next steps, read the summary and ranking signals before opening raw files.
|