dev-loops 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 (156) hide show
  1. package/.pi/dev-loop/defaults.yaml +477 -0
  2. package/AGENTS.md +25 -0
  3. package/CHANGELOG.md +18 -0
  4. package/LICENSE +21 -0
  5. package/README.md +178 -0
  6. package/agents/dev-loop.agent.md +82 -0
  7. package/agents/developer.agent.md +37 -0
  8. package/agents/docs.agent.md +33 -0
  9. package/agents/fixer.agent.md +53 -0
  10. package/agents/quality.agent.md +28 -0
  11. package/agents/refiner.agent.md +87 -0
  12. package/agents/review.agent.md +64 -0
  13. package/cli/index.mjs +424 -0
  14. package/extension/README.md +233 -0
  15. package/extension/checks.ts +94 -0
  16. package/extension/index.ts +131 -0
  17. package/extension/post-merge-update.ts +512 -0
  18. package/extension/presentation.ts +107 -0
  19. package/lib/dev-loops-core.mjs +284 -0
  20. package/package.json +103 -0
  21. package/scripts/README.md +1007 -0
  22. package/scripts/_cli-primitives.mjs +10 -0
  23. package/scripts/_core-helpers.mjs +30 -0
  24. package/scripts/docs/validate-links.mjs +567 -0
  25. package/scripts/docs/validate-no-duplicate-rules.mjs +250 -0
  26. package/scripts/github/_review-thread-mutations.mjs +214 -0
  27. package/scripts/github/capture-review-threads.mjs +180 -0
  28. package/scripts/github/create-draft-pr.mjs +108 -0
  29. package/scripts/github/detect-checkpoint-evidence.mjs +393 -0
  30. package/scripts/github/detect-linked-issue-pr.mjs +331 -0
  31. package/scripts/github/manage-sub-issues.mjs +394 -0
  32. package/scripts/github/probe-copilot-review.mjs +323 -0
  33. package/scripts/github/ready-for-review.mjs +93 -0
  34. package/scripts/github/reconcile-draft-gate.mjs +328 -0
  35. package/scripts/github/reply-resolve-review-thread.mjs +42 -0
  36. package/scripts/github/reply-resolve-review-threads.mjs +329 -0
  37. package/scripts/github/request-copilot-review.mjs +551 -0
  38. package/scripts/github/resolve-tracker-local-spec.mjs +205 -0
  39. package/scripts/github/stage-reviewer-draft.mjs +191 -0
  40. package/scripts/github/upsert-checkpoint-verdict.mjs +694 -0
  41. package/scripts/github/verify-fresh-review-context.mjs +125 -0
  42. package/scripts/github/write-gate-findings-log.mjs +212 -0
  43. package/scripts/loop/_checkpoint-io.mjs +55 -0
  44. package/scripts/loop/_checkpoint-paths.mjs +28 -0
  45. package/scripts/loop/_handoff-contract.mjs +230 -0
  46. package/scripts/loop/_inspect-run-viewer-adapter.mjs +345 -0
  47. package/scripts/loop/_loop-evidence.mjs +32 -0
  48. package/scripts/loop/_pr-runner-coordination.mjs +611 -0
  49. package/scripts/loop/_stale-runner-detection.mjs +145 -0
  50. package/scripts/loop/_steering-state-file.mjs +134 -0
  51. package/scripts/loop/build-handoff-envelope.mjs +181 -0
  52. package/scripts/loop/checkpoint-contract.mjs +49 -0
  53. package/scripts/loop/conductor-monitor.mjs +1850 -0
  54. package/scripts/loop/conductor.mjs +214 -0
  55. package/scripts/loop/copilot-pr-handoff.mjs +493 -0
  56. package/scripts/loop/debt-remediate.mjs +304 -0
  57. package/scripts/loop/detect-change-scope.mjs +102 -0
  58. package/scripts/loop/detect-copilot-loop-state.mjs +454 -0
  59. package/scripts/loop/detect-copilot-session-activity.mjs +186 -0
  60. package/scripts/loop/detect-initial-copilot-pr-state.mjs +318 -0
  61. package/scripts/loop/detect-internal-only-pr.mjs +270 -0
  62. package/scripts/loop/detect-issue-refinement-artifact.mjs +163 -0
  63. package/scripts/loop/detect-pr-gate-coordination-state.mjs +509 -0
  64. package/scripts/loop/detect-reviewer-loop-state.mjs +231 -0
  65. package/scripts/loop/detect-stale-runner.mjs +250 -0
  66. package/scripts/loop/detect-tracker-first-loop-state.mjs +76 -0
  67. package/scripts/loop/detect-tracker-pr-state.mjs +102 -0
  68. package/scripts/loop/info.mjs +267 -0
  69. package/scripts/loop/inspect-run-viewer/cli.mjs +117 -0
  70. package/scripts/loop/inspect-run-viewer/constants.mjs +80 -0
  71. package/scripts/loop/inspect-run-viewer/graph.mjs +757 -0
  72. package/scripts/loop/inspect-run-viewer/handoff-envelope-renderer.mjs +398 -0
  73. package/scripts/loop/inspect-run-viewer/inbox.mjs +308 -0
  74. package/scripts/loop/inspect-run-viewer/managed-instance.mjs +750 -0
  75. package/scripts/loop/inspect-run-viewer/rendering.mjs +411 -0
  76. package/scripts/loop/inspect-run-viewer/server.mjs +638 -0
  77. package/scripts/loop/inspect-run-viewer/shared.mjs +103 -0
  78. package/scripts/loop/inspect-run-viewer/status.mjs +715 -0
  79. package/scripts/loop/inspect-run-viewer-ci-changes.mjs +77 -0
  80. package/scripts/loop/inspect-run-viewer.mjs +82 -0
  81. package/scripts/loop/inspect-run.mjs +382 -0
  82. package/scripts/loop/outer-loop.mjs +419 -0
  83. package/scripts/loop/pr-runner-coordination.mjs +143 -0
  84. package/scripts/loop/pre-commit-branch-guard.mjs +68 -0
  85. package/scripts/loop/pre-flight-gate.mjs +236 -0
  86. package/scripts/loop/pre-pr-ready-gate.mjs +183 -0
  87. package/scripts/loop/pre-push-main-guard.mjs +103 -0
  88. package/scripts/loop/pre-write-remote-freshness-guard.mjs +32 -0
  89. package/scripts/loop/print-gates.mjs +42 -0
  90. package/scripts/loop/resolve-dev-loop-startup.mjs +533 -0
  91. package/scripts/loop/run-conductor-cycle.mjs +322 -0
  92. package/scripts/loop/run-queue.mjs +124 -0
  93. package/scripts/loop/run-refinement-audit.mjs +513 -0
  94. package/scripts/loop/run-watch-cycle.mjs +358 -0
  95. package/scripts/loop/steer-loop.mjs +841 -0
  96. package/scripts/loop/ui-designer-review-contract.mjs +76 -0
  97. package/scripts/loop/watch-initial-copilot-pr.mjs +253 -0
  98. package/scripts/projects/add-queue-item.mjs +528 -0
  99. package/scripts/projects/ensure-queue-board.mjs +837 -0
  100. package/scripts/projects/list-queue-items.mjs +489 -0
  101. package/scripts/projects/move-queue-item.mjs +549 -0
  102. package/scripts/projects/reorder-queue-item.mjs +518 -0
  103. package/scripts/refine/_refine-helpers.mjs +258 -0
  104. package/scripts/refine/prose-linkage-detector.mjs +92 -0
  105. package/scripts/refine/refinement-completeness-checker.mjs +88 -0
  106. package/scripts/refine/scope-boundary-cross-checker.mjs +163 -0
  107. package/scripts/refine/tree-integrity-validator.mjs +211 -0
  108. package/scripts/refine/verify.mjs +178 -0
  109. package/scripts/repo-wiki-local.mjs +156 -0
  110. package/scripts/repo-wiki.mjs +119 -0
  111. package/skills/copilot-pr-followup/SKILL.md +380 -0
  112. package/skills/dev-loop/SKILL.md +141 -0
  113. package/skills/dev-loop/scripts/dev-mode-context.mjs +152 -0
  114. package/skills/dev-loop/scripts/dev-mode-context.test.mjs +80 -0
  115. package/skills/dev-loop/scripts/init-phase.mjs +71 -0
  116. package/skills/dev-loop/scripts/log-bash-exit-1.mjs +25 -0
  117. package/skills/dev-loop/scripts/phase-files.mjs +29 -0
  118. package/skills/dev-loop/scripts/post-gate-verdict-fallback.mjs +480 -0
  119. package/skills/dev-loop/scripts/post-gate-verdict-fallback.test.mjs +732 -0
  120. package/skills/dev-loop/scripts/render-template.mjs +82 -0
  121. package/skills/dev-loop/scripts/render-template.test.mjs +63 -0
  122. package/skills/dev-loop/templates/bootstrap-agents.md +26 -0
  123. package/skills/dev-loop/templates/bootstrap-implementation-state.md +31 -0
  124. package/skills/dev-loop/templates/bootstrap-implementation-workflow.md +17 -0
  125. package/skills/dev-loop/templates/dev-mode-retrospective.md +15 -0
  126. package/skills/dev-loop/templates/dev-mode-review.md +17 -0
  127. package/skills/dev-loop/templates/dev-mode-skill-changes.md +11 -0
  128. package/skills/dev-loop/templates/merged-phase-plan.md +19 -0
  129. package/skills/dev-loop/templates/phase-doc.md +27 -0
  130. package/skills/dev-loop/templates/phase-summary.md +13 -0
  131. package/skills/dev-loop/templates/phase-variant.md +15 -0
  132. package/skills/dev-loop/templates/retrospective.md +11 -0
  133. package/skills/dev-loop/templates/review.md +32 -0
  134. package/skills/dev-loop/templates/ui-vision-review.md +55 -0
  135. package/skills/docs/acceptance-criteria-verification.md +21 -0
  136. package/skills/docs/anti-patterns.md +21 -0
  137. package/skills/docs/artifact-authority-contract.md +119 -0
  138. package/skills/docs/confirmation-rules.md +28 -0
  139. package/skills/docs/copilot-ci-status-contract.md +52 -0
  140. package/skills/docs/copilot-loop-operations.md +233 -0
  141. package/skills/docs/debt-remediation-contract.md +107 -0
  142. package/skills/docs/entrypoint-strategies.md +115 -0
  143. package/skills/docs/epic-tree-refinement-procedure.md +234 -0
  144. package/skills/docs/issue-intake-procedure.md +235 -0
  145. package/skills/docs/main-agent-contract.md +72 -0
  146. package/skills/docs/merge-preconditions.md +29 -0
  147. package/skills/docs/pr-lifecycle-contract.md +209 -0
  148. package/skills/docs/public-dev-loop-contract.md +497 -0
  149. package/skills/docs/retrospective-checkpoint-contract.md +159 -0
  150. package/skills/docs/stop-conditions.md +29 -0
  151. package/skills/docs/structural-quality.md +42 -0
  152. package/skills/docs/tracker-first-loop-state.md +281 -0
  153. package/skills/docs/validation-policy.md +27 -0
  154. package/skills/docs/workflow-handoff-contract.md +135 -0
  155. package/skills/final-approval/SKILL.md +19 -0
  156. package/skills/local-implementation/SKILL.md +640 -0
