jig-dev 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.
Files changed (3) hide show
  1. package/README.md +133 -0
  2. package/dist/cli.js +1619 -0
  3. package/package.json +51 -0
package/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # jig-dev
2
+
3
+ AI-powered spec-to-task decomposition and execution. Jig transforms high-level feature specifications into structured, executable tasks for AI coding agents.
4
+
5
+ ## Install
6
+
7
+ ### Quick start (no install)
8
+
9
+ ```bash
10
+ npx jig-dev init
11
+ # or
12
+ bunx jig-dev init
13
+ ```
14
+
15
+ ### Global install
16
+
17
+ ```bash
18
+ npm install -g jig-dev
19
+ # or
20
+ bun add -g jig-dev
21
+ ```
22
+
23
+ Then run:
24
+
25
+ ```bash
26
+ jig init
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ ### Initialize a project
32
+
33
+ ```bash
34
+ jig init
35
+ ```
36
+
37
+ Jig detects your framework, creates the `.jig/` directory, and sets up your project.
38
+
39
+ ### Bootstrap from existing code
40
+
41
+ ```bash
42
+ jig bootstrap
43
+ ```
44
+
45
+ Scans your codebase and generates feature specifications automatically.
46
+
47
+ ### Work with specs
48
+
49
+ ```bash
50
+ jig spec list # List all specs
51
+ jig spec show <name> # View a spec
52
+ jig spec new <name> # Create a new spec
53
+ ```
54
+
55
+ ### Decompose and execute
56
+
57
+ ```bash
58
+ jig decompose <spec> # Break spec into tasks
59
+ jig tasks <spec> # List tasks for a spec
60
+ jig run <spec> <task> # Execute a task via Claude Code
61
+ jig verify <spec> <task> # Run verification gates
62
+ jig status # View project status
63
+ ```
64
+
65
+ ### Cloud sync
66
+
67
+ ```bash
68
+ jig auth login # Authenticate
69
+ jig sync # Sync with cloud
70
+ ```
71
+
72
+ ## How it works
73
+
74
+ 1. **Write specs** -- Describe features in markdown with intent, acceptance criteria, and constraints
75
+ 2. **Decompose** -- Jig breaks specs into executable tasks with file scopes and verification gates
76
+ 3. **Execute** -- Claude Code runs tasks autonomously, guided by rich context
77
+ 4. **Verify** -- Automated verification gates confirm each task meets its criteria
78
+
79
+ ## Deploying the MCP Server
80
+
81
+ The hosted MCP server runs on Fly.io at `mcp.usejig.dev`.
82
+
83
+ ### Deploy
84
+
85
+ ```bash
86
+ fly deploy
87
+ ```
88
+
89
+ Deploys use **blue-green strategy**: the new instance boots and passes health checks before traffic switches over. Active SSE connections on the old instance are closed gracefully (in-flight requests finish, then transports close).
90
+
91
+ ### How graceful shutdown works
92
+
93
+ 1. Fly.io sends `SIGTERM` to the old instance (forwarded by `dumb-init`).
94
+ 2. The server stops accepting new connections.
95
+ 3. All active MCP transports are closed (SSE streams end cleanly with `retry: 3000ms` header).
96
+ 4. In-flight requests have up to 55 seconds to complete (Fly.io `kill_timeout` is 60s).
97
+ 5. Clients that lose their SSE stream will auto-reconnect within 3 seconds using the `retry` interval.
98
+ 6. If the old session ID is unknown to the new instance, clients re-initialize per the MCP spec (HTTP 404 triggers new `InitializeRequest`).
99
+
100
+ ### Monitoring
101
+
102
+ ```bash
103
+ # Check server health
104
+ curl https://mcp.usejig.dev/health
105
+
106
+ # View active sessions and uptime
107
+ fly ssh console -C "curl -s localhost:8080/health"
108
+
109
+ # Stream logs during deploy
110
+ fly logs
111
+ ```
112
+
113
+ ### Configuration
114
+
115
+ Key settings in `fly.toml`:
116
+ - `deploy.strategy = "bluegreen"` -- zero-downtime traffic switch
117
+ - `http_service.min_machines_running = 1` -- always-on
118
+ - `experimental.kill_timeout = "60s"` -- drain window before SIGKILL
119
+ - `http_service.http_options.idle_timeout = 300` -- 5-minute idle timeout for SSE
120
+
121
+ SSE settings in `src/mcp/hosted.ts`:
122
+ - `retryInterval: 3000` -- clients retry SSE connection after 3 seconds
123
+ - `eventStore: InMemoryEventStore` -- enables mid-session SSE resumption via `Last-Event-ID`
124
+ - Keepalive comments every 15 seconds prevent Fly.io proxy timeout
125
+
126
+ ## Requirements
127
+
128
+ - Node.js 18+ or Bun 1.0+
129
+ - Claude Code CLI (for task execution)
130
+
131
+ ## License
132
+
133
+ MIT