jig-dev 0.2.3 → 0.2.4
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/dist/cli.js +2 -176
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -268,181 +268,7 @@ ${y}`}});var NR=k(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value
|
|
|
268
268
|
`:`
|
|
269
269
|
`)+r,s=n+1,n=t.indexOf(`
|
|
270
270
|
`,s)}while(n!==-1);return i+=t.slice(s),i}var{stdout:jP,stderr:OP}=PP,yv=Symbol("GENERATOR"),oo=Symbol("STYLER"),vc=Symbol("IS_EMPTY"),CP=["ansi","ansi","ansi256","ansi16m"],ao=Object.create(null),s4=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=jP?jP.level:0;t.level=e.level===void 0?r:e.level};var i4=t=>{let e=(...r)=>r.join(" ");return s4(e,t),Object.setPrototypeOf(e,bc.prototype),e};function bc(t){return i4(t)}Object.setPrototypeOf(bc.prototype,Function.prototype);for(let[t,e]of Object.entries(Jr))ao[t]={get(){let r=Qd(this,vv(e.open,e.close,this[oo]),this[vc]);return Object.defineProperty(this,t,{value:r}),r}};ao.visible={get(){let t=Qd(this,this[oo],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var _v=(t,e,r,...n)=>t==="rgb"?e==="ansi16m"?Jr[r].ansi16m(...n):e==="ansi256"?Jr[r].ansi256(Jr.rgbToAnsi256(...n)):Jr[r].ansi(Jr.rgbToAnsi(...n)):t==="hex"?_v("rgb",e,r,...Jr.hexToRgb(...n)):Jr[r][t](...n),o4=["rgb","hex","ansi256"];for(let t of o4){ao[t]={get(){let{level:r}=this;return function(...n){let s=vv(_v(t,CP[r],"color",...n),Jr.color.close,this[oo]);return Qd(this,s,this[vc])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);ao[e]={get(){let{level:r}=this;return function(...n){let s=vv(_v(t,CP[r],"bgColor",...n),Jr.bgColor.close,this[oo]);return Qd(this,s,this[vc])}}}}var a4=Object.defineProperties(()=>{},{...ao,level:{enumerable:!0,get(){return this[yv].level},set(t){this[yv].level=t}}}),vv=(t,e,r)=>{let n,s;return r===void 0?(n=t,s=e):(n=r.openAll+t,s=e+r.closeAll),{open:t,close:e,openAll:n,closeAll:s,parent:r}},Qd=(t,e,r)=>{let n=(...s)=>c4(n,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(n,a4),n[yv]=t,n[oo]=e,n[vc]=r,n},c4=(t,e)=>{if(t.level<=0||!e)return t[vc]?"":e;let r=t[oo];if(r===void 0)return e;let{openAll:n,closeAll:s}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=IP(e,r.close,r.open),r=r.parent;let i=e.indexOf(`
|
|
271
|
-
`);return i!==-1&&(e=AP(e,s,n,i)),n+e+s};Object.defineProperties(bc.prototype,ao);var l4=bc(),ene=bc({level:OP?OP.level:0});var _=l4;import{resolve as _re,dirname as vre}from"node:path";import{readFileSync as bre}from"node:fs";import{fileURLToPath as wre}from"node:url";var _n=class extends Error{suggestion;exitCode;constructor(e,r,n=1){super(e),this.name="JigError",this.suggestion=r,this.exitCode=n}},ep=class extends _n{constructor(e,r){super(e,r??"Run 'jig init' to initialize a project.",1),this.name="ConfigError"}};var Yp=qt(_s(),1);import{readdir as kse,mkdir as DZ,readFile as wj,writeFile as kj}from"node:fs/promises";import{existsSync as Oe}from"node:fs";async function ut(t){return wj(t,"utf8")}async function wn(t,e){await kj(t,e,"utf8")}async function ew(t){let e=await wj(t,"utf8");return(0,Yp.parse)(e)}async function Sj(t,e){let r=(0,Yp.stringify)(e);await kj(t,r,"utf8")}async function tw(t){await DZ(t,{recursive:!0})}var dN=qt(_s(),1);import{join as zr,basename as QK}from"node:path";import{chmod as eJ}from"node:fs/promises";import{readdir as tJ}from"node:fs/promises";import{createInterface as rJ}from"node:readline";function $j(){return
|
|
272
|
-
|
|
273
|
-
**Jig** is a spec-driven AI development orchestration tool. It decomposes specifications into tasks, provides Claude Code with rich execution context, and validates completion through verification gates.
|
|
274
|
-
|
|
275
|
-
### Directory Structure
|
|
276
|
-
|
|
277
|
-
All Jig artifacts live in the \`.jig/\` directory:
|
|
278
|
-
|
|
279
|
-
- \`.jig/specs/\` - Markdown specification files (one per feature/task)
|
|
280
|
-
- \`.jig/tasks/\` - YAML task definitions (one file per spec_id, contains multiple tasks)
|
|
281
|
-
- \`.jig/runs/\` - YAML run logs (one file per execution, documents actual outputs and status)
|
|
282
|
-
- \`.jig/context-bundles/\` - YAML context bundles (files, constraints, patterns for tasks)
|
|
283
|
-
- \`.jig/config.yaml\` - Jig configuration (version, timeout)
|
|
284
|
-
|
|
285
|
-
### Task YAML Format
|
|
286
|
-
|
|
287
|
-
Each task file in \`.jig/tasks/\` contains a YAML array of task objects:
|
|
288
|
-
|
|
289
|
-
\`\`\`yaml
|
|
290
|
-
- id: unique-task-id
|
|
291
|
-
spec_id: spec-name
|
|
292
|
-
objective: "What to build or fix"
|
|
293
|
-
context: |
|
|
294
|
-
Free-form context for Claude Code.
|
|
295
|
-
References context bundles by name.
|
|
296
|
-
acceptance_criteria:
|
|
297
|
-
- "Testable condition 1"
|
|
298
|
-
- "Testable condition 2"
|
|
299
|
-
- "Testable condition 3"
|
|
300
|
-
file_scope:
|
|
301
|
-
- "src/components/Button.tsx"
|
|
302
|
-
- "src/styles/button.module.css"
|
|
303
|
-
- "tests/Button.test.ts"
|
|
304
|
-
verification:
|
|
305
|
-
- command: "bun test"
|
|
306
|
-
description: "All tests pass"
|
|
307
|
-
- command: "bun run build"
|
|
308
|
-
description: "Production build succeeds"
|
|
309
|
-
dependencies:
|
|
310
|
-
- other-task-id
|
|
311
|
-
status: "new"
|
|
312
|
-
\`\`\`
|
|
313
|
-
|
|
314
|
-
**Key Rules:**
|
|
315
|
-
- \`file_scope\`: Claude Code modifies ONLY files in this list. Nothing else.
|
|
316
|
-
- \`verification\`: Commands that must exit 0 for task to pass.
|
|
317
|
-
- \`status\` flow: \`new\` \u2192 \`decomposed\` \u2192 \`in-progress\` \u2192 \`passed\` or \`failed\`
|
|
318
|
-
- \`dependencies\`: Task IDs that must complete before this task starts.
|
|
319
|
-
|
|
320
|
-
### Context Bundles
|
|
321
|
-
|
|
322
|
-
Context bundles live in \`.jig/context-bundles/\` and provide reusable execution context:
|
|
323
|
-
|
|
324
|
-
\`\`\`yaml
|
|
325
|
-
name: "bundle-name"
|
|
326
|
-
description: "What this bundle provides"
|
|
327
|
-
files:
|
|
328
|
-
- path: "src/utils/helpers.ts"
|
|
329
|
-
reason: "Reference implementation for pattern X"
|
|
330
|
-
- path: "tests/setup.ts"
|
|
331
|
-
reason: "Test infrastructure"
|
|
332
|
-
constraints:
|
|
333
|
-
- "Never modify database schema without migration"
|
|
334
|
-
- "All async functions must be cancellable"
|
|
335
|
-
patterns:
|
|
336
|
-
- name: "error-handling"
|
|
337
|
-
description: "Try-catch with context-aware error messages"
|
|
338
|
-
- name: "component-structure"
|
|
339
|
-
description: "Functional components, hooks only, no class components"
|
|
340
|
-
\`\`\`
|
|
341
|
-
|
|
342
|
-
Bundles are loaded automatically when referenced in task \`context\` field. They provide files for inspection and constraints to enforce.
|
|
343
|
-
|
|
344
|
-
### Verification Gates
|
|
345
|
-
|
|
346
|
-
Verification commands are critical. They must:
|
|
347
|
-
- Exit with code 0 on success
|
|
348
|
-
- Be idempotent (safe to run multiple times)
|
|
349
|
-
- Complete within timeout (default 600s, set in \`.jig/config.yaml\`)
|
|
350
|
-
|
|
351
|
-
Run verification with: \`jig verify <task-id>\`
|
|
352
|
-
|
|
353
|
-
### Commit Format
|
|
354
|
-
|
|
355
|
-
Use \`jig commit\` instead of \`git commit\` to auto-mark tasks as passed:
|
|
356
|
-
|
|
357
|
-
\`\`\`
|
|
358
|
-
jig commit -m "feat: <description> [spec-name/task-id]"
|
|
359
|
-
\`\`\`
|
|
360
|
-
|
|
361
|
-
The \`[spec/task]\` tag in the commit message auto-marks the task as passed with completion notes generated from the commit. Multiple tags are supported.
|
|
362
|
-
|
|
363
|
-
Example:
|
|
364
|
-
\`\`\`
|
|
365
|
-
jig commit -m "feat: Add drag-drop to phrase panel [ui-components/phrase-drag]"
|
|
366
|
-
\`\`\`
|
|
367
|
-
|
|
368
|
-
If \`jig commit\` is unavailable, use \`git commit\` with the same format \u2014 the post-commit hook will handle it.
|
|
369
|
-
|
|
370
|
-
### CLI Commands
|
|
371
|
-
|
|
372
|
-
**Initialization:**
|
|
373
|
-
- \`jig init\` - Initialize .jig/ directory and CLAUDE.md
|
|
374
|
-
|
|
375
|
-
**Specs:**
|
|
376
|
-
- \`jig spec new <name>\` - Create new spec
|
|
377
|
-
- \`jig spec list\` - List all specs
|
|
378
|
-
- \`jig spec show <name>\` - Display spec content
|
|
379
|
-
- \`jig spec delete <name>\` - Delete a spec and its tasks
|
|
380
|
-
- \`jig spec archive <name>\` - Archive a spec
|
|
381
|
-
|
|
382
|
-
**Context Bundles:**
|
|
383
|
-
- \`jig context create <name>\` - Create context bundle
|
|
384
|
-
- \`jig context list\` - List bundles
|
|
385
|
-
- \`jig context show <name>\` - Display bundle content
|
|
386
|
-
|
|
387
|
-
**Tasks:**
|
|
388
|
-
- \`jig tasks <spec>\` - List tasks for a spec
|
|
389
|
-
- \`jig task show <name>\` - Display task details
|
|
390
|
-
- \`jig task start <name>\` - Mark task as in-progress
|
|
391
|
-
- \`jig task done <name> --notes "..."\` - Mark task as passed with notes
|
|
392
|
-
- \`jig task fail <name> --notes "..."\` - Mark task as failed with notes
|
|
393
|
-
- \`jig next\` - Show next ready tasks
|
|
394
|
-
- \`jig decompose <spec>\` - Decompose spec into tasks
|
|
395
|
-
|
|
396
|
-
**Execution:**
|
|
397
|
-
- \`jig run <spec> <task>\` - Execute task (Claude Code + verification)
|
|
398
|
-
- \`jig commit -m "message [spec/task]"\` - Git commit + auto-mark tasks as passed
|
|
399
|
-
- \`jig verify <spec> <task>\` - Run verification gates only
|
|
400
|
-
- \`jig status\` - Show all task statuses
|
|
401
|
-
|
|
402
|
-
### Setting Up Jig in a New Repository
|
|
403
|
-
|
|
404
|
-
When asked to set up Jig for a project:
|
|
405
|
-
|
|
406
|
-
**CLI (recommended for full local experience):**
|
|
407
|
-
1. Run \`jig init\` (or \`jig projects create\`) in the project root
|
|
408
|
-
2. Answer the prompts: project name, directory to scan
|
|
409
|
-
3. Accept the bootstrap offer if the codebase already has source files
|
|
410
|
-
4. This creates \`.jig/\` directories, links to the cloud, and adds this CLAUDE.md section
|
|
411
|
-
|
|
412
|
-
**From Claude.ai (no CLI needed):**
|
|
413
|
-
1. Use the \`create_project\` MCP tool with the repository name
|
|
414
|
-
2. The project is auto-selected \u2014 proceed to \`create_spec\`
|
|
415
|
-
3. The user can later run \`jig init\` locally to enable CLI-based task execution
|
|
416
|
-
|
|
417
|
-
**What gets created:**
|
|
418
|
-
- \`.jig/specs/\` \u2014 spec markdown files
|
|
419
|
-
- \`.jig/tasks/\` \u2014 task YAML definitions
|
|
420
|
-
- \`.jig/runs/\` \u2014 execution logs
|
|
421
|
-
- \`.jig/context-bundles/\` \u2014 reusable context packages
|
|
422
|
-
- \`.jig/config.yaml\` \u2014 project configuration
|
|
423
|
-
|
|
424
|
-
**When to bootstrap:** Run \`jig bootstrap\` when the codebase already has source files. Skip for empty/new repositories \u2014 create specs manually as you build.
|
|
425
|
-
|
|
426
|
-
### Work Loop (REQUIRED)
|
|
427
|
-
|
|
428
|
-
When working on Jig tasks, ALWAYS follow this loop regardless of execution method:
|
|
429
|
-
|
|
430
|
-
1. **Pick a task**: Run \`jig next\` to see ready tasks
|
|
431
|
-
2. **Start it**: Run \`jig task start <name>\`
|
|
432
|
-
3. **Read the task**: Run \`jig task show <name>\`
|
|
433
|
-
4. **Do the work**: Implement changes following file_scope and constraints
|
|
434
|
-
5. **Verify**: Run verification commands from the task
|
|
435
|
-
6. **Mark done or failed**:
|
|
436
|
-
- \`jig task done <name> --notes "Changed: <files>. Decisions: <choices>. Watch: <notes>."\`
|
|
437
|
-
- \`jig task fail <name> --notes "Blocked by: <cause>. Tried: <approaches>. Next: <suggestion>."\`
|
|
438
|
-
7. **Repeat**: Run \`jig next\` for the next task
|
|
439
|
-
|
|
440
|
-
**Status updates are mandatory.** Whether you use \`jig run\`, implement manually, or work through any other method, you MUST call \`jig task start\` before beginning and \`jig task done\`/\`jig task fail\` when finished. This keeps the dashboard and collaborators in sync.
|
|
441
|
-
|
|
442
|
-
**Completion notes are mandatory.** Always include \`--notes\` describing what changed, decisions made, and anything to watch out for.
|
|
443
|
-
|
|
444
|
-
Success = all acceptance criteria met AND all verification commands exit 0.
|
|
445
|
-
`}function xj(){return`#!/bin/sh
|
|
271
|
+
`);return i!==-1&&(e=AP(e,s,n,i)),n+e+s};Object.defineProperties(bc.prototype,ao);var l4=bc(),ene=bc({level:OP?OP.level:0});var _=l4;import{resolve as _re,dirname as vre}from"node:path";import{readFileSync as bre}from"node:fs";import{fileURLToPath as wre}from"node:url";var _n=class extends Error{suggestion;exitCode;constructor(e,r,n=1){super(e),this.name="JigError",this.suggestion=r,this.exitCode=n}},ep=class extends _n{constructor(e,r){super(e,r??"Run 'jig init' to initialize a project.",1),this.name="ConfigError"}};var Yp=qt(_s(),1);import{readdir as kse,mkdir as DZ,readFile as wj,writeFile as kj}from"node:fs/promises";import{existsSync as Oe}from"node:fs";async function ut(t){return wj(t,"utf8")}async function wn(t,e){await kj(t,e,"utf8")}async function ew(t){let e=await wj(t,"utf8");return(0,Yp.parse)(e)}async function Sj(t,e){let r=(0,Yp.stringify)(e);await kj(t,r,"utf8")}async function tw(t){await DZ(t,{recursive:!0})}var dN=qt(_s(),1);import{join as zr,basename as QK}from"node:path";import{chmod as eJ}from"node:fs/promises";import{readdir as tJ}from"node:fs/promises";import{createInterface as rJ}from"node:readline";function $j(){return'## Jig\n\n**Jig** is a spec-driven AI development orchestration tool. It decomposes specifications into tasks, provides Claude Code with rich execution context, and validates completion through verification gates.\n\n### Directory Structure\n\nAll Jig artifacts live in the `.jig/` directory:\n\n- `.jig/specs/` - Markdown specification files (one per feature/task)\n- `.jig/tasks/` - YAML task definitions (one file per spec_id, contains multiple tasks)\n- `.jig/runs/` - YAML run logs (one file per execution, documents actual outputs and status)\n- `.jig/context-bundles/` - YAML context bundles (files, constraints, patterns for tasks)\n- `.jig/config.yaml` - Jig configuration (version, timeout)\n\n### Task YAML Format\n\nEach task file in `.jig/tasks/` contains a YAML array of task objects:\n\n```yaml\n- id: unique-task-id\n spec_id: spec-name\n objective: "What to build or fix"\n context: |\n Free-form context for Claude Code.\n References context bundles by name.\n acceptance_criteria:\n - "Testable condition 1"\n - "Testable condition 2"\n - "Testable condition 3"\n file_scope:\n - "src/components/Button.tsx"\n - "src/styles/button.module.css"\n - "tests/Button.test.ts"\n verification:\n - command: "bun test"\n description: "All tests pass"\n - command: "bun run build"\n description: "Production build succeeds"\n dependencies:\n - other-task-id\n status: "new"\n```\n\n**Key Rules:**\n- `file_scope`: Claude Code modifies ONLY files in this list. Nothing else.\n- `verification`: Commands that must exit 0 for task to pass.\n- `status` flow: `new` \u2192 `decomposed` \u2192 `in-progress` \u2192 `passed` or `failed`\n- `dependencies`: Task IDs that must complete before this task starts.\n\n### Context Bundles\n\nContext bundles live in `.jig/context-bundles/` and provide reusable execution context:\n\n```yaml\nname: "bundle-name"\ndescription: "What this bundle provides"\nfiles:\n - path: "src/utils/helpers.ts"\n reason: "Reference implementation for pattern X"\n - path: "tests/setup.ts"\n reason: "Test infrastructure"\nconstraints:\n - "Never modify database schema without migration"\n - "All async functions must be cancellable"\npatterns:\n - name: "error-handling"\n description: "Try-catch with context-aware error messages"\n - name: "component-structure"\n description: "Functional components, hooks only, no class components"\n```\n\nBundles are loaded automatically when referenced in task `context` field. They provide files for inspection and constraints to enforce.\n\n### Verification Gates\n\nVerification commands are critical. They must:\n- Exit with code 0 on success\n- Be idempotent (safe to run multiple times)\n- Complete within timeout (default 600s, set in `.jig/config.yaml`)\n\nRun verification with: `jig verify <task-id>`\n\n### Commit Format\n\nUse `jig commit` instead of `git commit` to auto-mark tasks as passed:\n\n```\njig commit -m "feat: <description> [spec-name/task-id]"\n```\n\nThe `[spec/task]` tag in the commit message auto-marks the task as passed with completion notes generated from the commit. Multiple tags are supported.\n\nExample:\n```\njig commit -m "feat: Add drag-drop to phrase panel [ui-components/phrase-drag]"\n```\n\nIf `jig commit` is unavailable, use `git commit` with the same format \u2014 the post-commit hook will handle it.\n\n### IMPORTANT: Always Use the CLI, Never MCP\n\n**Claude Code must ALWAYS use `jig` CLI commands via the shell.** Do NOT use Jig MCP tools (`mcp__claude_ai_Jig__*` or `mcp__jig__*`). The MCP tools are for claude.ai web conversations only \u2014 they connect to a remote server with session management that does not work from Claude Code.\n\nIf you see Jig MCP tools available, **ignore them**. Use the equivalent CLI command instead:\n- MCP `list_projects` -> `jig projects list`\n- MCP `create_project` -> `jig init --name <name>`\n- MCP `list_specs` -> `jig spec list`\n- MCP `show_spec` -> `jig spec show <name>`\n- MCP `create_spec` -> `jig spec new <name>`\n- MCP `list_tasks` -> `jig tasks <spec>`\n- MCP `show_task` -> `jig task show <name>`\n- MCP `update_task` -> `jig task done/fail/start <name>`\n- MCP `show_status` -> `jig status`\n- MCP `decompose` -> `jig decompose <spec>`\n\n### CLI Commands\n\n**Initialization:**\n- `jig init` - Initialize .jig/ directory and CLAUDE.md\n\n**Specs:**\n- `jig spec new <name>` - Create new spec\n- `jig spec list` - List all specs\n- `jig spec show <name>` - Display spec content\n- `jig spec delete <name>` - Delete a spec and its tasks\n- `jig spec archive <name>` - Archive a spec\n\n**Context Bundles:**\n- `jig context create <name>` - Create context bundle\n- `jig context list` - List bundles\n- `jig context show <name>` - Display bundle content\n\n**Tasks:**\n- `jig tasks <spec>` - List tasks for a spec\n- `jig task show <name>` - Display task details\n- `jig task start <name>` - Mark task as in-progress\n- `jig task done <name> --notes "..."` - Mark task as passed with notes\n- `jig task fail <name> --notes "..."` - Mark task as failed with notes\n- `jig next` - Show next ready tasks\n- `jig decompose <spec>` - Decompose spec into tasks\n\n**Execution:**\n- `jig run <spec> <task>` - Execute task (Claude Code + verification)\n- `jig commit -m "message [spec/task]"` - Git commit + auto-mark tasks as passed\n- `jig verify <spec> <task>` - Run verification gates only\n- `jig status` - Show all task statuses\n\n### Setting Up Jig in a New Repository\n\nWhen asked to set up Jig for a project:\n\n**CLI (recommended for full local experience):**\n1. Run `jig init` (or `jig projects create`) in the project root\n2. Answer the prompts: project name, directory to scan\n3. Accept the bootstrap offer if the codebase already has source files\n4. This creates `.jig/` directories, links to the cloud, and adds this CLAUDE.md section\n\n**From Claude.ai (no CLI needed):**\n1. Use the `create_project` MCP tool with the repository name\n2. The project is auto-selected \u2014 proceed to `create_spec`\n3. The user can later run `jig init` locally to enable CLI-based task execution\n\n**What gets created:**\n- `.jig/specs/` \u2014 spec markdown files\n- `.jig/tasks/` \u2014 task YAML definitions\n- `.jig/runs/` \u2014 execution logs\n- `.jig/context-bundles/` \u2014 reusable context packages\n- `.jig/config.yaml` \u2014 project configuration\n\n**When to bootstrap:** Run `jig bootstrap` when the codebase already has source files. Skip for empty/new repositories \u2014 create specs manually as you build.\n\n### Work Loop (REQUIRED)\n\nWhen working on Jig tasks, ALWAYS follow this loop regardless of execution method:\n\n1. **Pick a task**: Run `jig next` to see ready tasks\n2. **Start it**: Run `jig task start <name>`\n3. **Read the task**: Run `jig task show <name>`\n4. **Do the work**: Implement changes following file_scope and constraints\n5. **Verify**: Run verification commands from the task\n6. **Mark done or failed**:\n - `jig task done <name> --notes "Changed: <files>. Decisions: <choices>. Watch: <notes>."`\n - `jig task fail <name> --notes "Blocked by: <cause>. Tried: <approaches>. Next: <suggestion>."`\n7. **Repeat**: Run `jig next` for the next task\n\n**Status updates are mandatory.** Whether you use `jig run`, implement manually, or work through any other method, you MUST call `jig task start` before beginning and `jig task done`/`jig task fail` when finished. This keeps the dashboard and collaborators in sync.\n\n**Completion notes are mandatory.** Always include `--notes` describing what changed, decisions made, and anything to watch out for.\n\nSuccess = all acceptance criteria met AND all verification commands exit 0.\n'}function xj(){return`#!/bin/sh
|
|
446
272
|
# Installed by jig init. Safe to remove.
|
|
447
273
|
# Auto-marks Jig tasks as passed when commit messages contain [spec/task].
|
|
448
274
|
|
|
@@ -1022,7 +848,7 @@ ${i}
|
|
|
1022
848
|
`)}async function wN(t,e,r=6e4){let n=t.verification||[],s=[];for(let i of n){let o=!1,a="";try{let c=await Ze(["sh","-c",i.command],{cwd:e,timeout:r});a=c.stdout,c.stderr&&(a+=`
|
|
1023
849
|
${c.stderr}`),o=c.exitCode===0}catch(c){a=c instanceof Error?c.message:String(c)}s.push({command:i.command,description:i.description,passed:o,output:a.trim()})}return{results:s,allPassed:s.length>0&&s.every(i=>i.passed)}}async function kN(){try{let r=(await Ze(["git","diff","--stat","HEAD"],{cwd:process.cwd()})).stdout.trim();if(!r)return null;let n=r.split(`
|
|
1024
850
|
`),s=n[n.length-1]?.trim(),i=n.slice(0,-1).map(a=>a.split("|")[0]?.trim()).filter(Boolean),o=[];return i.length>0&&o.push(`Changed: ${i.join(", ")}`),s&&o.push(`Summary: ${s}`),o.length>0?`[auto-generated] ${o.join(". ")}`:null}catch{return null}}function yt(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}async function Th(t,e,r){if(!t.search)return null;let s=(await t.search(e,"tasks_only",r)).split(`
|
|
1025
|
-
`);for(let i of s){let o=i.match(/\[task\]\s+\[[^\]]+\]\s+([^/]+)\/([^:]+)/);if(o?.[2]?.trim()===e&&o[1])return o[1].trim()}return null}async function SN(t){let{ds:e,projectId:r}=await X(),n=await e.listTasks(yt(t),r);console.log(n)}async function $N(t,e){let{ds:r,projectId:n}=await X();if(e){let s=await r.showTask(yt(t),yt(e),n);console.log(s)}else{let s=yt(t),i=await Th(r,s,n);if(i){let o=await r.showTask(i,s,n);console.log(o)}else console.log(_.red(`Task "${s}" not found.`)),console.log(_.dim("Run 'jig status' to see specs, then 'jig tasks <spec>' to list tasks."))}}async function xN(t,e){let{ds:r,projectId:n}=await X(),s,i;if(e)s=yt(t),i=yt(e);else{i=yt(t);let a=await Th(r,i,n);if(!a){console.log(_.red(`Task "${i}" not found.`)),console.log(_.dim("Run 'jig status' to see specs, then 'jig tasks <spec>' to list tasks."));return}s=a}let o=await r.updateTask(s,i,{status:"in-progress"},n);console.log(o)}async function TN(t,e,r){let n,s;typeof e=="string"?(n=e,s=r??{}):(n=void 0,s=typeof e=="object"&&e!==null?e:r??{});let{ds:i,projectId:o}=await X(),a,c;if(n)a=yt(t),c=yt(n);else{c=yt(t);let h=await Th(i,c,o);if(!h){console.log(_.red(`Task "${c}" not found.`)),console.log(_.dim("Run 'jig status' to see specs, then 'jig tasks <spec>' to list tasks."));return}a=h}let l=await i.showTask(a,c,o);if(l.includes("not found")){console.log(_.red(l));return}let u=(0,Hl.parse)(l),d
|
|
851
|
+
`);for(let i of s){let o=i.match(/\[task\]\s+\[[^\]]+\]\s+([^/]+)\/([^:]+)/);if(o?.[2]?.trim()===e&&o[1])return o[1].trim()}return null}async function SN(t){let{ds:e,projectId:r}=await X(),n=await e.listTasks(yt(t),r);console.log(n)}async function $N(t,e){let{ds:r,projectId:n}=await X();if(e){let s=await r.showTask(yt(t),yt(e),n);console.log(s)}else{let s=yt(t),i=await Th(r,s,n);if(i){let o=await r.showTask(i,s,n);console.log(o)}else console.log(_.red(`Task "${s}" not found.`)),console.log(_.dim("Run 'jig status' to see specs, then 'jig tasks <spec>' to list tasks."))}}async function xN(t,e){let{ds:r,projectId:n}=await X(),s,i;if(e)s=yt(t),i=yt(e);else{i=yt(t);let a=await Th(r,i,n);if(!a){console.log(_.red(`Task "${i}" not found.`)),console.log(_.dim("Run 'jig status' to see specs, then 'jig tasks <spec>' to list tasks."));return}s=a}let o=await r.updateTask(s,i,{status:"in-progress"},n);console.log(o)}async function TN(t,e,r){let n,s;typeof e=="string"?(n=e,s=r??{}):(n=void 0,s=typeof e=="object"&&e!==null?e:r??{});let{ds:i,projectId:o}=await X(),a,c;if(n)a=yt(t),c=yt(n);else{c=yt(t);let h=await Th(i,c,o);if(!h){console.log(_.red(`Task "${c}" not found.`)),console.log(_.dim("Run 'jig status' to see specs, then 'jig tasks <spec>' to list tasks."));return}a=h}let l=await i.showTask(a,c,o);if(l.includes("not found")){console.log(_.red(l));return}let u=null,d=!1;if(!s.skipVerify)try{u=(0,Hl.parse)(l),d=!!(u.verification&&u.verification.length>0)}catch{console.log(_.yellow(" Warning: Could not parse task YAML for verification. Skipping gates."))}if(u&&d&&!s.skipVerify){console.log(_.bold(`
|
|
1026
852
|
Running verification gates for "${c}":
|
|
1027
853
|
`));let{results:h,allPassed:m}=await wN(u,process.cwd());for(let y of h)if(y.passed)console.log(` ${_.green("o")} ${y.description} ${_.dim(`(${y.command})`)}`);else if(console.log(` ${_.red("x")} ${y.description} ${_.dim(`(${y.command})`)}`),y.output){let v=y.output.split(`
|
|
1028
854
|
`).slice(0,10);for(let b of v)console.log(_.dim(` ${b}`));y.output.split(`
|