devlyn-cli 4.1.0 → 4.2.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 (72) hide show
  1. package/AGENTS.md +10 -94
  2. package/CLAUDE.md +7 -160
  3. package/LICENSE +21 -0
  4. package/README.md +65 -110
  5. package/bin/devlyn.js +95 -116
  6. package/bin/instruction-templates.json +43 -2
  7. package/bin/instructions.js +29 -8
  8. package/config/skills/_shared/adapters/claude.md +8 -85
  9. package/config/skills/_shared/adapters/codex.md +14 -34
  10. package/config/skills/_shared/adapters/omp.md +1 -11
  11. package/config/skills/_shared/codex-monitored.sh +4 -54
  12. package/config/skills/_shared/engine-doctor.sh +18 -58
  13. package/config/skills/_shared/engine-preflight.md +15 -47
  14. package/config/skills/_shared/expected-contract.py +242 -0
  15. package/config/skills/_shared/expected.schema.json +10 -95
  16. package/config/skills/_shared/invocation-receipt.py +26 -757
  17. package/config/skills/_shared/platform-support.py +37 -28
  18. package/config/skills/_shared/role-config.py +100 -421
  19. package/config/skills/_shared/runtime-principles.md +17 -93
  20. package/config/skills/_shared/task-complete.py +490 -285
  21. package/config/skills/_shared/task-completion.md +235 -0
  22. package/config/skills/devlyn-engines/SKILL.md +9 -11
  23. package/config/skills/devlyn-ideate/SKILL.md +57 -107
  24. package/config/skills/devlyn-ideate/references/elicitation.md +18 -99
  25. package/config/skills/devlyn-ideate/references/loop.md +110 -0
  26. package/config/skills/devlyn-ideate/references/package-format.md +128 -0
  27. package/config/skills/devlyn-ideate/scripts/acceptance.py +795 -0
  28. package/config/skills/devlyn-ideate/scripts/queue.py +1780 -0
  29. package/package.json +2 -3
  30. package/config/commit-conventions.md +0 -28
  31. package/config/skills/_shared/adapters/README.md +0 -74
  32. package/config/skills/_shared/adapters/grok.md +0 -100
  33. package/config/skills/_shared/archive_run.py +0 -969
  34. package/config/skills/_shared/codex-config.md +0 -81
  35. package/config/skills/_shared/collect-codex-findings.py +0 -505
  36. package/config/skills/_shared/finish-gate.py +0 -521
  37. package/config/skills/_shared/grok-anchor-guard.py +0 -78
  38. package/config/skills/_shared/judge-output-parser.py +0 -200
  39. package/config/skills/_shared/judge-role-evidence.py +0 -320
  40. package/config/skills/_shared/phase-prompt-render.py +0 -183
  41. package/config/skills/_shared/process-evidence.py +0 -926
  42. package/config/skills/_shared/resolve-bootstrap.py +0 -1410
  43. package/config/skills/_shared/resolve-stop-hook.py +0 -359
  44. package/config/skills/_shared/run-bounded.py +0 -58
  45. package/config/skills/_shared/spec-verify-check.py +0 -5083
  46. package/config/skills/_shared/state-phase-write.py +0 -5989
  47. package/config/skills/_shared/terminal-claim-check.py +0 -777
  48. package/config/skills/_shared/verify-merge-findings.py +0 -3528
  49. package/config/skills/devlyn-design-ui/SKILL.md +0 -650
  50. package/config/skills/devlyn-ideate/references/from-spec-mode.md +0 -61
  51. package/config/skills/devlyn-ideate/references/project-mode.md +0 -80
  52. package/config/skills/devlyn-ideate/references/spec-template.md +0 -121
  53. package/config/skills/devlyn-ideate/references/templates/decision.md +0 -48
  54. package/config/skills/devlyn-ideate/references/templates/roadmap.md +0 -50
  55. package/config/skills/devlyn-ideate/references/templates/vision.md +0 -44
  56. package/config/skills/devlyn-queue/SKILL.md +0 -66
  57. package/config/skills/devlyn-queue/scripts/append.py +0 -94
  58. package/config/skills/devlyn-resolve/SKILL.md +0 -379
  59. package/config/skills/devlyn-resolve/references/free-form-mode.md +0 -71
  60. package/config/skills/devlyn-resolve/references/outer-loop.md +0 -23
  61. package/config/skills/devlyn-resolve/references/phases/build-gate.md +0 -75
  62. package/config/skills/devlyn-resolve/references/phases/cleanup.md +0 -33
  63. package/config/skills/devlyn-resolve/references/phases/implement.md +0 -44
  64. package/config/skills/devlyn-resolve/references/phases/plan.md +0 -39
  65. package/config/skills/devlyn-resolve/references/phases/probe-derive.md +0 -261
  66. package/config/skills/devlyn-resolve/references/phases/surface-close.md +0 -34
  67. package/config/skills/devlyn-resolve/references/phases/verify.md +0 -310
  68. package/config/skills/devlyn-resolve/references/state-schema.md +0 -152
  69. package/config/skills/devlyn-resolve/references/task-completion.md +0 -160
  70. package/config/templates/prompt-templates.md +0 -71
  71. package/config/templates/template-feature.spec.md +0 -255
  72. package/config/templates/template-product-spec.md +0 -680
