@ankurhalder/codebase-snapshot 2.1.1 → 2.2.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/README.md +36 -0
- package/dist/bin.js +739 -43
- package/dist/{chunk-SUOJL5EX.js → chunk-5I564BGX.js} +23 -15
- package/dist/cli.cjs +719 -27
- package/dist/cli.d.cts +5 -1
- package/dist/cli.d.ts +5 -1
- package/dist/cli.js +698 -13
- package/dist/index.cjs +21 -13
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/docs/agent.md +80 -0
- package/docs/install.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,6 +54,11 @@ npx @ankurhalder/codebase-snapshot init --preset react-vite --max-part-bytes 120
|
|
|
54
54
|
- **TypeScript AST extraction** — directives, imports, exports (including `export *` and anonymous
|
|
55
55
|
defaults), functions, classes, interfaces, types, enums, components, hooks, and route handlers.
|
|
56
56
|
- **Structured summaries** — JSON key shapes and Markdown headings, computed from redacted text.
|
|
57
|
+
- **Built for AI agents** — `snap describe --format json` returns a machine-readable
|
|
58
|
+
contract (workflow, every option and default, exit codes, presets, safety rules), and
|
|
59
|
+
`snap skill --install` writes the bundled agent skill into `AGENTS.md`,
|
|
60
|
+
`.claude/skills/` and `.cursor/rules/` so a zero-context agent discovers the tool
|
|
61
|
+
automatically. See [docs/agent.md](docs/agent.md).
|
|
57
62
|
- **Zero-config presets** — auto-detects Next.js, Vite, Node/Express/Nest, and plain TypeScript.
|
|
58
63
|
- **Real integrity validation** — verifies source hashes, every emitted `parts/*.md` against its recorded
|
|
59
64
|
`byteSize`/`sha256`, monolith artifacts, and the recorded configuration.
|
|
@@ -94,6 +99,37 @@ and troubleshooting.
|
|
|
94
99
|
|
|
95
100
|
---
|
|
96
101
|
|
|
102
|
+
## 🤖 For AI agents
|
|
103
|
+
|
|
104
|
+
An agent with **no prior knowledge** of this tool can drive it end to end. Two commands
|
|
105
|
+
exist for exactly that:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Machine-readable contract: workflow, every option + default, exit codes,
|
|
109
|
+
# presets, safety rules and troubleshooting — as JSON on stdout.
|
|
110
|
+
npx @ankurhalder/codebase-snapshot@latest describe --format json
|
|
111
|
+
|
|
112
|
+
# Write the bundled agent skill where agents look for it:
|
|
113
|
+
# AGENTS.md, .claude/skills/codebase-snapshot/SKILL.md, .cursor/rules/
|
|
114
|
+
npx @ankurhalder/codebase-snapshot@latest skill --install
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The typical agent flow, once the contract is read:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
npx @ankurhalder/codebase-snapshot@latest init --yes # detect the project, write config
|
|
121
|
+
npx @ankurhalder/codebase-snapshot@latest generate # write ./snapshot/
|
|
122
|
+
npx @ankurhalder/codebase-snapshot@latest validate # exit 0 = matches disk
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Pin the tag (`@latest` or `@2`): a bare scoped spec can resolve to a placeholder manifest
|
|
126
|
+
with no executable on some npm builds and exit 0 printing nothing.
|
|
127
|
+
|
|
128
|
+
Details, including the contract schema and the skill's install targets, are in
|
|
129
|
+
[docs/agent.md](docs/agent.md).
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
97
133
|
## 🛠️ CLI
|
|
98
134
|
|
|
99
135
|
```bash
|