shipr-agent 0.1.0 → 0.1.2

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 (3) hide show
  1. package/README.md +289 -15
  2. package/dist/index.js +97259 -96267
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,33 +2,307 @@
2
2
 
3
3
  > Fully autonomous terminal-based coding agent
4
4
 
5
- Shipr takes a plain-English mission description and produces a 100% working, committed, production-ready codebase — or halts cleanly without touching git.
5
+ Shipr takes a plain-English mission description and produces a production-ready, committed codebase — or halts cleanly without touching git.
6
6
 
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- npm install -g shipr
10
+ npm install -g shipr-agent
11
11
  ```
12
12
 
13
- ## Usage
13
+ Or run directly without installing:
14
+
15
+ ```bash
16
+ npx shipr-agent --help
17
+ ```
18
+
19
+ ## Quick Start
20
+
21
+ ```bash
22
+ # 1. Authenticate with an AI provider
23
+ shipr auth add github-copilot # GitHub Device Flow (opens browser)
24
+ shipr auth add openai # paste your API key
25
+ shipr auth add anthropic # paste your API key
26
+
27
+ # 2. Verify authentication
28
+ shipr auth list
29
+
30
+ # 3. Navigate to your project
31
+ cd my-project/
32
+
33
+ # 4. Run a mission
34
+ shipr run "Add user authentication with JWT and refresh tokens"
35
+ ```
36
+
37
+ ## Commands
38
+
39
+ ### `shipr run <mission>`
40
+
41
+ Run an autonomous coding mission. This is the main command.
42
+
43
+ ```bash
44
+ # Basic usage — uses the first authenticated provider
45
+ shipr run "Build a REST API with CRUD endpoints for users and posts"
46
+
47
+ # Choose a specific provider
48
+ shipr run --provider github-copilot "Add WebSocket real-time notifications"
49
+ shipr run --provider openai "Refactor the database layer to use Prisma"
50
+ shipr run --provider anthropic "Write comprehensive test coverage"
51
+
52
+ # Dry run — plan without executing (no files changed)
53
+ shipr run --simulate "Migrate from Express to Fastify"
54
+
55
+ # Set a cost budget (halts if exceeded)
56
+ shipr run --budget 5.00 "Build an admin dashboard"
57
+
58
+ # Run slices in parallel (up to 4)
59
+ shipr run --parallel 4 "Add search, filtering, and pagination"
60
+
61
+ # Use the rich Ink-based TUI
62
+ shipr run --rich "Build a payment integration"
63
+ ```
64
+
65
+ **What happens during a mission:**
66
+
67
+ ```
68
+ PREFLIGHT → Analyzes your codebase (files, frameworks, dependencies)
69
+ CLARIFY → Asks clarifying questions (press Enter to accept defaults)
70
+ RESEARCH → Studies codebase structure + web research
71
+ PLAN → Creates a task DAG (directed acyclic graph) of work
72
+ EXECUTE → Dispatches tasks to the AI, writes code, validates each step
73
+ VERIFY → Runs 6-layer verification (typecheck, lint, test, build, custom, security)
74
+ COMMIT → Squash-merges all changes into a clean commit
75
+ ```
76
+
77
+ ### `shipr new <name>`
78
+
79
+ Scaffold a new project from a template.
80
+
81
+ ```bash
82
+ shipr new my-api --type api # Express + TypeScript API
83
+ shipr new my-app --type web-app # React + Vite web app
84
+ shipr new my-cli --type cli # Commander CLI tool
85
+ shipr new my-lib --type library # npm library with build
86
+ shipr new my-svc --type monorepo # Turborepo monorepo
87
+ shipr new my-bot --type fullstack # Full-stack app
88
+ ```
89
+
90
+ ### `shipr status`
91
+
92
+ Show the current mission's state and progress.
14
93
 
15
94
  ```bash
16
- shipr run "add user authentication with JWT"
17
- shipr new my-app --type web-app
18
95
  shipr status
