@netanelyasi/agent-ready 0.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/LICENSE +21 -0
- package/README.md +457 -0
- package/dist/analyzers/scoreReadiness.d.ts +2 -0
- package/dist/analyzers/scoreReadiness.js +49 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +73 -0
- package/dist/generators/generate.d.ts +2 -0
- package/dist/generators/generate.js +482 -0
- package/dist/scanner/scanProject.d.ts +2 -0
- package/dist/scanner/scanProject.js +544 -0
- package/dist/types.d.ts +97 -0
- package/dist/types.js +1 -0
- package/dist/utils/fs.d.ts +12 -0
- package/dist/utils/fs.js +102 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 BrainboxAI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
# agent-ready
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>Turn any repository into an AI-agent-ready codebase.</strong>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="#install">Install</a> ·
|
|
9
|
+
<a href="#quick-start">Quick Start</a> ·
|
|
10
|
+
<a href="#what-it-generates">What it Generates</a> ·
|
|
11
|
+
<a href="#how-it-works">How it Works</a> ·
|
|
12
|
+
<a href="#development">Development</a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<img alt="Status" src="https://img.shields.io/badge/status-experimental-f59e0b?style=flat-square" />
|
|
17
|
+
<img alt="Version" src="https://img.shields.io/badge/version-0.2.0-111827?style=flat-square" />
|
|
18
|
+
<img alt="License" src="https://img.shields.io/badge/license-MIT-0f766e?style=flat-square" />
|
|
19
|
+
<img alt="Runtime" src="https://img.shields.io/badge/runtime-Node.js-3c873a?style=flat-square" />
|
|
20
|
+
<img alt="Built by BrainboxAI" src="https://img.shields.io/badge/by-BrainboxAI-111827?style=flat-square" />
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
`agent-ready` is a CLI by **BrainboxAI** that scans a project and generates the harness AI coding agents need to work safely and effectively: context files, code maps, ignore rules, skills, hook templates, and readiness reports.
|
|
24
|
+
|
|
25
|
+
It is designed for real repositories—not demo apps. Use it on small apps, legacy codebases, monorepos, service folders, or projects that need a clean onboarding layer for Claude Code and other agentic coding tools.
|
|
26
|
+
|
|
27
|
+
> [!WARNING]
|
|
28
|
+
> `agent-ready` is an **experimental early preview**. It is useful today, but its repository detection is heuristic and generated files should be reviewed before committing.
|
|
29
|
+
|
|
30
|
+
> [!NOTE]
|
|
31
|
+
> **Inspired by Anthropic's Claude Code large-codebase guidance**
|
|
32
|
+
> This project was created after studying Anthropic's article:
|
|
33
|
+
> [**How Claude Code works in large codebases: best practices and where to start**](https://claude.com/blog/how-claude-code-works-in-large-codebases-best-practices-and-where-to-start).
|
|
34
|
+
> `agent-ready` turns those ideas—lean `CLAUDE.md` files, codebase maps, skills, hooks, MCP, LSP, scoped context, and subagent-friendly workflows—into a repeatable CLI workflow.
|
|
35
|
+
|
|
36
|
+
## Table of Contents
|
|
37
|
+
|
|
38
|
+
- [Why agent-ready](#why-agent-ready)
|
|
39
|
+
- [Install](#install)
|
|
40
|
+
- [Quick Start](#quick-start)
|
|
41
|
+
- [What it Generates](#what-it-generates)
|
|
42
|
+
- [How it Works](#how-it-works)
|
|
43
|
+
- [Detected Project Signals](#detected-project-signals)
|
|
44
|
+
- [Code Understanding](#code-understanding)
|
|
45
|
+
- [Safety Model](#safety-model)
|
|
46
|
+
- [Limitations](#limitations)
|
|
47
|
+
- [Example Output](#example-output)
|
|
48
|
+
- [CLI Reference](#cli-reference)
|
|
49
|
+
- [Development](#development)
|
|
50
|
+
- [Roadmap](#roadmap)
|
|
51
|
+
- [Brand](#brand)
|
|
52
|
+
- [Acknowledgements](#acknowledgements)
|
|
53
|
+
- [Contributing](#contributing)
|
|
54
|
+
- [License](#license)
|
|
55
|
+
|
|
56
|
+
## Why agent-ready
|
|
57
|
+
|
|
58
|
+
AI agents perform best when a repository is legible:
|
|
59
|
+
|
|
60
|
+
- Where should the agent start searching?
|
|
61
|
+
- Which files are generated noise?
|
|
62
|
+
- Which test/build commands are safe and local?
|
|
63
|
+
- Which project rules belong in always-loaded context?
|
|
64
|
+
- Which expertise should load only on demand?
|
|
65
|
+
- What should the agent never touch without confirmation?
|
|
66
|
+
|
|
67
|
+
`agent-ready` turns those answers into files an agent can actually use.
|
|
68
|
+
|
|
69
|
+
Instead of manually writing a bloated `CLAUDE.md`, it creates a layered harness:
|
|
70
|
+
|
|
71
|
+
```txt
|
|
72
|
+
CLAUDE.md # lean root agent guide
|
|
73
|
+
CODEMAP.md # repository map for navigation
|
|
74
|
+
.aiignore # noisy paths to avoid
|
|
75
|
+
.claude/settings.json # versioned deny rules
|
|
76
|
+
.agent-ready/report.md # readiness score and findings
|
|
77
|
+
.agent-ready/recommendations.md
|
|
78
|
+
.agent-ready/hooks/README.md
|
|
79
|
+
.agent-ready/skills/*/SKILL.md
|
|
80
|
+
apps/*/CLAUDE.md # generated for detected monorepo workspaces
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Install
|
|
84
|
+
|
|
85
|
+
### Run with npx
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npx @netanelyasi/agent-ready analyze .
|
|
89
|
+
npx @netanelyasi/agent-ready init . --dry-run
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Install globally
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npm install -g @netanelyasi/agent-ready
|
|
96
|
+
agent-ready analyze .
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### From source
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
git clone https://github.com/Brainboxai-IL/agent-ready.git agent-ready
|
|
103
|
+
cd agent-ready
|
|
104
|
+
npm install
|
|
105
|
+
npm run build
|
|
106
|
+
node dist/cli.js analyze .
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
> Published package: [`@netanelyasi/agent-ready`](https://www.npmjs.com/package/@netanelyasi/agent-ready). The CLI binary remains `agent-ready` after global install.
|
|
110
|
+
|
|
111
|
+
## Quick Start
|
|
112
|
+
|
|
113
|
+
Analyze a project without writing files:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
agent-ready analyze /path/to/project
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Preview generated files:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
agent-ready init /path/to/project --dry-run
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Generate the harness:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
agent-ready init /path/to/project
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Overwrite existing generated files intentionally:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
agent-ready init /path/to/project --force
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
By default, existing files are not overwritten. If `CLAUDE.md` already exists, `agent-ready` writes:
|
|
138
|
+
|
|
139
|
+
```txt
|
|
140
|
+
CLAUDE.md.agent-ready-proposed
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## What it Generates
|
|
144
|
+
|
|
145
|
+
### `CLAUDE.md`
|
|
146
|
+
|
|
147
|
+
A lean root guide for AI agents:
|
|
148
|
+
|
|
149
|
+
- project snapshot
|
|
150
|
+
- detected stack
|
|
151
|
+
- important directories
|
|
152
|
+
- validation commands
|
|
153
|
+
- operating rules
|
|
154
|
+
- critical framework/database notes
|
|
155
|
+
|
|
156
|
+
It is intentionally short. Task-specific expertise is placed in skills instead of loading into every session.
|
|
157
|
+
|
|
158
|
+
### `CODEMAP.md`
|
|
159
|
+
|
|
160
|
+
A navigation map for agents before broad search:
|
|
161
|
+
|
|
162
|
+
- detected entry points
|
|
163
|
+
- central files by internal import usage
|
|
164
|
+
- representative internal import graph
|
|
165
|
+
- external dependencies used in source files
|
|
166
|
+
- top-level directory purpose
|
|
167
|
+
- workspace/package manifests
|
|
168
|
+
- search guidance
|
|
169
|
+
- high-signal project structure
|
|
170
|
+
|
|
171
|
+
### `.aiignore`
|
|
172
|
+
|
|
173
|
+
Common noise exclusions:
|
|
174
|
+
|
|
175
|
+
```txt
|
|
176
|
+
node_modules/
|
|
177
|
+
.next/
|
|
178
|
+
dist/
|
|
179
|
+
build/
|
|
180
|
+
coverage/
|
|
181
|
+
.turbo/
|
|
182
|
+
vendor/
|
|
183
|
+
generated/
|
|
184
|
+
**/*.generated.*
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### `.claude/settings.json`
|
|
188
|
+
|
|
189
|
+
Versioned deny rules and runnable Claude Code hooks so every developer gets the same baseline safety.
|
|
190
|
+
|
|
191
|
+
Generated hooks include:
|
|
192
|
+
|
|
193
|
+
- `PreToolUse` for `Bash` — blocks destructive commands such as `rm -rf`, `git reset --hard`, `git clean -f`, and force-pushes.
|
|
194
|
+
- `PreToolUse` for `Write|Edit|MultiEdit` — blocks edits to generated/noisy paths such as `node_modules`, `dist`, `build`, `coverage`, `.next`, `vendor`, and `*.generated.*`.
|
|
195
|
+
- `PostToolUse` for `Write|Edit|MultiEdit` — reminds the agent which local validation command to run after edits.
|
|
196
|
+
|
|
197
|
+
### `.agent-ready/skills/*/SKILL.md`
|
|
198
|
+
|
|
199
|
+
On-demand task expertise. Examples:
|
|
200
|
+
|
|
201
|
+
- `codebase-navigation`
|
|
202
|
+
- `validation`
|
|
203
|
+
- `nextjs-hydration`
|
|
204
|
+
- `supabase-debugging`
|
|
205
|
+
- `rtl-ui`
|
|
206
|
+
- `deployment`
|
|
207
|
+
|
|
208
|
+
Skills are generated only when matching project signals are detected.
|
|
209
|
+
|
|
210
|
+
### `.claude/hooks/*.mjs`
|
|
211
|
+
|
|
212
|
+
Runnable hook scripts wired by `.claude/settings.json`:
|
|
213
|
+
|
|
214
|
+
- `.claude/hooks/prevent-destructive.mjs`
|
|
215
|
+
- `.claude/hooks/protect-generated.mjs`
|
|
216
|
+
- `.claude/hooks/suggest-validation.mjs`
|
|
217
|
+
|
|
218
|
+
### `.agent-ready/hooks/README.md`
|
|
219
|
+
|
|
220
|
+
Human-readable hook policy notes for maintainers. The actual Claude Code hooks are generated under `.claude/hooks` and wired in `.claude/settings.json`.
|
|
221
|
+
|
|
222
|
+
### Workspace `CLAUDE.md` files
|
|
223
|
+
|
|
224
|
+
In monorepos, `agent-ready` creates local guides next to detected package manifests, for example:
|
|
225
|
+
|
|
226
|
+
```txt
|
|
227
|
+
apps/web/CLAUDE.md
|
|
228
|
+
packages/db/CLAUDE.md
|
|
229
|
+
services/api/CLAUDE.md
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Each one contains local commands and navigation rules for that workspace.
|
|
233
|
+
|
|
234
|
+
## How it Works
|
|
235
|
+
|
|
236
|
+
`agent-ready` scans the repository directly from disk. It does not upload code, build embeddings, or require a remote index.
|
|
237
|
+
|
|
238
|
+
The scanner detects:
|
|
239
|
+
|
|
240
|
+
1. package manifests and scripts
|
|
241
|
+
2. languages and frameworks
|
|
242
|
+
3. database/tooling signals
|
|
243
|
+
4. deployment infrastructure
|
|
244
|
+
5. monorepo/workspace layout
|
|
245
|
+
6. important directories
|
|
246
|
+
7. noisy/generated paths
|
|
247
|
+
8. existing AI harness files
|
|
248
|
+
|
|
249
|
+
Then it generates a practical agent harness and assigns an **Agent Readiness Score**.
|
|
250
|
+
|
|
251
|
+
Important: the score does **not** give full credit for files that `agent-ready` generated itself. Generated files are treated as a baseline. They only become readiness signal after maintainers review and customize them.
|
|
252
|
+
|
|
253
|
+
## Detected Project Signals
|
|
254
|
+
|
|
255
|
+
Current detection includes:
|
|
256
|
+
|
|
257
|
+
| Area | Signals |
|
|
258
|
+
| --- | --- |
|
|
259
|
+
| JavaScript/TypeScript | `package.json`, lockfiles, scripts, TS/JS files |
|
|
260
|
+
| Frameworks | Next.js, React, Vue, Nuxt, SvelteKit, Vite, Express, NestJS |
|
|
261
|
+
| Other languages | Python, PHP, Java, C#, Go, Rust, C/C++ |
|
|
262
|
+
| Databases | Supabase, Prisma, Drizzle, PostgreSQL, MySQL, MongoDB |
|
|
263
|
+
| Monorepos | Turborepo, Nx, pnpm workspaces, package workspaces |
|
|
264
|
+
| Deployment | Docker, GitHub Actions, Vercel, Netlify, Cloudflare Workers |
|
|
265
|
+
| UI traits | Hebrew/RTL detection |
|
|
266
|
+
| Validation | build, test, lint, typecheck, format scripts |
|
|
267
|
+
|
|
268
|
+
## Code Understanding
|
|
269
|
+
|
|
270
|
+
`agent-ready` is moving beyond boilerplate generation. It now builds a lightweight static map for JavaScript, TypeScript, Python, Go, and Rust projects:
|
|
271
|
+
|
|
272
|
+
- package/script entry points
|
|
273
|
+
- common CLI, server, app, route, Python, Go, and Rust entry files
|
|
274
|
+
- JS/TS imports, including TypeScript source imported with runtime `.js` specifiers
|
|
275
|
+
- Python `import` / `from ... import ...` relationships, including relative modules
|
|
276
|
+
- Go imports resolved through the local `go.mod` module path
|
|
277
|
+
- Rust `mod` declarations and basic `crate::` / `self::` / `super::` use paths
|
|
278
|
+
- central files ranked by inbound imports
|
|
279
|
+
- external packages imported by source files
|
|
280
|
+
|
|
281
|
+
This makes `CODEMAP.md` useful as a code navigation artifact, not just a formatted directory listing.
|
|
282
|
+
|
|
283
|
+
## Safety Model
|
|
284
|
+
|
|
285
|
+
`agent-ready` is conservative by default.
|
|
286
|
+
|
|
287
|
+
- **No overwrite by default** — existing files produce `*.agent-ready-proposed`.
|
|
288
|
+
- **Dry-run supported** — preview before writing.
|
|
289
|
+
- **Runnable hooks generated** — safety checks are wired in `.claude/settings.json`, not just described in documentation.
|
|
290
|
+
- **Generated noise is denied** — build/vendor/generated paths are excluded and protected by a `PreToolUse` hook.
|
|
291
|
+
- **Root context stays lean** — deep knowledge goes into skills.
|
|
292
|
+
- **Local validation preferred** — workspace commands are favored over full-repo commands.
|
|
293
|
+
- **No self-inflating score** — generated files are not counted as maintainer-authored readiness until reviewed/customized.
|
|
294
|
+
|
|
295
|
+
## Limitations
|
|
296
|
+
|
|
297
|
+
`agent-ready` is intentionally conservative and heuristic.
|
|
298
|
+
|
|
299
|
+
- Detection can miss custom frameworks, unusual scripts, and non-standard repository layouts.
|
|
300
|
+
- Generated files are a strong starting point, not a replacement for maintainer review.
|
|
301
|
+
- Static code understanding covers JS/TS plus first-pass Python/Go/Rust import graphs. PHP/Java/C#/C/C++ are detected but do not yet get import graph mapping.
|
|
302
|
+
- It does not yet perform deep semantic analysis of README files, CI workflows, environment variables, or architecture docs.
|
|
303
|
+
- It does not upload code or call remote AI services.
|
|
304
|
+
- It is not affiliated with or endorsed by Anthropic.
|
|
305
|
+
|
|
306
|
+
## Example Output
|
|
307
|
+
|
|
308
|
+
```txt
|
|
309
|
+
Agent Ready: my-app
|
|
310
|
+
Root: /code/my-app
|
|
311
|
+
Score: 72/100
|
|
312
|
+
Languages: TypeScript, Python
|
|
313
|
+
Frameworks: Next.js, React
|
|
314
|
+
Databases/tools: Supabase
|
|
315
|
+
Deployment: Docker, GitHub Actions
|
|
316
|
+
Monorepo: yes (Turborepo, pnpm workspaces)
|
|
317
|
+
|
|
318
|
+
Missing:
|
|
319
|
+
- No CODEMAP.md / codebase map
|
|
320
|
+
- No reusable skills directory
|
|
321
|
+
|
|
322
|
+
Generating 14 files:
|
|
323
|
+
- created: CLAUDE.md
|
|
324
|
+
- created: CODEMAP.md
|
|
325
|
+
- created: .aiignore
|
|
326
|
+
- created: .claude/settings.json
|
|
327
|
+
- created: .agent-ready/report.md
|
|
328
|
+
- created: .agent-ready/recommendations.md
|
|
329
|
+
- created: .agent-ready/hooks/README.md
|
|
330
|
+
- created: .agent-ready/skills/codebase-navigation/SKILL.md
|
|
331
|
+
- created: .agent-ready/skills/validation/SKILL.md
|
|
332
|
+
- created: .agent-ready/skills/nextjs-hydration/SKILL.md
|
|
333
|
+
- created: .agent-ready/skills/supabase-debugging/SKILL.md
|
|
334
|
+
- created: apps/web/CLAUDE.md
|
|
335
|
+
- created: packages/db/CLAUDE.md
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
## CLI Reference
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
agent-ready analyze [path]
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
Scan a project and print the readiness summary. Does not write files.
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
agent-ready init [path]
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
Scan a project and generate the AI-agent harness.
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
agent-ready init [path] --dry-run
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
Show which files would be generated without writing anything.
|
|
357
|
+
|
|
358
|
+
```bash
|
|
359
|
+
agent-ready init [path] --force
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
Overwrite existing files instead of writing `*.agent-ready-proposed`.
|
|
363
|
+
|
|
364
|
+
## Development
|
|
365
|
+
|
|
366
|
+
Requirements:
|
|
367
|
+
|
|
368
|
+
- Node.js
|
|
369
|
+
- npm
|
|
370
|
+
|
|
371
|
+
Install dependencies:
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
npm install
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
Run in development:
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
npm run dev -- analyze .
|
|
381
|
+
npm run dev -- init . --dry-run
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
Type-check:
|
|
385
|
+
|
|
386
|
+
```bash
|
|
387
|
+
npm run check
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
Run tests:
|
|
391
|
+
|
|
392
|
+
```bash
|
|
393
|
+
npm test
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
Build:
|
|
397
|
+
|
|
398
|
+
```bash
|
|
399
|
+
npm run build
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
Run compiled CLI:
|
|
403
|
+
|
|
404
|
+
```bash
|
|
405
|
+
node dist/cli.js analyze .
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
## Roadmap
|
|
409
|
+
|
|
410
|
+
Planned improvements:
|
|
411
|
+
|
|
412
|
+
- deeper README/config/workflow analysis
|
|
413
|
+
- richer monorepo workspace detection
|
|
414
|
+
- generated `CONTRIBUTING.md` and `SECURITY.md` templates
|
|
415
|
+
- optional AI-assisted repository summary mode
|
|
416
|
+
- npm package release
|
|
417
|
+
- plugin/export presets for Claude Code, Cursor, Codex, and other agents
|
|
418
|
+
- CI mode for failing builds when agent readiness drops below a threshold
|
|
419
|
+
|
|
420
|
+
## Brand
|
|
421
|
+
|
|
422
|
+
`agent-ready` is built by **BrainboxAI**.
|
|
423
|
+
|
|
424
|
+
BrainboxAI builds practical AI-agent infrastructure: tools, workflows, and automation systems that help teams move from ad-hoc prompting to reliable agent operations.
|
|
425
|
+
|
|
426
|
+
## Acknowledgements
|
|
427
|
+
|
|
428
|
+
`agent-ready` was created after studying Anthropic's guidance on making large codebases navigable for Claude Code.
|
|
429
|
+
|
|
430
|
+
> **Reference article**
|
|
431
|
+
> [How Claude Code works in large codebases: best practices and where to start](https://claude.com/blog/how-claude-code-works-in-large-codebases-best-practices-and-where-to-start) — Anthropic.
|
|
432
|
+
|
|
433
|
+
The core idea is to turn those best practices into a repeatable CLI workflow:
|
|
434
|
+
|
|
435
|
+
- scan the repository
|
|
436
|
+
- generate lean, layered context
|
|
437
|
+
- map the codebase before broad search
|
|
438
|
+
- separate reusable expertise into skills
|
|
439
|
+
- document hooks, validation paths, MCP, and LSP recommendations
|
|
440
|
+
- keep generated/build/vendor noise away from agents
|
|
441
|
+
|
|
442
|
+
This project is independent and is not affiliated with or endorsed by Anthropic.
|
|
443
|
+
|
|
444
|
+
## Contributing
|
|
445
|
+
|
|
446
|
+
Contributions are welcome once the public repository is available.
|
|
447
|
+
|
|
448
|
+
Before opening a pull request:
|
|
449
|
+
|
|
450
|
+
1. Run `npm run check`.
|
|
451
|
+
2. Run `npm run build`.
|
|
452
|
+
3. Test the CLI on at least one real project with `--dry-run`.
|
|
453
|
+
4. Keep generated context lean; do not move task-specific expertise into root `CLAUDE.md` templates.
|
|
454
|
+
|
|
455
|
+
## License
|
|
456
|
+
|
|
457
|
+
MIT © BrainboxAI
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export function scoreReadiness(scan) {
|
|
2
|
+
let score = 0;
|
|
3
|
+
const strengths = [];
|
|
4
|
+
const missing = [];
|
|
5
|
+
const warnings = [];
|
|
6
|
+
addHarness(scan.existingHarness.claudeMd, 18, "Maintainer-authored root CLAUDE.md exists", "No maintainer-authored root CLAUDE.md");
|
|
7
|
+
addHarness(scan.existingHarness.codemap, 12, "Maintainer-authored CODEMAP.md exists", "No maintainer-authored CODEMAP.md / codebase map");
|
|
8
|
+
addHarness(scan.existingHarness.aiIgnore, 10, "Maintainer-authored .aiignore exists", "No maintainer-authored .aiignore");
|
|
9
|
+
addHarness(scan.existingHarness.claudeSettings, 10, "Maintainer-authored .claude/settings.json exists", "No maintainer-authored Claude settings/permissions");
|
|
10
|
+
add(Boolean(scan.commands.build?.length), 10, "Build command detected", "No build command detected");
|
|
11
|
+
add(Boolean(scan.commands.test?.length || scan.commands.lint?.length || scan.commands.typecheck?.length), 12, "Validation commands detected", "No test/lint/typecheck command detected");
|
|
12
|
+
add(scan.codeGraph.entryPoints.length > 0, 8, "Code entry points detected", "No code entry points detected");
|
|
13
|
+
add(scan.codeGraph.importEdges.length > 0 || scan.codeGraph.externalImports.length > 0, 8, "Import graph detected", "No import graph detected");
|
|
14
|
+
add(scan.monorepo.detected ? scan.packages.length > 1 : true, 5, "Workspace/package layout detected", "Monorepo detected but packages are unclear");
|
|
15
|
+
add(scan.languages.length > 0, 5, `Languages detected: ${scan.languages.join(", ")}`, "Could not detect languages");
|
|
16
|
+
add(scan.existingHarness.skillsDir && !isOnlyAgentReadySkills(scan), 2, "Maintainer skills directory exists", "No maintainer-authored reusable skills directory");
|
|
17
|
+
warnIfGenerated("CLAUDE.md", scan.existingHarness.claudeMd);
|
|
18
|
+
warnIfGenerated("CODEMAP.md", scan.existingHarness.codemap);
|
|
19
|
+
warnIfGenerated(".aiignore", scan.existingHarness.aiIgnore);
|
|
20
|
+
warnIfGenerated(".claude/settings.json", scan.existingHarness.claudeSettings);
|
|
21
|
+
if (scan.monorepo.detected && !scan.existingHarness.claudeMd.exists)
|
|
22
|
+
warnings.push("Monorepo without CLAUDE.md: agents will waste context discovering structure.");
|
|
23
|
+
if (scan.noisyPaths.length > 0 && !scan.existingHarness.aiIgnore.exists)
|
|
24
|
+
warnings.push(`Noisy paths detected (${scan.noisyPaths.join(", ")}) but no .aiignore exists.`);
|
|
25
|
+
if (scan.traits.hasHebrewOrRtl)
|
|
26
|
+
strengths.push("Hebrew/RTL trait detected; RTL UI skill will be generated.");
|
|
27
|
+
if (scan.databases.length > 0)
|
|
28
|
+
strengths.push(`Database tooling detected: ${scan.databases.join(", ")}.`);
|
|
29
|
+
return { score: Math.min(score, 100), strengths, missing, warnings };
|
|
30
|
+
function add(condition, points, yes, no) {
|
|
31
|
+
if (condition) {
|
|
32
|
+
score += points;
|
|
33
|
+
strengths.push(yes);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
missing.push(no);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function addHarness(file, points, yes, no) {
|
|
40
|
+
add(file.countsAsMaintainerAuthored, points, yes, file.exists ? `${no} (existing file is agent-ready generated and needs maintainer review)` : no);
|
|
41
|
+
}
|
|
42
|
+
function warnIfGenerated(label, file) {
|
|
43
|
+
if (file.generatedByAgentReady)
|
|
44
|
+
warnings.push(`${label} was generated by agent-ready; it is not counted as maintainer-authored readiness until reviewed/customized.`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function isOnlyAgentReadySkills(scan) {
|
|
48
|
+
return scan.existingHarness.skillsDir && !scan.existingHarness.claudeMd.countsAsMaintainerAuthored;
|
|
49
|
+
}
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { scoreReadiness } from "./analyzers/scoreReadiness.js";
|
|
4
|
+
import { generateFiles } from "./generators/generate.js";
|
|
5
|
+
import { scanProject } from "./scanner/scanProject.js";
|
|
6
|
+
import { safeWriteFile } from "./utils/fs.js";
|
|
7
|
+
async function main() {
|
|
8
|
+
const args = parseArgs(process.argv.slice(2));
|
|
9
|
+
if (args.command === "help") {
|
|
10
|
+
printHelp();
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const root = path.resolve(args.target);
|
|
14
|
+
const scan = await scanProject(root);
|
|
15
|
+
const score = scoreReadiness(scan);
|
|
16
|
+
printSummary(scan, score);
|
|
17
|
+
if (args.command === "analyze")
|
|
18
|
+
return;
|
|
19
|
+
const files = generateFiles(scan, score, args.force);
|
|
20
|
+
console.log(`\nGenerating ${files.length} files${args.dryRun ? " (dry-run)" : ""}:`);
|
|
21
|
+
for (const file of files) {
|
|
22
|
+
const relative = path.relative(root, file.path).replaceAll(path.sep, "/");
|
|
23
|
+
if (args.dryRun) {
|
|
24
|
+
console.log(`- would write ${relative}`);
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
const result = await safeWriteFile(file.path, file.content, args.force);
|
|
28
|
+
const target = result === "proposed" ? `${relative}.agent-ready-proposed` : relative;
|
|
29
|
+
console.log(`- ${result}: ${target}`);
|
|
30
|
+
}
|
|
31
|
+
console.log("\nDone. Start with CODEMAP.md and .agent-ready/report.md.");
|
|
32
|
+
}
|
|
33
|
+
function parseArgs(argv) {
|
|
34
|
+
const command = argv[0] === "init" || argv[0] === "analyze" ? argv[0] : argv[0] ? "help" : "help";
|
|
35
|
+
const flags = new Set(argv.filter((arg) => arg.startsWith("--")));
|
|
36
|
+
const target = argv.find((arg, index) => index > 0 && !arg.startsWith("--")) ?? ".";
|
|
37
|
+
return {
|
|
38
|
+
command,
|
|
39
|
+
target,
|
|
40
|
+
dryRun: flags.has("--dry-run"),
|
|
41
|
+
force: flags.has("--force"),
|
|
42
|
+
verbose: flags.has("--verbose"),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function printSummary(scan, score) {
|
|
46
|
+
console.log(`Agent Ready: ${scan.name}`);
|
|
47
|
+
console.log(`Root: ${scan.root}`);
|
|
48
|
+
console.log(`Score: ${score.score}/100`);
|
|
49
|
+
console.log(`Languages: ${scan.languages.join(", ") || "none detected"}`);
|
|
50
|
+
console.log(`Frameworks: ${scan.frameworks.join(", ") || "none detected"}`);
|
|
51
|
+
console.log(`Databases/tools: ${scan.databases.join(", ") || "none detected"}`);
|
|
52
|
+
console.log(`Deployment: ${scan.deployment.join(", ") || "none detected"}`);
|
|
53
|
+
console.log(`Monorepo: ${scan.monorepo.detected ? `yes (${scan.monorepo.tools.join(", ") || "multiple packages"})` : "no/unclear"}`);
|
|
54
|
+
console.log(`Entry points: ${scan.codeGraph.entryPoints.length}`);
|
|
55
|
+
console.log(`Resolved internal imports: ${scan.codeGraph.importEdges.length}`);
|
|
56
|
+
if (score.missing.length) {
|
|
57
|
+
console.log("\nMissing:");
|
|
58
|
+
for (const item of score.missing)
|
|
59
|
+
console.log(`- ${item}`);
|
|
60
|
+
}
|
|
61
|
+
if (score.warnings.length) {
|
|
62
|
+
console.log("\nWarnings:");
|
|
63
|
+
for (const item of score.warnings)
|
|
64
|
+
console.log(`- ${item}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function printHelp() {
|
|
68
|
+
console.log(`agent-ready\n\nUsage:\n agent-ready analyze [path]\n agent-ready init [path] [--dry-run] [--force]\n\nCommands:\n analyze Scan project and print readiness summary\n init Generate CLAUDE.md, CODEMAP.md, .aiignore, settings, skills, and reports\n\nOptions:\n --dry-run Show files that would be written\n --force Overwrite existing files instead of writing *.agent-ready-proposed\n`);
|
|
69
|
+
}
|
|
70
|
+
main().catch((error) => {
|
|
71
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
72
|
+
process.exit(1);
|
|
73
|
+
});
|