@skitterbyte/skitterspec-jira 2.18.0 → 2.18.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.
- package/assets/rules/spec-planning.md +12 -0
- package/package.json +1 -1
- package/src/init.js +85 -4
|
@@ -36,6 +36,18 @@ finding one. They are marked `disable-model-invocation`, meaning
|
|
|
36
36
|
**only you can run them** — a skill that wants one will tell you to type it
|
|
37
37
|
rather than invoking it.
|
|
38
38
|
|
|
39
|
+
**A command finds the project itself, wherever the session stands.** Its line
|
|
40
|
+
runs in the session's current directory, which after a `cd` may be the git root
|
|
41
|
+
or a worktree's root rather than the project folder — and in a repo whose
|
|
42
|
+
project is a subfolder, a runner started there found no install and printed
|
|
43
|
+
npm's registry 404. So with a local install the line is a small `node -e`
|
|
44
|
+
launcher, written that way because both `/bin/sh` and cmd.exe can start it. It
|
|
45
|
+
runs in the current directory when the install is there, which is the usual case and unchanged. Otherwise
|
|
46
|
+
it runs in this checkout's project folder, using the subfolder recorded when
|
|
47
|
+
the command was installed and the primary checkout's install when a worktree
|
|
48
|
+
has none. Failing both, it refuses in one line naming the folder it expected.
|
|
49
|
+
`skitterspec update` rewrites the command files to this form.
|
|
50
|
+
|
|
39
51
|
**The `spec-remote-review` command was retired** with the published review tier
|
|
40
52
|
(feat-tailnet-remote-tier). It toggled whether a spec might publish its review
|
|
41
53
|
as a claude.ai page — a second store no wait could watch, and a page this
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skitterbyte/skitterspec-jira",
|
|
3
|
-
"version": "2.18.
|
|
3
|
+
"version": "2.18.1",
|
|
4
4
|
"description": "Spec-driven development for Claude Code, with one-way Jira Cloud sync — a superset of @skitterbyte/skitterspec: the base filesystem workflow plus /spec-status · /spec-push and the spec-sync CLI. The repo is canonical; Jira is a generated mirror. Install this OR the base OR the Linear superset — exactly one.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
package/src/init.js
CHANGED
|
@@ -245,8 +245,88 @@ function renderExec(content, dir, env = process.env) {
|
|
|
245
245
|
})
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
//
|
|
249
|
-
|
|
248
|
+
// --- the command launcher (bug-commands-outside-project) -------------------
|
|
249
|
+
//
|
|
250
|
+
// A command file lives in the project folder's `.claude/commands/`, but its `!`
|
|
251
|
+
// line runs in whatever directory the SESSION is standing in. A runner resolves
|
|
252
|
+
// the install from there, so in a repo whose project is a subfolder a session
|
|
253
|
+
// that had cd'd to the git root — or to a worktree's root — got npm's registry
|
|
254
|
+
// 404 instead of the engine. So on the local rung a command's `{{exec}}` renders
|
|
255
|
+
// as a launcher that picks the folder first:
|
|
256
|
+
//
|
|
257
|
+
// 1. the cwd, walking up, when the install is there — the healthy path, run
|
|
258
|
+
// in the cwd exactly as before;
|
|
259
|
+
// 2. else this checkout's project folder (git toplevel + the prefix recorded
|
|
260
|
+
// here at render time), then the primary checkout's — a `--docs` worktree
|
|
261
|
+
// has no install of its own — run in THIS checkout's project folder, so a
|
|
262
|
+
// bare command still means the spec you are standing on;
|
|
263
|
+
// 3. else one line naming the folder it expected, exit 1.
|
|
264
|
+
//
|
|
265
|
+
// It is `node -e`, inline, rather than a script file beside the commands,
|
|
266
|
+
// because finding a file from an unknown cwd is the very problem being solved,
|
|
267
|
+
// and a local-scope install keeps `.claude/` out of git, so a worktree may not
|
|
268
|
+
// have one. Node runs the engine's JS entry directly (no `.bin` shim, no
|
|
269
|
+
// shell), which is the one form both `/bin/sh` and cmd.exe can start — vm-bridge
|
|
270
|
+
// runs these lines through cmd.
|
|
271
|
+
//
|
|
272
|
+
// WHAT WOULD BREAK IT: the line passes through two shells' quoting. It is one
|
|
273
|
+
// double-quoted word, so the script must hold no `"`, `$`, `` ` ``, `\`, `%` or
|
|
274
|
+
// `!` — and neither may anything substituted into it. A prefix holding one of
|
|
275
|
+
// those is cannot-tell and renders as `''` (rule 4): rungs 1 and 3 still hold.
|
|
276
|
+
const LAUNCHER = [
|
|
277
|
+
"const f=require('fs'),p=require('path'),c=require('child_process'),K='{{pkg}}',B='{{bin}}',P='{{prefix}}'",
|
|
278
|
+
"const g=a=>{try{return c.execFileSync('git',a,{encoding:'utf8',stdio:['ignore','pipe','ignore']}).trim()}catch(e){}}",
|
|
279
|
+
'const w=d=>{for(let i=0;i<6;i++){const m=p.join(d,' +
|
|
280
|
+
"'node_modules',K,'package.json');if(f.existsSync(m)){const b=JSON.parse(f.readFileSync(m,'utf8')).bin;" +
|
|
281
|
+
"return p.join(p.dirname(m),typeof b=='string'?b:b[B])}const u=p.dirname(d);if(u==d)return;d=u}}",
|
|
282
|
+
'let d=process.cwd(),e=w(d)',
|
|
283
|
+
"if(e==null){const t=g(['rev-parse','--show-toplevel']),m=g(['rev-parse','--git-common-dir']);" +
|
|
284
|
+
'if(t){d=p.join(t,P);e=w(d)||m&&w(p.join(p.dirname(p.resolve(m)),P))}}',
|
|
285
|
+
"if(e==null){console.error(B+': not installed for '+d+' (no node_modules/'+K+' there or above) - install it there, or run from the project folder');process.exit(1)}",
|
|
286
|
+
"const r=c.spawnSync(process.execPath,[e,...process.argv.slice(1)],{cwd:d,stdio:'inherit'});process.exit(r.status==null?1:r.status)",
|
|
287
|
+
].join(';')
|
|
288
|
+
|
|
289
|
+
const UNSAFE_IN_LAUNCHER = /["'$`\\%!]/
|
|
290
|
+
|
|
291
|
+
// The project's folder within its git repo, as a repo path — '' at the root,
|
|
292
|
+
// outside a repo, or when it cannot be carried safely in the launcher.
|
|
293
|
+
function launcherPrefix(dir) {
|
|
294
|
+
let top
|
|
295
|
+
try {
|
|
296
|
+
top = execFileSync('git', ['-C', dir, 'rev-parse', '--show-toplevel'], {
|
|
297
|
+
encoding: 'utf8',
|
|
298
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
299
|
+
}).trim()
|
|
300
|
+
} catch {
|
|
301
|
+
return ''
|
|
302
|
+
}
|
|
303
|
+
const real = (p) => {
|
|
304
|
+
try {
|
|
305
|
+
return fs.realpathSync.native(p)
|
|
306
|
+
} catch {
|
|
307
|
+
return path.resolve(p)
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
const rel = path.relative(real(top), real(dir))
|
|
311
|
+
if (!rel || rel.startsWith('..') || path.isAbsolute(rel)) return ''
|
|
312
|
+
const prefix = rel.split(path.sep).join('/')
|
|
313
|
+
return UNSAFE_IN_LAUNCHER.test(prefix) ? '' : prefix
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
function launcherFor(bin, dir) {
|
|
317
|
+
const script = LAUNCHER.replace('{{pkg}}', distributionPackage())
|
|
318
|
+
.replace('{{bin}}', bin)
|
|
319
|
+
.replace('{{prefix}}', launcherPrefix(dir))
|
|
320
|
+
return `node -e "${script}" --`
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// What a command file's `!` line runs. Only the local rung changes: a global
|
|
324
|
+
// install and the `npx -p` fallback resolve the same from any directory.
|
|
325
|
+
function renderCommand(content, dir, env = process.env) {
|
|
326
|
+
if (!content.includes('{{exec}}')) return content
|
|
327
|
+
if (detectRunner(dir, env).rung !== 'local') return renderExec(content, dir, env)
|
|
328
|
+
return content.replace(EXEC_RE, (_m, _sp, bin) => (bin ? launcherFor(bin, dir) : 'node'))
|
|
329
|
+
}
|
|
250
330
|
|
|
251
331
|
// Which managed files carry the token: markdown only. Hooks and JSON templates
|
|
252
332
|
// are copied byte for byte.
|
|
@@ -387,7 +467,7 @@ function managedTargets(dir) {
|
|
|
387
467
|
})
|
|
388
468
|
for (const name of SKILLS) add(path.join('skills', name, 'SKILL.md'), path.join(dir, '.claude', 'skills', name, 'SKILL.md'))
|
|
389
469
|
for (const name of COMMANDS)
|
|
390
|
-
add(path.join('commands', name), path.join(dir, '.claude', 'commands', name))
|
|
470
|
+
add(path.join('commands', name), path.join(dir, '.claude', 'commands', name), renderCommand)
|
|
391
471
|
for (const name of RULES) add(path.join('rules', name), path.join(dir, '.claude', 'rules', name))
|
|
392
472
|
for (const name of HOOKS) add(path.join('hooks', name), path.join(dir, '.claude', 'hooks', name))
|
|
393
473
|
for (const asset of CORE_FILES) add(asset, path.join(dir, 'specs', '.core', path.basename(asset)))
|
|
@@ -582,7 +662,8 @@ function writeFile(dir, target, content, { force }) {
|
|
|
582
662
|
|
|
583
663
|
function copyAsset(dir, assetRelPath, targetAbs, opts) {
|
|
584
664
|
const raw = fs.readFileSync(path.join(ASSETS, assetRelPath), 'utf8')
|
|
585
|
-
const
|
|
665
|
+
const render = assetRelPath.startsWith(`commands${path.sep}`) ? renderCommand : renderExec
|
|
666
|
+
const content = renderable(assetRelPath) ? render(raw, dir) : raw
|
|
586
667
|
writeFile(dir, targetAbs, content, opts)
|
|
587
668
|
}
|
|
588
669
|
|