@@ -1,160 +0,0 @@
1
- # Outer-owner task completion
2
-
3
- Completion belongs to the outer task owner after source acceptance. It does not
4
- add a phase or change product verdicts, finish-gate/archive authority or worker
5
- isolation. Explicit local-only/no-push instructions win. Otherwise delivery is
6
- authorized by the task scope; no additional approval ceremony is required.
7
-
8
- ## Allocate before work
9
-
10
- Use the caller's DEVLYN_SHARED_DIR. When this reference is opened
11
- directly, derive that binding from ../../_shared relative to this
12
- reference's reader-supplied containing directory, resolving directory
13
- symlinks first. Missing source identity is
14
- BLOCKED:skill-source-unresolved; a missing task-complete.py is
15
- BLOCKED:shared-dir-unresolved. Never select another installation.
16
-
17
- Run the bound task-complete.py before committing owner inputs or
18
- starting direct/full work:
19
-
20
- ```sh
21
- python3 "$DEVLYN_SHARED_DIR/task-complete.py" allocate --repo . \
22
- --task '<task identity>' --branch '<absent task branch>' \
23
- --worktree '<absent path>' --repository '<owner/repo>' --remote origin --base main
24
- ```
25
-
26
- Every task owns a linked worktree; `--worktree` is required. Its baseline is the
27
- exact fetched remote base, independent of the anchor's branch or dirty state;
28
- allocation leaves the anchor's HEAD, index and files untouched. Save the returned
29
- receipt path under the common Gitdir. `reconciled` reports earlier accepted,
30
- PR-delivered tasks whose merged resources were cleaned or retained; it is
31
- informational, so never resume or release a receipt you do not own. Existing
32
- branches/trees cannot be adopted, even when their names look generated. An
33
- interrupted allocation stays blocked for inspection; do not delete its receipt
34
- and enroll the resulting branch. Unreceipted tasks remain owner-managed.
35
-
36
- Allocation also returns a receipt-owned `scratch` directory. Put disposable
37
- build intermediates there (for example, set
38
- `CARGO_TARGET_DIR` to `<scratch>/target`). Keep source checkouts, Git data,
39
- lockfiles, reports and restart evidence outside scratch. Do not create unowned
40
- temporary build trees or preserve them by copying them into evidence custody.
41
- Prefer `TemporaryDirectory`/`finally` for short-lived test fixtures.
42
-
43
- After waiting for task writers, `complete --writers-stopped` empties this
44
- scratch on delivery returns, including local-only and pending-PR routes. To
45
- release build caches when parking or after a failed run, use:
46
-
47
- ```sh
48
- python3 "$DEVLYN_SHARED_DIR/task-complete.py" clean-scratch \
49
- --receipt '<returned receipt.json>' --writers-stopped
50
- ```
51
-
52
- This empties only the prospectively owned scratch, preserves its directory
53
- identity for interrupted cleanup and later builds, checks live users and reports
54
- the logical byte count separately from actual free disk space. It does not depend on a product PASS or rewrite that verdict.
55
- Unknown historical roots, source/recovery data, shared caches and terminal
56
- history are never adopted or swept. A refused cleanup does not block source
57
- delivery; it stays visible in the handoff with its receipt and retry command
58
- (`CLEANUP_PENDING` after delivered source). No task is described as cleaned
59
- while owned disposable files remain. On resumption, finish any pending scratch
60
- cleanup before allocating more temporary storage; the next allocation also
61
- retries it for completed deliveries with released writers. Rebuild from retained
62
- inputs when needed; cleanup is not an instruction to restart parked work.
63
-
64
- ## Accept a scoped commit
65
-
66
- Direct work: finish actual decisive checks and diff review, stage only the
67
- accepted paths and commit them. The helper never stages product files. Write a
68
- root acceptance file in the checkout (usually ignored `.devlyn/acceptance.json`):
69
-
70
- ```json
71
- {"kind":"direct","task":"<task identity>","source_sha":"<full commit>","checks":[{"command":"<actual check>","evidence":".devlyn/checks.log"}]}
72
- ```
73
-
74
- The owner accepts these checks; the helper preserves evidence bytes and does not
75
- claim to have independently proved the assertions. No synthetic pipeline state
76
- or full resolve run is needed to deliver a direct task.
77
-
78
- For full resolve, use only its intended successfully archived normal run:
79
-
80
- ```json
81
- {"kind":"pipeline","task":"<task identity>","source_sha":"<cleanup.post_sha>","run_id":"<exact archived run_id>"}
82
- ```
83
-
84
- Terminal CLEAN alone is insufficient. Successful VERIFY and terminal precedence,
85
- the run-bound report/digest, clean finish summary and required evidence must
86
- agree. Failed, incomplete and verify-only runs are ineligible. Acceptance binds
87
- exact bytes and source before push; changed acceptance/evidence or subsequent
88
- product commits require a new accepted task, never implicit descendant approval.
89
-
90
- For a queue drain, resolve returns the acceptance/archive to the queue owner.
91
- Commit the terminal queue transition first, then add
92
- `"queue":{"commit":"<full terminal commit>","file":"docs/specs/queue.md"}` to
93
- acceptance. This commit must have only the verified source as parent and change
94
- exactly the declared queue file. The owner reviews the transition; the helper
95
- does not infer that arbitrary edits to that file are valid queue metadata.
96
- Complete once per item after that commit. Failed items are never published.
97
-
98
- ## Deliver and resume
99
-
100
- Wait for your children, stop your dev servers and task writers, then leave the
101
- task tree. Make the FIRST completion call from outside it with the installed
102
- helper and `--writers-stopped`; this releases the tree for cleanup after merge:
103
-
104
- ```sh
105
- python3 "$DEVLYN_SHARED_DIR/task-complete.py" complete \
106
- --receipt '<returned receipt.json>' \
107
- --acceptance '<task worktree>/.devlyn/acceptance.json' --writers-stopped
108
- ```
109
-
110
- Project policy is `git config --local devlyn.completionMode auto|pr`; absent means
111
- `auto`. Invalid local values fail before external effects, even with an override.
112
- Use `complete --mode auto|pr` for one task, or `--local-only`/`--no-push` to honor
113
- the user's delivery restriction. These per-task choices persist in the receipt.
114
-
115
- `pr` pushes the exact accepted task ref and creates/reuses its exact repository,
116
- head and base PR. While OPEN, it cancels owned auto-merge, reports `PR` with its URL
117
- and retains the checkout. Once MERGED by any method, either mode cleans released
118
- resources in that call, on resume or at the next allocation. Default `auto` also requests
119
- `gh pr merge --auto --merge --match-head-commit <accepted SHA>`. Repository
120
- checks/reviews and merge policy remain authoritative: no admin bypass, strategy
121
- fallback or repository setting changes. When the repository disallows merge
122
- commits or refuses the request, delivery reports `PR` with `merge_refused` and
123
- the PR waits for a person. Command success alone never proves merge.
124
-
125
- `PENDING` retains the workspace and reports a receipt-based resume command.
126
- `BLOCKED` includes the cause and the same retry path; repair the reported condition
127
- before retrying. Resume reobserves Git/PR state under a per-receipt lock, reuses
128
- the original acceptance, and performs only missing eligible effects. Delivery results remain separate from the
129
- immutable product result; do not rewrite an archived PASS for a delivery error.
130
-
131
- ## Yield and retain recoverability
132
-
133
- Cleanup requires actual matching MERGED evidence; linked-tree removal also
134
- requires the owner's recorded release. OS observation supplements it; neither the receipt
135
- nor a scan guarantees exclusion of future writers. Processes with cwd or open
136
- files inside the tree, inaccessible process state (on Linux, other users'
137
- processes unless run as root), caller cwd inside the tree, dirty/untracked files,
138
- a nested repository or worktree, or changed refs/Gitdir/registration retain
139
- affected resources. Use `git worktree lock` to keep a tree.
140
- On native Windows, locking and file durability are supported, but the helper cannot prove writer cessation and reports `writer observation unsupported on this platform; retain workspace`. Even `--writers-stopped` cannot authorize deletion without that observation: retain the workspace, its task refs and external receipt/custody, report delivery separately, and preserve the receipt-based resume command. Do not kill unknown processes or force worktree removal to make completion pass.
141
-
142
- The receipt directory holds byte-verified `custody/`, `manifest.json` and a guarded
143
- `refs/devlyn/completed/<id>` recovery ref. Archive/check evidence is copied there
144
- before publication; removal rechecks it, the recovery ref and the merge commit on base.
145
- Ignored build output and other ignored files are disposable under native
146
- non-force worktree removal. The tree's `.devlyn/` files are byte/mode-verified
147
- and preserved as `<receipt dir>/records/.devlyn`; non-regular files or symlinks
148
- there retain the tree. Partial/corrupt custody or records retain it for repair.
149
-
150
- Legacy in-place receipts retire refs only once their task branch is no longer
151
- checked out; their checkout is never modified. Local ref deletion is guarded by
152
- the expected SHA; remote deletion uses an exact force-with-lease solely as
153
- compare-and-delete, never for product publication. A changed remote branch is
154
- retained. Retry uses the external receipt/evidence after removal. Recovery
155
- refs/evidence have no automatic expiry.
156
-
157
- Queue drains remain serial. Record source verdict and delivery status separately;
158
- retain pending/PR workspaces. Before advancing, use a separate owned branch from
159
- base; do not put the next item's commits on a retained pending branch. If safe
160
- placement is unavailable, report remaining items pending and stop the drain.
@@ -1,71 +0,0 @@
1
- # Prompt Templates
2
-
3
- Reusable prompts optimized for common workflows based on usage patterns.
4
-
5
- ## Investigation with Checkpoints
6
-
7
- Use for code investigation or feature analysis to ensure findings are captured:
8
-
9
- ```
10
- Investigate [issue/feature]. As you go, use TodoWrite to checkpoint your findings.
11
- Every 5-10 minutes of analysis, output a 'Current Understanding' summary so I have
12
- something actionable if we need to stop.
13
- ```
14
-
15
- ## Time-Boxed Sessions
16
-
17
- Use when you have limited time and need guaranteed deliverables:
18
-
19
- ```
20
- I have [X] minutes. My goal is [specific goal]. Success means [specific deliverable].
21
- Start with the minimum viable solution, then improve if time allows.
22
- ```
23
-
24
- ## Debugging
25
-
26
- For systematic debugging, use `/devlyn-resolve [issue description]` which includes:
27
- - Code path mapping
28
- - Hypothesis-driven analysis
29
- - Test-driven fix validation
30
- - Full regression check
31
-
32
- ## Parallel Feature Analysis
33
-
34
- Use for comprehensive feature gap analysis:
35
-
36
- ```
37
- Spawn separate agents to:
38
- (1) analyze the data layer for this feature
39
- (2) check the API endpoints
40
- (3) review the UI components
41
- Consolidate findings into a single summary.
42
- ```
43
-
44
- ## Autonomous Feature Implementation
45
-
46
- Use for end-to-end feature implementation with validation:
47
-
48
- ```
49
- Implement [feature] end-to-end. First, use Task to spawn a sub-agent to analyze
50
- existing patterns in the codebase. Then implement the feature with:
51
- 1) [Component 1]
52
- 2) [Component 2]
53
- 3) [Component 3]
54
- Write comprehensive tests and iterate on the implementation until all tests pass.
55
- Run the full test suite before presenting the final diff. Do not stop until you
56
- have working, tested code ready for PR.
57
- ```
58
-
59
- ## Autonomous Bug Fix
60
-
61
- For complex bugs that need autonomous resolution:
62
-
63
- ```
64
- /devlyn-resolve [bug description]
65
-
66
- After analysis, implement the fix autonomously:
67
- - Write failing test first
68
- - Iterate through hypotheses until test passes
69
- - Run full test suite before completing
70
- - Do not stop at 'needs more investigation'
71
- ```
@@ -1,255 +0,0 @@
1
- # {Feature Name}
2
-
3
- ## Meta
4
-
5
- ```yaml
6
- id: F-{number}
7
- status: draft
8
- version: "0.1"
9
- created: { date }
10
- product_spec: "{behavior}"
11
- phase: { phase }
12
- platform: { platform }
13
- interfaces: [{ list }]
14
- ```
15
-
16
- ## Overview
17
-
18
- ```yaml
19
- purpose: { one sentence }
20
- success_criteria:
21
- - { outcome }
22
- ```
23
-
24
- ---
25
-
26
- ## Data Model
27
-
28
- ### {Entity}
29
-
30
- ```yaml
31
- attributes:
32
- { field }:
33
- type: { type }
34
- required: { bool }
35
- constraints: { rules }
36
-
37
- relations:
38
- { name }:
39
- target: { Entity }
40
- type: { relation }
41
-
42
- examples:
43
- typical: {}
44
- edge: {}
45
- ```
46
-
47
- ---
48
-
49
- <!-- Include sections based on interfaces[] -->
50
-
51
- ## API
52
-
53
- <!-- if: api in interfaces -->
54
-
55
- ### {METHOD} {/path}
56
-
57
- ```yaml
58
- purpose: { text }
59
- auth: { level }
60
- request: {}
61
- response:
62
- success: {}
63
- errors: []
64
- ```
65
-
66
- ---
67
-
68
- ## CLI
69
-
70
- <!-- if: commands in interfaces -->
71
-
72
- ### {command}
73
-
74
- ```yaml
75
- usage: { pattern }
76
- arguments: {}
77
- options: {}
78
- output: {}
79
- examples: []
80
- ```
81
-
82
- ---
83
-
84
- ## Public API
85
-
86
- <!-- if: public_api in interfaces -->
87
-
88
- ### {function}
89
-
90
- ```yaml
91
- signature: { sig }
92
- parameters: {}
93
- returns: {}
94
- throws: []
95
- ```
96
-
97
- ---
98
-
99
- ## MCP
100
-
101
- <!-- if: tools in interfaces -->
102
-
103
- ### Tool: {name}
104
-
105
- ```yaml
106
- description: { text }
107
- parameters: {}
108
- returns: { text }
109
- ```
110
-
111
- ---
112
-
113
- ## UI
114
-
115
- <!-- if: ui in interfaces -->
116
-
117
- ### {View}
118
-
119
- ```yaml
120
- route: { path }
121
- states: {}
122
- flow: []
123
- ```
124
-
125
- ---
126
-
127
- ## SmartContract (EVM, non-EVM like Solana)
128
-
129
- <!-- if: contract_functions in interfaces -->
130
-
131
- ### State
132
-
133
- ```yaml
134
- { variable }:
135
- type: { type }
136
- visibility: { visibility }
137
- ```
138
-
139
- ### Functions
140
-
141
- #### {function}
142
-
143
- ```yaml
144
- visibility: { external|public }
145
- mutability: { view|pure|payable }
146
- modifiers: []
147
- parameters: {}
148
- returns: {}
149
- requires: []
150
- emits: []
151
- ```
152
-
153
- ### Events
154
-
155
- ```yaml
156
- { Event }:
157
- params: {}
158
- indexed: []
159
- ```
160
-
161
- ### Access Control
162
-
163
- ```yaml
164
- roles: {}
165
- ```
166
-
167
- ---
168
-
169
- ## Events
170
-
171
- <!-- if: events in interfaces -->
172
-
173
- ### {event}
174
-
175
- ```yaml
176
- trigger: { when }
177
- payload: {}
178
- ```
179
-
180
- ---
181
-
182
- ## Jobs
183
-
184
- <!-- if: jobs in interfaces -->
185
-
186
- ### {job}
187
-
188
- ```yaml
189
- trigger: { type }
190
- schedule: { cron }
191
- input: {}
192
- output: {}
193
- ```
194
-
195
- ---
196
-
197
- ## Business Logic
198
-
199
- ### Rules
200
-
201
- ```yaml
202
- - rule: { name }
203
- when: { condition }
204
- then: { action }
205
- ```
206
-
207
- ### Validations
208
-
209
- ```yaml
210
- - field: { name }
211
- rules: []
212
- message: { text }
213
- ```
214
-
215
- ---
216
-
217
- ## Integrations
218
-
219
- <!-- if: has external services -->
220
-
221
- ```yaml
222
- - service: { name }
223
- operation: { what }
224
- fallback: { backup }
225
- ```
226
-
227
- ---
228
-
229
- ## Test Scenarios
230
-
231
- ### Unit
232
-
233
- ```yaml
234
- - scenario: { text }
235
- given: { setup }
236
- when: { action }
237
- then: { result }
238
- ```
239
-
240
- ### Edge Cases
241
-
242
- ```yaml
243
- - case: { text }
244
- input: { value }
245
- expected: { handling }
246
- ```
247
-
248
- ---
249
-
250
- ## Dependencies
251
-
252
- ```yaml
253
- requires: []
254
- enables: []
255
- ```