@skitterbyte/skitterspec-linear 19.14.0 → 19.16.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 (45) hide show
  1. package/README.md +2 -0
  2. package/assets/claude-md-section.md +12 -0
  3. package/assets/core/env.config.md +25 -3
  4. package/assets/hooks/main-guard.cjs +73 -6
  5. package/assets/hooks/project-guard.cjs +80 -6
  6. package/assets/hooks/review-gate.cjs +73 -6
  7. package/assets/review/page.html +2 -1
  8. package/assets/rules/commit-trailers.md +2 -2
  9. package/assets/rules/offered-unblocks.md +22 -0
  10. package/assets/rules/spec-planning.md +12 -1
  11. package/assets/skills/no-spec/SKILL.md +5 -0
  12. package/assets/skills/spec/SKILL.md +20 -3
  13. package/assets/skills/spec-bug/SKILL.md +8 -2
  14. package/assets/skills/spec-complete/SKILL.md +28 -2
  15. package/assets/skills/spec-diff/SKILL.md +5 -0
  16. package/assets/skills/spec-hotfix/SKILL.md +8 -2
  17. package/assets/skills/spec-idea/SKILL.md +5 -0
  18. package/assets/skills/spec-init/SKILL.md +4 -2
  19. package/assets/skills/spec-next/SKILL.md +18 -0
  20. package/assets/skills/spec-park/SKILL.md +92 -0
  21. package/assets/skills/spec-resume/SKILL.md +153 -0
  22. package/assets/skills/spec-start/SKILL.md +6 -2
  23. package/assets/skills/spec-status/SKILL.md +1 -1
  24. package/assets/skills/spec-sync/SKILL.md +12 -12
  25. package/assets/skills/spec-to-main/SKILL.md +5 -1
  26. package/assets/skills/spec-todo/SKILL.md +5 -2
  27. package/package.json +1 -1
  28. package/src/cli.js +311 -15
  29. package/src/env/base.js +21 -5
  30. package/src/env/basepin.js +62 -0
  31. package/src/env/bootstrap.js +3 -1
  32. package/src/env/checks.js +49 -0
  33. package/src/env/config.js +48 -1
  34. package/src/env/hooks.js +53 -4
  35. package/src/env/provision.js +10 -2
  36. package/src/env/resolve.js +66 -13
  37. package/src/env/resume.js +234 -0
  38. package/src/env/review.js +4 -1
  39. package/src/env/serve.js +3 -0
  40. package/src/ideacmd.js +11 -1
  41. package/src/init.js +287 -49
  42. package/src/tada/todo.js +19 -4
  43. package/src/vendor/linear/cli-sync.js +3 -3
  44. package/src/vendor/provider-kit/src/specs.js +46 -1
  45. package/src/vendor/sync-core/src/summary.js +10 -1
@@ -21,7 +21,10 @@ const {
21
21
  findSpecFolder,
22
22
  resolveSpec,
23
23
  liveWorktreePaths,
24
+ resolveBaseBranch,
24
25
  } = require('../../../env/resolve.js')
26
+ const { specBranchDocs } = require('../../../env/specbranches.js')
27
+ const { frontmatterField } = require('../../../env/resume.js')
25
28
  const { loadEnvConfig } = require('../../../env/config.js')
26
29
  const { primaryAnchor, attachProject, projectIn } = require('../../../env/project.js')
27
30
  const { readSnapshot, parseFrontmatter, lintPhases, fieldsOf, projectionOf, compareStored, comparableDescription } = require('../../sync-core')
@@ -180,6 +183,48 @@ function makeSpecHelpers({ program = 'spec-sync' } = {}) {
180
183
  return [...byName.values()].sort((a, b) => a.spec.localeCompare(b.spec))
181
184
  }
182
185
 