19
- shipr cost
20
96
  ```
21
97
 
22
- ## Features
98
+ ```
99
+ Shipr Mission: Build a REST API with auth
100
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
101
+ ✓ Status: EXECUTING
102
+ Slices: 3/6 done Tasks: 9/18 done
103
+ Estimated cost: $2.00
104
+ Actual cost: $0.3280 (34 API calls)
105
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
106
+ ```
107
+
108
+ ### `shipr resume`
109
+
110
+ Resume a previously interrupted or failed mission.
111
+
112
+ ```bash
113
+ shipr resume # auto-find the most recent resumable mission
114
+ shipr resume --mission m_abc123 # resume a specific mission
115
+ shipr resume --provider anthropic # resume with a different provider
116
+ ```
117
+
118
+ ### `shipr steer <instruction>`
119
+
120
+ Send a mid-mission steering directive. Picked up at the next slice boundary.
121
+
122
+ ```bash
123
+ shipr steer "Use PostgreSQL instead of SQLite"
124
+ shipr steer "Skip the admin dashboard, focus on the API"
125
+ shipr steer "Add rate limiting to all endpoints"
126
+ ```
23
127
 
24
- - 16 AI provider integrations (Anthropic, OpenAI, Gemini, Groq, and more)
25
- - Mission → Slice → Task execution hierarchy
26
- - 6-layer verification gate (typecheck, lint, test, build, custom, security)
27
- - TF-IDF context retrieval with 8-slot packet system
28
- - Git worktree isolation per mission
29
- - Cost/token tracking with budget enforcement
30
- - OAuth + OS keychain credential management
31
- - Rich terminal UI (chalk+ora default, Ink+React optional)
128
+ ### `shipr cost`
129
+
130
+ Show cost and token usage across all missions.
131
+
132
+ ```bash
133
+ shipr cost # all missions
134
+ shipr cost --mission m_abc123 # specific mission
135
+ ```
136
+
137
+ ```
138
+ 💰 Cost Summary
139
+
140
+ m_abc123 Build a REST API with auth
141
+ Cost: $0.3280 Input: 186.4K Output: 34.2K Calls: 34
142
+ m_def456 Add WebSocket notifications
143
+ Cost: $0.1890 Input: 98.1K Output: 19.7K Calls: 22
144
+ ──────────────────────────────────────────────────
145
+ Total Cost: $0.5170 Input: 284.5K Output: 53.9K Calls: 56
146
+ ```
147
+
148
+ ### `shipr auth`
149
+
150
+ Manage API credentials. Stored in OS keychain (macOS Keychain, Linux libsecret) — never on disk.
151
+
152
+ ```bash
153
+ shipr auth add openai # add API key for a provider
154
+ shipr auth add github-copilot # GitHub Device Flow (browser-based)
155
+ shipr auth list # show all providers and auth status
156
+ shipr auth revoke openai # remove stored credentials
157
+ ```
158
+
159
+ ### `shipr providers`
160
+
161
+ List all 16 supported AI providers with models, pricing, and context windows.
162
+
163
+ ```bash
164
+ shipr providers
165
+ ```
166
+
167
+ ### `shipr missions`
168
+
169
+ List all past and current missions.
170
+
171
+ ```bash
172
+ shipr missions
173
+ ```
174
+
175
+ ## Supported Providers
176
+
177
+ | Provider | Auth | Models |
178
+ |---|---|---|
179
+ | **Anthropic** | API key | Claude Sonnet 4, Opus 4, Haiku 3.5 |
180
+ | **OpenAI** | API key | GPT-4o, GPT-4o-mini, o3 |
181
+ | **Google Gemini** | API key | Gemini 2.5 Pro, 2.5 Flash |
182
+ | **GitHub Copilot** | Device Flow | GPT-4o, Claude Sonnet 4 (free with subscription) |
183
+ | **Groq** | API key | Llama 3.3 70B, Mixtral |
184
+ | **Mistral** | API key | Mistral Large, Codestral |
185
+ | **xAI** | API key | Grok 2 |
186
+ | **DeepSeek** | API key | DeepSeek V3, Coder V3 |
187
+ | **OpenRouter** | API key | 20+ models from all providers |
188
+ | **Cohere** | API key | Command R+, Command R |
189
+ | **Perplexity** | API key | Sonar Large, Sonar Small |
190
+ | **AWS Bedrock** | AWS credentials | Claude, Llama, Mistral on AWS |
191
+ | **Azure OpenAI** | OAuth | GPT-4o, GPT-4 on Azure |
192
+ | **Ollama** | Local | Any local model |
193
+ | **LM Studio** | Local | Any local model |
194
+ | **vLLM** | Local | Any local model |
195
+
196
+ ## How It Works
197
+
198
+ ```
199
+ ┌─────────────────────────────────────────────────────────┐
200
+ │ "Add user authentication with JWT" │
201
+ └──────────────────────┬──────────────────────────────────┘
202
+
203
+ ┌────────────▼────────────┐
204
+ │ PREFLIGHT │ Analyze codebase
205
+ │ Files, frameworks, │ Estimate cost
206
+ │ dependencies, tests │ Zero LLM tokens
207
+ └────────────┬────────────┘
208
+
209
+ ┌────────────▼────────────┐
210
+ │ CLARIFY │ Ask smart questions
211
+ │ "JWT or sessions?" │ LLM-generated
212
+ │ "Which database?" │
213
+ └────────────┬────────────┘
214
+
215
+ ┌────────────▼────────────┐
216
+ │ RESEARCH │ Codebase: static analysis
217
+ │ Import graph, deps, │ Web: LLM-powered search
218
+ │ frameworks, patterns │
219
+ └────────────┬────────────┘
220
+
221
+ ┌────────────▼────────────┐
222
+ │ PLAN │ Create task DAG
223
+ │ S01: Schema setup │ Ordered by risk
224
+ │ S02: Auth middleware │ Dependencies tracked
225
+ │ S03: CRUD endpoints │
226
+ └────────────┬────────────┘
227
+
228
+ ┌────────────▼────────────┐
229
+ │ EXECUTE │ For each task:
230
+ │ Build context packet │ → LLM generates code
231
+ │ Dispatch to LLM │ → Apply file changes
232
+ │ Apply changes │ → Hallucination guard
233
+ │ Run guards │ → Stub detector
234
+ └────────────┬────────────┘
235
+
236
+ ┌────────────▼────────────┐
237
+ │ VERIFY │ 6-layer gate:
238
+ │ ✓ typecheck │ TypeScript compiler
239
+ │ ✓ lint │ Biome/ESLint
240
+ │ ✓ test │ bun test/jest
241
+ │ ✓ build │ Build command
242
+ │ ✓ custom │ User scripts
243
+ │ ✓ security │ Pattern scanning
244
+ └────────────┬────────────┘
245
+
246
+ ┌────────────▼────────────┐
247
+ │ COMMIT │ Squash-merge
248
+ │ Clean commit message │ Generate REPORT.md
249
+ │ Back to main branch │ Cleanup worktree
250
+ └─────────────────────────┘
251
+ ```
252
+
253
+ ## Safety Guarantees
254
+
255
+ - **No commit unless all 6 verify layers pass** — zero errors tolerated
256
+ - **Git worktree isolation** — mission work happens on a separate branch
257
+ - **Test immutability** — tests are never modified to make them pass
258
+ - **Hallucination guard** — rejects empty/unchanged file responses
259
+ - **Stub detector** — rejects TODO/FIXME/placeholder code
260
+ - **Stuck detector** — halts on repeated identical responses or zero progress
261
+ - **Budget enforcement** — halts if cost exceeds per-mission or monthly limit
262
+ - **No force push** — ever
263
+ - **Atomic file writes** — temp + rename for crash safety
264
+ - **No plaintext credentials** — OS keychain or AES-256-GCM encrypted fallback
265
+
266
+ ## Configuration
267
+
268
+ Create `.shipr/config.yaml` in your project (or `~/.shipr/config.yaml` for global defaults):
269
+
270
+ ```yaml
271
+ # Default provider and model
272
+ provider: github-copilot
273
+ model: gpt-4o
274
+
275
+ # Budget limits
276
+ budget:
277
+ perMission: 5.00 # USD per mission
278
+ perMonth: 50.00 # USD per calendar month
279
+
280
+ # Execution
281
+ parallel: 2 # max concurrent slices (1-8)
282
+
283
+ # Verify gate
284
+ verify:
285
+ custom: "npm run check" # custom verification command
286
+ ```
287
+
288
+ ## Project Structure
289
+
290
+ After a mission, Shipr creates a `.shipr/` directory in your project:
291
+
292
+ ```
293
+ .shipr/
294
+ config.yaml # project-level configuration
295
+ missions/
296
+ M-abc123/
297
+ MISSION.json # mission metadata
298
+ STATE.json # state machine state
299
+ PLAN.json # task DAG
300
+ RESEARCH.json # codebase + web research findings
301
+ LEDGER.json # cost/token tracking
302
+ CONTEXT.md # task summaries and context
303
+ STEER.md # steering directives
304
+ REPORT.md # narrative completion report
305
+ ```
32
306
 
33
307
  ## License
34
308