yadflow 4.7.0 → 4.8.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/CHANGELOG.md +89 -0
- package/README.md +43 -4
- package/bin/commands.mjs +4 -1
- package/bin/yad.mjs +147 -20
- package/cli/agent-guard.mjs +511 -0
- package/cli/agent-guide.mjs +83 -0
- package/cli/agent-rules.mjs +381 -0
- package/cli/argv-flags.mjs +7 -0
- package/cli/ci-check.mjs +492 -0
- package/cli/docs.mjs +1 -1
- package/cli/doctor.mjs +43 -7
- package/cli/epic-state.mjs +3 -3
- package/cli/errors.mjs +1 -0
- package/cli/guide.mjs +549 -0
- package/cli/hook.mjs +32 -3
- package/cli/lib.mjs +46 -0
- package/cli/lifecycle/defaults/2.json +124 -0
- package/cli/lifecycle/lifecycle.schema.json +5 -2
- package/cli/lifecycle.mjs +16 -3
- package/cli/manifest.mjs +75 -0
- package/cli/marked-block.mjs +48 -0
- package/cli/members.mjs +19 -5
- package/cli/migrate.mjs +17 -19
- package/cli/next.mjs +1 -1
- package/cli/plan.mjs +326 -22
- package/cli/protection.mjs +50 -0
- package/cli/reconcile.mjs +187 -26
- package/cli/report.mjs +62 -14
- package/cli/setup.mjs +244 -25
- package/cli/signing.mjs +377 -0
- package/cli/test-agents-file.mjs +993 -0
- package/cli/test-ci-check.mjs +616 -0
- package/cli/test-guide.mjs +1267 -0
- package/cli/test-node.mjs +129 -0
- package/cli/test-setup-agent.mjs +352 -0
- package/cli/test-signing.mjs +524 -0
- package/cli/toolbox.mjs +1 -1
- package/cli/update-commit.mjs +313 -11
- package/cli/workspace.mjs +37 -12
- package/package.json +6 -4
- package/skills/sdlc/config.yaml +4 -4
- package/skills/sdlc/module-help.csv +1 -0
- package/skills/yad-change/SKILL.md +3 -2
- package/skills/yad-checks/SKILL.md +29 -9
- package/skills/yad-checks/references/check-gates.md +9 -4
- package/skills/yad-checks/templates/checks/package-manager.sh +1 -1
- package/skills/yad-checks/templates/github/yad-checks.yml +1 -1
- package/skills/yad-checks/templates/gitlab/.gitlab-ci.yml +1 -1
- package/skills/yad-checks/templates/gitlab/yad-checks.gitlab-ci.yml +1 -1
- package/skills/yad-checks/templates/gitlab/yad-product-checks.gitlab-ci.yml +1 -1
- package/skills/yad-checks/templates/gitlab/yad-update-guard.gitlab-ci.yml +1 -1
- package/skills/yad-checks/templates/gitlab/yad-verified-commits.gitlab-ci.yml +1 -1
- package/skills/yad-checks/templates/hooks/agent-guard.mjs +116 -0
- package/skills/yad-commit/SKILL.md +4 -3
- package/skills/yad-connect-repos/SKILL.md +5 -3
- package/skills/yad-connect-repos/references/code-context.md +2 -1
- package/skills/yad-connect-repos/references/repos-registry.md +2 -1
- package/skills/yad-docs-overview/references/pipeline-model.md +2 -2
- package/skills/yad-engineer-review/SKILL.md +12 -7
- package/skills/yad-engineer-review/references/ship-and-record.md +7 -4
- package/skills/yad-epic/SKILL.md +2 -1
- package/skills/yad-epic/references/state-schema.md +1 -1
- package/skills/yad-guide/SKILL.md +192 -0
- package/skills/yad-open-pr/SKILL.md +1 -1
- package/skills/yad-pair-review/SKILL.md +14 -5
- package/skills/yad-product-bridge/SKILL.md +32 -13
- package/skills/yad-product-bridge/references/bridge.md +6 -3
- package/skills/yad-product-bridge/templates/github/yad-gate-sync.yml +2 -2
- package/skills/yad-product-bridge/templates/gitlab/yad-gate-sync.gitlab-ci.yml +1 -1
- package/skills/yad-report/SKILL.md +15 -0
- package/skills/yad-review-companion/SKILL.md +5 -3
- package/skills/yad-review-gate/SKILL.md +13 -9
- package/skills/yad-review-gate/references/gating.md +1 -1
- package/skills/yad-run/SKILL.md +10 -6
- package/skills/yad-run/references/run-loop.md +2 -1
- package/skills/yad-sync-repos/SKILL.md +2 -1
- package/skills/yad-ui/SKILL.md +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,92 @@
|
|
|
1
|
+
# [4.8.0](https://github.com/abdelrahmannasr/yadflow/compare/v4.7.0...v4.8.0) (2026-11-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **agents:** E158 review 1 — the guard reads the line as yad does, PR approvals are the person's ([86b4150](https://github.com/abdelrahmannasr/yadflow/commit/86b4150c70d5080264c04fdba2a6d2e6935b38bb))
|
|
7
|
+
* **agents:** E158 review 10 — skipping the git hooks is the person's; API merges; node and wrapper options ([5c31021](https://github.com/abdelrahmannasr/yadflow/commit/5c3102159266bbca02c1cc544a232a1b723cd519))
|
|
8
|
+
* **agents:** E158 review 11 — API merges only as writes; core.hooksPath in git config; the hook door is the person's ([9e820d8](https://github.com/abdelrahmannasr/yadflow/commit/9e820d8f294bdfb989ee2ce464f0ced5b9a84434))
|
|
9
|
+
* **agents:** E158 review 12 — xargs switches; field= approvals; the pointer block's hook rule; the pre-commit hook's skip is a person's ([815660d](https://github.com/abdelrahmannasr/yadflow/commit/815660d0ecd492b0745456ca38475ae229a70c07))
|
|
10
|
+
* **agents:** E158 review 13 — doctor on an earlier hook text; BSD xargs; the ledger hook's person-only rows ([e8346ac](https://github.com/abdelrahmannasr/yadflow/commit/e8346ac21bc65c00513d49ce1e2d788073305b6b))
|
|
11
|
+
* **agents:** E158 review 14 — short options with =; the shipped guard header; commit --manual is the person's in migrate and ship ([78ea0a8](https://github.com/abdelrahmannasr/yadflow/commit/78ea0a83f416962dd10a6fb8fcaa540d7644619e))
|
|
12
|
+
* **agents:** E158 review 15 — pin the person-only wording in tests; doc nits ([70704a0](https://github.com/abdelrahmannasr/yadflow/commit/70704a0cf183f525a2603504b0d14f4794074299))
|
|
13
|
+
* **agents:** E158 review 2 — the guard reads here-strings, comments and more prefixes; closed annotations; push hand-offs in skill references ([26c00e8](https://github.com/abdelrahmannasr/yadflow/commit/26c00e816f6be3fde654a37fb5cb5881096212b7))
|
|
14
|
+
* **agents:** E158 review 3 — substitutions and package runners in the guard, no block added to an unwired repo ([1a915e5](https://github.com/abdelrahmannasr/yadflow/commit/1a915e55346f77907c60912dc200ae870d4f1a83))
|
|
15
|
+
* **agents:** E158 review 4 — only files the run writes ride update --open-pr; the person's acts in more skills ([3d8ba6f](https://github.com/abdelrahmannasr/yadflow/commit/3d8ba6f5eeb0befc09ae4904af5ace690035117e))
|
|
16
|
+
* **agents:** E158 review 5 — a runner's -c line is judged; the guard and allow list are the Product folder's ([6b6d456](https://github.com/abdelrahmannasr/yadflow/commit/6b6d456ec36f878c0bfc525510b6f4f507786e6b))
|
|
17
|
+
* **agents:** E158 review 6 — one reader for package runners; a real read confirms each GitLab setting ([b28ac7f](https://github.com/abdelrahmannasr/yadflow/commit/b28ac7f3975e94c6ab360bced158762e2e36107b))
|
|
18
|
+
* **agents:** E158 review 7 — npm -w in the guard; approvals confirmed on the PR/MR ([016b699](https://github.com/abdelrahmannasr/yadflow/commit/016b69923ef3251c48b47905b9764b1414b41112))
|
|
19
|
+
* **agents:** E158 review 8 — bun options before run; confirming an approval per mode ([7c22a89](https://github.com/abdelrahmannasr/yadflow/commit/7c22a89cbdfab7d42a52cfc212ab17b2f8274360))
|
|
20
|
+
* **agents:** E158 review 9 — bun options that take a value; the stories review branch ([073c48a](https://github.com/abdelrahmannasr/yadflow/commit/073c48a39c99707602e6106520b8bfdc8c4ab6e7))
|
|
21
|
+
* **agents:** E158b review 1 — never remove entries through a linked tool folder; cases 8 and 10 through yad itself; doc twins ([736992b](https://github.com/abdelrahmannasr/yadflow/commit/736992bf54b202746d388ec2086421734bd634ef))
|
|
22
|
+
* **agents:** E158b review 2 — a linked .cursor too; the code repo block names all four kinds ([569c682](https://github.com/abdelrahmannasr/yadflow/commit/569c68213b748df7a36bf341f017d8e640175cf6))
|
|
23
|
+
* **agents:** E159 review 1 — init's found repos need --connect; team size and AI tools checked before any write; doc twins ([6bba7c2](https://github.com/abdelrahmannasr/yadflow/commit/6bba7c2c2327bdbee29c32e64cf4fbb9b852ff5b))
|
|
24
|
+
* **agents:** E159 review 2 — an --add-repo that is not a git repo is refused before any write ([0a30394](https://github.com/abdelrahmannasr/yadflow/commit/0a3039471ed162ab1802e5ac3a65ded1adf7c90c))
|
|
25
|
+
* **agents:** E160a review 1 — no false ok: an unread account, another account's no-reply address, a GPG key matched by part of an email or unable to sign ([5f6591f](https://github.com/abdelrahmannasr/yadflow/commit/5f6591f27790ae45264e3588906125f9bd94adca))
|
|
26
|
+
* **agents:** E160a review 10 — a pin gpg does not have asks first about a typo; the test uses gpg's real failure ([8195108](https://github.com/abdelrahmannasr/yadflow/commit/8195108cebeefd7ef8fb380d5e546af744bf984b))
|
|
27
|
+
* **agents:** E160a review 11 — a named key gpg does not have asks about a typo first, with or without "!" ([ef9452b](https://github.com/abdelrahmannasr/yadflow/commit/ef9452b5c2ddf50cafe4e3dd7f2fb9c9165dfa23))
|
|
28
|
+
* **agents:** E160a review 12 — an email lookup keeps the usual steps (tested); the GPG steps name the "!" pin ([76fb607](https://github.com/abdelrahmannasr/yadflow/commit/76fb607ee3d9ced3bfc0495eee43bfec79da3690))
|
|
29
|
+
* **agents:** E160a review 2 — a GPG stub cannot sign here; only usable keys count; no login is unknown ([ef4e552](https://github.com/abdelrahmannasr/yadflow/commit/ef4e552e59be4ebe0cba77792bee1b9ccfbd100a))
|
|
30
|
+
* **agents:** E160a review 3 — an offline primary with a signing subkey is ok; only signing keys count; disabled, smartcard and stub keys named; no id is unknown ([019eac9](https://github.com/abdelrahmannasr/yadflow/commit/019eac946cdd7ca5b7b1b56aff933092e1fe1519))
|
|
31
|
+
* **agents:** E160a review 4 — a primary that cannot be used takes its subkeys with it; an orphan subkey is skipped; smartcard only when every signing part is on one ([a191d37](https://github.com/abdelrahmannasr/yadflow/commit/a191d37ef302f5b51c70563d1107021b6cbafbf6))
|
|
32
|
+
* **agents:** E160a review 5 — an expired or revoked copy on the account is a gap; any signing part on a card names the card ([17dbfcf](https://github.com/abdelrahmannasr/yadflow/commit/17dbfcf80ead0efa352da47d2ec9e3aa58586f70))
|
|
33
|
+
* **agents:** E160a review 6 — the part gpg signs with must be on the account and in force; an unreadable expiry is unknown ([3d2a915](https://github.com/abdelrahmannasr/yadflow/commit/3d2a915e30264eb0bfe3255bed7d7861fc8019bf))
|
|
34
|
+
* **agents:** E160a review 7 — a pinned part that cannot sign is a gap; a tie goes to the first subkey; the hint reads every id ([1dbe2da](https://github.com/abdelrahmannasr/yadflow/commit/1dbe2da78601813c0c3469d7ac098c163c0ff202))
|
|
35
|
+
* **agents:** E160a review 8 — the hint reads only the signing key; a fingerprint pin matches a long id; the card follows the part gpg signs with ([1bcc32d](https://github.com/abdelrahmannasr/yadflow/commit/1bcc32d0d458c179edc94fb2852eee759b504483))
|
|
36
|
+
* **agents:** E160a review 9 — tests for a short id two keys share; a pin gpg does not have says so ([ec854d5](https://github.com/abdelrahmannasr/yadflow/commit/ec854d54e1a379617b563ce40983b744432dda99))
|
|
37
|
+
* **agents:** E160b review 1 — GitLab's root pipeline must include yad's jobs; no ok from disagreeing or group-hidden answers; direct push; the gate bot's steps ([02edead](https://github.com/abdelrahmannasr/yadflow/commit/02edead8d58289dcdcf60264872e3b0bdf8d5a57))
|
|
38
|
+
* **agents:** E160b review 10 — flow style anywhere in the include is unknown; the unknown sentences read whole ([8dac984](https://github.com/abdelrahmannasr/yadflow/commit/8dac98493a905e6dfa2f48d27afc0b6420836556))
|
|
39
|
+
* **agents:** E160b review 11 — a list item whose dash stands alone is read from its next line ([91fc195](https://github.com/abdelrahmannasr/yadflow/commit/91fc1953152d24f5b613352554bd034e65877162))
|
|
40
|
+
* **agents:** E160b review 2 — no platform is never a quiet ok; the CI file GitLab reads; a full page or disagreeing rules are unknown ([4401ac0](https://github.com/abdelrahmannasr/yadflow/commit/4401ac0a65e0c01dc4f347586b760f1a4f5957b8))
|
|
41
|
+
* **agents:** E160b review 3 — an unread CI file setting is unknown; an include is a line of its own; a verified Product with no platform; admins on classic protection ([1b8290a](https://github.com/abdelrahmannasr/yadflow/commit/1b8290ad79d3eff7630a0bf571e2db748b5051e7))
|
|
42
|
+
* **agents:** E160b review 4 — only the CI file's top-level include counts; an include with its own rules is unknown ([4ec942f](https://github.com/abdelrahmannasr/yadflow/commit/4ec942f9d51709cc170c6c96dd28eda45304c794))
|
|
43
|
+
* **agents:** E160b review 5 — two top-level include keys are unknown; a list item needs a space after its dash; the fix line keeps the list's indent ([652c103](https://github.com/abdelrahmannasr/yadflow/commit/652c10373d9b4ab4134b0cca54342f1b0b67ebe0))
|
|
44
|
+
* **agents:** E160b review 6 — each fix line is pure YAML and the map form is named; a repo with no platform anywhere is not a files ok ([35afa07](https://github.com/abdelrahmannasr/yadflow/commit/35afa0709d9f85df27ec327825b8982434dbdde9))
|
|
45
|
+
* **agents:** E160b review 7 — an include that is not a list yet keeps its own kind; a plainer no-platform message ([b412f3b](https://github.com/abdelrahmannasr/yadflow/commit/b412f3b7620b656b003672af82bf53c8a0a7dc8d))
|
|
46
|
+
* **agents:** E160b review 8 — an include that is not a list yet moves exactly as written into the first list item ([7aaf84d](https://github.com/abdelrahmannasr/yadflow/commit/7aaf84dd666161b84f4797bc06bbd3a6c3677d89))
|
|
47
|
+
* **agents:** E160b review 9 — an include written on one line in [ ] or { } is unknown, with no rewrite step ([4b74817](https://github.com/abdelrahmannasr/yadflow/commit/4b7481719a0155f1caa1b6dd95ff2ea304e056b7))
|
|
48
|
+
* **agents:** E163 review 1 — ask right before a default-branch push (a request made earlier is not the yes); the acceptance run isolates the agents and checks the disk ([4c3ba9f](https://github.com/abdelrahmannasr/yadflow/commit/4c3ba9f893dac4f0bb574ad13140422799711bc2))
|
|
49
|
+
* **guide:** E157 review 1 — the review hand-off is reached, and a broken ledger is never a new epic ([66d6029](https://github.com/abdelrahmannasr/yadflow/commit/66d6029c3fc735882563ec72fce67f6afc718e29))
|
|
50
|
+
* **guide:** E157 review 1 — the rules' classes match what each command does ([0b026bd](https://github.com/abdelrahmannasr/yadflow/commit/0b026bd10638eed84915086ad5a858fb0361dd74)), closes [#356](https://github.com/abdelrahmannasr/yadflow/issues/356)
|
|
51
|
+
* **guide:** E157 review 2 — re-opened reviews, a skip CI would refuse, and an unknown epic ([f1eb97c](https://github.com/abdelrahmannasr/yadflow/commit/f1eb97c00d43eeffdc28e1ad63040988714b0a87))
|
|
52
|
+
* **guide:** E157 review 3 — the printed skip when CI owns the ledger, and one rule for blocked steps ([b86d485](https://github.com/abdelrahmannasr/yadflow/commit/b86d485cfa25885c55c3f4baf44eb646cfb22291))
|
|
53
|
+
* **guide:** E157 review 4 — commit --manual is the person's, and the fetch caution ([ec91eef](https://github.com/abdelrahmannasr/yadflow/commit/ec91eef7b6b072b2413758e38ca9e13e71544ce7))
|
|
54
|
+
* **guide:** E157 review 5 — a trust verdict is recorded on request, --force is asked, and a bare command takes its default ([3e33d03](https://github.com/abdelrahmannasr/yadflow/commit/3e33d0336dbea9c672ae2c5c9a2d90125888a18d))
|
|
55
|
+
* **guide:** E157 review 6 — --solo/--team on setup switch the mode, and a person's word is recorded on request ([371aacd](https://github.com/abdelrahmannasr/yadflow/commit/371aacdd045c1207b4c2c6103c6e4c31d038bdc2))
|
|
56
|
+
* **guide:** E157 review 7 — setup is the person's until E159, and a push is always asked ([c505f05](https://github.com/abdelrahmannasr/yadflow/commit/c505f053db9db798f9bde2de674bf26079ba4c97))
|
|
57
|
+
* **guide:** E157 review 8 — the halt reason from the build-state, and on-request kept under a push ([8bcfa12](https://github.com/abdelrahmannasr/yadflow/commit/8bcfa12b7b94ff13ccd87d34161fa4e431eae716))
|
|
58
|
+
* **guide:** E157 review 9 — reaches() never raises CI's or removed commands, and onRequest is tested ([87b7005](https://github.com/abdelrahmannasr/yadflow/commit/87b7005f6592b7359618ce65faef4e41fdc1a1e8))
|
|
59
|
+
* **lifecycle:** E157 review 1 — descriptions true with no platform and in plain words ([ba94afc](https://github.com/abdelrahmannasr/yadflow/commit/ba94afc1c5dfeab842098bc92addb2d2638240ce))
|
|
60
|
+
* **node:** E161 review 1 — the running-Node test fits the 18/20 legs; a failed move removes only what it made; folder modes kept; docs on Node 22 as the deploy ([b123c12](https://github.com/abdelrahmannasr/yadflow/commit/b123c12711450bbe1a5fab916464255ba731bdd3))
|
|
61
|
+
* **node:** E161 review 2 — a read-only folder is filled before its mode is set, and every removal in the move opens folders first ([7897118](https://github.com/abdelrahmannasr/yadflow/commit/789711890723afcb08d67a0327bbbedbe391f0ee))
|
|
62
|
+
* **release:** the release check passes on Node 24 — coverage prints TAP, and a missing summary never stops the check ([37980aa](https://github.com/abdelrahmannasr/yadflow/commit/37980aa10b33e1d30f2aeaf8945a201c48eaa07e))
|
|
63
|
+
* **update:** E157 update review 1 — every repo checked before it is written, and upkeep never loops ([1f3bd17](https://github.com/abdelrahmannasr/yadflow/commit/1f3bd17461e037f5ae10959145c022a41b40eb58))
|
|
64
|
+
* **update:** E157 update review 11 — the hook script and the entry that runs it land together ([ffaeec2](https://github.com/abdelrahmannasr/yadflow/commit/ffaeec2fa7cacf982bd8561f2464508c96dd7448))
|
|
65
|
+
* **update:** E157 update review 12 — no settings row when yad's entries are already committed ([87a504a](https://github.com/abdelrahmannasr/yadflow/commit/87a504adb57214ae8e341816958cc16b068a59ff))
|
|
66
|
+
* **update:** E157 update review 2 — all or nothing, and upkeep read per repo ([f555cb4](https://github.com/abdelrahmannasr/yadflow/commit/f555cb447e6f40d537a8359b8df98e8c35976846))
|
|
67
|
+
* **update:** E157 update review 3 — one list of repos for the run and the guide ([c01f6df](https://github.com/abdelrahmannasr/yadflow/commit/c01f6df28424facff4c3c5e6b3376af962e505ef))
|
|
68
|
+
* **update:** E157 update review 4 — no upkeep for an unwired repo, and no run while any repo would stop it ([86ad9b1](https://github.com/abdelrahmannasr/yadflow/commit/86ad9b1d4dec4284475802622632e0c3f6905de0))
|
|
69
|
+
* **update:** E157 update review 6 — a reason and hint for every held or half-done repo ([a69cbd7](https://github.com/abdelrahmannasr/yadflow/commit/a69cbd77cbcc5ff640aac4777c63096d797a0c6e))
|
|
70
|
+
* **update:** E157 update review 7 — never held forever, never a downgrade, a person's files kept ([92bdacb](https://github.com/abdelrahmannasr/yadflow/commit/92bdacb0036f2897293eda0811cef535ed6db72c))
|
|
71
|
+
* **update:** E157 update review 8 — no part lists, no crash on a reshaped skill, a true hint after a failed push ([7eba6c0](https://github.com/abdelrahmannasr/yadflow/commit/7eba6c084b546433c63bb8f4fed5a8421dce8386))
|
|
72
|
+
* **update:** E157 update review 9 — the kept count names only files back in place ([e95afa8](https://github.com/abdelrahmannasr/yadflow/commit/e95afa8427ade0712de6ab356e9a2307479722a5))
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Features
|
|
76
|
+
|
|
77
|
+
* **agents:** E158 — the agent guard, pre-approved reads, and reports from the agent ([204b327](https://github.com/abdelrahmannasr/yadflow/commit/204b327331b7531a044f615784a745b65698a70d))
|
|
78
|
+
* **agents:** E158 — the yadflow rules block in AGENTS.md and CLAUDE.md ([0ab3563](https://github.com/abdelrahmannasr/yadflow/commit/0ab356372e4569305d74a46fa927791c83b381a7))
|
|
79
|
+
* **agents:** E158b — the agent guard and the read-only allow list in every connected code repo ([777d9c9](https://github.com/abdelrahmannasr/yadflow/commit/777d9c9071ff8bf92b7142cacaa08fba574820c3))
|
|
80
|
+
* **agents:** E159 — every setup question has a flag; a --json run missing one is refused before any write, with the questions ([9d42e0e](https://github.com/abdelrahmannasr/yadflow/commit/9d42e0e64da014c04da4c26b3bcc88adf5500d65))
|
|
81
|
+
* **agents:** E160a — yad signing check reads whether commits will be signed and Verified; the doctor line; closes [#432](https://github.com/abdelrahmannasr/yadflow/issues/432) ([eaf8647](https://github.com/abdelrahmannasr/yadflow/commit/eaf8647830d80f5cd640e6eec08f9b0a6205fd6b))
|
|
82
|
+
* **agents:** E160b — yad ci check reads whether yad's checks will hold a merge, for the Product and each repo ([50b44b1](https://github.com/abdelrahmannasr/yadflow/commit/50b44b1b473c7b612140a7eff1bab9332d6974d1))
|
|
83
|
+
* **guide:** E157 upkeep — the guide puts the update first when the install is behind ([68ada64](https://github.com/abdelrahmannasr/yadflow/commit/68ada6475ecc91410bf830947fb5a86384cd4e7d))
|
|
84
|
+
* **guide:** E157 yad guide — the step brief an AI agent reads before each step ([86bfff4](https://github.com/abdelrahmannasr/yadflow/commit/86bfff42083e393146596093f6cdc04a2b54b35f))
|
|
85
|
+
* **lifecycle:** E157 default 2 — what each step is for and who does it ([ad4f301](https://github.com/abdelrahmannasr/yadflow/commit/ad4f301702107e9a6b98911e12bf6dcafb325769))
|
|
86
|
+
* **node:** E161 — Node 22 is the supported line; 18 and 20 warn, and leave in yadflow 5 ([6bedc41](https://github.com/abdelrahmannasr/yadflow/commit/6bedc4112e0a1f191e2271aeef2600ebe0af7463))
|
|
87
|
+
* **skills:** E158 — the yad-guide skill ([144d963](https://github.com/abdelrahmannasr/yadflow/commit/144d9635477503b8393bc7ae2daba1392255a256))
|
|
88
|
+
* **update:** E157 yad update --open-pr — the update on its own branch, with a PR/MR per repo ([db4d8eb](https://github.com/abdelrahmannasr/yadflow/commit/db4d8eb4bbbba9ef6245bd697e073179331174d8))
|
|
89
|
+
|
|
1
90
|
# [4.7.0](https://github.com/abdelrahmannasr/yadflow/compare/v4.6.0...v4.7.0) (2026-10-27)
|
|
2
91
|
|
|
3
92
|
|
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ where it matters.
|
|
|
17
17
|
|
|
18
18
|
- **The `yad` command-line tool.** It is written in Node and has no dependencies. It sets up a
|
|
19
19
|
project, tells you the next action, runs reviews, and reads the project history.
|
|
20
|
-
- **
|
|
20
|
+
- **39 workflow skills.** A skill is a set of instructions that your AI assistant loads for one task,
|
|
21
21
|
such as "write the architecture". The skills run in Claude Code, Codex CLI, Cursor, Gemini CLI,
|
|
22
22
|
GitHub Copilot, Zencoder and opencode.
|
|
23
23
|
- **Plain files in git.** Every plan, decision, approval and link lives as a readable file in a
|
|
@@ -86,7 +86,8 @@ It is large, so open it full size.
|
|
|
86
86
|
|
|
87
87
|
**You need:**
|
|
88
88
|
|
|
89
|
-
- Node.js
|
|
89
|
+
- Node.js 22 or newer. Node 18 and 20 still run yadflow 4, with a warning: they are end of life and get
|
|
90
|
+
no security fixes, so yadflow 5 will need Node 22.
|
|
90
91
|
- git
|
|
91
92
|
- an AI assistant from the list above
|
|
92
93
|
|
|
@@ -138,6 +139,42 @@ stops. `yad next` then says the epic review is waiting. How the review passes de
|
|
|
138
139
|
In solo mode no approval is needed. Merging your own pull request (then the same `yad gate sync`,
|
|
139
140
|
unless CI runs it), or `yad gate advance` with no platform, is the human decision. After that, `yad next` names the next step.
|
|
140
141
|
|
|
142
|
+
**Or let your AI agent drive.** Open the folder in Claude Code or Codex and type:
|
|
143
|
+
|
|
144
|
+
```text
|
|
145
|
+
Run yadflow here: run `npx -y yadflow@4 guide --json` and follow the yad-guide rules.
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The rules call the command `yad`. Install it once (`npm install -g yadflow`) so `yad …` works; without it
|
|
149
|
+
the agent runs `npx yadflow …`, which Claude Code asks you to allow each time.
|
|
150
|
+
|
|
151
|
+
In a folder with no Product yet, the agent asks you the setup questions in the chat: solo or team, new
|
|
152
|
+
or existing code, where the Product lives, which repos to connect, and the others. You can tell it to
|
|
153
|
+
take the defaults. It then runs `new`, `init` or `setup` with your answers. If it misses one, yad refuses
|
|
154
|
+
before writing anything and lists the questions still open. When you join a team, the agent runs
|
|
155
|
+
`yad join`; if you are not logged in to GitHub or GitLab, it gives you the login command to run yourself.
|
|
156
|
+
|
|
157
|
+
The agent reads `yad guide` before each step. It tells you what the step is for, whether you can skip
|
|
158
|
+
it, and who does it. Then it does its own part. The parts that are yours (approvals and merges, logins,
|
|
159
|
+
secrets, signing keys, repository settings) it hands to you with the exact command or steps, and it
|
|
160
|
+
checks they were done before it goes on. Setup writes the rules into `AGENTS.md` — the file AI coding
|
|
161
|
+
agents read at the start of a session — and into a `CLAUDE.md` that loads it, so every new session
|
|
162
|
+
starts with them.
|
|
163
|
+
|
|
164
|
+
In Claude Code and Cursor, in a session opened at the Product folder or at any connected code repo, a
|
|
165
|
+
hook also stops the agent. A
|
|
166
|
+
hook is a small script the agent's tool runs before each shell command. It refuses four kinds of
|
|
167
|
+
command when the agent runs them:
|
|
168
|
+
|
|
169
|
+
- a yad command only you may run (a gate approve, comment, advance or reopen, or `commit --manual`,
|
|
170
|
+
a commit past the local ledger check, which CI still checks);
|
|
171
|
+
- approving or merging a pull request (GitHub) or merge request (GitLab), a PR/MR, with `gh` or `glab`;
|
|
172
|
+
- skipping the git hooks (`git commit --no-verify`), which would pass the local ledger check;
|
|
173
|
+
- a force push, which overwrites commits already on the server.
|
|
174
|
+
|
|
175
|
+
The hook reads only the command line, so it catches mistakes, not tricks. In Codex, which has no hooks,
|
|
176
|
+
only the rules apply.
|
|
177
|
+
|
|
141
178
|
**Other ways in:**
|
|
142
179
|
|
|
143
180
|
| You have | Run | Then |
|
|
@@ -233,7 +270,8 @@ The record is worth trusting because people approve what goes into it.
|
|
|
233
270
|
- **Checks on every change.** Each change must name its task (spec-link). A contract change must be
|
|
234
271
|
declared and locked again (contract-check). Commits must carry a signature that GitHub or GitLab
|
|
235
272
|
marks as verified (verified-commits; it is skipped, with a warning, when there is no platform).
|
|
236
|
-
To make these checks block a merge, see [branch protection](docs/branch-protection.md)
|
|
273
|
+
To make these checks block a merge, see [branch protection](docs/branch-protection.md); `yad ci check`
|
|
274
|
+
reads whether they do. Every
|
|
237
275
|
check's rules, exemptions and failure messages are listed in [CI gates](docs/GATES.md).
|
|
238
276
|
- **Pair review.** The `yad-pair-review` skill walks you through a change one risky part at a time.
|
|
239
277
|
It asks you questions and keeps a private log of how your reviewing improves. It never blocks a
|
|
@@ -257,6 +295,7 @@ The record is worth trusting because people approve what goes into it.
|
|
|
257
295
|
- the Shape and Build steps with review gates
|
|
258
296
|
- linked changes and `yad thread`
|
|
259
297
|
- `yad history`, `yad next` and `yad usage`
|
|
298
|
+
- `yad guide`, the step brief an AI coding agent reads before each step — what the step is for, whether it can be skipped, who does it, the skills that fit, what the agent runs, and what only the person can do
|
|
260
299
|
- `yad status --brief`, where the work stands in about 20 lines — this checkout's task, each open epic's next action, your open PRs/MRs and what is owed — for picking up after a break or an AI context reset
|
|
261
300
|
- `yad standup`, a daily status for each team member — what they did since the last working day, what they are on now, and what is waiting — rebuilt live from git, the ledgers and the platform, facts only
|
|
262
301
|
- `yad detect`, which lists the skills, agents, MCP servers and plugins installed for each AI agent
|
|
@@ -284,7 +323,7 @@ The record is worth trusting because people approve what goes into it.
|
|
|
284
323
|
- [working together: capture, claims, owners, fold](docs/CLI.md#working-together-capture-claims-owners-and-fold)
|
|
285
324
|
- [troubleshooting and error codes](docs/CLI.md#troubleshooting-yad-doctor--error-codes)
|
|
286
325
|
- [every CI gate: rules, exemptions and failures](docs/GATES.md)
|
|
287
|
-
- [all
|
|
326
|
+
- [all 39 skills](docs/SKILLS.md)
|
|
288
327
|
- [the by-hand walkthrough](docs/WALKTHROUGH.md)
|
|
289
328
|
- **Upgrade:** [staying up to date](docs/CLI.md#staying-up-to-date) ·
|
|
290
329
|
[upgrading to 4.0](docs/migrations/upgrading-to-4.md) ·
|
package/bin/commands.mjs
CHANGED
|
@@ -19,6 +19,7 @@ export { gateApprove, gateComment, gateAdvance } from '../cli/gate-local.mjs';
|
|
|
19
19
|
export { isValidEpicId, productDriftError, seedableProfiles } from '../cli/epic-state.mjs';
|
|
20
20
|
export { runEpicNew, runFoundationNew, runFoundationStatus } from '../cli/epic.mjs';
|
|
21
21
|
export { runStatus } from '../cli/status.mjs';
|
|
22
|
+
export { runGuide } from '../cli/guide.mjs';
|
|
22
23
|
export { runSkillBind, runSkillList, runSkillRecommend, runSkillUnbind } from '../cli/skill.mjs';
|
|
23
24
|
export { runCommit } from '../cli/commit.mjs';
|
|
24
25
|
export { runOpenPr } from '../cli/openpr.mjs';
|
|
@@ -44,6 +45,8 @@ export { runDocs } from '../cli/docs.mjs';
|
|
|
44
45
|
export { runDetect } from '../cli/detect.mjs';
|
|
45
46
|
export { runToolboxAdd, runToolboxCheck, runToolboxList, runToolboxRemove } from '../cli/toolbox.mjs';
|
|
46
47
|
export { runDoctor } from '../cli/doctor.mjs';
|
|
48
|
+
export { runSigningCheck } from '../cli/signing.mjs';
|
|
49
|
+
export { runCiCheck } from '../cli/ci-check.mjs';
|
|
47
50
|
export { runMigrate, warnIfProjectAhead } from '../cli/migrate.mjs';
|
|
48
51
|
export { runNext } from '../cli/next.mjs';
|
|
49
52
|
export { runSkip, runDefer, runUnblock, runLaneSkip } from '../cli/skip.mjs';
|
|
@@ -51,6 +54,6 @@ export { runDial, runKill } from '../cli/dial.mjs';
|
|
|
51
54
|
export { runMode } from '../cli/mode.mjs';
|
|
52
55
|
export { syncStatuses } from '../cli/artifact-status.mjs';
|
|
53
56
|
export { runThread, runReconcile } from '../cli/thread.mjs';
|
|
54
|
-
export { runReport } from '../cli/report.mjs';
|
|
57
|
+
export { runReport, REPORT_KINDS } from '../cli/report.mjs';
|
|
55
58
|
export { runUsage } from '../cli/usage.mjs';
|
|
56
59
|
export { maybeNotifyUpdate } from '../cli/update-notice.mjs';
|
package/bin/yad.mjs
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { VERSION } from '../cli/manifest.mjs';
|
|
6
|
-
import { c, log, warn, closePrompts, askYesNo, refuse, beginJSON, inJSON, emitJSON, jsonEmitted, jsonFailure, stripAnsi, isPlainObject, ENVELOPE_KEYS } from '../cli/lib.mjs';
|
|
7
|
-
import { runLedgerGuardHook, runStagedLedgerGuard } from '../cli/hook.mjs';
|
|
6
|
+
import { c, log, warn, closePrompts, askYesNo, refuse, beginJSON, inJSON, emitJSON, jsonEmitted, jsonFailure, stripAnsi, isPlainObject, forTerminal, nodeSupport, nodeEndOfLife, ENVELOPE_KEYS } from '../cli/lib.mjs';
|
|
7
|
+
import { runLedgerGuardHook, runStagedLedgerGuard, runAgentGuardHook } from '../cli/hook.mjs';
|
|
8
|
+
import { VALUE_FLAGS, LIST_FLAGS } from '../cli/argv-flags.mjs';
|
|
8
9
|
|
|
9
10
|
const helpText = (profiles) => `${c.bold('yad')} — setup, review-gate & build helpers for the SDLC Workflow module ${c.dim('v' + VERSION)}
|
|
10
11
|
|
|
@@ -22,13 +23,22 @@ ${c.bold('Start a workspace')} ${c.dim('(the folder holding product/ and the cod
|
|
|
22
23
|
every repo it registers; a failed repo clone is reported, never fatal. Then
|
|
23
24
|
only per-machine steps: git-ignored skill copies + the git pre-commit hook.
|
|
24
25
|
Last, \`yad member add\` (below): your member file, on a branch with its own
|
|
25
|
-
PR/MR — the only shared change join makes. A problem there never fails join
|
|
26
|
+
PR/MR — the only shared change join makes. A problem there never fails join.
|
|
27
|
+
--ide-targets <a,b> picks the AI tools; under --json it is required (asked
|
|
28
|
+
before the clone), and a missing platform login comes back as your step (E159)
|
|
26
29
|
|
|
27
30
|
${c.bold('Setup & maintenance')}
|
|
28
31
|
yad setup Guided first-run setup (profile interview, install, connect & wire repos,
|
|
29
32
|
then the tools this project uses that are missing — offered, never installed)
|
|
30
33
|
profile flags: --solo | --team <n>, --greenfield | --brownfield,
|
|
31
|
-
--monorepo | --separate, --tools (configure design/testing/learning now)
|
|
34
|
+
--monorepo | --separate, --tools | --no-tools (configure design/testing/learning now)
|
|
35
|
+
every other answer: --ide-targets <a,b>, --platform <github|gitlab|none>,
|
|
36
|
+
--default-branch <name>, --design|--testing|--learning <tool|none>
|
|
37
|
+
(--design-url, --testing-url), --reconfigure | --no-reconfigure,
|
|
38
|
+
--git-init | --no-git-init, --connect <all|none|names>,
|
|
39
|
+
--add-repo <name>=<path>[,<platform>[,<branch>]] (repeat it),
|
|
40
|
+
--coderabbit <all|none|names>. Under --json a missing answer is refused before
|
|
41
|
+
anything is written, with the questions to ask (E159)
|
|
32
42
|
yad check Report what is missing / drifted / modified / stale / legacy (read-only)
|
|
33
43
|
yad check --fix Reconcile: fill what is missing, update what changed
|
|
34
44
|
yad update Apply drift only (alias for: check --fix --scope=changed);
|
|
@@ -43,8 +53,23 @@ ${c.bold('Setup & maintenance')}
|
|
|
43
53
|
commit; no PR — the push-on-main yad-update-guard runs verified-commits
|
|
44
54
|
+ commit-message). Announce the team & pause merges first. Also works as
|
|
45
55
|
'yad check --fix --push'; --allow-branch permits a non-default branch
|
|
56
|
+
yad update --open-pr Instead of --push: commit each repo's changes on its own branch
|
|
57
|
+
(chore/yad-update-v<version>), push it, and open a PR/MR into the
|
|
58
|
+
default branch, so the checks run and a person merges it. Works on a
|
|
59
|
+
protected branch. Each repo must be on its default branch; it is left
|
|
60
|
+
there. Also 'yad check --fix --open-pr'
|
|
46
61
|
yad doctor [--json] Environment + state health: tools/auth, config files,
|
|
47
62
|
repo paths, epic ledgers (exit 1 on any failure)
|
|
63
|
+
yad signing check [--json]
|
|
64
|
+
Will your commits be signed and marked Verified? Reads this folder's git
|
|
65
|
+
config, the key it names, and your account on the Product's platform (the
|
|
66
|
+
key listed for signing, a verified email). Read-only; exit 1 on a gap (E160)
|
|
67
|
+
yad ci check [--repo <name> | --all] [--json] [--dir <Product>]
|
|
68
|
+
Will yad's checks hold a merge? For the Product and each registered repo
|
|
69
|
+
(from inside one repo: that repo; --repo picks one code repo, --all every
|
|
70
|
+
one — not both): yad's CI files, the default branch's protection, the
|
|
71
|
+
checks required before a merge, force pushes, deletion. Read-only; each
|
|
72
|
+
gap names the settings page or the yad command; exit 1 on a gap (E160)
|
|
48
73
|
yad migrate [--apply] [--keep product|hub] [--json] Move this project's state files onto the shape
|
|
49
74
|
this yadflow expects. Prints what WOULD change and writes
|
|
50
75
|
nothing until --apply, which copies each file it rewrites to
|
|
@@ -57,6 +82,10 @@ ${c.bold('Setup & maintenance')}
|
|
|
57
82
|
yad report [-m <text>] File a bug in the yadflow repo with auto-scrubbed diagnostics
|
|
58
83
|
(no paths/hosts/repo names/logins/flag values). Also offered
|
|
59
84
|
automatically after an unexpected failure. YAD_NO_REPORT=1 disables.
|
|
85
|
+
--kind enhancement files an idea instead of a bug. --json previews
|
|
86
|
+
(never posts) and gives a \`confirm\` value; --post --confirm <value>
|
|
87
|
+
then posts that exact text with no prompt — for an AI agent, after
|
|
88
|
+
the person said yes to the preview.
|
|
60
89
|
yad hook ledger-guard ${c.dim('harness-invoked, not typed')} — refuse an agent's edit to the
|
|
61
90
|
CI-owned gate ledger in verified mode and name the command that owns
|
|
62
91
|
the transition. Reads a tool-call payload on stdin (or --path <p>);
|
|
@@ -67,7 +96,15 @@ ${c.bold('Setup & maintenance')}
|
|
|
67
96
|
setup / check --fix. With --staged it judges the files a commit is
|
|
68
97
|
about to record instead — the git pre-commit hook check --fix
|
|
69
98
|
installs in this clone refuses a person's hand commit to the ledger.
|
|
70
|
-
|
|
99
|
+
yad hook agent-guard ${c.dim('harness-invoked, not typed')} — before an agent's shell command:
|
|
100
|
+
refuse a yad command only the person runs (gate approve, comment,
|
|
101
|
+
advance, reopen; commit --manual), a PR/MR approval or merge (gh,
|
|
102
|
+
glab, their api), skipping the git hooks (--no-verify or -n,
|
|
103
|
+
YAD_HOOK_DISABLE, core.hooksPath), or a force push, and say
|
|
104
|
+
what to do instead. Reads the shell payload on stdin; answers in the
|
|
105
|
+
protocol the payload names (Cursor: JSON; Claude Code: exit 2).
|
|
106
|
+
A speed bump, not proof. Wired on every Product by setup / check --fix.
|
|
107
|
+
A person's YAD_HOOK_DISABLE=1 skips it.
|
|
71
108
|
|
|
72
109
|
${c.bold('Parallel agents')} ${c.dim('(one git worktree per epic — #115)')}
|
|
73
110
|
yad worktree add <epic> [--repo <name>|--all] [--dry-run]
|
|
@@ -85,7 +122,8 @@ ${c.bold('Parallel agents')} ${c.dim('(one git worktree per epic — #115)')}
|
|
|
85
122
|
|
|
86
123
|
${c.bold('Team members')} ${c.dim('(identity only — no roles, no reviewers, no allowlist)')}
|
|
87
124
|
yad member add [--no-push] Prove who you are and write .sdlc/members/<platform>-<login>.json:
|
|
88
|
-
your account on the Product's platform (logs you in if needed
|
|
125
|
+
your account on the Product's platform (logs you in if needed;
|
|
126
|
+
under --json it never does: the login is the person's step),
|
|
89
127
|
your other GitHub/GitLab accounts and git emails that the platform
|
|
90
128
|
says are VERIFIED (stored hashed). One commit per email on
|
|
91
129
|
yad/member/<login>, pushed, with a PR/MR. Never your checkout
|
|
@@ -151,6 +189,12 @@ ${c.bold('Where am I / what next')}
|
|
|
151
189
|
yad next --all Every active epic's next action at once
|
|
152
190
|
yad next [<epic>] --json The same answer as a machine-readable action object (for
|
|
153
191
|
agents/CI) — always every epic, so --all is implied
|
|
192
|
+
yad guide [<epic>] [--json] The brief an AI agent reads before each step (E157): what the
|
|
193
|
+
step is for, mandatory or skippable, who does it, the skills
|
|
194
|
+
that fit, what the agent runs, and what only the person can do
|
|
195
|
+
(with the exact steps and the command that confirms it). With
|
|
196
|
+
no Product yet, the command to start one and the questions it
|
|
197
|
+
asks, each with its flag (E159). Read-only
|
|
154
198
|
yad status [--brief] [--no-fetch] [--json]
|
|
155
199
|
Where the work stands in ~20 lines, for after a context reset:
|
|
156
200
|
this checkout's task and its Build step, each open epic and its
|
|
@@ -442,10 +486,9 @@ ${c.bold('Environment')}
|
|
|
442
486
|
YAD_NO_REPORT=1 Never offer to file a bug report after a failure
|
|
443
487
|
YAD_PLATFORM_LOGIN=0 Name a record's author by git user.name; never ask gh/glab who is logged in`;
|
|
444
488
|
|
|
489
|
+
const REPORT_USAGE = 'usage: yad report [-m <text>] [--kind bug|enhancement] [--json] | yad report -m <text> [--kind …] --post --confirm <value>';
|
|
445
490
|
const STANDUP_USAGE = 'usage: yad standup [--since <YYYY-MM-DD>|<N>h|<N>d] [--tz <zone>] [--member <login>|--me] [--format md|html] [--out <file>] [--json]';
|
|
446
491
|
|
|
447
|
-
const VALUE_FLAGS = new Set(['--dir', '--type', '--message', '--task', '--ai', '--risk', '--repo', '--platform', '--base', '--title', '--scope', '--branch', '--pr', '--epic', '--team', '--body', '--out', '--since', '--until', '--member', '--format', '--reason', '--profile', '--parent', '--inherits', '--to', '--retro-ship', '--merge-commit', '--path', '--ide-targets', '--theme', '--thread', '--by', '--count', '--engagement', '--keep', '--role', '--fallback', '--detect', '--install', '--source', '--tz', '--verdict', '--ran-by', '--note', '--uid', '--run', '--via']);
|
|
448
|
-
const LIST_FLAGS = new Set(['--signal', '--approver']);
|
|
449
492
|
|
|
450
493
|
function parseArgs(argv) {
|
|
451
494
|
const o = { _: [], dir: process.cwd(), fix: false, force: false, scope: 'all' };
|
|
@@ -461,6 +504,8 @@ function parseArgs(argv) {
|
|
|
461
504
|
else if (a === '--no-fetch') o.noFetch = true;
|
|
462
505
|
else if (a === '--no-build') o.noBuild = true;
|
|
463
506
|
else if (a === '--push') o.push = true;
|
|
507
|
+
else if (a === '--open-pr') o.openPr = true;
|
|
508
|
+
else if (a === '--post') o.post = true;
|
|
464
509
|
else if (a === '--allow-branch') o.allowBranch = true;
|
|
465
510
|
else if (a === '--overwrite-local') o.overwriteLocal = true;
|
|
466
511
|
else if (a === '--merged') o.merged = true;
|
|
@@ -489,6 +534,12 @@ function parseArgs(argv) {
|
|
|
489
534
|
else if (a === '--monorepo') o.monorepo = true;
|
|
490
535
|
else if (a === '--separate') o.separate = true;
|
|
491
536
|
else if (a === '--tools') o.tools = true;
|
|
537
|
+
// E159: the yes/no setup answers, both ways, so an agent can pass what the person said.
|
|
538
|
+
else if (a === '--no-tools') o.noTools = true;
|
|
539
|
+
else if (a === '--reconfigure') o.reconfigure = true;
|
|
540
|
+
else if (a === '--no-reconfigure') o.reconfigure = false;
|
|
541
|
+
else if (a === '--git-init') o.gitInit = true;
|
|
542
|
+
else if (a === '--no-git-init') o.gitInit = false;
|
|
492
543
|
else if (a === '--refresh') o.refresh = true;
|
|
493
544
|
else if (a === '--repos') o.repos = true;
|
|
494
545
|
else if (a === '--wire') o.wire = true;
|
|
@@ -533,6 +584,16 @@ function parseArgs(argv) {
|
|
|
533
584
|
return o;
|
|
534
585
|
}
|
|
535
586
|
|
|
587
|
+
// E159: the setup answers beyond the profile flags, as `runSetup` reads them.
|
|
588
|
+
const setupAnswers = (o) => ({
|
|
589
|
+
noTools: o.noTools, reconfigure: o.reconfigure, gitInit: o.gitInit,
|
|
590
|
+
platform: o.platform === undefined ? undefined : String(o.platform).toLowerCase(),
|
|
591
|
+
defaultBranch: o['default-branch'], designUrl: o['design-url'], testingUrl: o['testing-url'],
|
|
592
|
+
// The tool names are read as setup reads a typed answer: in lower case.
|
|
593
|
+
...Object.fromEntries(['design', 'testing', 'learning'].map((k) => [k, o[k] === undefined ? undefined : String(o[k]).toLowerCase()])),
|
|
594
|
+
connect: o.connect, addRepo: o['add-repo'], coderabbit: o.coderabbit,
|
|
595
|
+
});
|
|
596
|
+
|
|
536
597
|
// The command `main` is running, for the error handler (set once the arguments are read).
|
|
537
598
|
let runningCmd = null;
|
|
538
599
|
|
|
@@ -553,8 +614,10 @@ const ACTIONS = {
|
|
|
553
614
|
codeowners: { known: ['check'], default: 'check' },
|
|
554
615
|
docs: { known: ['list', 'build', 'deploy', 'sync'], default: 'list' },
|
|
555
616
|
reconcile: { known: ['check', 'refresh', 'wire'] },
|
|
556
|
-
hook: { known: ['ledger-guard'] },
|
|
617
|
+
hook: { known: ['ledger-guard', 'agent-guard'] },
|
|
557
618
|
toolbox: { known: ['list', 'check', 'add', 'remove'], default: 'list' },
|
|
619
|
+
signing: { known: ['check'], default: 'check' },
|
|
620
|
+
ci: { known: ['check'], default: 'check' },
|
|
558
621
|
member: { known: ['add', 'list', 'remove'], default: 'list' },
|
|
559
622
|
worktree: { known: ['add', 'list', 'remove'], default: 'list' },
|
|
560
623
|
run: { known: ['checks'] },
|
|
@@ -567,10 +630,10 @@ const PRODUCT_CMDS = new Set([
|
|
|
567
630
|
'check', 'update', 'doctor', 'migrate', 'usage', 'sync-status', 'epic', 'foundation', 'skill', 'next',
|
|
568
631
|
'skip', 'unskip', 'defer', 'undefer', 'dial', 'mode', 'kill', 'unkill', 'unblock', 'gate', 'checkpoint',
|
|
569
632
|
'capture', 'claims', 'assign', 'unassign', 'owners', 'fold', 'tidy', 'index', 'history', 'repo',
|
|
570
|
-
'risk-map', 'codeowners', 'docs', 'thread', 'reconcile', 'member', 'standup', 'build', 'worktree',
|
|
633
|
+
'risk-map', 'codeowners', 'docs', 'thread', 'reconcile', 'member', 'standup', 'build', 'worktree', 'ci',
|
|
571
634
|
]);
|
|
572
635
|
// `status` reads the Product but must keep the folder it ran in: "here" is that checkout's task branch (#349).
|
|
573
|
-
const REPO_CMDS = new Set(['commit', 'open-pr', 'ship', 'review', 'run', 'status']);
|
|
636
|
+
const REPO_CMDS = new Set(['commit', 'open-pr', 'ship', 'review', 'run', 'status', 'guide']);
|
|
574
637
|
// The Product commands that WRITE its files without first checking it is one. Run from a code repo they
|
|
575
638
|
// wrote an epic, a dial or the module into it; they refuse instead (E80). The rest either only read, or
|
|
576
639
|
// already refuse a folder that is not a Product.
|
|
@@ -640,7 +703,9 @@ async function main() {
|
|
|
640
703
|
// Its stdout is already a protocol (Claude Code reads the exit code, Cursor a permission object),
|
|
641
704
|
// so it takes no --json (E1).
|
|
642
705
|
if (inJSON()) return refuse('yad hook takes no --json — its output is the protocol the agent reads', 'run it without --json');
|
|
643
|
-
|
|
706
|
+
// E158: the agent guard, before an agent's shell command.
|
|
707
|
+
if (action === 'agent-guard') { runAgentGuardHook({ format: o.format ?? null }); return; }
|
|
708
|
+
if (action !== 'ledger-guard') return refuse(`unknown hook: ${action ?? '(none)'} (ledger-guard, agent-guard)`);
|
|
644
709
|
// `--staged` is the git pre-commit half (E48): the files come from the index, never from stdin.
|
|
645
710
|
if (o.staged) { runStagedLedgerGuard(); return; }
|
|
646
711
|
runLedgerGuardHook({ paths: o.path ? [o.path] : [], format: o.format });
|
|
@@ -679,7 +744,7 @@ async function main() {
|
|
|
679
744
|
// The workspace folder itself, or a repo the Product does not register: no Product here, but the
|
|
680
745
|
// person is one `cd` away from it — say so, rather than let "run yad setup" make a second one.
|
|
681
746
|
if (PRODUCT_CMDS.has(cmd)) warn(`this folder is not in a repo the Product registers — the Product is ${shown(found.elsewhere)}: cd there, or pass --dir ${shown(found.elsewhere)}`);
|
|
682
|
-
else if (cmd === 'status') o.productElsewhere = shown(found.elsewhere);
|
|
747
|
+
else if (cmd === 'status' || cmd === 'guide') o.productElsewhere = shown(found.elsewhere);
|
|
683
748
|
} else if (found?.root && REPO_CMDS.has(cmd)) o.product = found.root;
|
|
684
749
|
else if (found?.root && !dirGiven && found.via !== 'here') {
|
|
685
750
|
o.dir = found.root;
|
|
@@ -691,6 +756,11 @@ async function main() {
|
|
|
691
756
|
const hit = commands.registryEntryFor(found.root, dirGiven ? o.dir : shellCwd());
|
|
692
757
|
if (typeof hit?.meta?.name === 'string') o._[2] = hit.meta.name;
|
|
693
758
|
}
|
|
759
|
+
// `yad ci check` the same way: that repo, unless --repo or --all says otherwise.
|
|
760
|
+
if (cmd === 'ci' && o.repo === undefined && !o.all) {
|
|
761
|
+
const hit = commands.registryEntryFor(found.root, dirGiven ? o.dir : shellCwd());
|
|
762
|
+
if (typeof hit?.meta?.name === 'string') o.repo = hit.meta.name;
|
|
763
|
+
}
|
|
694
764
|
}
|
|
695
765
|
}
|
|
696
766
|
// A command that WRITES the Product never writes into a folder that is not one (a code repo, say).
|
|
@@ -705,6 +775,11 @@ async function main() {
|
|
|
705
775
|
// shape-8.md). Not on `hook` — its stderr is the channel a block reason reaches a model on — and not
|
|
706
776
|
// where the command reports the same thing itself (doctor, migrate) or runs before a project exists.
|
|
707
777
|
if (!['hook', 'doctor', 'migrate', 'setup', 'report', 'detect', 'toolbox', 'new', 'init', 'join'].includes(cmd)) commands.warnIfProjectAhead(o.dir || process.cwd());
|
|
778
|
+
// E161: an end-of-life Node, once per run, on stderr (so --json stays clean). `hook` has returned above
|
|
779
|
+
// (its stderr is the channel a block reason reaches a model on); `doctor` says it in its own node row.
|
|
780
|
+
// YAD_TEST_NODE_VERSION stands in for the running version in tests only.
|
|
781
|
+
const nodeNow = process.env.YAD_TEST_NODE_VERSION || process.versions.node;
|
|
782
|
+
if (!['hook', 'doctor'].includes(cmd) && nodeSupport(nodeNow) === 'end-of-life') process.stderr.write(`${c.yellow(`! ${nodeEndOfLife(nodeNow)}`)}\n`);
|
|
708
783
|
// E122: the Product's settings (or an epic's PR ledger) under two names that say different things.
|
|
709
784
|
// Every command refuses rather than pick one — whichever it picked, somebody's edit would be silently
|
|
710
785
|
// ignored. Not `doctor` (it reports the drift), `migrate` (it ends it) or `report` (it files a bug
|
|
@@ -729,6 +804,7 @@ async function main() {
|
|
|
729
804
|
today, force: o.force,
|
|
730
805
|
solo: o.solo, team: o.team, greenfield: o.greenfield, brownfield: o.brownfield,
|
|
731
806
|
monorepo: o.monorepo, separate: o.separate, tools: o.tools,
|
|
807
|
+
...setupAnswers(o),
|
|
732
808
|
// The agent directories to install into, as a pre-answer for CI/scripts exactly like `--solo`
|
|
733
809
|
// above (E11). Until this flag existed, `ideTargets` was reachable only programmatically: a
|
|
734
810
|
// non-interactive run took `ask`'s default and had NO way to choose. That was survivable while
|
|
@@ -749,20 +825,25 @@ async function main() {
|
|
|
749
825
|
today, force: o.force,
|
|
750
826
|
solo: o.solo, team: o.team, greenfield: o.greenfield, brownfield: o.brownfield,
|
|
751
827
|
monorepo: o.monorepo, separate: o.separate, tools: o.tools,
|
|
828
|
+
...setupAnswers(o),
|
|
752
829
|
ideTargets: o['ide-targets'] === undefined ? undefined : String(o['ide-targets']).split(',').map((t) => t.trim()).filter(Boolean),
|
|
753
830
|
};
|
|
754
831
|
if (cmd === 'new') result = await commands.runNew(o.dir, o._[1], setupFlags);
|
|
755
832
|
else if (cmd === 'init') result = await commands.runInit(o.dir, { ...setupFlags, path: o.path });
|
|
756
|
-
else result = await commands.runJoin(o.dir, o._[1], o._[2], { ideTargets: setupFlags.ideTargets });
|
|
833
|
+
else result = await commands.runJoin(o.dir, o._[1], o._[2], { ideTargets: setupFlags.ideTargets, noPush: !!o.noPush });
|
|
757
834
|
break;
|
|
758
835
|
}
|
|
759
836
|
case 'check':
|
|
760
837
|
if (noProduct()) break;
|
|
761
|
-
|
|
838
|
+
if (o.push && o.openPr) { refuse('--push and --open-pr publish the update two different ways — pick one', 'use --open-pr for a branch and a PR/MR per repo, or --push to push straight to each default branch'); break; }
|
|
839
|
+
if (o.openPr && o.allowBranch) { refuse('--allow-branch does not apply to --open-pr: the update branch is cut from each repo\'s default branch', 'switch each repo to its default branch, then run it again'); break; }
|
|
840
|
+
result = await commands.reconcile(o.dir, { fix: o.fix, scope: o.scope, force: o.force, push: o.push, openPr: o.openPr, allowBranch: o.allowBranch, overwriteLocal: o.overwriteLocal, today, toolbox: toolboxAt });
|
|
762
841
|
break;
|
|
763
842
|
case 'update':
|
|
764
843
|
if (noProduct()) break;
|
|
765
|
-
|
|
844
|
+
if (o.push && o.openPr) { refuse('--push and --open-pr publish the update two different ways — pick one', 'use --open-pr for a branch and a PR/MR per repo, or --push to push straight to each default branch'); break; }
|
|
845
|
+
if (o.openPr && o.allowBranch) { refuse('--allow-branch does not apply to --open-pr: the update branch is cut from each repo\'s default branch', 'switch each repo to its default branch, then run it again'); break; }
|
|
846
|
+
result = await commands.reconcile(o.dir, { fix: true, scope: 'changed', force: o.force, push: o.push, openPr: o.openPr, allowBranch: o.allowBranch, overwriteLocal: o.overwriteLocal, today, toolbox: toolboxAt });
|
|
766
847
|
break;
|
|
767
848
|
case 'doctor':
|
|
768
849
|
result = await commands.runDoctor(o.dir, { json: o.json });
|
|
@@ -770,6 +851,33 @@ async function main() {
|
|
|
770
851
|
case 'migrate':
|
|
771
852
|
result = await commands.runMigrate(o.dir, { apply: o.apply, json: o.json, keep: o.keep ?? null });
|
|
772
853
|
break;
|
|
854
|
+
case 'signing': {
|
|
855
|
+
// E160a. Read-only: the git config in this folder, the key it names, and the account on the Product's
|
|
856
|
+
// platform (found as every Product command finds it, from this folder or a repo the Product registers).
|
|
857
|
+
const [, action = 'check', extra] = o._;
|
|
858
|
+
if (action !== 'check' || extra) { refuse(`unknown signing action: ${[action, extra].filter(Boolean).join(' ')}`, 'usage: yad signing check [--json] [--dir <folder>]'); break; }
|
|
859
|
+
const found = commands.findProduct(dirGiven ? o.dir : shellCwd());
|
|
860
|
+
// Why no Product was found is said, as every Product command says it: the account is then not checked.
|
|
861
|
+
if (found?.problem) warn(`${found.problem} — your account is not checked`);
|
|
862
|
+
else if (found?.elsewhere) warn(`this folder is not in a repo the Product registers (the Product is ${path.relative(process.cwd(), found.elsewhere) || '.'}) — your account is not checked; run it from there, or pass --dir`);
|
|
863
|
+
result = commands.runSigningCheck(dirGiven ? o.dir : shellCwd(), { root: found?.problem || found?.elsewhere ? null : found?.root ?? null, json: o.json });
|
|
864
|
+
break;
|
|
865
|
+
}
|
|
866
|
+
case 'ci': {
|
|
867
|
+
// E160b. Read-only: yad's CI files on disk, and the platform's rules on each default branch.
|
|
868
|
+
const [, action = 'check', extra] = o._;
|
|
869
|
+
const usage = 'usage: yad ci check [--repo <name> | --all] [--json] [--dir <folder>]';
|
|
870
|
+
if (action !== 'check' || extra) { refuse(`unknown ci action: ${[action, extra].filter(Boolean).join(' ')}`, usage); break; }
|
|
871
|
+
if (o.repo !== undefined && o.all) { refuse('--repo and --all name different repos: pass one of them', usage); break; }
|
|
872
|
+
if (!commands.hasProduct(o.dir)) { refuse(`no Product here (${o.dir}) — yad ci check reads the repos a Product registers`, 'run it from the Product, from inside a repo it registers, or pass --dir <the Product> (with --repo <name> for one repo)'); break; }
|
|
873
|
+
result = commands.runCiCheck(o.dir, { repo: o.all ? null : o.repo ?? null, json: o.json });
|
|
874
|
+
if (result?.unknownRepo !== undefined) {
|
|
875
|
+
const names = result.names.map(forTerminal);
|
|
876
|
+
refuse(`no repo named ${forTerminal(result.unknownRepo)} is registered`, names.length ? `the registered repos: ${names.join(', ')} (or --all)` : 'this Product registers no code repos');
|
|
877
|
+
result = undefined;
|
|
878
|
+
}
|
|
879
|
+
break;
|
|
880
|
+
}
|
|
773
881
|
case 'toolbox': {
|
|
774
882
|
// E84 + E86. Finding a tool reads the folder yad runs in (a code repo's own skills count); the
|
|
775
883
|
// team's choices are the Product's `.sdlc/toolbox.json`, found the way every Product command finds
|
|
@@ -820,9 +928,16 @@ async function main() {
|
|
|
820
928
|
result = commands.runDetect(o.dir || process.cwd(), { json: o.json });
|
|
821
929
|
break;
|
|
822
930
|
}
|
|
823
|
-
case 'report':
|
|
824
|
-
|
|
931
|
+
case 'report': {
|
|
932
|
+
// E158: an agent previews with --json, shows the person, and on their yes posts with --post --confirm.
|
|
933
|
+
const kind = o.kind ?? 'bug';
|
|
934
|
+
if (!commands.REPORT_KINDS.includes(kind)) { refuse(`yad report --kind takes ${commands.REPORT_KINDS.join(' or ')} (got: ${kind})`, REPORT_USAGE); break; }
|
|
935
|
+
if (o.post && !o.confirm) { refuse('yad report --post needs --confirm <value>: the `confirm` its --json preview gave, after the person said yes to that text', REPORT_USAGE); break; }
|
|
936
|
+
if (o.confirm && !o.post) { refuse('yad report --confirm is for --post', REPORT_USAGE); break; }
|
|
937
|
+
result = await commands.runReport(o.dir, { message: o.message, kind, post: !!o.post, confirm: o.confirm ?? null });
|
|
938
|
+
if (result?.refused) process.exitCode = 1;
|
|
825
939
|
break;
|
|
940
|
+
}
|
|
826
941
|
case 'usage':
|
|
827
942
|
result = commands.runUsage(o.dir, {
|
|
828
943
|
out: o.out, since: o.since, until: o.until, all: o.all, member: o.member,
|
|
@@ -883,6 +998,17 @@ async function main() {
|
|
|
883
998
|
result = await commands.runStatus(root, { cwd: o.dir, json: o.json, fetch: !o.noFetch });
|
|
884
999
|
break;
|
|
885
1000
|
}
|
|
1001
|
+
case 'guide': {
|
|
1002
|
+
// Like `status`, it keeps the folder it ran in ("here" is that checkout). Unlike `status`, no Product
|
|
1003
|
+
// is an answer, not a refusal: it says how to start one (the first start, E157).
|
|
1004
|
+
const [, epic] = o._;
|
|
1005
|
+
if (o._[2] !== undefined) { refuse(`yad guide takes one epic id, not ${o._[2]}`, 'usage: yad guide [<epic>] [--json]'); break; }
|
|
1006
|
+
if (epic !== undefined && !commands.isValidEpicId(epic)) { refuse(`invalid epic id: ${epic} (expected EP-<slug>, [a-z0-9-] only)`, 'usage: yad guide [<epic>] [--json]'); break; }
|
|
1007
|
+
const root = o.product || (commands.hasProduct(o.dir) ? o.dir : null);
|
|
1008
|
+
// A Product one `cd` away is said in the answer too, so an agent never starts a second one (E80).
|
|
1009
|
+
result = await commands.runGuide(root, { epic: epic ?? null, cwd: o.dir, json: o.json, productElsewhere: root ? null : o.productElsewhere ?? null });
|
|
1010
|
+
break;
|
|
1011
|
+
}
|
|
886
1012
|
case 'next': {
|
|
887
1013
|
const [, epic] = o._;
|
|
888
1014
|
// `--check` with no step is a malformed guard call — fail loudly rather than silently print.
|
|
@@ -1027,7 +1153,7 @@ async function main() {
|
|
|
1027
1153
|
case 'ship':
|
|
1028
1154
|
// The ledger override is its own act (E49): recorded in its own commit, never folded into a
|
|
1029
1155
|
// commit-and-open-PR run. Refused, never ignored.
|
|
1030
|
-
if (o.manual || o.reason !== undefined) { refuse('yad ship takes no --manual/--reason:
|
|
1156
|
+
if (o.manual || o.reason !== undefined) { refuse('yad ship takes no --manual/--reason: the person commits with `yad commit --manual --reason "<why>" …` (an AI agent hands it to them, `!` in front in Claude Code), then `yad open-pr`'); break; }
|
|
1031
1157
|
// Opening on the standing approval follows the checks, not the commit (#356): its own command.
|
|
1032
1158
|
if (o.via !== undefined) { refuse('yad ship takes no --via: commit, run the checks, then `yad open-pr --via auto`'); break; }
|
|
1033
1159
|
// A commit body (#357: the Decisions: paragraph) is written by `yad commit`; ship never drops it unseen.
|
|
@@ -1248,7 +1374,8 @@ main()
|
|
|
1248
1374
|
if (inJSON() && !jsonEmitted()) {
|
|
1249
1375
|
if (err?.parsedCmd !== undefined && runningCmd === null) beginJSON(commandName(err.parsedWords ?? []));
|
|
1250
1376
|
const hint = err?.hint || (/expects a value$/.test(String(err?.message)) ? '`yad --help` lists the flags of each command' : null);
|
|
1251
|
-
|
|
1377
|
+
// E159: a setup refused for unanswered questions lists them, so an agent can ask the person.
|
|
1378
|
+
refuse(String(err?.message || err), hint, { code: err?.code && /^YAD-/.test(err.code) ? err.code : null, ...(Array.isArray(err?.questions) ? { questions: err.questions } : {}) });
|
|
1252
1379
|
return;
|
|
1253
1380
|
}
|
|
1254
1381
|
const code = err?.code && /^YAD-/.test(err.code) ? ` [${err.code}]` : '';
|