186
+ // `listSpecs`, plus the specs that exist ONLY on their own branch
187
+ // (`source: 'branch'`, with the `ref` they were read from). Under
188
+ // `land.specDocs: "branch"` an in-flight spec has no copy on base and, on a
189
+ // machine that never provisioned it, no worktree either — so a ticket that
190
+ // already has a spec read as unadopted, and `/spec #N` began a second one.
191
+ // Read off local then remote-tracking spec branches, never fetched.
192
+ //
193
+ // WHAT WOULD FOOL THIS: a remote that was never fetched (its specs are absent
194
+ // — the old answer, never a wrong one), and a spec branch renamed away from
195
+ // `branch.pattern` (not found). Anything unreadable adds nothing.
196
+ function listSpecsWithBranches(dir, config) {
197
+ const live = listSpecs(dir, config)
198
+ const git = (args) => {
199
+ try {
200
+ return execFileSync('git', ['-C', dir, ...args], { encoding: 'utf-8', stdio: ['ignore', 'pipe', 'ignore'] }).trim()
201
+ } catch {
202
+ return null
203
+ }
204
+ }
205
+ let docs
206
+ try {
207
+ const anchor = primaryAnchor(dir, git)
208
+ const env = loadEnvConfig(anchor.dir || dir)
209
+ if (!env.present) return live
210
+ docs = specBranchDocs(git, env.config, resolveBaseBranch(env.config, git))
211
+ } catch {
212
+ return live
213
+ }
214
+ const field = fieldsOf(config).identifier
215
+ const seen = new Set(live.map((s) => s.spec))
216
+ const extra = docs
217
+ .filter((d) => !seen.has(d.folder))
218
+ .map((d) => ({
219
+ spec: d.folder,
220
+ bucket: d.bucket,
221
+ identifier: frontmatterField(d.overview, field),
222
+ source: 'branch',
223
+ ref: d.ref.replace(/^refs\/(heads|remotes)\//, ''),
224
+ }))
225
+ return [...live, ...extra].sort((a, b) => a.spec.localeCompare(b.spec))
226
+ }
227
+
183
228
  // Resolve a spec argument to its folder, or null with a message on stdout.
184
229
  // EVERY failure path here must print and EVERY caller must return a non-zero
185
230
  // code: a push skill checks $? before it applies a plan, so a resolve failure
@@ -253,7 +298,7 @@ function makeSpecHelpers({ program = 'spec-sync' } = {}) {
253
298
  return lines
254
299
  }
255
300
 
256
- return { resolveSnapshotDir, specIdentifier, linkedIdentifier, listSpecs, listSpecsLive, resolveOrExit, warningLines, warnToErr, verifyLines }
301
+ return { resolveSnapshotDir, specIdentifier, linkedIdentifier, listSpecs, listSpecsLive, listSpecsWithBranches, resolveOrExit, warningLines, warnToErr, verifyLines }
257
302
  }
258
303
 
259
304
  module.exports = { makeSpecHelpers }
@@ -188,6 +188,11 @@ function specBlockInner({ snapshotDir, sections, body, phases }) {
188
188
  if (t) parts.push(`**Touches** ${t}`)
189
189
  const gating = headerValue(body, 'Gating')
190
190
  if (gating) parts.push(`**Gating** ${gating}`)
191
+ // A spec parked on something outside the repo (feat-spec-resume). It says
192
+ // why the ticket is not moving, and never sets its Status: the tracker owns
193
+ // status. Absent, nothing is written, so an unparked block is unchanged.
194
+ const blocked = headerValue(body, 'Blocked on')
195
+ if (blocked && blocked !== '—') parts.push(`**Blocked on** ${blocked}`)
191
196
  const progress = progressLine(phases)
192
197
  if (progress) parts.push(progress)
193
198
  parts.push(`**Spec** \`${specPath(snapshotDir)}\``)
@@ -239,7 +244,11 @@ function progressLine(phases) {
239
244
  function phaseBlockInner(phase) {
240
245
  const goal = String((phase && phase.goal) || '').trim() || String((phase && phase.name) || '').trim()
241
246
  const { ticked, total } = taskCounts(phase)
242
- return total ? `${goal}\n\n**Progress** ${ticked} of ${total} tasks` : goal
247
+ const blocked = headerValue(((phase && phase.lines) || []).join('\n'), 'Blocked on')
248
+ const parts = [goal]
249
+ if (blocked && blocked !== '—') parts.push(`**Blocked on** ${blocked}`)
250
+ if (total) parts.push(`**Progress** ${ticked} of ${total} tasks`)
251
+ return parts.join('\n\n')
243
252
  }
244
253
 
245
254
  module.exports = {