@autotelic/jig-cli 0.0.0-stage → 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 (81) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +169 -2
  3. package/bin/jig.js +23 -0
  4. package/dist/baseline.d.ts +8 -0
  5. package/dist/baseline.d.ts.map +1 -0
  6. package/dist/baseline.js +30 -0
  7. package/dist/baseline.js.map +1 -0
  8. package/dist/cli.d.ts +2 -0
  9. package/dist/cli.d.ts.map +1 -0
  10. package/dist/cli.js +342 -0
  11. package/dist/cli.js.map +1 -0
  12. package/dist/commands.d.ts +50 -0
  13. package/dist/commands.d.ts.map +1 -0
  14. package/dist/commands.js +145 -0
  15. package/dist/commands.js.map +1 -0
  16. package/dist/config.d.ts +32 -0
  17. package/dist/config.d.ts.map +1 -0
  18. package/dist/config.js +59 -0
  19. package/dist/config.js.map +1 -0
  20. package/dist/engines.d.ts +85 -0
  21. package/dist/engines.d.ts.map +1 -0
  22. package/dist/engines.js +575 -0
  23. package/dist/engines.js.map +1 -0
  24. package/dist/exec.d.ts +16 -0
  25. package/dist/exec.d.ts.map +1 -0
  26. package/dist/exec.js +13 -0
  27. package/dist/exec.js.map +1 -0
  28. package/dist/gate.d.ts +46 -0
  29. package/dist/gate.d.ts.map +1 -0
  30. package/dist/gate.js +82 -0
  31. package/dist/gate.js.map +1 -0
  32. package/dist/git.d.ts +5 -0
  33. package/dist/git.d.ts.map +1 -0
  34. package/dist/git.js +39 -0
  35. package/dist/git.js.map +1 -0
  36. package/dist/gitattributes.d.ts +27 -0
  37. package/dist/gitattributes.d.ts.map +1 -0
  38. package/dist/gitattributes.js +63 -0
  39. package/dist/gitattributes.js.map +1 -0
  40. package/dist/index.d.ts +12 -0
  41. package/dist/index.d.ts.map +1 -0
  42. package/dist/index.js +12 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/init.d.ts +163 -0
  45. package/dist/init.d.ts.map +1 -0
  46. package/dist/init.js +1855 -0
  47. package/dist/init.js.map +1 -0
  48. package/dist/menu.d.ts +82 -0
  49. package/dist/menu.d.ts.map +1 -0
  50. package/dist/menu.js +388 -0
  51. package/dist/menu.js.map +1 -0
  52. package/dist/opencode.d.ts +66 -0
  53. package/dist/opencode.d.ts.map +1 -0
  54. package/dist/opencode.js +392 -0
  55. package/dist/opencode.js.map +1 -0
  56. package/dist/package-json.d.ts +13 -0
  57. package/dist/package-json.d.ts.map +1 -0
  58. package/dist/package-json.js +33 -0
  59. package/dist/package-json.js.map +1 -0
  60. package/dist/projections.d.ts +140 -0
  61. package/dist/projections.d.ts.map +1 -0
  62. package/dist/projections.js +186 -0
  63. package/dist/projections.js.map +1 -0
  64. package/dist/render.d.ts +21 -0
  65. package/dist/render.d.ts.map +1 -0
  66. package/dist/render.js +131 -0
  67. package/dist/render.js.map +1 -0
  68. package/dist/room.d.ts +16 -0
  69. package/dist/room.d.ts.map +1 -0
  70. package/dist/room.js +56 -0
  71. package/dist/room.js.map +1 -0
  72. package/dist/run.d.ts +10 -0
  73. package/dist/run.d.ts.map +1 -0
  74. package/dist/run.js +18 -0
  75. package/dist/run.js.map +1 -0
  76. package/extensions/jig.ts +465 -0
  77. package/package.json +78 -3
  78. package/skills/feedback-loop/SKILL.md +14 -0
  79. package/skills/intercom-setup/SKILL.md +20 -0
  80. package/skills/project-run/SKILL.md +18 -0
  81. package/skills/room/SKILL.md +17 -0
