patchpilots 0.1.0 โ†’ 0.1.1

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 +60 -55
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # PatchPilots
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/patchpilots)](https://www.npmjs.com/package/patchpilots)
4
+ [![license](https://img.shields.io/npm/l/patchpilots)](https://github.com/alavesa/patchpilots/blob/main/LICENSE)
5
+
3
6
  A team of AI agents that reviews and improves your code automatically.
4
7
 
5
8
  ```
@@ -26,13 +29,25 @@ A team of AI agents that reviews and improves your code automatically.
26
29
 
27
30
  Built for solo developers and hobby projects โ€” when you don't have a team to review your PRs, PatchPilots is your crew.
28
31
 
32
+ ## Install
33
+
34
+ ```bash
35
+ npx patchpilots review ./src
36
+ ```
37
+
38
+ Or install globally:
39
+
40
+ ```bash
41
+ npm install -g patchpilots
42
+ ```
43
+
29
44
  ## The Crew
30
45
 
31
46
  | Agent | Command | What it does |
32
47
  |-------|---------|--------------|
33
48
  | ๐Ÿง  Planner | `patchpilots plan` | Analyzes codebase and breaks down work into tasks |
34
49
  | ๐Ÿ” Reviewer | `patchpilots review` | Finds bugs, security issues, and code smells |
35
- | โœจ Coder | `patchpilots improve` | Rewrites and fixes code based on review findings |
50
+ | โœจ Coder | `patchpilots improve` | Fixes code based on review findings (diff-based patches) |
36
51
  | ๐Ÿงช Tester | `patchpilots test` | Generates unit tests for your source files |
37
52
  | ๐Ÿ“ Docs | `patchpilots docs` | Generates JSDoc/TSDoc documentation |
38
53
  | ๐ŸŽฏ Orchestrator | (coordinates) | Manages the pipeline between agents |
@@ -40,31 +55,27 @@ Built for solo developers and hobby projects โ€” when you don't have a team to r
40
55
  ## Quick start
41
56
 
42
57
  ```bash
43
- # Install dependencies
44
- npm install
58
+ # Set your API key (get one at https://console.anthropic.com/settings/keys)
59
+ # Option 1: Global config (set once, works everywhere)
60
+ echo '{"apiKey": "sk-ant-..."}' > ~/.patchpilots.json
45
61
 
46
- # Set your API key
62
+ # Option 2: Environment variable
47
63
  export ANTHROPIC_API_KEY=your-key-here
48
64
 
49
65
  # Review code
50
- npx tsx bin/patchpilots.ts review ./src
66
+ npx patchpilots review ./src
51
67
 
52
68
  # Generate an implementation plan
53
- npx tsx bin/patchpilots.ts plan ./src --task "add authentication"
69
+ npx patchpilots plan ./src --task "add authentication"
54
70
 
55
- # Review and improve code
56
- npx tsx bin/patchpilots.ts improve ./src
71
+ # Review and fix code
72
+ npx patchpilots improve ./src --write
57
73
 
58
74
  # Generate unit tests
59
- npx tsx bin/patchpilots.ts test ./src
75
+ npx patchpilots test ./src --write
60
76
 
61
77
  # Generate documentation
62
- npx tsx bin/patchpilots.ts docs ./src
63
-
64
- # Apply any changes to disk
65
- npx tsx bin/patchpilots.ts improve ./src --write
66
- npx tsx bin/patchpilots.ts test ./src --write
67
- npx tsx bin/patchpilots.ts docs ./src --write
78
+ npx patchpilots docs ./src --write
68
79
  ```
69
80
 
70
81
  ## CLI commands
@@ -83,14 +94,14 @@ Analyzes your code and reports findings grouped by file, color-coded by severity
83
94
 
84
95
  ### `patchpilots improve <path>`
85
96
 
86
- Reviews code and then generates improved versions with fixes applied.
97
+ Reviews code and generates search-and-replace patches to fix issues.
87
98
 
88
99
  All `review` options plus:
89
100
 
90
101
  | Option | Description |
91
102
  |--------|-------------|
92
- | `--write` | Write improved files to disk (default: dry-run) |
93
- | `--backup` | Create `.bak` files before overwriting |
103
+ | `--write` | Apply patches to disk (default: dry-run) |
104
+ | `--backup` | Create `.bak` files before patching |
94
105
 
95
106
  ### `patchpilots test <path>`
96
107
 
@@ -120,40 +131,35 @@ Generates documentation for source files.
120
131
 
121
132
  ## Configuration
122
133
 
123
- Create a `.patchpilots.json` in your project root:
134
+ Set your API key **once globally** so it works for every project:
135
+
136
+ ```bash
137
+ echo '{"apiKey": "sk-ant-..."}' > ~/.patchpilots.json
138
+ ```
139
+
140
+ Or create a per-project `.patchpilots.json`:
124
141
 
125
142
  ```json
126
143
  {
127
144
  "model": "claude-sonnet-4-6",
128
- "maxTokens": 16000,
129
- "temperature": 0.3,
130
- "include": ["**/*.ts", "**/*.js"],
145
+ "maxTokens": 64000,
146
+ "include": ["**/*.ts", "**/*.js", "**/*.tsx", "**/*.jsx", "**/*.html", "**/*.css"],
131
147
  "exclude": ["node_modules/**", "dist/**"],
132
148
  "maxFileSize": 100000,
133
149
  "maxFiles": 20
134
150
  }
135
151
  ```
136
152
 
137
- Or set your API key **once globally** so it works for every project:
153
+ Config resolution order: CLI flags > project `.patchpilots.json` > global `~/.patchpilots.json` > `ANTHROPIC_API_KEY` env var.
138
154
 
139
- ```bash
140
- echo '{"apiKey": "sk-ant-..."}' > ~/.patchpilots.json
141
- ```
155
+ ### Supported file types
142
156
 
143
- Or per-project via `.patchpilots.json` in your project root, or via environment variable:
144
-
145
- ```bash
146
- export ANTHROPIC_API_KEY=your-key-here
147
- ```
148
-
149
- Config resolution order: CLI flags > project `.patchpilots.json` > global `~/.patchpilots.json` > `ANTHROPIC_API_KEY` env var.
157
+ TypeScript, JavaScript, JSX/TSX, Python, Go, Rust, Java, Ruby, PHP, C/C++, C#, Swift, Kotlin, HTML, CSS, SCSS, Vue, Svelte.
150
158
 
151
159
  ## Powered by Claude API
152
160
 
153
- PatchPilots uses three key features of the Claude API:
154
-
155
161
  ### Structured outputs
156
- Every agent response is **guaranteed** to match its Zod schema via `zodOutputFormat`. No regex JSON extraction, no prayer-based parsing โ€” the API enforces the schema.
162
+ Every agent response is **guaranteed** to match its Zod schema via JSON schema enforcement. No regex JSON extraction, no prayer-based parsing โ€” the API enforces the schema.
157
163
 
158
164
  ### Adaptive thinking
159
165
  Agents use Claude's adaptive thinking mode for deeper reasoning. The Reviewer agent thinks through code logic before flagging issues, catching bugs that a surface-level scan would miss.
@@ -167,9 +173,12 @@ System prompts are cached via Claude's `cache_control` โ€” repeat runs against t
167
173
  ### Cost tracking
168
174
  Every run shows a cost summary with per-agent token usage and estimated USD cost.
169
175
 
176
+ ### Diff-based patches
177
+ The Coder agent returns search-and-replace patches instead of full file content, dramatically reducing token usage and enabling fixes on large files.
178
+
170
179
  ## Architecture
171
180
 
172
- PatchPilots uses a clean agent abstraction. Every agent extends `BaseAgent<T>` and implements three methods:
181
+ Every agent extends `BaseAgent<T>` and implements three methods:
173
182
 
174
183
  ```typescript
175
184
  class MyAgent extends BaseAgent<MyOutputType> {
@@ -191,38 +200,34 @@ The LLM client uses typed Anthropic SDK exceptions:
191
200
  ## Tech stack
192
201
 
193
202
  - TypeScript + Node.js
194
- - Claude API (`@anthropic-ai/sdk` v0.79.0)
195
- - Structured outputs (`zodOutputFormat`) โ€” guaranteed schema compliance
203
+ - Claude API (`@anthropic-ai/sdk`)
204
+ - Structured outputs (JSON schema) โ€” guaranteed schema compliance
196
205
  - Adaptive thinking โ€” deeper code analysis
197
206
  - Streaming โ€” real-time response delivery
198
- - Commander (CLI)
199
- - Chalk (terminal formatting)
200
- - Zod (schema definition + validation)
201
-
202
- ## Status
203
-
204
- This is an MVP โ€” actively being built in public. Follow along for updates.
207
+ - Diff-based patches โ€” efficient code fixes
208
+ - Prompt caching โ€” cost optimization
209
+ - Commander (CLI) + Chalk (terminal formatting) + Zod (validation)
205
210
 
206
211
  ## Roadmap
207
212
 
208
213
  ### Done
209
214
  - [x] 6 AI agents: Planner, Reviewer, Coder, Tester, Docs, Orchestrator
210
- - [x] Structured outputs with Zod schemas โ€” guaranteed valid responses
215
+ - [x] Structured outputs with Zod schemas
211
216
  - [x] Adaptive thinking for deeper code analysis
212
- - [x] Streaming โ€” real-time response delivery
213
- - [x] Prompt caching โ€” ~90% cost savings on repeat runs
214
- - [x] Cost tracking โ€” per-agent token usage and USD estimate after every run
215
- - [x] Global config (`~/.patchpilots.json`) โ€” set API key once for all projects
217
+ - [x] Streaming with real-time progress
218
+ - [x] Prompt caching (~90% cost savings on repeat runs)
219
+ - [x] Cost tracking (per-agent token usage and USD estimate)
220
+ - [x] Global config (`~/.patchpilots.json`)
221
+ - [x] Diff-based Coder output (patches instead of full files)
222
+ - [x] Published to npm (`npx patchpilots`)
223
+ - [x] HTML, CSS, SCSS, Vue, Svelte file support
216
224
 
217
225
  ### Next up
218
- - [x] **Diff-based Coder output** โ€” return patches instead of full files (fixes token limit on large files)
219
- - [ ] **npm publish** โ€” `npx patchpilots review ./src` from anywhere
226
+ - [ ] **Security agent** โ€” OWASP Top 10, secrets detection, input validation, auth pattern analysis
220
227
  - [ ] **Parallel file review** โ€” review files in batches instead of one giant prompt
221
228
  - [ ] **GitHub Action** โ€” auto-review PRs and post findings as comments
222
229
  - [ ] **`patchpilots audit`** โ€” full pipeline: plan โ†’ review โ†’ improve โ†’ test โ†’ docs in one command
223
230
  - [ ] **Smart model routing** โ€” Haiku for Docs/Tester, Sonnet for Reviewer/Coder
224
- - [ ] **HTML/CSS support** โ€” review static sites and stylesheets
225
- - [ ] **Security agent** โ€” dedicated OWASP Top 10, secrets detection, input validation, and auth pattern analysis
226
231
  - [ ] **Designer agent** โ€” generate CSS, design tokens, and component markup
227
232
 
228
233
  ## License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchpilots",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "A team of AI agents that reviews and improves your code automatically",
5
5
  "type": "module",
6
6
  "bin": {