task-delegate 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.
package/AGENTS.md ADDED
@@ -0,0 +1,29 @@
1
+ # TaskDelegate Agent Instructions
2
+
3
+ TaskDelegate is designed to keep the orchestrator context small while delegating bounded coding tasks to CLI coding agents.
4
+
5
+ ## Current backend policy
6
+
7
+ - `opencode`: stable/default backend.
8
+ - `codex`: experimental/manual backend.
9
+ - `claude`: experimental/manual backend.
10
+
11
+ ## Commit boundary
12
+
13
+ Delegate agents must not commit, push, reset, clean, or rewrite history. The orchestrator or human reviewer owns the final diff review and commit.
14
+
15
+ ## Low-context policy
16
+
17
+ - Prefer 40-80 line briefs.
18
+ - Maximum brief length: 120 lines by default.
19
+ - Do not paste full conversation history into delegated prompts.
20
+ - Do not paste large files unless the backend cannot read the repository.
21
+ - Retry with a delta brief, not a full duplicate brief.
22
+
23
+ ## Safety policy
24
+
25
+ - Do not read `.env`, secret, key, certificate, or credential files.
26
+ - Do not write outside the selected project directory.
27
+ - Do not install packages unless the brief explicitly allows it.
28
+ - Do not run destructive commands.
29
+ - Re-run tests/lint/build before accepting delegated changes.
@@ -0,0 +1,59 @@
1
+ # GitHub Profile Setup for MOHJRNL/task-delegate
2
+
3
+ This repo is personalized for the GitHub profile:
4
+
5
+ ```text
6
+ MOHJRNL
7
+ ```
8
+
9
+ Expected repository URL:
10
+
11
+ ```text
12
+ https://github.com/MOHJRNL/task-delegate
13
+ ```
14
+
15
+ ## Option A — create and push with GitHub CLI
16
+
17
+ From the repo root:
18
+
19
+ ```bash
20
+ git init
21
+ git add .
22
+ git commit -m "Initial release: TaskDelegate v0.1"
23
+ ./scripts/create-github-repo.sh
24
+ ```
25
+
26
+ ## Option B — create empty repo manually, then push
27
+
28
+ Create an empty public GitHub repo named `task-delegate` under `MOHJRNL`, then run:
29
+
30
+ ```bash
31
+ git init
32
+ git add .
33
+ git commit -m "Initial release: TaskDelegate v0.1"
34
+ git branch -M main
35
+ git remote add origin https://github.com/MOHJRNL/task-delegate.git
36
+ git push -u origin main
37
+ ```
38
+
39
+ ## Public install commands after push
40
+
41
+ As an Agent Skill:
42
+
43
+ ```bash
44
+ npx skills add MOHJRNL/task-delegate --skill task-delegate
45
+ ```
46
+
47
+ As a GitHub-backed npx package before npm publish:
48
+
49
+ ```bash
50
+ npx github:MOHJRNL/task-delegate --help
51
+ npx github:MOHJRNL/task-delegate doctor
52
+ ```
53
+
54
+ After npm publish:
55
+
56
+ ```bash
57
+ npx task-delegate --help
58
+ npx task-delegate doctor
59
+ ```
package/LICENSE ADDED
@@ -0,0 +1,52 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ https://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work.
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on or derived from the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link or bind by name to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner.
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
37
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
38
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding notices that do not pertain to any part of the Derivative Works.
39
+
40
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
41
+
42
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions.
43
+
44
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work.
45
+
46
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
47
+
48
+ 8. Limitation of Liability. In no event and under no legal theory shall any Contributor be liable to You for damages arising from use of the Work.
49
+
50
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer support, warranty, indemnity, or other liability obligations. However, You may do so only on Your own behalf and on Your sole responsibility.
51
+
52
+ END OF TERMS AND CONDITIONS
package/NOTICE ADDED
@@ -0,0 +1,7 @@
1
+ TaskDelegate
2
+ Copyright 2026 TaskDelegate contributors.
3
+
4
+ TaskDelegate is an original low-context delegation skill/package.
5
+ If you fork, redistribute, or publish a derivative package, please preserve this NOTICE file and clearly indicate that your work is based on TaskDelegate.
6
+
7
+ This product includes no bundled OpenCode, Codex, Claude Code, Kimi, Qwen, Gemini, or other third-party backend CLI binaries. Adapters are lightweight wrappers only.
package/PUBLISHING.md ADDED
@@ -0,0 +1,118 @@
1
+ # Publishing TaskDelegate
2
+
3
+ TaskDelegate is prepared for two public distribution paths:
4
+
5
+ 1. GitHub skill distribution through `npx skills add`.
6
+ 2. npm CLI distribution through `npx task-delegate`.
7
+
8
+ Official repository:
9
+
10
+ ```text
11
+ https://github.com/MOHJRNL/task-delegate
12
+ ```
13
+
14
+ ## Before publishing
15
+
16
+ Validate:
17
+
18
+ ```bash
19
+ npm run check
20
+ npm test
21
+ npm run pack:dry-run
22
+ npm run doctor
23
+ ```
24
+
25
+ Confirm `package.json` points to:
26
+
27
+ ```text
28
+ https://github.com/MOHJRNL/task-delegate
29
+ ```
30
+
31
+ ## GitHub skill installation path
32
+
33
+ Users can install the skill directly from GitHub with:
34
+
35
+ ```bash
36
+ npx skills add MOHJRNL/task-delegate --skill task-delegate
37
+ ```
38
+
39
+ This installs the skill package from:
40
+
41
+ ```text
42
+ skills/task-delegate/
43
+ ```
44
+
45
+ The adapters are bundled under:
46
+
47
+ ```text
48
+ skills/task-delegate/scripts/adapters/
49
+ ```
50
+
51
+ Users do not install adapters separately.
52
+
53
+ ## GitHub-only npx usage before npm publish
54
+
55
+ Users can run the CLI directly from the public GitHub repo:
56
+
57
+ ```bash
58
+ npx github:MOHJRNL/task-delegate --help
59
+ npx github:MOHJRNL/task-delegate doctor
60
+ ```
61
+
62
+ ## npm CLI publishing path
63
+
64
+ Login:
65
+
66
+ ```bash
67
+ npm login
68
+ npm whoami
69
+ ```
70
+
71
+ Publish unscoped if available:
72
+
73
+ ```bash
74
+ npm publish
75
+ ```
76
+
77
+ Users can then run:
78
+
79
+ ```bash
80
+ npx task-delegate --help
81
+ npx task-delegate doctor
82
+ npx task-delegate run --backend opencode --mode safe-auto --brief brief.md --cd .
83
+ ```
84
+
85
+ ## Scoped package fallback
86
+
87
+ If `task-delegate` is unavailable on npm, change `package.json`:
88
+
89
+ ```json
90
+ {
91
+ "name": "@mohjrnl/task-delegate",
92
+ "bin": {
93
+ "task-delegate": "bin/task-delegate.mjs"
94
+ },
95
+ "publishConfig": {
96
+ "access": "public"
97
+ }
98
+ }
99
+ ```
100
+
101
+ Publish:
102
+
103
+ ```bash
104
+ npm publish --access public
105
+ ```
106
+
107
+ Users can then run:
108
+
109
+ ```bash
110
+ npx @mohjrnl/task-delegate --help
111
+ npx @mohjrnl/task-delegate doctor
112
+ ```
113
+
114
+ ## Attribution and forks
115
+
116
+ TaskDelegate uses Apache-2.0 and ships a `NOTICE` file. Forks and derivative packages should keep the license and NOTICE attribution.
117
+
118
+ GitHub forks created through GitHub will show the upstream fork relationship automatically. npm packages cannot force a visual fork relationship, so the license/NOTICE files are the portable attribution mechanism.
package/README.md ADDED
@@ -0,0 +1,333 @@
1
+ # TaskDelegate
2
+
3
+ **TaskDelegate** is a low-context delegation skill and CLI that lets coding agents hand off bounded implementation tasks to CLI coding agents through compact briefs, safe execution modes, bundled adapters, and structured results.
4
+
5
+ The first version is intentionally lean:
6
+
7
+ - **Language:** Node.js
8
+ - **Stable backend:** OpenCode
9
+ - **Experimental backends:** Codex, Claude Code
10
+ - **Default OpenCode mode:** `safe-auto`
11
+ - **Safety:** deny rules, no commit boundary, clean working tree preflight
12
+ - **Output:** compact `result.json`
13
+ - **Adapters:** bundled inside the package; users do not install adapters separately
14
+ - **Roadmap:** GitHub, DevSecOps, Python reporting, Kimi/Qwen/Gemini adapters later
15
+
16
+ ## Why TaskDelegate exists
17
+
18
+ Most orchestrator agents waste context when they try to inspect, implement, debug, and review everything inside one conversation. TaskDelegate moves implementation-heavy work into a separate CLI-agent run and returns only a compact result for review.
19
+
20
+ ```text
21
+ orchestrator agent
22
+ → compact brief
23
+ → backend adapter
24
+ → CLI coding agent
25
+ → result.json + logs + diff metadata
26
+ → orchestrator review
27
+ → human/orchestrator commit
28
+ ```
29
+
30
+ ## Current backend matrix
31
+
32
+ | Backend | Status | Default mode | Recommended use |
33
+ |---|---|---|---|
34
+ | OpenCode | Stable | `safe-auto` | Mechanical edits, small features, tests, refactors |
35
+ | Codex | Experimental | `manual` | Reasoning-heavy implementation or second pass |
36
+ | Claude Code | Experimental | `manual` | Complex refactor, architecture-sensitive work, planning/review |
37
+
38
+ ## Requirements
39
+
40
+ - Node.js 18+
41
+ - Git
42
+ - At least one supported CLI backend installed and authenticated:
43
+ - `opencode`
44
+ - `codex`
45
+ - `claude`
46
+
47
+ ## Official repository
48
+
49
+ ```text
50
+ https://github.com/MOHJRNL/task-delegate
51
+ ```
52
+
53
+ ## Installation
54
+
55
+ TaskDelegate supports two public usage paths.
56
+
57
+ ### 1. Install as an Agent Skill
58
+
59
+ Install the skill from this GitHub repository:
60
+
61
+ ```bash
62
+ npx skills add MOHJRNL/task-delegate --skill task-delegate
63
+ ```
64
+
65
+ This copies the `skills/task-delegate` package, including scripts, references, and adapters. No separate adapter install is required.
66
+
67
+ ### 2. Run as a CLI with npx
68
+
69
+ Before npm publishing, run directly from GitHub:
70
+
71
+ ```bash
72
+ npx github:MOHJRNL/task-delegate --help
73
+ npx github:MOHJRNL/task-delegate doctor
74
+ ```
75
+
76
+ After publishing to npm, users can run without a global install:
77
+
78
+ ```bash
79
+ npx task-delegate --help
80
+ npx task-delegate doctor
81
+ npx task-delegate run --backend opencode --mode safe-auto --brief brief.md --cd .
82
+ ```
83
+
84
+ Recommended pinned usage after release:
85
+
86
+ ```bash
87
+ npx task-delegate@0.1.0 --help
88
+ ```
89
+
90
+ ## What is bundled vs external
91
+
92
+ Bundled:
93
+
94
+ - `task-delegate` CLI
95
+ - `task-delegate` skill
96
+ - OpenCode/Codex/Claude adapters
97
+ - brief templates
98
+ - permission/review references
99
+
100
+ External prerequisites:
101
+
102
+ - Node.js
103
+ - Git
104
+ - whichever backend CLI the user wants to run: `opencode`, `codex`, or `claude`
105
+ - backend authentication/configuration
106
+
107
+ Adapters are wrappers. They are intentionally bundled. Backend CLIs are not bundled because they have their own installation, authentication, permissions, model access, and release cadence.
108
+
109
+ ## Quick start for local development
110
+
111
+ ```bash
112
+ npm test
113
+ npm run check
114
+ npm run pack:dry-run
115
+ ```
116
+
117
+ Run the CLI locally from the repo:
118
+
119
+ ```bash
120
+ node bin/task-delegate.mjs --help
121
+ node bin/task-delegate.mjs doctor
122
+ node bin/task-delegate.mjs list-backends
123
+ ```
124
+
125
+ Dry run without launching a backend:
126
+
127
+ ```bash
128
+ npm run dry-run
129
+ ```
130
+
131
+ Delegate to OpenCode:
132
+
133
+ ```bash
134
+ task-delegate run \
135
+ --backend opencode \
136
+ --mode safe-auto \
137
+ --brief examples/brief.sample.md \
138
+ --cd /path/to/project
139
+ ```
140
+
141
+ Delegate to Codex manually:
142
+
143
+ ```bash
144
+ task-delegate run \
145
+ --backend codex \
146
+ --mode manual \
147
+ --brief examples/brief.sample.md \
148
+ --cd /path/to/project
149
+ ```
150
+
151
+ Delegate to Claude Code in plan mode:
152
+
153
+ ```bash
154
+ task-delegate run \
155
+ --backend claude \
156
+ --mode plan \
157
+ --brief examples/brief.sample.md \
158
+ --cd /path/to/project
159
+ ```
160
+
161
+ ## Skill installation helper
162
+
163
+ If a user wants to copy the skill directly from the npm package into a local agent project:
164
+
165
+ ```bash
166
+ npx task-delegate install-skill --dest .claude/skills
167
+ ```
168
+
169
+ This installs:
170
+
171
+ ```text
172
+ .claude/skills/task-delegate/
173
+ ├── SKILL.md
174
+ ├── scripts/
175
+ └── references/
176
+ ```
177
+
178
+ The adapter scripts are included. No separate adapter package is needed.
179
+
180
+ ## Publishing to npm
181
+
182
+ TaskDelegate is npm-ready. The package exposes a CLI binary through the `bin` field:
183
+
184
+ ```json
185
+ {
186
+ "bin": {
187
+ "task-delegate": "bin/task-delegate.mjs"
188
+ }
189
+ }
190
+ ```
191
+
192
+ Before the first public release:
193
+
194
+ ```bash
195
+ npm login
196
+ npm run prepublishOnly
197
+ npm publish
198
+ ```
199
+
200
+ If the unscoped package name `task-delegate` is unavailable, switch to a scoped package name, for example:
201
+
202
+ ```json
203
+ {
204
+ "name": "@mohjrnl/task-delegate",
205
+ "bin": {
206
+ "task-delegate": "bin/task-delegate.mjs"
207
+ },
208
+ "publishConfig": {
209
+ "access": "public"
210
+ }
211
+ }
212
+ ```
213
+
214
+ Then users can run:
215
+
216
+ ```bash
217
+ npx @mohjrnl/task-delegate --help
218
+ ```
219
+
220
+ ## Output
221
+
222
+ Each run writes to:
223
+
224
+ ```text
225
+ .task-delegate/runs/<timestamp>-<backend>/
226
+ ├── result.json
227
+ ├── stdout.log
228
+ ├── stderr.log
229
+ ├── prompt.md
230
+ ├── git-before.txt
231
+ ├── git-after.txt
232
+ ├── diff-stat.txt
233
+ └── changed-files.txt
234
+ ```
235
+
236
+ `result.json` is intentionally compact so the orchestrator does not need to load long logs into context.
237
+
238
+ ## Modes
239
+
240
+ | Mode | Meaning |
241
+ |---|---|
242
+ | `plan` | Ask the backend to analyze and propose a plan only. |
243
+ | `manual` | Run with conservative/manual permissions where supported. |
244
+ | `safe-auto` | Allow non-interactive execution with guardrails. Stable only for OpenCode in v0.1. |
245
+
246
+ ## Safety model
247
+
248
+ TaskDelegate does not claim to make CLI agents safe by itself. It creates a safer operating loop:
249
+
250
+ - no commits by backend agents
251
+ - dirty working tree preflight
252
+ - deny rules for OpenCode via `OPENCODE_PERMISSION`
253
+ - compact output instead of full transcript loading
254
+ - explicit review required
255
+ - destructive command warnings
256
+
257
+ ## Troubleshooting
258
+
259
+ ### TaskDelegate requires a Git project
260
+
261
+ TaskDelegate is designed to run inside a Git repository so it can capture:
262
+
263
+ - Git status before and after the delegated run
264
+ - changed files
265
+ - diff stat
266
+ - review metadata
267
+
268
+ For a new test project:
269
+
270
+ ```bash
271
+ git init
272
+ echo ".task-delegate/" >> .gitignore
273
+ git add .
274
+ git commit -m "Initial project"
275
+ ```
276
+
277
+ The `.task-delegate/` directory contains run outputs and should normally be ignored.
278
+
279
+ ### OpenCode fails with `Unexpected server error`
280
+
281
+ First test OpenCode directly:
282
+
283
+ ```bash
284
+ opencode run --pure --print-logs --log-level DEBUG "Say hello and do not edit files."
285
+ ```
286
+
287
+ If the logs show `ProviderModelNotFoundError`, your default OpenCode model is invalid or no longer available.
288
+
289
+ List available models:
290
+
291
+ ```bash
292
+ opencode models
293
+ ```
294
+
295
+ Then pass a valid model explicitly:
296
+
297
+ ```bash
298
+ npx github:MOHJRNL/task-delegate run \
299
+ --backend opencode \
300
+ --mode safe-auto \
301
+ --brief brief.md \
302
+ --cd . \
303
+ --model zai-coding-plan/glm-4.7
304
+ ```
305
+
306
+ The `--model` flag is optional, but useful when the default OpenCode model is not configured correctly.
307
+
308
+ ### Payment method errors
309
+
310
+ Some OpenCode-hosted models may require billing. If you see a `No payment method` error, choose another available model or configure billing in OpenCode.
311
+
312
+ ### Duplicate skill warning
313
+
314
+ If TaskDelegate is installed both globally and for Claude Code, OpenCode may warn about duplicate skill names, for example:
315
+
316
+ ```text
317
+ duplicate skill name task-delegate
318
+ ```
319
+
320
+ This is usually harmless. It means the same skill exists in more than one skill location, such as:
321
+
322
+ ```text
323
+ ~/.agents/skills/task-delegate
324
+ ~/.claude/skills/task-delegate
325
+ ```
326
+
327
+ ## Attribution and forks
328
+
329
+ TaskDelegate uses Apache-2.0 with a `NOTICE` file. Forks and redistributed derivative packages should preserve the license and NOTICE attribution. GitHub forks will also show the upstream relationship automatically when created through GitHub.
330
+
331
+ ## Roadmap
332
+
333
+ See [`skills/task-delegate/references/roadmap.md`](skills/task-delegate/references/roadmap.md).
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ // TaskDelegate CLI entrypoint.
3
+ // Keeps the published npm bin stable even if the internal skill script moves later.
4
+ import '../skills/task-delegate/scripts/relay.mjs';
@@ -0,0 +1,34 @@
1
+ # Task
2
+
3
+ Add a tiny documentation note to the README explaining how to run the test suite.
4
+
5
+ # Goal
6
+
7
+ The README should clearly mention the command `npm test`.
8
+
9
+ # Scope
10
+
11
+ Allowed:
12
+ - Edit README.md only.
13
+
14
+ Not allowed:
15
+ - Do not commit.
16
+ - Do not push.
17
+ - Do not read secrets.
18
+ - Do not install packages.
19
+ - Do not change source code.
20
+
21
+ # Acceptance criteria
22
+
23
+ - README includes the test command.
24
+ - No unrelated files are changed.
25
+
26
+ # Gates to run
27
+
28
+ ```bash
29
+ npm test
30
+ ```
31
+
32
+ # Output required
33
+
34
+ Return a short summary, changed files, commands run, and unresolved issues.