@workit-dev/opencode 1.1.8 → 1.2.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/skills/workit-implement/SKILL.md +9 -10
- package/dist/plugin.js +102 -2
- package/package.json +2 -2
|
@@ -16,21 +16,20 @@ description: Build a requested change in small verified steps - follow local pat
|
|
|
16
16
|
judged? Cite the plan with `--ref <path>` or record the decision; don't re-judge.
|
|
17
17
|
3. Small steps that each leave the tree green. Behavior change: write the
|
|
18
18
|
acceptance as Given/When/Then and see a test fail first (call the skill tool with `workit-bdd`).
|
|
19
|
-
Mechanical change: the existing checks are enough.
|
|
20
|
-
a
|
|
19
|
+
Mechanical change: the existing checks are enough. A codemod or schematic
|
|
20
|
+
goes one area at a time: run it on one directory, `workit check`, commit
|
|
21
|
+
that directory, then the next; never loop it over all areas. No tautological tests: a test must fail if the behavior breaks, never restate the implementation.
|
|
21
22
|
4. Run the real checks, local-first: the targeted test or check for the file
|
|
22
23
|
you touched while you work, then the full configured set once at the end
|
|
23
|
-
(`workit check test`, plus `lint` and `typecheck` when the repo has them)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
lease waits and names its holder (`workit lock status`). A tool warning is a finding: fix it in this PR in the right layer, or record the false positive with evidence; pre-existing ones get their own PR.
|
|
24
|
+
(`workit check test`, plus `lint` and `typecheck` when the repo has them).
|
|
25
|
+
Heavy work runs under one machine-wide lease: an ad-hoc suite is `workit check --heavy -- <cmd>`, never a hand-made flock; a busy
|
|
26
|
+
lease waits and names its holder (`workit lock status`). A tool warning is a finding: fix it in this PR, or record the false positive with evidence; pre-existing ones get their own PR.
|
|
27
27
|
5. Prove the feature on its real surface with the project's `verify-<app>`
|
|
28
|
-
skill; none yet? Write one (call the skill tool with `workit-verify-app`).
|
|
29
|
-
not that the feature works. The report carries what you observed: a UI
|
|
28
|
+
skill; none yet? Write one (call the skill tool with `workit-verify-app`). The report carries what you observed: a UI
|
|
30
29
|
change a screenshot or console/network check (chrome devtools or
|
|
31
30
|
agent-browser), an API a quoted real response. App not runnable? Say so
|
|
32
31
|
plainly, never claim success.
|
|
33
|
-
6. Commit: `workit git commit -m "<type>: <what>" -- <paths
|
|
32
|
+
6. Commit: `workit git commit -m "<type>: <what>" -- <paths>`; Co-Authored-By goes in with `--trailer "Co-Authored-By: <name> <email>"`. Host note: a Workit worktree (`workit fanout worktree create`) takes `workit git --cwd <worktree> …`; a Claude Code host-isolated one (`.claude/worktrees/agent-<id>`) takes plain git. One file holding two changes: stage one change's hunks with `workit git stage --patch <file>` (a `git diff -- <file>` cut to them), then `workit git commit -m "<msg>" --staged` (exactly the index); a path staged in part commits only its staged hunks (`--whole` takes the file).
|
|
34
33
|
No endpoint named? Stop here and state the next command. Hand delivery to
|
|
35
34
|
ship, which pushes and opens the PR with its body shape (call the skill tool with `workit-ship`), only
|
|
36
35
|
when that was requested, or the request implies delivery and the effective
|
|
@@ -48,7 +47,7 @@ description: Build a requested change in small verified steps - follow local pat
|
|
|
48
47
|
|
|
49
48
|
Independent slices that could run in parallel: fan them out (call the skill tool with `workit-fanout`).
|
|
50
49
|
One `implementer` slice: `workit fanout worktree create <slice>` before spawning,
|
|
51
|
-
then `workit fanout brief <slice>`; no host isolation
|
|
50
|
+
then `workit fanout brief <slice>`; no host isolation.
|
|
52
51
|
|
|
53
52
|
Stay inline by default (workspace `delegation: inline-first`). Hand work off
|
|
54
53
|
only past the thresholds: an explorer after about 3 tool calls or 10k tokens
|
package/dist/plugin.js
CHANGED
|
@@ -25586,7 +25586,7 @@ var shellScript2 = (words) => {
|
|
|
25586
25586
|
return null;
|
|
25587
25587
|
for (let index = 1;index < words.length; index++) {
|
|
25588
25588
|
const word = words[index];
|
|
25589
|
-
if (/^-[a-z]*c
|
|
25589
|
+
if (/^-[a-z]*c[a-z]*$/.test(word))
|
|
25590
25590
|
return words[index + 1] ?? null;
|
|
25591
25591
|
if (/^[-+][oO]$/.test(word))
|
|
25592
25592
|
index++;
|
|
@@ -25617,8 +25617,16 @@ var opaqueWrites = (input, scriptOf = (index) => input[index]) => {
|
|
|
25617
25617
|
const files = operands(args);
|
|
25618
25618
|
const has = (pattern) => args.some((arg) => pattern.test(arg));
|
|
25619
25619
|
const listed = (named) => named.length ? named : ["."];
|
|
25620
|
-
if (name === "unlink" || name === "shred")
|
|
25620
|
+
if (name === "unlink" || name === "shred" || name === "mkfifo")
|
|
25621
25621
|
return listed(files);
|
|
25622
|
+
if (name === "wget")
|
|
25623
|
+
return wgetOutputs(args);
|
|
25624
|
+
if (name === "tar")
|
|
25625
|
+
return tarOutputs(args);
|
|
25626
|
+
if (name === "unzip")
|
|
25627
|
+
return has(/^-[a-zA-Z]*[lptvzZ]/) ? null : listed(args.flatMap((arg, at) => arg.startsWith("-d") ? [arg.slice(2) || args[at + 1] || "."] : []));
|
|
25628
|
+
if (name === "git")
|
|
25629
|
+
return gitOutputs(args);
|
|
25622
25630
|
if (/^(?:chmod|chown|chgrp|chattr)$/.test(name))
|
|
25623
25631
|
return listed(has(/^--reference/) ? files : files.slice(1));
|
|
25624
25632
|
if (name === "rsync") {
|
|
@@ -25738,6 +25746,85 @@ var curlOutputs = (args) => {
|
|
|
25738
25746
|
files.push(...dirs.length ? dirs : ["."]);
|
|
25739
25747
|
return files.length > 0 ? files : null;
|
|
25740
25748
|
};
|
|
25749
|
+
var valueOf = (args, option) => {
|
|
25750
|
+
const at = args.findIndex((arg) => option.test(arg));
|
|
25751
|
+
return at < 0 ? undefined : option.exec(args[at])?.[1] || args[at + 1];
|
|
25752
|
+
};
|
|
25753
|
+
var wgetOutputs = (args) => {
|
|
25754
|
+
const named = valueOf(args, /^(?:-[a-zA-Z]*O|--output-document=?)(.*)$/s);
|
|
25755
|
+
const logs = [/^-[a-zA-Z]*[oa](.*)$/s, /^--(?:output-file|append-output)=?(.*)$/s].flatMap((option) => valueOf(args, option) ?? []);
|
|
25756
|
+
if (named === undefined)
|
|
25757
|
+
return [...logs, valueOf(args, /^(?:-[a-zA-Z]*P|--directory-prefix=?)(.*)$/s) ?? "."];
|
|
25758
|
+
return named === "-" ? logs : [...logs, named];
|
|
25759
|
+
};
|
|
25760
|
+
var tarOutputs = (args) => {
|
|
25761
|
+
const letters = args.filter((arg, at) => at === 0 && !arg.startsWith("-") || /^-[a-zA-Z]+$/.test(arg)).join("").replaceAll("C", "");
|
|
25762
|
+
const long = (pattern) => args.some((arg) => pattern.test(arg));
|
|
25763
|
+
const extract = /x/.test(letters) || long(/^--(?:extract|get)$/);
|
|
25764
|
+
const creates = /[cruA]/.test(letters) || long(/^--(?:create|append|update|concatenate|delete)$/);
|
|
25765
|
+
if (!extract && !creates)
|
|
25766
|
+
return null;
|
|
25767
|
+
const files = [];
|
|
25768
|
+
if (extract) {
|
|
25769
|
+
const dirs = args.flatMap((arg, at) => /^-C|^--directory(?:=|$)/.test(arg) ? [arg.replace(/^-C|^--directory=?/, "") || args[at + 1] || "."] : []);
|
|
25770
|
+
files.push(...dirs.length ? dirs : ["."]);
|
|
25771
|
+
}
|
|
25772
|
+
const old = args[0] !== undefined && !args[0].startsWith("-") && args[0].includes("f");
|
|
25773
|
+
const archive = old ? args[1] : valueOf(args, /^(?:-[a-zA-Z]*f|--file=?)(.*)$/s);
|
|
25774
|
+
if (creates && archive !== undefined && archive !== "-")
|
|
25775
|
+
files.push(archive);
|
|
25776
|
+
return files;
|
|
25777
|
+
};
|
|
25778
|
+
var CONFIG_READ = /^(?:--get(?:-all|-regexp|-urlmatch)?|--list|-l|get|list)$/;
|
|
25779
|
+
var CONFIG_WRITE = /^(?:--(?:unset(?:-all)?|add|replace-all|rename-section|remove-section|edit)|-e|set|unset|rename-section|remove-section|edit)$/;
|
|
25780
|
+
var CONFIG_VALUE = /^(?:--file|-f|--blob|--type|--default|--comment)$/;
|
|
25781
|
+
var configWrites = (rest) => {
|
|
25782
|
+
if (rest.some((arg) => CONFIG_READ.test(arg)))
|
|
25783
|
+
return false;
|
|
25784
|
+
if (rest.some((arg) => CONFIG_WRITE.test(arg)))
|
|
25785
|
+
return true;
|
|
25786
|
+
let named = 0;
|
|
25787
|
+
for (let index = 0;index < rest.length; index++)
|
|
25788
|
+
if (CONFIG_VALUE.test(rest[index]))
|
|
25789
|
+
index++;
|
|
25790
|
+
else if (!rest[index].startsWith("-"))
|
|
25791
|
+
named++;
|
|
25792
|
+
return named > 1;
|
|
25793
|
+
};
|
|
25794
|
+
var GIT_VALUE = /^(?:-[Ccbouj]|--(?:git-dir|work-tree|namespace|config-env|branch|origin|config|depth|reference(?:-if-able)?|template|separate-git-dir|upload-pack|jobs|filter|initial-branch|object-format))$/;
|
|
25795
|
+
var gitOutputs = (args) => {
|
|
25796
|
+
let at = 0;
|
|
25797
|
+
let base;
|
|
25798
|
+
for (;args[at]?.startsWith("-"); at += GIT_VALUE.test(args[at]) ? 2 : 1)
|
|
25799
|
+
if (args[at] === "-C")
|
|
25800
|
+
base = args[at + 1];
|
|
25801
|
+
const [sub = "", ...rest] = args.slice(at);
|
|
25802
|
+
if (rest.some((arg) => arg === "--help" || arg === "-h"))
|
|
25803
|
+
return null;
|
|
25804
|
+
const names = rest.filter((arg, index) => !arg.startsWith("-") && !GIT_VALUE.test(rest[index - 1] ?? ""));
|
|
25805
|
+
const has = (pattern) => rest.some((arg) => pattern.test(arg));
|
|
25806
|
+
const files = [];
|
|
25807
|
+
const output = valueOf(rest, sub === "archive" ? /^(?:-o|--output=?)(.*)$/s : /^--output=?(.*)$/s);
|
|
25808
|
+
if (output !== undefined)
|
|
25809
|
+
files.push(output);
|
|
25810
|
+
if (sub === "init")
|
|
25811
|
+
files.push(names[0] ?? ".");
|
|
25812
|
+
if (sub === "clone")
|
|
25813
|
+
files.push(names[1] ?? names[0]?.replace(/(?:\.git)?[\\/]*$/, "").split(/[\\/:]/).at(-1) ?? ".");
|
|
25814
|
+
if (sub === "format-patch" && !has(/^--stdout$/))
|
|
25815
|
+
files.push(valueOf(rest, /^(?:-o|--output-directory=?)(.*)$/s) ?? ".");
|
|
25816
|
+
if (sub === "bundle" && names[0] === "create" && names[1])
|
|
25817
|
+
files.push(names[1]);
|
|
25818
|
+
if (sub === "config" && configWrites(rest))
|
|
25819
|
+
files.push(has(/^--global$/) ? "~/.gitconfig" : has(/^--system$/) ? "/etc/gitconfig" : valueOf(rest, /^(?:-f|--file=?)(.*)$/s) ?? ".");
|
|
25820
|
+
const branchWrite = has(/^-[a-zA-Z]*[dDfmMcCu]|^--(?:delete|force|move|copy|set-upstream|unset-upstream|edit)/) || names.length > 0 && !has(/^-[a-zA-Z]*[lavr]|^--(?:list|all|remotes|verbose|show|contains|no-contains|merged|no-merged|points-at|format|sort)/);
|
|
25821
|
+
if (sub === "fetch" || sub === "gc" || sub === "branch" && branchWrite)
|
|
25822
|
+
files.push(".");
|
|
25823
|
+
if (base === undefined)
|
|
25824
|
+
return files.length ? files : null;
|
|
25825
|
+
const under = (file) => file === "." ? `${base}/${OPAQUE_TARGET}git` : /^[/~$]|^[A-Za-z]:[\\/]/.test(file) ? file : `${base}/${file}`;
|
|
25826
|
+
return files.length ? files.map(under) : null;
|
|
25827
|
+
};
|
|
25741
25828
|
var pathsIn = (text) => [
|
|
25742
25829
|
...text.matchAll(/(?<![\w.~:/$-])(?:~\/|\/|[A-Za-z]:\/|\.\.(?:\/|$))[^\s'"`$),;:*?<>|\\[\]{}]*/g)
|
|
25743
25830
|
].map((match) => match[0]);
|
|
@@ -27447,6 +27534,19 @@ var MUTATING_REMOTE = new Set([
|
|
|
27447
27534
|
"set-branches",
|
|
27448
27535
|
"prune"
|
|
27449
27536
|
]);
|
|
27537
|
+
var JUDGE_VERBS = {
|
|
27538
|
+
check: true,
|
|
27539
|
+
dir: true,
|
|
27540
|
+
help: true,
|
|
27541
|
+
"test-audit": true,
|
|
27542
|
+
ledger: ["verdict", "finding", "list", "check", "ruling"],
|
|
27543
|
+
pr: ["status"],
|
|
27544
|
+
ci: ["wait", "logs"],
|
|
27545
|
+
fanout: ["status", "brief"],
|
|
27546
|
+
models: ["show"],
|
|
27547
|
+
lock: ["status"]
|
|
27548
|
+
};
|
|
27549
|
+
var JUDGE_JOB = Object.entries(JUDGE_VERBS).map(([verb, subs]) => `workit ${verb}${subs === true ? "" : ` ${subs.join("|")}`}`).join(", ");
|
|
27450
27550
|
|
|
27451
27551
|
// packages/workit-core/src/hooks/steering.ts
|
|
27452
27552
|
var ROLES = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workit-dev/opencode",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit OpenCode plugin — native tools, adaptive policy, and sixteen method skills",
|
|
6
6
|
"keywords": [
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@opencode/plugin": "2.0.18",
|
|
44
|
-
"@workit-dev/core": "^1.1
|
|
44
|
+
"@workit-dev/core": "^1.2.1"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=24"
|