repopilot 0.12.0 → 0.14.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.
Files changed (2) hide show
  1. package/README.md +112 -284
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -7,76 +7,46 @@
7
7
  [![License](https://img.shields.io/crates/l/repopilot.svg)](LICENSE)
8
8
  [![GitHub Stars](https://img.shields.io/github/stars/MykytaStel/repopilot?style=social)](https://github.com/MykytaStel/repopilot)
9
9
 
10
- **Local-first repository risk checks for safer human and AI-assisted code changes.**
10
+ **Local-first repository audits for safer human and AI-assisted code changes.**
11
11
 
12
- RepoPilot gives teams a fast safety pass before a pull request, release, or AI
13
- coding session. It scans a repository locally, explains architecture, security,
14
- code-quality, testing, and framework risks, then turns findings into AI-ready
15
- context without uploading your source code to a hosted scanner.
16
-
17
- It is not meant to replace language linters. RepoPilot focuses on repository
18
- signals that are hard to see from one file at a time: risky files, architecture
19
- drift, security candidates, testing gaps, review risk, baselines, and remediation
20
- context for Claude Code, ChatGPT, Cursor, or another coding assistant.
21
-
22
- ---
23
-
24
- ## Why RepoPilot?
25
-
26
- Most tools either lint one language or send results into a dashboard. RepoPilot is
27
- designed for the local development loop:
12
+ RepoPilot is a fast Rust CLI that scans a repository locally, ranks evidence-backed risks, supports baseline adoption, reviews branches, and creates AI-ready remediation context without uploading source code.
28
13
 
29
14
  ```text
30
- scan -> understand risk -> generate AI context -> fix -> review
15
+ scan -> review risk -> baseline adoption -> CI evidence -> local AI context
31
16
  ```
32
17
 
33
- | Capability | Language linters | Hosted scanners | RepoPilot |
34
- |---|---:|---:|---:|
35
- | Runs locally | ✅ | ❌ | ✅ |
36
- | No source upload required | ✅ | ❌ | ✅ |
37
- | Cross-language repository view | ❌ | ✅ | ✅ |
38
- | Architecture and repo risk signals | partial | ✅ | ✅ |
39
- | AI-ready remediation context | ❌ | ❌ | ✅ |
40
- | Baseline and PR review workflow | partial | ✅ | ✅ |
41
- | Default noise reduction / Trust Mode | ❌ | partial | ✅ |
42
-
43
- Use RepoPilot when you need to:
44
-
45
- - understand the highest-risk files before asking an AI assistant to edit;
46
- - add a CI gate without blocking on every existing finding;
47
- - review PR risk from changed lines instead of only whole-repo noise;
48
- - produce local evidence for releases through Markdown, JSON, SARIF, and receipts.
49
-
50
- ---
18
+ RepoPilot is not a replacement for language linters, formatters, type checkers, or dedicated security scanners. It complements them with repository-level evidence: secrets, runtime footguns, architecture risk, review blast radius, baseline status, and report formats that work in CI.
51
19
 
52
20
  ## Install
53
21
 
54
- With Cargo:
22
+ Choose one install method.
23
+
24
+ Cargo:
55
25
 
56
26
  ```bash
57
27
  cargo install repopilot
58
28
  ```
59
29
 
60
- With npm:
30
+ npm:
61
31
 
62
32
  ```bash
63
33
  npm install -g repopilot
64
34
  ```
65
35
 
66
- With Homebrew:
36
+ Homebrew:
67
37
 
68
38
  ```bash
69
39
  brew tap mykytastel/repopilot
70
40
  brew install repopilot
71
41
  ```
72
42
 
73
- With curl on Linux/macOS:
43
+ Installer:
74
44
 
75
45
  ```bash
76
46
  curl -fsSL https://raw.githubusercontent.com/MykytaStel/repopilot/main/install.sh | bash
77
47
  ```
78
48
 
79
- Build from source:
49
+ From source:
80
50
 
81
51
  ```bash
82
52
  git clone https://github.com/MykytaStel/repopilot.git
@@ -84,347 +54,205 @@ cd repopilot
84
54
  cargo build --release
85
55
  ```
86
56
 
87
- Upgrade:
88
-
89
- ```bash
90
- cargo install repopilot --force
91
- npm update -g repopilot
92
- brew update && brew upgrade repopilot
93
- ```
94
-
95
- ---
57
+ More: [docs/install.md](docs/install.md).
96
58
 
97
59
  ## Quick Start
98
60
 
99
- Start with a local scan:
61
+ Run a local scan:
100
62
 
101
63
  ```bash
102
64
  repopilot scan .
65
+ repopilot doctor .
103
66
  ```
104
67
 
105
- Check adoption readiness and create an intentional baseline for existing debt:
68
+ Adopt RepoPilot in an existing repository without failing CI on old debt:
106
69
 
107
70
  ```bash
108
- repopilot doctor .
109
71
  repopilot baseline create . --output .repopilot/baseline.json
110
72
  repopilot scan . --baseline .repopilot/baseline.json --fail-on new-high
111
73
  ```
112
74
 
113
- Generate AI-ready context for the highest-risk work:
75
+ Review a branch:
114
76
 
115
77
  ```bash
116
- repopilot ai context . --budget 4k
78
+ repopilot review . --base origin/main
117
79
  ```
118
80
 
119
- Copy AI context on macOS:
81
+ Generate local AI context:
120
82
 
121
83
  ```bash
122
- repopilot ai context . | pbcopy
84
+ repopilot ai context . --budget 4k
123
85
  ```
124
86
 
125
- Save a Markdown report:
87
+ Save CI evidence:
126
88
 
127
89
  ```bash
128
90
  repopilot scan . --format markdown --output repopilot-report.md
91
+ repopilot scan . --format json --output repopilot-report.json --receipt .repopilot/receipt.json
92
+ repopilot scan . --format sarif --output repopilot.sarif
129
93
  ```
130
94
 
131
- Run a focused security scan:
132
-
133
- ```bash
134
- repopilot scan . --min-severity high --rule security.secret-candidate
135
- ```
136
-
137
- Review only changed code against a base branch:
138
-
139
- ```bash
140
- repopilot review . --base origin/main
141
- ```
142
-
143
- ---
144
-
145
- ## Trust Mode
146
-
147
- RepoPilot's default scan profile is intentionally quiet.
95
+ ## Use with AI agents (MCP)
148
96
 
149
- The default profile focuses on actionable production, security, and runtime risks.
150
- Strict mode shows the full raw audit output, including maintainability and testing
151
- suggestions.
97
+ RepoPilot ships a local [Model Context Protocol](https://modelcontextprotocol.io) server so AI coding agents (Claude Code, Cursor, …) can call it as a tool — auditing what the agent just changed, without anything leaving your machine.
152
98
 
153
99
  ```bash
154
- repopilot scan . # default profile
155
- repopilot scan . --profile strict # full audit output
156
- repopilot scan . --include-maintainability
100
+ claude mcp add repopilot -- repopilot mcp
157
101
  ```
158
102
 
159
- The visibility engine classifies findings by product intent:
103
+ The server runs locally over stdio (JSON-RPC, no network, no AI calls) and exposes four tools:
160
104
 
161
- ```text
162
- SecurityRisk | RuntimeRisk | ActionableRisk | Maintainability | TestingGap | Informational
163
- ```
105
+ - `repopilot_review_change` — audit the current Git changes: in-diff vs out-of-diff findings plus blast radius.
106
+ - `repopilot_scan` — full repository audit as a JSON report.
107
+ - `repopilot_context` — a budgeted, AI-ready Markdown brief of the repo.
108
+ - `repopilot_explain_file` — how a single file is classified and which rules apply.
164
109
 
165
- Hidden suggestions are summarized by intent, rule, category, and reason, so the
166
- default report stays quiet without silently losing information.
110
+ More: [docs/mcp.md](docs/mcp.md).
167
111
 
168
- Read more:
112
+ ## What It Checks
169
113
 
170
- - [Trust Mode](docs/trust-mode.md)
171
- - [Core Visibility Engine](docs/core-visibility-engine.md)
172
-
173
- ---
114
+ | Area | Examples |
115
+ |---|---|
116
+ | Security | secret candidates, private keys, committed `.env` files |
117
+ | Runtime risk | Rust panic/unwrap paths, JavaScript/Python/Go/JVM/.NET process exits |
118
+ | Architecture | circular dependencies, excessive fan-out, instability hubs |
119
+ | Review risk | changed files, branch context, blast radius |
120
+ | Adoption | baselines, new-vs-existing findings, CI gates |
121
+ | Evidence | JSON, Markdown, SARIF, receipts, report envelopes |
122
+ | AI context | local, budgeted, evidence-backed Markdown for coding assistants |
174
123
 
175
- ## AI Workflow
124
+ ## Trust Mode
176
125
 
177
- RepoPilot does not call LLM APIs. It produces local Markdown that you choose where
178
- to paste.
126
+ Default scans are intentionally quiet. They keep high-trust security, runtime, and import-graph findings visible while summarizing broad maintainability and testing suggestions as strict-only noise.
179
127
 
180
128
  ```bash
181
- repopilot ai context . --focus security
182
- repopilot ai plan . --focus security
183
- repopilot ai prompt . --budget 8k
184
- ```
185
-
186
- Typical loop:
187
-
188
- ```text
189
- 1. Run RepoPilot locally.
190
- 2. Read the risk summary.
191
- 3. Generate focused AI context.
192
- 4. Paste the context into Claude Code, ChatGPT, Cursor, or another assistant.
193
- 5. Apply the patch.
194
- 6. Run RepoPilot review/scan again.
129
+ repopilot scan . # compact default output
130
+ repopilot scan . --output-style full
131
+ repopilot scan . --profile strict # full audit output
195
132
  ```
196
133
 
197
- See [AI workflows](docs/ai-workflows.md).
134
+ Use strict mode for cleanup passes, rule development, and release hardening. Use the default profile for day-to-day local checks and CI gates.
198
135
 
199
- ---
136
+ More: [docs/trust-mode.md](docs/trust-mode.md).
200
137
 
201
138
  ## Core Commands
202
139
 
203
- | Command | Alias | Description |
204
- |---|---:|---|
205
- | `repopilot scan <path>` | `s` | Scan a project, folder, or file |
206
- | `repopilot scan <path> --changed` | — | Scan changed files with local cache |
207
- | `repopilot cache clear [path]` | — | Remove `.repopilot/cache` |
208
- | `repopilot review [path]` | `r` | Review findings that touch changed Git diff lines |
209
- | `repopilot ai context <path>` | — | Generate LLM-ready repository context |
210
- | `repopilot ai plan <path>` | — | Generate a prioritized remediation plan |
211
- | `repopilot ai prompt <path>` | — | Generate a paste-ready remediation prompt |
212
- | `repopilot compare <before> <after>` | `cmp` | Compare two JSON scan reports |
213
- | `repopilot baseline create <path>` | `bl` | Store current findings as accepted debt |
214
- | `repopilot doctor [path]` | `d` | Diagnose audit readiness |
215
- | `repopilot init` | — | Generate `repopilot.toml` |
216
-
217
- Get command help:
218
-
219
- ```bash
220
- repopilot --help
221
- repopilot scan --help
222
- repopilot review --help
223
- repopilot ai --help
140
+ ```text
141
+ scan | review | baseline | compare | doctor | inspect | ai | init | cache | mcp
224
142
  ```
225
143
 
226
- ---
227
-
228
- ## Output Formats
144
+ Common workflows:
229
145
 
230
146
  ```bash
231
- repopilot scan . --format console
232
- repopilot scan . --format json --output report.json
233
- repopilot scan . --format markdown --output report.md
234
- repopilot scan . --format html --output report.html
235
- repopilot scan . --format sarif --output repopilot.sarif
147
+ repopilot scan .
148
+ repopilot review . --base origin/main
149
+ repopilot baseline create .
150
+ repopilot compare before.json after.json
151
+ repopilot inspect rules
152
+ repopilot inspect eval-rules --format json
153
+ repopilot ai context .
236
154
  ```
237
155
 
238
- Use:
239
-
240
- - `console` for local development
241
- - `markdown` for human-readable reports
242
- - `json` for scripts and integrations
243
- - `html` for shareable reports
244
- - `sarif` for GitHub Code Scanning
156
+ More: [docs/commands.md](docs/commands.md) and [docs/cli.md](docs/cli.md).
245
157
 
246
- ---
158
+ ## Baseline Adoption
247
159
 
248
- ## Configuration
249
-
250
- Generate a config file:
160
+ A baseline records current findings as accepted existing debt. Future scans can fail only on newly introduced risk:
251
161
 
252
162
  ```bash
253
- repopilot init
163
+ repopilot baseline create . --output .repopilot/baseline.json
164
+ git add .repopilot/baseline.json
165
+ repopilot scan . --baseline .repopilot/baseline.json --fail-on new-high
254
166
  ```
255
167
 
256
- Run with an explicit config:
168
+ Review baseline updates like code changes. A baseline is not a suppression file; it is a CI adoption contract.
257
169
 
258
- ```bash
259
- repopilot scan . --config repopilot.toml
260
- ```
170
+ ## Rule Quality
261
171
 
262
- Configuration precedence:
172
+ Rules move through a lifecycle:
263
173
 
264
174
  ```text
265
- CLI args > repopilot.toml > built-in defaults
175
+ experimental -> preview -> stable
266
176
  ```
267
177
 
268
- Common scan options:
178
+ Before a rule becomes stable or default-visible, it should have metadata, true-positive and false-positive fixtures, stable finding IDs, concrete evidence, false-positive notes, recommendations, and clean local evaluation:
269
179
 
270
180
  ```bash
271
- repopilot scan . --preset strict
272
- repopilot scan . --preset balanced
273
- repopilot scan . --preset lenient
274
- repopilot scan . --max-file-loc 500
275
- repopilot scan . --max-directory-depth 6
276
- repopilot scan . --exclude generated
277
- repopilot scan . --include-low-signal
181
+ repopilot inspect eval-rules --format json
278
182
  ```
279
183
 
280
- See [configuration docs](docs/configuration.md).
184
+ More: [docs/rule-quality-gate.md](docs/rule-quality-gate.md).
281
185
 
282
- ---
186
+ ## Local-First
283
187
 
284
- ## Baseline and Review
188
+ RepoPilot does not upload source code, run a hosted scanner, call LLM APIs implicitly, send telemetry, or require a SaaS account.
285
189
 
286
- Create a baseline for existing findings:
190
+ AI commands only format local scan evidence as Markdown for tools such as Claude Code, ChatGPT, Cursor, Zed, or another assistant.
287
191
 
288
- ```bash
289
- repopilot baseline create . --output .repopilot/baseline.json
290
- ```
192
+ ## Reports
193
+
194
+ | Format | Use case |
195
+ |---|---|
196
+ | Console | fast local feedback |
197
+ | Markdown | PR comments and human-readable reports |
198
+ | JSON | automation and internal tooling |
199
+ | SARIF | GitHub Code Scanning |
200
+ | HTML | shareable local reports |
201
+ | Receipt | compact release/CI evidence |
291
202
 
292
- Scan against accepted debt:
203
+ More: [docs/reports.md](docs/reports.md).
293
204
 
294
- ```bash
295
- repopilot scan . --baseline .repopilot/baseline.json
296
- ```
205
+ ## CI
297
206
 
298
- Fail CI only on new high-risk findings:
207
+ Minimal baseline-aware gate:
299
208
 
300
209
  ```bash
301
210
  repopilot scan . --baseline .repopilot/baseline.json --fail-on new-high
302
211
  ```
303
212
 
304
- Commit `.repopilot/baseline.json` only after reviewing the accepted findings.
305
- Do not update it just to make CI green; note accepted baseline changes in the PR.
306
-
307
- Validate or bypass local feedback suppressions:
213
+ GitHub Code Scanning:
308
214
 
309
215
  ```bash
310
- repopilot inspect feedback .
311
- repopilot scan . --ignore-feedback
216
+ repopilot scan . --format sarif --output repopilot.sarif
312
217
  ```
313
218
 
314
- Review a pull request or branch diff:
219
+ Release smoke:
315
220
 
316
221
  ```bash
317
- repopilot review . --base origin/main --fail-on-priority p1
222
+ ./scripts/smoke-product.sh
318
223
  ```
319
224
 
320
- See:
321
-
322
- - [CLI reference](docs/cli.md)
323
- - [Commands guide](docs/commands.md)
324
- - [GitHub Code Scanning integration](docs/integrations/github-code-scanning.md)
325
-
326
- ---
327
-
328
- ## What RepoPilot Checks
329
-
330
- RepoPilot includes rules for:
331
-
332
- - architecture risk
333
- - large and complex files
334
- - deep nesting
335
- - risky barrel files
336
- - excessive fan-out and coupling
337
- - circular dependencies
338
- - TODO/FIXME/HACK markers
339
- - long functions
340
- - hardcoded secret candidates
341
- - committed private keys
342
- - committed `.env` files
343
- - missing test structure
344
- - source files without test counterparts
345
- - JavaScript/TypeScript framework signals
346
- - React and React Native project health
347
- - Django project health
348
- - Rust panic/unwrap risk
349
- - JavaScript runtime exit risk
225
+ More: [docs/integrations/github-code-scanning.md](docs/integrations/github-code-scanning.md).
350
226
 
351
- See the full rule list in [rulesets](docs/rulesets.md).
227
+ ## Documentation
352
228
 
353
- ---
229
+ | Document | Purpose |
230
+ |---|---|
231
+ | [Install](docs/install.md) | Cargo, npm, Homebrew, curl, and source builds |
232
+ | [Commands](docs/commands.md) | Task-oriented workflows |
233
+ | [CLI](docs/cli.md) | Complete command and flag reference |
234
+ | [Configuration](docs/configuration.md) | `repopilot.toml`, presets, ignores, and baselines |
235
+ | [Rulesets](docs/rulesets.md) | Built-in rules, lifecycle, severity, and confidence |
236
+ | [Trust Mode](docs/trust-mode.md) | Default vs strict visibility policy |
237
+ | [Reports](docs/reports.md) | JSON, SARIF, Markdown, HTML, receipts, and schema fields |
238
+ | [Release Process](docs/release.md) | Local and CI release gates |
354
239
 
355
- ## Example
240
+ ## Development
356
241
 
357
242
  ```bash
358
- $ repopilot scan .
359
-
360
- RepoPilot Scan
361
- Version: 0.12.0
362
- Path: .
363
- Risk: Elevated
364
- Health score: 93/100
365
- Profile: default
366
- Findings visible: 7
367
- Hidden suggestions: 657 strict-only suggestions
368
-
369
- Top risks:
370
- P0 security.secret-candidate src/config/app.ts:12
371
- P1 language.rust.panic-risk src/api/routes/search.rs:88
372
-
373
- Hidden suggestions breakdown:
374
- 379 testing-gap / testing.source-without-test
375
- 104 maintainability / code-quality.long-function
376
- 43 maintainability / architecture.large-file
243
+ cargo fmt --all -- --check
244
+ cargo clippy --all-targets --all-features -- -D warnings
245
+ cargo test --all
246
+ npm run test:npm
247
+ ./scripts/smoke-product.sh
377
248
  ```
378
249
 
379
- Default mode shows what is likely to matter now. Strict mode keeps the full audit:
250
+ Run rule evaluation from source:
380
251
 
381
252
  ```bash
382
- repopilot scan . --profile strict
253
+ cargo run -- inspect eval-rules --format json
383
254
  ```
384
255
 
385
- ---
386
-
387
- ## Documentation
388
-
389
- | Document | Description |
390
- |---|---|
391
- | [Install](docs/install.md) | Cargo, npm, Homebrew, curl, and source builds |
392
- | [AI workflows](docs/ai-workflows.md) | Claude Code, ChatGPT, Cursor, and remediation workflows |
393
- | [Security](docs/security.md) | Local-first trust model and vulnerability reporting |
394
- | [Configuration](docs/configuration.md) | `repopilot.toml`, presets, ignore files, and baseline adoption |
395
- | [Language support](docs/language-support.md) | Supported language/framework tiers and limitations |
396
- | [Knowledge Engine](docs/knowledge-engine.md) | Rule applicability and local-first learning policy |
397
- | [Risk Engine](docs/risk-engine.md) | Risk scoring, priorities, and calibration policy |
398
- | [Local Feedback](docs/local-feedback.md) | Repository-local suppressions and validation |
399
- | [Trust Mode](docs/trust-mode.md) | Default vs strict visibility and hidden suggestions |
400
- | [Core Visibility Engine](docs/core-visibility-engine.md) | Finding intent model and visibility decisions |
401
- | [CLI reference](docs/cli.md) | Commands, flags, and exit codes |
402
- | [Commands guide](docs/commands.md) | Task-oriented command examples |
403
- | [Rulesets](docs/rulesets.md) | Implemented rules, categories, and severity levels |
404
- | [React Native](docs/react-native.md) | React Native and Expo detection |
405
- | [GitHub Code Scanning](docs/integrations/github-code-scanning.md) | SARIF workflow and CI setup |
406
- | [Roadmap](docs/roadmap.md) | Pre-1.0 roadmap and v1 gates |
407
- | [0.12 GTM plan](docs/gtm-0.12.md) | Launch audiences, messaging, and proof points |
408
- | [Release process](docs/release.md) | Manual release process |
409
- | [Changelog](CHANGELOG.md) | Version history |
410
-
411
- ---
412
-
413
- ## Roadmap
414
-
415
- Planned direction:
416
-
417
- - stronger Trust Mode calibration
418
- - `repopilot eval` with golden fixtures
419
- - local feedback validation and report transparency
420
- - hidden suggestion trend tracking
421
- - deeper dependency graph and impact analysis
422
- - AI task packs with context, constraints, and acceptance criteria
423
-
424
- See [roadmap](docs/roadmap.md).
425
-
426
- ---
427
-
428
256
  ## License
429
257
 
430
- RepoPilot is licensed under **MIT OR Apache-2.0**.
258
+ RepoPilot is licensed under **MIT OR Apache-2.0**.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repopilot",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "Local-first CLI for repository audit, architecture risk detection, baseline tracking, and CI-friendly code review.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "repository": {
@@ -26,11 +26,11 @@
26
26
  "LICENSE"
27
27
  ],
28
28
  "optionalDependencies": {
29
- "@repopilot/darwin-arm64": "0.12.0",
30
- "@repopilot/darwin-x64": "0.12.0",
31
- "@repopilot/linux-arm64-gnu": "0.12.0",
32
- "@repopilot/linux-x64-gnu": "0.12.0",
33
- "@repopilot/win32-x64-msvc": "0.12.0"
29
+ "@repopilot/darwin-arm64": "0.14.0",
30
+ "@repopilot/darwin-x64": "0.14.0",
31
+ "@repopilot/linux-arm64-gnu": "0.14.0",
32
+ "@repopilot/linux-x64-gnu": "0.14.0",
33
+ "@repopilot/win32-x64-msvc": "0.14.0"
34
34
  },
35
35
  "keywords": [
36
36
  "cli",