@ankurhalder/codebase-snapshot 2.1.1 → 3.0.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 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** — `codebase-snapshot describe --format json` returns a machine-readable
58
+ contract (workflow, every option and default, exit codes, presets, safety rules), and
59
+ `codebase-snapshot 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,11 +99,43 @@ 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
+ The bare form works too — `npx @ankurhalder/codebase-snapshot generate` — because the
126
+ package ships exactly one executable, which is what lets npm resolve it. Pin `@latest`
127
+ (or `@3`) when you need the same build on every machine.
128
+
129
+ Details, including the contract schema and the skill's install targets, are in
130
+ [docs/agent.md](docs/agent.md).
131
+
132
+ ---
133
+
97
134
  ## 🛠️ CLI
98
135
 
99
136
  ```bash
100
137
  codebase-snapshot [command] [options]
101
- snap [command] [options]
138
+ codebase-snapshot [command] [options]
102
139
  ```
103
140
 
104
141
  Every option accepts both `--opt value` and `--opt=value`. Human-readable progress goes to **stderr**;