@@ -0,0 +1,477 @@
1
+ version: 1
2
+
3
+ # Default strategy: "github-first" or "local-first"
4
+ strategy:
5
+ default: github-first
6
+
7
+ # Local-first input source: "tracker" (GitHub issue body) or "phase-docs" (docs/phases/*)
8
+ inputSource:
9
+ default: tracker
10
+
11
+ # Refinement fan-out: how many parallel review variants to generate
12
+ refinement:
13
+ fanOut: 3
14
+ mode: parallel
15
+ maxCopilotRounds: 5
16
+ stopOnLowSignal: false
17
+ lowSignalRoundThreshold: 3
18
+ lowSignalMaxComments: 2
19
+ roles:
20
+ - scope
21
+ - coverage
22
+ - dry
23
+ - kiss
24
+
25
+ # Gate review angle definitions
26
+ # Consumers can add, remove, or reorder angles per gate.
27
+ gates:
28
+ draft:
29
+ # Draft gate: runs before marking PR ready for review.
30
+ # All angle families enabled by default.
31
+ # Opt out of individual angles via `excludeAngles`.
32
+ angles:
33
+ - scope
34
+ - coverage
35
+ - correctness
36
+ - ci-guard
37
+ - contract-surface
38
+ - link-check
39
+ - config-drift
40
+ - gate-evidence
41
+ - no-op
42
+ - input-validation
43
+ - packaging-runtime
44
+ - state-concurrency
45
+ - renderer-security
46
+ - determinism
47
+ - pr-comments
48
+ - pr-description
49
+ excludeAngles: []
50
+ required: true
51
+ # When true, draft gate waits for green CI before the gate may run.
52
+ requireCi: true
53
+ mandatoryAngles:
54
+ - pr-description
55
+ preApproval:
56
+ # Pre-approval gate: runs before declaring merge-ready.
57
+ # All angle families enabled by default.
58
+ # Opt out of individual angles via `excludeAngles`.
59
+ angles:
60
+ - dry
61
+ - kiss
62
+ - yagni
63
+ - srp
64
+ - soc
65
+ - deep
66
+ - ocp
67
+ - lsp
68
+ - isp
69
+ - dip
70
+ - docs
71
+ - pr-checklist-matrix
72
+ excludeAngles: []
73
+ required: true
74
+ mandatoryAngles:
75
+ - pr-checklist-matrix
76
+
77
+ # Autonomy: which gates require operator confirmation (stop points)
78
+ autonomy:
79
+ stopAt:
80
+ - merge
81
+
82
+ # Workflow defaults: optional enforcement and local-mode posture
83
+ workflow:
84
+ asyncStartMode: required
85
+ requireRetrospective: false
86
+ requireRetrospectiveGate: false
87
+ requireDraftFirst: false
88
+ devModeDefault: false
89
+
90
+ # Persona registry: maps named workflow personas/angles to agents and prompts.
91
+ # Gate review angles resolve through this registry, and non-gate personas such
92
+ # as `refiner` may also live here so consuming repos can customize prompt text.
93
+ # Consumers can add custom angles or reusable persona prompts.
94
+ # Each entry:
95
+ # persona — agent persona name (must exist in agents/)
96
+ # prompt — focused instruction for the agent
97
+ # defaultModel — optional model override (null = use persona default)
98
+ personas:
99
+ refiner:
100
+ persona: refiner
101
+ prompt: |-
102
+ For every refinement, include an AC/DoD/Non-goal coverage matrix:
103
+
104
+ | Item | Type (AC/DoD/Non-goal) | Status (Met/Partial/Unmet/Unverified) | Evidence | Notes |
105
+ |---|---|---|---|---|
106
+ | <exact item text> | AC | Unverified | <reference> | |
107
+
108
+ Use exact wording from the source issue(s); when the governing input is a phase doc or other spec instead of an issue, use that source wording exactly for every explicit item.
109
+ Include every explicit acceptance criterion, definition-of-done item, and non-goal; do not skip items.
110
+ If no explicit definition of done exists, add a `Proposed DoD` subsection before the matrix.
111
+ Treat any `Partial`, `Unmet`, or `Unverified` row as incomplete refinement.
112
+ A refinement is complete only when no item has `Partial`, `Unmet`, or `Unverified` status.
113
+
114
+ When a bounded audit artifact is supplied, add an `Audit inputs` subsection.
115
+ Summarize the audited scope, list prioritized findings, include the highest-value follow-up candidates,
116
+ and add an explicit `Will not rewrite/broaden in this phase` statement.
117
+ For each prioritized finding, classify it as exactly one of: current-phase scope/AC,
118
+ DoD expectation, explicit non-goal/defer, or risk/watchpoint.
119
+ Do not fabricate audit evidence when none was provided.
120
+ defaultModel: null
121
+
122
+ audit:
123
+ persona: review
124
+ prompt: >-
125
+ Run a bounded refinement audit. Audit only the named files/areas.
126
+ Prefer delete / merge / trim / defer framing over additive rewrite plans.
127
+ Produce prioritized findings and highest-value follow-up candidates,
128
+ not a whole-repo essay.
129
+ Always include a bounded-scope statement and a `not rewriting in this phase`
130
+ statement. Findings are planning inputs, not automatic rewrite authorization.
131
+ defaultModel: null
132
+
133
+ scope:
134
+ persona: review
135
+ prompt: >-
136
+ Check whether every changed file belongs in this PR.
137
+ Flag unrelated or out-of-scope changes.
138
+ The PR description's scope section is the contract.
139
+ defaultModel: null
140
+
141
+ coverage:
142
+ persona: review
143
+ prompt: >-
144
+ Check whether tests cover the changed behavior adequately.
145
+ Look for missing edge cases, untested error paths,
146
+ and acceptance-criteria gaps.
147
+ Also flag test-name quality issues: test names that misrepresent
148
+ what is actually asserted, overly broad names that hide gaps, and
149
+ names that don't match the behavior under test.
150
+ Flag missing negative-case coverage: malformed-argument tests,
151
+ error-contract tests, and edge-case coverage for boundary
152
+ conditions, empty inputs, and unexpected states.
153
+ Do not accept happy-path-only test suites.
154
+ defaultModel: null
155
+
156
+ correctness:
157
+ persona: review
158
+ prompt: >-
159
+ Check whether the implementation matches the acceptance criteria
160
+ and PR description. Flag logic errors, contract violations,
161
+ and behavior mismatches.
162
+ defaultModel: null
163
+
164
+ docs:
165
+ persona: docs
166
+ prompt: >-
167
+ Review documentation correctness for the current change. Check that
168
+ relative markdown links resolve, symlink-backed doc pointers resolve,
169
+ navigable doc references are actual markdown links rather than bare
170
+ backtick path mentions, command/script references still exist and use
171
+ current names, and index/surface references match the current file tree.
172
+ Also flag stale command references: removed or renamed npm scripts,
173
+ CLI commands, or tool invocations that no longer match the current
174
+ codebase. When the repo provides `scripts/docs/validate-links.mjs`,
175
+ use it for the mechanical link pass; otherwise keep the review scoped
176
+ to the touched doc surface and current change only.
177
+ defaultModel: null
178
+
179
+ deep:
180
+ persona: review
181
+ prompt: >-
182
+ Perform a structural code quality audit of this PR.
183
+
184
+ Bring the same rigor as a full-codebase deslop audit, scoped to this
185
+ change:
186
+ - Question whether every new file, export, layer, or abstraction is
187
+ genuinely necessary. Prefer deletion over addition.
188
+ - Flag files crossing 1000 lines without strong justification.
189
+ - Flag new conditionals bolted onto unrelated paths. Push logic into its
190
+ own boundary instead of scattering special cases.
191
+ - Flag thin wrappers, re-export-only files, and identity abstractions
192
+ that add indirection without buying clarity.
193
+ - Flag feature logic leaking into shared or general-purpose modules.
194
+ - Question cast-heavy, optionality-heavy, or any-typed contracts that
195
+ obscure the real invariant.
196
+
197
+ Be ambitious about simplification:
198
+ - Look for "code judo" moves: restructurings that preserve behavior while
199
+ deleting whole categories of complexity.
200
+ - Prefer the simpler model. If the change adds moving parts, ask whether
201
+ fewer would achieve the same result.
202
+
203
+ Do not rubber-stamp working-but-messier code.
204
+ Approval bar:
205
+ - no structural regression
206
+ - no missed simplification opportunity
207
+ - no unjustified file-size explosion
208
+ - no spaghetti branching growth
209
+ - no unnecessary abstraction or indirection
210
+
211
+ This persona complements full-repo deslop audits: same rigor,
212
+ applied per-PR.
213
+ defaultModel: null
214
+
215
+ dry:
216
+ persona: review
217
+ prompt: >-
218
+ Flag duplicated logic, repeated patterns, and copy-pasted code.
219
+ Prefer one canonical path. Check for restated policies across
220
+ docs and skills.
221
+ defaultModel: null
222
+
223
+ kiss:
224
+ persona: review
225
+ prompt: >-
226
+ Flag over-engineering and unnecessary complexity.
227
+ Prefer simple solutions. Question extra layers, abstractions,
228
+ and indirection that don't earn their keep.
229
+ defaultModel: null
230
+
231
+ srp:
232
+ persona: review
233
+ prompt: >-
234
+ Single Responsibility Principle: check that each module, file,
235
+ class, and function has exactly one reason to change.
236
+ Flag multi-concern files, god objects, mixed abstractions,
237
+ and modules that own unrelated responsibilities.
238
+ defaultModel: null
239
+
240
+ ocp:
241
+ persona: review
242
+ prompt: >-
243
+ Open/Closed Principle: flag code that requires modifying existing
244
+ modules to add new behavior. Prefer extension points, plugin
245
+ architectures, and config-driven dispatch over patching internals.
246
+ defaultModel: null
247
+
248
+ lsp:
249
+ persona: review
250
+ prompt: >-
251
+ Liskov Substitution Principle: flag subtypes or implementations
252
+ that weaken base contracts, throw unexpected errors, or require
253
+ special-casing in callers. Subtypes must be fully substitutable
254
+ for their base types.
255
+ defaultModel: null
256
+
257
+ isp:
258
+ persona: review
259
+ prompt: >-
260
+ Interface Segregation Principle: flag fat interfaces and modules
261
+ that force consumers to depend on methods or exports they never
262
+ use. Prefer narrow, role-specific interfaces.
263
+ defaultModel: null
264
+
265
+ dip:
266
+ persona: review
267
+ prompt: >-
268
+ Dependency Inversion Principle: flag high-level modules depending
269
+ on low-level implementation details. Check that abstractions are
270
+ owned by the consumer, not the implementation. Flag concrete
271
+ imports where an interface/contract should exist.
272
+ defaultModel: null
273
+
274
+ soc:
275
+ persona: review
276
+ prompt: >-
277
+ Separation of Concerns: flag modules that mix distinct concerns
278
+ (e.g., business logic + I/O, data access + presentation,
279
+ orchestration + implementation). Each concern should live in
280
+ its own module with a clear boundary.
281
+ defaultModel: null
282
+
283
+ yagni:
284
+ persona: review
285
+ prompt: >-
286
+ Flag speculative features, future-proofing, and compatibility shims
287
+ not required by the current acceptance criteria.
288
+ YAGNI = You Aren't Gonna Need It.
289
+ defaultModel: null
290
+
291
+ # ── Audit-derived draft-gate personas ──────────────────────────────
292
+ # These prompts translate recurring Copilot review themes into reusable,
293
+ # consumer-repo-generic review angles. Keep examples out of prompt text;
294
+ # operators enable opt-ins by adding angle names to gates.*.angles.
295
+
296
+ contract-surface:
297
+ persona: review
298
+ prompt: >-
299
+ Review this change for public contract-surface drift. Check whether documented schema fields, state/sentinel names, runtime values, tests, and CLI output agree. Verify CLI --help usage matches accepted flags. Compare stdout JSON success shape and stderr JSON error shape against documented examples. Flag optional fields documented as always emitted but conditionally omitted, or fields emitted but undocumented. Stay repo-agnostic; cite concrete changed files and give minimal fixes.
300
+ defaultModel: null
301
+
302
+ input-validation:
303
+ persona: review
304
+ prompt: >-
305
+ Review this change for input-validation drift. Check repo slug, issue number, host, SHA, whitespace, and sentinel normalization. Prefer shared parsers/helpers over ad hoc validation. Flag malformed inputs that slip through, confusing errors, path traversal-like segments, and inconsistent trimming/normalization across CLI/API entrypoints. Recommend minimal tests for accepted and rejected forms.
306
+ defaultModel: null
307
+
308
+ packaging-runtime:
309
+ persona: review
310
+ prompt: >-
311
+ Review this change for packaging/runtime asset contract gaps. Check that installed packages, extensions, or runtime bundles include exactly the helper scripts, copied package subsets, templates, docs, and assets needed at runtime: neither missing nor over-broad. Compare install docs, fixture assertions, allow-lists, and import paths. Flag runtime-only dependencies not covered by packaging tests.
312
+ defaultModel: null
313
+
314
+ state-concurrency:
315
+ persona: review
316
+ prompt: >-
317
+ Review this change for state concurrency and locking risks. Check state-file read/modify/write paths, lock acquisition/release, stale lock handling, concurrent invocations, atomic writes, managed process cleanup, and stderr/error capture. Flag races that can clobber state or leave orphaned locks/processes. Recommend narrow deterministic concurrency or cleanup tests.
318
+ defaultModel: null
319
+
320
+ renderer-security:
321
+ persona: review
322
+ prompt: >-
323
+ Review this change for renderer security. Check HTML text escaping, URL encoding, attribute encoding, JSON/script embedding, and rendering of user-controlled content. Treat titles, names, URLs, statuses, errors, and external payload fields as untrusted. Flag raw interpolation into HTML or attributes and tests that expect unsafe output.
324
+ defaultModel: null
325
+
326
+ determinism:
327
+ persona: review
328
+ prompt: >-
329
+ Review this change for determinism. Check ordering, tie-breakers, localeCompare use, time/random/environment dependence, polling/count assumptions, and mocks/stubs that allow unexpected extra calls. Require stable sorting, strict stubs, deterministic fixture data, and tests independent of locale, timezone, filesystem order, and network timing.
330
+ defaultModel: null
331
+
332
+ ci-guard:
333
+ persona: review
334
+ prompt: >-
335
+ Audit CI/workflow semantics for reproducibility and correctness:
336
+ - Verify CI configuration is deterministic (no floating version ranges
337
+ in install steps, lockfile is respected).
338
+ - Check that branch-protection rules and status-check requirements
339
+ match the stated merge policy.
340
+ - Flag non-reproducible install steps and missing lockfile enforcement.
341
+ - Verify that CI failure precedence is correct: a failing required check
342
+ must block merge regardless of other passing checks.
343
+ - Flag Node.js support-floor mismatches between CI matrices,
344
+ package.json engines, and documented requirements.
345
+ - Flag pending check-run states that could silently hide failures.
346
+ defaultModel: null
347
+
348
+ link-check:
349
+ persona: review
350
+ prompt: >-
351
+ Validate link and path correctness:
352
+ - Check that all Markdown relative links resolve to existing files
353
+ or sections.
354
+ - Flag placeholder links (e.g. href targets still using example URLs,
355
+ 404 references, or TODO links).
356
+ - When the repo provides `scripts/docs/validate-links.mjs`, run it
357
+ for the mechanical link pass and report any failures.
358
+ - Flag symlink-backed doc pointers that point to missing targets.
359
+ - This persona complements mechanical link validation with context-aware
360
+ judgment for link intent and anchor correctness.
361
+ defaultModel: null
362
+
363
+ pr-description:
364
+ persona: review
365
+ prompt: >-
366
+ Review the PR description for completeness, contract fitness, and checkbox formatting before this PR is marked ready for review.
367
+ The PR body is the implementation contract — it must have:
368
+ - A Summary section explaining what changed and why
369
+ - A Scope and context section defining the boundary of the change
370
+ - A File-by-file changes section listing every touched file and what changed in it
371
+ - An Acceptance criteria section with the linked issue acceptance criteria
372
+ - A Definition of done section
373
+ - A Non-goals section
374
+ - A Validation command section describing exactly how to verify the change
375
+ - The "Closes #N" line must match the linked issue; flag changes that alter or remove the operator-intended close target
376
+ Checkboxes (`- [ ]` / `- [x]`, or `* [ ]` / `* [x]`) must appear inside genuine Markdown list items. Flag any checkbox marker used outside a list item (including table cells) as a worth-fixing-now finding.
377
+ Flag any checkbox marker wrapped in backticks (e.g. `` `[x]` ``) as a worth-fixing-now finding.
378
+ Flag PRs where the body is a single sentence or lacks any of these sections.
379
+ Do not block on formatting preferences other than checkbox correctness.
380
+ defaultModel: null
381
+
382
+ pr-checklist-matrix:
383
+ persona: review
384
+ prompt: >-
385
+ Verify before approval that the PR checklist and AC/DoD/non-goals matrix are complete.
386
+ - Every PR checkbox (`- [ ]`) must be checked. If any box is unchecked, flag it as a blocking finding.
387
+ - The PR body must contain an AC/DoD/non-goals matrix that maps each acceptance criterion
388
+ to its definition-of-done item(s) and lists explicit non-goals.
389
+ - The matrix must have a markdown table with at least a header row and one content row.
390
+ - Flag the matrix as incomplete if any acceptance criterion, definition-of-done item, or non-goal is missing.
391
+ defaultModel: null
392
+
393
+ pr-comments:
394
+ persona: review
395
+ prompt: >-
396
+ Scan PR comments for unresolved issues before declaring the gate clean.
397
+ Check all PR comments and review threads for:
398
+ - Comments from the repository owner or collaborators that point out
399
+ implementation bugs, logic errors, contract violations, or security
400
+ issues
401
+ - Unresolved review threads that raise implementation concerns
402
+ Flag any unresolved comment that identifies a concrete implementation
403
+ problem as a blocking finding (severity: must-fix or worth-fixing-now).
404
+ Do not flag:
405
+ - Resolved threads
406
+ - Style nits, formatting suggestions, or cosmetic feedback
407
+ - Comments from non-collaborators or bots
408
+ - Outdated comments that were already addressed in a later commit
409
+ If no unresolved implementation concerns exist, return clean.
410
+ config-drift:
411
+ persona: review
412
+ prompt: >-
413
+ Cross-check config, schema, and documentation for contract drift:
414
+ - Verify that configuration files (.pi/dev-loop/settings.yaml,
415
+ package.json, CI workflows, skill manifests) agree on canonical
416
+ status tokens, support floors, and required flags.
417
+ - Flag any instance where two sources of truth disagree about the
418
+ supported contract (e.g. one doc says a flag is required, another
419
+ says it's optional).
420
+ - Check that the engines.node field matches CI matrix and any
421
+ documented Node.js support floor.
422
+ - Flag inconsistencies within a single doc that could confuse
423
+ consumers (e.g. one section says "default: true" and another
424
+ section implies the opposite).
425
+ defaultModel: null
426
+
427
+ gate-evidence:
428
+ persona: review
429
+ prompt: >-
430
+ Verify that required workflow checkpoint evidence is present and valid:
431
+ - Check that the draft checkpoint verdict comment exists. While the PR is
432
+ still draft, it must also reference the current head SHA. After the PR
433
+ leaves draft, the `draft_gate` checkpoint verdict comment is a one-time transition record
434
+ and head-SHA matching no longer applies.
435
+ - Check that the pre-approval checkpoint verdict comment exists when the PR
436
+ is in a ready/merge state.
437
+ - Flag any PR that transitions to ready/merge states without visible
438
+ checkpoint evidence for the current head.
439
+ - When draft-first enforcement is configured, verify that a draft-gate
440
+ comment was posted before the PR was marked ready.
441
+ - This persona is opt-in for the draft gate (uncomment to add).
442
+ On first PR it checks for any checkpoint evidence (not only draft_gate since
443
+ no prior gate exists).
444
+ defaultModel: null
445
+
446
+ no-op:
447
+ persona: review
448
+ prompt: >-
449
+ Flag workflow or tool invocations that are effectively no-ops:
450
+ - Check that shell commands and tool calls actually affect output,
451
+ state, or exit behavior rather than discarding their effect.
452
+ - Flag tool invocations that look successful but pass arguments in
453
+ a way that produces no meaningful change.
454
+ - Flag commands whose output is generated but never consumed.
455
+ - Flag patterns where a tool is called in a loop but only the last
456
+ iteration's result is used (or none at all).
457
+ defaultModel: null
458
+
459
+ # Internal path patterns for internal-only PR detection.
460
+ # If ALL changed files in a PR match one of these patterns, the PR is
461
+ # classified as internal-only and Copilot review is suppressed.
462
+ # Consumer repos can override these in .pi/dev-loop/settings.yaml.
463
+ # Internal path patterns for internal-only PR detection.
464
+ # Flat array of regex strings. If ALL changed files in a PR match at least
465
+ # one pattern, the PR is classified as internal-only and Copilot review is
466
+ # suppressed. Consumer repos override with their own list.
467
+ # Example consumer override:
468
+ # internalPathPatterns:
469
+ # - "^tools/"
470
+ # - "^internal/"
471
+ internalPathPatterns:
472
+ - "^scripts/"
473
+ - "^docs/"
474
+ - "^skills/docs/"
475
+ - "^\\.pi/"
476
+ - "^\\.github/"
477
+ - "^test/"
package/AGENTS.md ADDED
@@ -0,0 +1,25 @@
1
+ # AGENTS.md
2
+
3
+ ## Repo contract
4
+ - `dev-loop` is the single public workflow entrypoint.
5
+ - For routed work, run `dev-loops loop startup ...` first, then load only the returned `requiredReads`.
6
+ - Canonical workflow docs live under `skills/docs/`.
7
+
8
+ ## Working rules
9
+ - Main agent: read-only for all files tracked by the repository. All mutations flow through `dev-loop` async subagent. `skills/docs/main-agent-contract.md` is a mandatory baseline read alongside AGENTS.md (intentional exception to requiredReads-only loading for routed work; it defines the absolute delegation boundary that applies in all sessions).
10
+ - No direct commits to `main`; use feature branches, worktrees, and PRs.
11
+ - Use `tmp/worktrees/<issue-or-branch-slug>/` for mutating local work; keep the main checkout for inspection.
12
+ - Always run `git fetch origin` before creating or reusing a worktree — never create from a stale `origin/main`.
13
+ - Canonical guidance lives in `docs/worktree-guidance.md`.
14
+ - Prefer the GitHub-first routed path for branch/PR/CI/review work; use local implementation only when explicitly requested.
15
+ - Use `npm run verify` as the default local validation path.
16
+ - When creating GitHub issues via `gh issue create`, always include `--assignee @me` so the new artifact is self-assigned.
17
+ - When creating PRs in this repo, use `dev-loops pr create-draft --assignee @me ...` so draft-first is enforced mechanically while preserving self-assignment.
18
+ - Never start implementation (file mutation, branch creation, PR creation) without explicit instruction. "Queue," "add to list," "track," "note" are NOT implementation triggers. Only proceed when the user says "start," "go," "implement," "do it," "work on," or equivalent imperative. Confirm if unsure.
19
+ - All work must originate from a tracked artifact: a GitHub issue (tracker-first) or a persisted markdown plan file (local-planning). See [Artifact Authority Contract](skills/docs/artifact-authority-contract.md) for canonical mode definitions and settings. No work may originate from a PR or direct local change unless explicitly requested.
20
+ - Implement one phase at a time; if durable repo docs explicitly record a reprioritization exception, follow [Implementation State](docs/IMPLEMENTATION_STATE.md) and the active phase doc.
21
+ - Keep compatibility surface minimal; do not add legacy aliases, wrappers, or duplicate docs unless explicitly requested.
22
+ - A question requires an answer, not an action. When the user asks a question — even one implying criticism or correction — answer first before taking any action. Do not treat a question as implicit authorization to act.
23
+ - Keep workflow procedure out of AGENTS; put shared contracts under `skills/docs/`. Brief, high-signal main-agent dispatch contracts (e.g., sequential dispatch) are the narrow exception — they stay in AGENTS.md because AGENTS.md is the canonical main-agent instruction surface.
24
+ - No PR scope has gate exemptions (#579): see skills/dev-loop/SKILL.md "No gate exemptions" section.
25
+ - **Sequential dispatch contract (#693):** When the user says "sequential", "one at a time", "serially", or "in order" with multiple `dev-loop` targets, the main agent must dispatch `dev-loop` async subagents one at a time — each blocking on prior completion before the next starts. This is deterministic: the keyword must always produce serial execution, never concurrent. The main agent is the sequencer; do not dispatch all targets at once.
package/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## 0.1.0
6
+
7
+ ### Added
8
+
9
+ - Initial publishable `dev-loops` v0.1.0 package metadata.
10
+ - Primary npm package name is the unscoped `dev-loops` (`@mfittko/dev-loops` kept only as a documented fallback).
11
+ - Public npm provenance and access configuration.
12
+ - `@dev-loops/core` `^0.1.0` dependency for the extracted scoped runtime package.
13
+ - CLI entrypoint `dev-loops` via `./cli/index.mjs`.
14
+ - Repository, bugs, and homepage URLs pointing to `mfittko/dev-loops`.
15
+
16
+ ### Removed
17
+
18
+ - Broken `postinstall` lifecycle script that failed on consumer installs.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 mfittko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.