@@ -0,0 +1,465 @@
1
+ /**
2
+ * jig as a pi extension.
3
+ *
4
+ * jig is the harness: it runs every conformance engine in a repository and merges them
5
+ * into one report. This extension is a thin shell over the `jig` CLI, so pi can run it
6
+ * in whatever repository pi is working in:
7
+ *
8
+ * jig_check run every engine and return the findings
9
+ * jig_engines list what is configured, and whether it is on PATH
10
+ * jig_onboard read the setup plan and prompt without writing anything
11
+ * jig_init apply that plan after a human approves it
12
+ * /jig run a check from the prompt line
13
+ *
14
+ * Like `joggle`'s extension this file is NOT typechecked by the package (tsconfig
15
+ * includes `src` only): it is a pi package, loaded by pi, which strips the types itself.
16
+ * `pi install /absolute/path/to/tackle/packages/jig-cli` adds it globally.
17
+ */
18
+ import { existsSync } from "node:fs"
19
+ import { homedir } from "node:os"
20
+ import { dirname, join, resolve } from "node:path"
21
+ import { fileURLToPath } from "node:url"
22
+ import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent"
23
+ import { Type } from "typebox"
24
+
25
+ /** The package this extension ships in: the directory above `extensions/`. */
26
+ const root = resolve(dirname(fileURLToPath(import.meta.url)), "..")
27
+
28
+ /** The first `name` on PATH, if any. */
29
+ const onPath = (name: string): string | undefined => {
30
+ for (const dir of (process.env.PATH ?? "").split(":")) {
31
+ if (dir === "") continue
32
+ const candidate = join(dir, name)
33
+ if (existsSync(candidate)) return candidate
34
+ }
35
+ return undefined
36
+ }
37
+
38
+ /**
39
+ * Put `HOME` back when the host handed this process an environment without it.
40
+ *
41
+ * `pi.exec` inherits this process's environment and takes no `env` option, so the only place
42
+ * a missing variable can be repaired is here. pi spawns without a login shell and has been
43
+ * seen to hand over an environment with no `HOME`; a launcher such as Doppler finds its own
44
+ * auth there, so without it a judged run silently degrades to "no key" for a reason nobody
45
+ * can see. Nested secret layers (a personal Doppler config around a repository one) are
46
+ * otherwise the host's business, and this file must not touch anything else.
47
+ */
48
+ const repairEnvironment = (): void => {
49
+ if (process.env.HOME !== undefined && process.env.HOME !== "") return
50
+ const home = homedir()
51
+ if (home !== "") process.env.HOME = home
52
+ }
53
+
54
+ repairEnvironment()
55
+
56
+ /** How to launch jig: a command and its leading args. */
57
+ interface Launcher {
58
+ readonly command: string
59
+ readonly args: ReadonlyArray<string>
60
+ }
61
+
62
+ /**
63
+ * How to invoke jig: a `jig` on PATH first (so pi and the shell get the same result),
64
+ * then this checkout's build, then the source through the `development` condition.
65
+ * `JIG_BIN` overrides all of it.
66
+ */
67
+ const cli = (): Launcher => {
68
+ const override = process.env.JIG_BIN
69
+ if (override !== undefined && override !== "") return { command: override, args: [] }
70
+ const global = onPath("jig")
71
+ if (global !== undefined) return { command: global, args: [] }
72
+ const built = join(root, "dist", "cli.js")
73
+ if (existsSync(built)) return { command: process.execPath, args: [built] }
74
+ return {
75
+ command: process.execPath,
76
+ args: ["--conditions=development", join(root, "src", "cli.ts")],
77
+ }
78
+ }
79
+
80
+ interface ExecOutcome {
81
+ readonly stdout: string
82
+ readonly stderr: string
83
+ readonly code: number
84
+ }
85
+
86
+ const run = async (
87
+ pi: ExtensionAPI,
88
+ cwd: string,
89
+ args: ReadonlyArray<string>,
90
+ signal: AbortSignal | undefined,
91
+ ): Promise<ExecOutcome> => {
92
+ repairEnvironment()
93
+ const { command, args: prefix } = cli()
94
+ const result = await pi.exec(command, [...prefix, ...args], {
95
+ cwd,
96
+ ...(signal === undefined ? {} : { signal }),
97
+ timeout: 180_000,
98
+ })
99
+ return { stdout: result.stdout, stderr: result.stderr, code: result.code }
100
+ }
101
+
102
+ /*
103
+ * There is deliberately no report parser and no renderer here.
104
+ *
105
+ * jig owns the one human form; this extension asks jig for it and hands the text back.
106
+ * A JSON parse plus a numbered list here would be a second renderer, and a second
107
+ * renderer is a second answer — the failure this whole workspace exists to prevent.
108
+ */
109
+
110
+ interface ToolResult {
111
+ readonly content: ReadonlyArray<{ readonly type: "text"; readonly text: string }>
112
+ readonly details: Record<string, unknown>
113
+ readonly isError?: boolean
114
+ }
115
+
116
+ const ok = (text: string, details: Record<string, unknown>): ToolResult => ({
117
+ content: [{ type: "text", text }],
118
+ details,
119
+ })
120
+
121
+ const failed = (text: string, details: Record<string, unknown>): ToolResult => ({
122
+ content: [{ type: "text", text }],
123
+ details,
124
+ isError: true,
125
+ })
126
+
127
+ const reason = (error: unknown): string => (error instanceof Error ? error.message : String(error))
128
+
129
+ const checkParameters = Type.Object({
130
+ cwd: Type.Optional(
131
+ Type.String({
132
+ description:
133
+ "Repository to check, absolute or relative to pi's working directory. Default: the working directory pi is running in.",
134
+ }),
135
+ ),
136
+ limit: Type.Optional(
137
+ Type.Number({ description: "Maximum findings to return. 0 returns all of them. Default 50." }),
138
+ ),
139
+ })
140
+
141
+ interface CheckParameters {
142
+ readonly cwd?: string
143
+ readonly limit?: number
144
+ }
145
+
146
+ /**
147
+ * The gate a plan is built for.
148
+ *
149
+ * `touched-files` is the adoption default, but it cannot validate a clean checkout: the
150
+ * working-tree diff is empty, so nothing is in scope and the gate passes while the report
151
+ * still lists findings. A workshop or a first run wants `all`.
152
+ */
153
+ const gateParameter = Type.Optional(
154
+ Type.Union([Type.Literal("touched-files"), Type.Literal("all")], {
155
+ description:
156
+ "What the gate enforces: only the change in front of you (default), or every finding in the repo. Use `all` when validating from a clean checkout.",
157
+ }),
158
+ )
159
+
160
+ const targetFor = (cwd: string | undefined, ctx: ExtensionContext): string =>
161
+ cwd === undefined ? ctx.cwd : resolve(ctx.cwd, cwd)
162
+
163
+ export default function (pi: ExtensionAPI): void {
164
+ pi.registerTool({
165
+ name: "jig_check",
166
+ label: "jig Check",
167
+ description:
168
+ "Run every conformance engine configured for this repository (plumb, joggle, cutlist, …) and return one merged report of errors, warnings and notices, plus a note for any engine that could not run — and whether an engine replayed a cache or skipped a rule, because a note means 'not looked at', never 'clean'. Returns at most 50 findings; pass `limit` to change that (`0` returns all).",
169
+ promptSnippet: "Run every conformance engine in one pass with jig",
170
+ promptGuidelines: [
171
+ "Use jig_check after a batch of edits to see everything the repository enforces at once — lint, cross-file, and vocabulary findings in one report.",
172
+ "A note in the report means an engine did not run, or replayed a cache: that is 'not looked at', not 'clean'.",
173
+ ],
174
+ parameters: checkParameters,
175
+ async execute(
176
+ _toolCallId: string,
177
+ params: CheckParameters,
178
+ signal: AbortSignal | undefined,
179
+ _onUpdate: unknown,
180
+ ctx: ExtensionContext,
181
+ ): Promise<ToolResult> {
182
+ try {
183
+ const target = targetFor(params.cwd, ctx)
184
+ const limit = params.limit === undefined ? 50 : params.limit
185
+ const result = await run(
186
+ pi,
187
+ target,
188
+ ["check", "--cwd", target, "--format", "text", "--limit", String(limit)],
189
+ signal,
190
+ )
191
+ // A non-zero exit is a result, not an error: `jig check` exits non-zero on
192
+ // findings, and the report is on stdout either way.
193
+ const text = (result.stdout.trim() === "" ? result.stderr : result.stdout).trim()
194
+ return ok(text === "" ? `jig check exited ${result.code}` : text, {
195
+ code: result.code,
196
+ cwd: target,
197
+ })
198
+ } catch (error) {
199
+ return failed(`jig could not run: ${reason(error)}`, { command: "jig check" })
200
+ }
201
+ },
202
+ })
203
+
204
+ pi.registerTool({
205
+ name: "jig_engines",
206
+ label: "jig Engines",
207
+ description:
208
+ "List the conformance engines jig is configured to run here, and whether each is on PATH.",
209
+ promptSnippet: "List the engines jig runs here",
210
+ parameters: Type.Object({
211
+ cwd: Type.Optional(
212
+ Type.String({ description: "Repository to read. Default: pi's working directory." }),
213
+ ),
214
+ }),
215
+ async execute(
216
+ _toolCallId: string,
217
+ params: { readonly cwd?: string },
218
+ signal: AbortSignal | undefined,
219
+ _onUpdate: unknown,
220
+ ctx: ExtensionContext,
221
+ ): Promise<ToolResult> {
222
+ try {
223
+ const target = targetFor(params.cwd, ctx)
224
+ const result = await run(pi, target, ["engines", "--cwd", target], signal)
225
+ const text = (result.stdout.trim() === "" ? result.stderr : result.stdout).trim()
226
+ if (result.code !== 0)
227
+ return failed(`jig engines failed (exit ${result.code}): ${text}`, {})
228
+ return ok(text === "" ? "no engines configured" : text, { cwd: target })
229
+ } catch (error) {
230
+ return failed(`jig could not run: ${reason(error)}`, { command: "jig engines" })
231
+ }
232
+ },
233
+ })
234
+
235
+ pi.registerTool({
236
+ name: "jig_onboard",
237
+ label: "jig Onboard",
238
+ description:
239
+ 'Read the setup plan and agent prompt for jig in this repository without writing anything. It names the package manager, the engines that can run, the paths init would write, and where to stop and ask. Run `jig init` (add `--cutlist` for a UI repo) only after a human approves the plan. Pass `gate: "all"` when validating from a clean checkout; `touched-files` reports existing debt but does not enforce it until a file is touched.',
240
+ promptSnippet: "Read the jig setup prompt before initialising",
241
+ promptGuidelines: [
242
+ "Use jig_onboard before changing jig.config.json: it writes nothing and shows the engines and paths the scan found.",
243
+ "After approval, run `jig init` (or `jig init --cutlist`) to apply the plan, then `jig_check`.",
244
+ 'For a first run or a workshop on a clean checkout, call jig_onboard with gate "all" so the plan enforces every finding.',
245
+ ],
246
+ parameters: Type.Object({
247
+ cwd: Type.Optional(
248
+ Type.String({ description: "Repository to inspect. Default: pi's working directory." }),
249
+ ),
250
+ format: Type.Optional(
251
+ Type.Union([Type.Literal("text"), Type.Literal("json")], {
252
+ description: "The prompt alone, or the prompt with the plan as JSON. Default text.",
253
+ }),
254
+ ),
255
+ gate: gateParameter,
256
+ force: Type.Optional(
257
+ Type.Boolean({
258
+ description:
259
+ "Plan a rewrite of jig.config.json, JIG.md and ONBOARD.md; never the baseline. Default false.",
260
+ }),
261
+ ),
262
+ }),
263
+ async execute(
264
+ _toolCallId: string,
265
+ params: {
266
+ readonly cwd?: string
267
+ readonly format?: "text" | "json"
268
+ readonly gate?: "touched-files" | "all"
269
+ readonly force?: boolean
270
+ },
271
+ signal: AbortSignal | undefined,
272
+ _onUpdate: unknown,
273
+ ctx: ExtensionContext,
274
+ ): Promise<ToolResult> {
275
+ try {
276
+ const target = targetFor(params.cwd, ctx)
277
+ const format = params.format === undefined ? "text" : params.format
278
+ const result = await run(
279
+ pi,
280
+ target,
281
+ [
282
+ "onboard",
283
+ "--cwd",
284
+ target,
285
+ "--format",
286
+ format,
287
+ ...(params.gate === undefined ? [] : ["--gate", params.gate]),
288
+ ...(params.force === true ? ["--force"] : []),
289
+ ],
290
+ signal,
291
+ )
292
+ const text = (result.stdout.trim() === "" ? result.stderr : result.stdout).trim()
293
+ if (result.code !== 0)
294
+ return failed(`jig onboard failed (exit ${result.code}): ${text}`, {})
295
+ return ok(text === "" ? "jig onboard printed nothing" : text, { cwd: target })
296
+ } catch (error) {
297
+ return failed(`jig could not run: ${reason(error)}`, { command: "jig onboard" })
298
+ }
299
+ },
300
+ })
301
+
302
+ pi.registerTool({
303
+ name: "jig_init",
304
+ label: "jig Init",
305
+ description:
306
+ "Apply the jig setup plan: write jig.config.json, the baseline, JIG.md, ONBOARD.md, a starter joggle.config.json, and optionally a cutlist draft. Use only after a human has approved the plan from jig_onboard; this writes files. Pass the same `gate` the plan used so the applied config matches what was approved.",
307
+ promptSnippet: "Apply the jig setup plan after approval",
308
+ promptGuidelines: [
309
+ "Run jig_onboard first and show the plan to the human. Do not call jig_init until they approve it.",
310
+ 'Pass the same gate jig_onboard planned with; `gate: "all"` is the honest first-run gate on a clean checkout.',
311
+ "After init, run jig_engines and jig_check; do not run jig baseline without asking.",
312
+ ],
313
+ parameters: Type.Object({
314
+ cwd: Type.Optional(
315
+ Type.String({ description: "Repository to set up. Default: pi's working directory." }),
316
+ ),
317
+ cutlist: Type.Optional(
318
+ Type.Boolean({
319
+ description: "Also draft cutlist.config.json from detected UI roots. Default false.",
320
+ }),
321
+ ),
322
+ gate: gateParameter,
323
+ force: Type.Optional(
324
+ Type.Boolean({
325
+ description:
326
+ "Rewrite jig.config.json, JIG.md and ONBOARD.md; never the baseline. Default false.",
327
+ }),
328
+ ),
329
+ }),
330
+ async execute(
331
+ _toolCallId: string,
332
+ params: {
333
+ readonly cwd?: string
334
+ readonly cutlist?: boolean
335
+ readonly gate?: "touched-files" | "all"
336
+ readonly force?: boolean
337
+ },
338
+ signal: AbortSignal | undefined,
339
+ _onUpdate: unknown,
340
+ ctx: ExtensionContext,
341
+ ): Promise<ToolResult> {
342
+ try {
343
+ const target = targetFor(params.cwd, ctx)
344
+ const result = await run(
345
+ pi,
346
+ target,
347
+ [
348
+ "init",
349
+ "--cwd",
350
+ target,
351
+ ...(params.cutlist === true ? ["--cutlist"] : []),
352
+ ...(params.gate === undefined ? [] : ["--gate", params.gate]),
353
+ ...(params.force === true ? ["--force"] : []),
354
+ ],
355
+ signal,
356
+ )
357
+ const text = (result.stdout.trim() === "" ? result.stderr : result.stdout).trim()
358
+ if (result.code !== 0) return failed(`jig init failed (exit ${result.code}): ${text}`, {})
359
+ return ok(text === "" ? "jig init wrote nothing" : text, { cwd: target })
360
+ } catch (error) {
361
+ return failed(`jig could not run: ${reason(error)}`, { command: "jig init" })
362
+ }
363
+ },
364
+ })
365
+
366
+ pi.registerTool({
367
+ name: "jig_menu",
368
+ label: "jig Menu",
369
+ description:
370
+ "Read the cutlist artifact for this repository: the stable shape, or the parts/features/recipes that answer a query. Use this to find the right component before writing UI; it reads the generated menu, patterns, and recipes instead of re-analysing the tree.",
371
+ promptSnippet: "Find a component or pattern in the cutlist menu",
372
+ promptGuidelines: [
373
+ "Use jig_menu before building a new interface: search for the concept (for example `dialog` or `wizard`) and prefer the recipe's import and shape over inventing a new part.",
374
+ "A recipe is a skeleton, not a generated app; adapt its props and children to the call site.",
375
+ ],
376
+ parameters: Type.Object({
377
+ cwd: Type.Optional(
378
+ Type.String({ description: "Repository to read. Default: pi's working directory." }),
379
+ ),
380
+ query: Type.Optional(
381
+ Type.String({
382
+ description: "A part, feature, or concept to find. Omit for the stable shape.",
383
+ }),
384
+ ),
385
+ page: Type.Optional(
386
+ Type.String({
387
+ description:
388
+ "What does this page render? A route name, id, or path. Answers with the direct parts and what is reached through them.",
389
+ }),
390
+ ),
391
+ part: Type.Optional(
392
+ Type.String({
393
+ description:
394
+ "Which pages mount this part? A component name, id, or path. Answers with the renderers and the routes above them.",
395
+ }),
396
+ ),
397
+ similar: Type.Optional(
398
+ Type.String({
399
+ description:
400
+ "What already exists like this name? Use before proposing a new part; answers with name and skeleton evidence.",
401
+ }),
402
+ ),
403
+ limit: Type.Optional(Type.Number({ description: "Maximum matches. Default 12." })),
404
+ }),
405
+ async execute(
406
+ _toolCallId: string,
407
+ params: {
408
+ readonly cwd?: string
409
+ readonly query?: string
410
+ readonly page?: string
411
+ readonly part?: string
412
+ readonly similar?: string
413
+ readonly limit?: number
414
+ },
415
+ signal: AbortSignal | undefined,
416
+ _onUpdate: unknown,
417
+ ctx: ExtensionContext,
418
+ ): Promise<ToolResult> {
419
+ try {
420
+ const target = targetFor(params.cwd, ctx)
421
+ const limit = params.limit === undefined ? 12 : params.limit
422
+ const flag = (name: string, value: string | undefined): ReadonlyArray<string> =>
423
+ value === undefined || value === "" ? [] : [`--${name}`, value]
424
+ const args = [
425
+ "menu",
426
+ "--cwd",
427
+ target,
428
+ "--limit",
429
+ String(limit),
430
+ ...flag("page", params.page),
431
+ ...flag("part", params.part),
432
+ ...flag("similar", params.similar),
433
+ ...(params.query === undefined || params.query === "" ? [] : [params.query]),
434
+ ]
435
+ const result = await run(pi, target, args, signal)
436
+ const text = (result.stdout.trim() === "" ? result.stderr : result.stdout).trim()
437
+ return ok(text === "" ? `jig menu exited ${result.code}` : text, {
438
+ code: result.code,
439
+ cwd: target,
440
+ })
441
+ } catch (error) {
442
+ return failed(`jig could not read the menu: ${reason(error)}`, { command: "jig menu" })
443
+ }
444
+ },
445
+ })
446
+
447
+ pi.registerCommand("jig", {
448
+ description:
449
+ "Run jig check on this repository. Arguments pass through, e.g. /jig --cwd ../other-repo.",
450
+ handler: async (args: string, ctx: ExtensionContext) => {
451
+ const extra = args.trim() === "" ? [] : args.trim().split(/\s+/)
452
+ const cwdIndex = extra.indexOf("--cwd")
453
+ const named = cwdIndex === -1 ? undefined : extra[cwdIndex + 1]
454
+ const target = named === undefined ? ctx.cwd : resolve(ctx.cwd, named)
455
+ const argv = cwdIndex === -1 ? ["--cwd", target, ...extra] : extra
456
+ try {
457
+ const result = await run(pi, ctx.cwd, ["check", ...argv], ctx.signal)
458
+ const text = (result.stdout.trim() === "" ? result.stderr : result.stdout).trim()
459
+ ctx.ui.notify(text === "" ? "jig: no output" : text, result.code === 0 ? "info" : "error")
460
+ } catch (error) {
461
+ ctx.ui.notify(`jig could not run: ${reason(error)}`, "error")
462
+ }
463
+ },
464
+ })
465
+ }
package/package.json CHANGED
@@ -1,6 +1,81 @@
1
1
  {
2
2
  "name": "@autotelic/jig-cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "description": "The harness (CLI: `jig`): run every conformance engine in one pass, merge them into one report, and hold the ratchet. Shells out; never links. The package is `jig-cli` only because `jig` is taken; the command the world types is `jig`.",
5
+ "homepage": "https://github.com/autotelic/tackle/tree/main/packages/jig-cli#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/autotelic/tackle/issues"
8
+ },
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/autotelic/tackle.git",
13
+ "directory": "packages/jig-cli"
14
+ },
15
+ "bin": {
16
+ "jig": "./bin/jig.js"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "bin",
21
+ "extensions",
22
+ "skills"
23
+ ],
24
+ "type": "module",
25
+ "exports": {
26
+ ".": {
27
+ "development": "./src/index.ts",
28
+ "default": "./dist/index.js"
29
+ },
30
+ "./opencode": {
31
+ "development": "./src/opencode.ts",
32
+ "default": "./dist/opencode.js"
33
+ }
34
+ },
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "dependencies": {
39
+ "@autotelic/protocol": "0.1.1",
40
+ "@effect/platform-node": "4.0.5",
41
+ "effect": "4.0.5"
42
+ },
43
+ "devDependencies": {
44
+ "@effect/tsgo": "0.56.0",
45
+ "@opencode/plugin": "2.1.2",
46
+ "@types/node": "24.13.5",
47
+ "@typescript/native": "npm:typescript@7.0.2",
48
+ "fast-check": "4.10.2",
49
+ "typebox": "1.3.34",
50
+ "vitest": "5.0.1"
51
+ },
52
+ "peerDependencies": {
53
+ "@opencode/plugin": "*",
54
+ "typebox": "*"
55
+ },
56
+ "peerDependenciesMeta": {
57
+ "@opencode/plugin": {
58
+ "optional": true
59
+ },
60
+ "typebox": {
61
+ "optional": true
62
+ }
63
+ },
64
+ "engines": {
65
+ "node": ">=24.18.0"
66
+ },
67
+ "pi": {
68
+ "extensions": [
69
+ "./extensions"
70
+ ],
71
+ "skills": [
72
+ "./skills"
73
+ ]
74
+ },
75
+ "scripts": {
76
+ "jig": "node --conditions=development src/cli.ts",
77
+ "build": "tsc -p tsconfig.build.json",
78
+ "typecheck": "tsc --noEmit",
79
+ "test": "vitest run --passWithNoTests"
80
+ }
6
81
  }
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: feedback-loop
3
+ description: Have a second session try to break your work in a real repository. Use when a change needs checking instead of believing.
4
+ ---
5
+
6
+ Tell the tester the commit, the first command, and what counts as success — never what you expect
7
+ it to find.
8
+
9
+ **Tester owes**: the command it ran and the output it got. "The onboarding is wrong" is not a
10
+ finding; `jig init --hooks` printing `foreign` when the hook exists is.
11
+
12
+ **Builder owes**: which commit, and which gate is green — the command and its exit status, not a
13
+ claim. Fix defects; argue disagreements in the same message, with the reason. Never reopen a
14
+ finding whose sha has moved without saying so.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: intercom-setup
3
+ description: Message another session on this machine, and diagnose a message that never arrived. Use before a builder and a tester coordinate.
4
+ ---
5
+
6
+ ```sh
7
+ pi install npm:pi-intercom # once per machine, then restart the session
8
+ ```
9
+
10
+ Name each side (`/alias builder`, `/alias tester`), then **list before you send**:
11
+
12
+ ```ts
13
+ intercom({ action: "list" })
14
+ ```
15
+
16
+ A peer that is not in that list receives nothing, and the send still looks successful. That one
17
+ check is the whole skill.
18
+
19
+ An alias dies with its session: after a restart, send by session id rather than name. A peer that
20
+ is listed but silent is mid-turn; messages land at turn boundaries.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: project-run
3
+ description: Run one workstream from a GitHub label and a Linear project to merged pull requests. Use when a session starts with a label and a project rather than a task.
4
+ ---
5
+
6
+ Inputs: this repository, a GitHub label, a Linear project.
7
+
8
+ 1. **Room.** `jig room plan`, then `jig room daemon` (own terminal) and `jig room session`.
9
+ 2. **Work.** The label is the queue; the project is the plan.
10
+ `gh issue list --label "<label>" --state open`
11
+ `linearis issues list --limit 100` — filter to the project's name.
12
+ Take one item, implement it, open a PR that closes it. One item at a time.
13
+ 3. **Watch.** After each push:
14
+ `gh pr checks --watch` for CI, `jig room resume --apply` for reviews and inline notes.
15
+ Rerun the repository's own gate before pushing, and never report a green you did not see.
16
+ 4. **Report.** Tell a `tackle` session what the tooling did wrong — not what you did:
17
+ `intercom({ action: "list" })`. If no tackle session is listed, start one in the tackle
18
+ checkout (`pi`, then `/alias tackle`), list again, and send the command and its output.
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: room
3
+ description: Hold a conversation across restarts. Use when work outlives one session, or when returning after the machine was off.
4
+ ---
5
+
6
+ The ledger lives at `~/.room/<login>/<projectId>/`, outside the checkout.
7
+
8
+ ```sh
9
+ jig room plan # read before starting: names the room, writes nothing
10
+ jig room daemon # its own terminal
11
+ jig room session # attach, then work
12
+ jig room resume # what changed while this machine was off; --apply records it
13
+ ```
14
+
15
+ A card written at an older sha than the head is a question, not an instruction: check the note
16
+ still applies before changing code. `cursor lost` means this machine has no watermark, so the
17
+ card reports the current round rather than claiming nothing happened.