sw-plan 0.1.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 ADDED
@@ -0,0 +1,66 @@
1
+ # Planner CLI
2
+
3
+ A standalone CLI tool for generating integration plans for software projects using Claude Agent SDK.
4
+
5
+ ## Overview
6
+
7
+ This CLI runs inside a git repository and uses Claude's Agent SDK to:
8
+
9
+ 1. **Analyze the codebase** - Explores project structure, dependencies, and patterns
10
+ 2. **Ask clarifying questions** - Gathers requirements about the integration
11
+ 3. **Generate three integration plans** - Provides Easy, Medium, and Hard difficulty options
12
+
13
+ ## Usage
14
+
15
+ The CLI is designed to run in sandboxed environments (like Vercel Sandbox) where it can safely analyze codebases.
16
+
17
+ ```bash
18
+ planner-cli '{"integration": "Stripe", "apiKey": "sk-...", "jsonSchema": {...}, ...}'
19
+ ```
20
+
21
+ ### Parameters
22
+
23
+ The CLI expects a JSON string with the following parameters:
24
+
25
+ - `integration` (required): The name of the integration (e.g., "Stripe", "Supabase")
26
+ - `apiKey` (required): Anthropic API key for Claude
27
+ - `jsonSchema` (required): JSON Schema defining the expected output structure
28
+ - `projectContext` (optional): Pre-analyzed project context
29
+ - `clarifications` (optional): User answers to clarifying questions
30
+ - `conversationHistory` (optional): Previous conversation messages for continuation
31
+ - `cwd` (optional): Working directory (defaults to current directory)
32
+
33
+ ### Output
34
+
35
+ The CLI outputs JSON lines to stdout:
36
+
37
+ ```json
38
+ {"type":"assistant","message":{...}}
39
+ {"type":"tool_use","message":{...}}
40
+ {"type":"result","structured_output":{...}}
41
+ ```
42
+
43
+ ## Development
44
+
45
+ ### Build
46
+
47
+ ```bash
48
+ pnpm build
49
+ ```
50
+
51
+ ### Type Check
52
+
53
+ ```bash
54
+ pnpm run dev # Watch mode
55
+ ```
56
+
57
+ ## Architecture
58
+
59
+ - **src/index.ts** - Main CLI entry point
60
+ - Runs in sandbox environments with Claude Agent SDK
61
+ - Outputs structured JSON for easy parsing by parent processes
62
+ - Uses Claude's tool use capabilities (Read, Write, Glob, Grep) for codebase analysis
63
+
64
+ ## Integration
65
+
66
+ This CLI is compiled and injected into sandbox environments by the parent planner application. The compilation is handled by `compile-sandbox-runner.ts` using esbuild.