@iceinvein/agent-skills 0.1.40 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/README.md +18 -2
  2. package/dist/cli/index.js +115 -34
  3. package/package.json +1 -1
  4. package/skills/index.json +14 -2
  5. package/skills/magpie/SKILL.md +118 -40
  6. package/skills/magpie/bin/magpie.ts +43 -0
  7. package/skills/magpie/fixtures/fake-gh-nodiff.sh +38 -0
  8. package/skills/magpie/package.json +1 -1
  9. package/skills/magpie/references/peer-review.md +7 -2
  10. package/skills/magpie/references/specialists.md +38 -7
  11. package/skills/magpie/scripts/__tests__/cli.test.ts +101 -1
  12. package/skills/magpie/scripts/__tests__/dedupe-cmd.test.ts +187 -0
  13. package/skills/magpie/scripts/__tests__/diff-chunks.test.ts +51 -0
  14. package/skills/magpie/scripts/__tests__/filter-diff-preservation.test.ts +54 -0
  15. package/skills/magpie/scripts/__tests__/findings-files.test.ts +35 -0
  16. package/skills/magpie/scripts/__tests__/gh.test.ts +69 -0
  17. package/skills/magpie/scripts/__tests__/git-diff.test.ts +83 -0
  18. package/skills/magpie/scripts/__tests__/helpers/git-fixture.ts +47 -0
  19. package/skills/magpie/scripts/__tests__/path-filter.test.ts +27 -0
  20. package/skills/magpie/scripts/__tests__/render-cmd.test.ts +95 -0
  21. package/skills/magpie/scripts/__tests__/render-findings.test.ts +33 -0
  22. package/skills/magpie/scripts/__tests__/render-progress.test.ts +42 -0
  23. package/skills/magpie/scripts/__tests__/setup-cmd.test.ts +83 -1
  24. package/skills/magpie/scripts/__tests__/shard.test.ts +165 -0
  25. package/skills/magpie/scripts/__tests__/skill-lint.test.ts +96 -1
  26. package/skills/magpie/scripts/dedupe-cmd.ts +58 -3
  27. package/skills/magpie/scripts/diff-chunks.ts +28 -0
  28. package/skills/magpie/scripts/findings-files.ts +32 -0
  29. package/skills/magpie/scripts/gh.ts +64 -13
  30. package/skills/magpie/scripts/git-diff.ts +111 -0
  31. package/skills/magpie/scripts/path-filter.ts +9 -5
  32. package/skills/magpie/scripts/refresh.ts +8 -0
  33. package/skills/magpie/scripts/render-cmd.ts +28 -9
  34. package/skills/magpie/scripts/render-findings.ts +11 -1
  35. package/skills/magpie/scripts/render-progress.ts +6 -1
  36. package/skills/magpie/scripts/setup-cmd.ts +38 -1
  37. package/skills/magpie/scripts/shard.ts +171 -0
  38. package/skills/magpie/scripts/status-cmd.ts +4 -1
  39. package/skills/magpie/skill.json +2 -2
  40. package/skills/magpie/templates/styles.css +5 -0
  41. package/skills/migrate/README.md +194 -0
  42. package/skills/migrate/SKILL.md +197 -0
  43. package/skills/migrate/bin/migrate +15 -0
  44. package/skills/migrate/bin/migrate.ts +309 -0
  45. package/skills/migrate/biome.json +35 -0
  46. package/skills/migrate/bun.lock +24 -0
  47. package/skills/migrate/docs/architecture.md +294 -0
  48. package/skills/migrate/docs/reference.md +590 -0
  49. package/skills/migrate/fixtures/tiny-express/GROUND-TRUTH.md +39 -0
  50. package/skills/migrate/fixtures/tiny-express/app.js +29 -0
  51. package/skills/migrate/fixtures/tiny-express/cron.js +6 -0
  52. package/skills/migrate/fixtures/tiny-express/reports/daily-users.json +6 -0
  53. package/skills/migrate/fixtures/tiny-express/schema.sql +12 -0
  54. package/skills/migrate/fixtures/tiny-express/settings.json +4 -0
  55. package/skills/migrate/fixtures/tiny-express/views/users.html +9 -0
  56. package/skills/migrate/fixtures/tiny-webforms/Controllers/UsersController.cs +68 -0
  57. package/skills/migrate/fixtures/tiny-webforms/Default.aspx +7 -0
  58. package/skills/migrate/fixtures/tiny-webforms/Default.aspx.cs +14 -0
  59. package/skills/migrate/fixtures/tiny-webforms/GROUND-TRUTH.md +50 -0
  60. package/skills/migrate/fixtures/tiny-webforms/Integrations/BillingClient.cs +16 -0
  61. package/skills/migrate/fixtures/tiny-webforms/Jobs/NightlyDigestJob.cs +33 -0
  62. package/skills/migrate/fixtures/tiny-webforms/Reports/DailyUsers.rdl +11 -0
  63. package/skills/migrate/fixtures/tiny-webforms/Schema.sql +12 -0
  64. package/skills/migrate/fixtures/tiny-webforms/Site.master +16 -0
  65. package/skills/migrate/fixtures/tiny-webforms/Users.aspx +8 -0
  66. package/skills/migrate/fixtures/tiny-webforms/Users.aspx.cs +14 -0
  67. package/skills/migrate/fixtures/tiny-webforms/web.config +10 -0
  68. package/skills/migrate/install.sh +68 -0
  69. package/skills/migrate/package.json +17 -0
  70. package/skills/migrate/references/phases/enumerate.md +291 -0
  71. package/skills/migrate/references/phases/extract.md +652 -0
  72. package/skills/migrate/references/phases/parity.md +275 -0
  73. package/skills/migrate/references/phases/probe.md +135 -0
  74. package/skills/migrate/references/phases/queue.md +242 -0
  75. package/skills/migrate/references/phases/seam.md +416 -0
  76. package/skills/migrate/references/recipes/README.md +116 -0
  77. package/skills/migrate/references/recipes/aspnet.md +287 -0
  78. package/skills/migrate/references/run-ops.md +280 -0
  79. package/skills/migrate/scripts/__tests__/census.test.ts +775 -0
  80. package/skills/migrate/scripts/__tests__/check.test.ts +458 -0
  81. package/skills/migrate/scripts/__tests__/citations.test.ts +156 -0
  82. package/skills/migrate/scripts/__tests__/cli.test.ts +183 -0
  83. package/skills/migrate/scripts/__tests__/concurrency.test.ts +164 -0
  84. package/skills/migrate/scripts/__tests__/config.test.ts +112 -0
  85. package/skills/migrate/scripts/__tests__/e2e-express.test.ts +1093 -0
  86. package/skills/migrate/scripts/__tests__/e2e-webforms.test.ts +1276 -0
  87. package/skills/migrate/scripts/__tests__/e2e.test.ts +320 -0
  88. package/skills/migrate/scripts/__tests__/ids.test.ts +38 -0
  89. package/skills/migrate/scripts/__tests__/import.test.ts +155 -0
  90. package/skills/migrate/scripts/__tests__/init.test.ts +192 -0
  91. package/skills/migrate/scripts/__tests__/leaks.test.ts +176 -0
  92. package/skills/migrate/scripts/__tests__/lock.test.ts +183 -0
  93. package/skills/migrate/scripts/__tests__/paths.test.ts +129 -0
  94. package/skills/migrate/scripts/__tests__/phase-cmd.test.ts +151 -0
  95. package/skills/migrate/scripts/__tests__/phases.test.ts +70 -0
  96. package/skills/migrate/scripts/__tests__/queue.test.ts +475 -0
  97. package/skills/migrate/scripts/__tests__/report.test.ts +150 -0
  98. package/skills/migrate/scripts/__tests__/run-state.test.ts +136 -0
  99. package/skills/migrate/scripts/__tests__/status-reset.test.ts +318 -0
  100. package/skills/migrate/scripts/__tests__/store.test.ts +132 -0
  101. package/skills/migrate/scripts/__tests__/validate.test.ts +54 -0
  102. package/skills/migrate/scripts/census-cmd.ts +109 -0
  103. package/skills/migrate/scripts/census.ts +342 -0
  104. package/skills/migrate/scripts/check-cmd.ts +24 -0
  105. package/skills/migrate/scripts/check.ts +376 -0
  106. package/skills/migrate/scripts/citations.ts +92 -0
  107. package/skills/migrate/scripts/config.ts +237 -0
  108. package/skills/migrate/scripts/ids.ts +31 -0
  109. package/skills/migrate/scripts/import-cmd.ts +141 -0
  110. package/skills/migrate/scripts/init-cmd.ts +118 -0
  111. package/skills/migrate/scripts/leaks.ts +184 -0
  112. package/skills/migrate/scripts/lock.ts +188 -0
  113. package/skills/migrate/scripts/paths.ts +103 -0
  114. package/skills/migrate/scripts/phase-cmd.ts +63 -0
  115. package/skills/migrate/scripts/phases.ts +113 -0
  116. package/skills/migrate/scripts/queue-cmd.ts +98 -0
  117. package/skills/migrate/scripts/queue.ts +258 -0
  118. package/skills/migrate/scripts/report-cmd.ts +47 -0
  119. package/skills/migrate/scripts/report.ts +131 -0
  120. package/skills/migrate/scripts/reset-cmd.ts +120 -0
  121. package/skills/migrate/scripts/status-cmd.ts +52 -0
  122. package/skills/migrate/scripts/store.ts +159 -0
  123. package/skills/migrate/scripts/types.ts +137 -0
  124. package/skills/migrate/scripts/validate.ts +221 -0
  125. package/skills/migrate/skill.json +33 -0
  126. package/skills/migrate/templates/config.toml +27 -0
  127. package/skills/migrate/templates/queue-item.md +17 -0
  128. package/skills/migrate/tsconfig.json +18 -0
  129. package/skills/migrate/uninstall.sh +31 -0
  130. package/skills/sluice/SKILL.md +95 -0
  131. package/skills/sluice/references/deep-channel.md +114 -0
  132. package/skills/sluice/references/finish.md +37 -0
  133. package/skills/sluice/references/intent.md +29 -0
  134. package/skills/sluice/references/meter.md +38 -0
  135. package/skills/sluice/references/review.md +42 -0
  136. package/skills/sluice/references/root-cause.md +38 -0
  137. package/skills/sluice/references/show-or-say.md +36 -0
  138. package/skills/sluice/references/test-first.md +35 -0
  139. package/skills/sluice/references/verify.md +26 -0
  140. package/skills/sluice/scripts/run-stats.sh +236 -0
  141. package/skills/sluice/skill.json +33 -0
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Run by agent-skills as a postremove step before the migrate skill bundle is
5
+ # deleted. Reads the path recorded by install.sh and removes the PATH symlink
6
+ # if it still points back into this bundle.
7
+
8
+ SOURCE_DIR="$(cd "$(dirname "$0")" && pwd)"
9
+ STATE_FILE="$SOURCE_DIR/.installed-cli-path"
10
+
11
+ if [ ! -f "$STATE_FILE" ]; then
12
+ exit 0
13
+ fi
14
+
15
+ CLI_PATH="$(head -n 1 "$STATE_FILE")"
16
+ [ -z "$CLI_PATH" ] && exit 0
17
+
18
+ if [ -L "$CLI_PATH" ]; then
19
+ TARGET="$(readlink "$CLI_PATH")"
20
+ case "$TARGET" in
21
+ "$SOURCE_DIR"/*)
22
+ rm -f "$CLI_PATH"
23
+ echo "Removed migrate CLI symlink at $CLI_PATH"
24
+ ;;
25
+ *)
26
+ echo "migrate uninstall: leaving $CLI_PATH alone (points to $TARGET, not this bundle)"
27
+ ;;
28
+ esac
29
+ fi
30
+
31
+ rm -f "$STATE_FILE"
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: sluice
3
+ description: Use at the start of any request that changes code. Routes the work into one of four channels (bypass, fast, main, deep) by change shape, and applies only the rules that channel needs. Also use when asked to work faster or with less process.
4
+ ---
5
+
6
+ # Sluice
7
+
8
+ A sluice sorts material by size into channels and meters what flows through.
9
+ Same here: pick the channel the change needs, pay for nothing else.
10
+
11
+ ## Route first
12
+
13
+ Pick a channel from the change's shape, state it in one line, then proceed. The
14
+ announcement is how your partner redirects you without being asked.
15
+
16
+ | Channel | Signal | Rules | Say |
17
+ |---------|--------|-------|-----|
18
+ | `bypass` | No code change: a question, an explanation, a read | none | nothing, just answer |
19
+ | `fast` | Existing interfaces, one subsystem (a new flag on an existing command still counts as existing) | test-first, verify | "Fast channel, existing interfaces. Test first, then implement." |
20
+ | `main` | Adds an interface, or crosses subsystems | + agree intent, review before merge | "Main channel, new interface. Agreeing the shape first." |
21
+ | `deep` | Several subsystems, or a plan was asked for | + written design and plan | "Deep channel, several subsystems. Design before code." |
22
+
23
+ `bypass`, `fast`, and `main` proceed without stopping for approval; only
24
+ `deep` stops, for design sign-off before code, and again for the plan when
25
+ agents rather than you will carry it out.
26
+
27
+ Name the channel and the signal that actually routed you there. The strings above
28
+ are examples, not fixed copy, and a channel with a two-part signal should say
29
+ which part applied. `bypass` says nothing at all, because a question that gets
30
+ announced stops being a question.
31
+
32
+ **`root-cause`, `finish` and `meter` are not channel-assigned.** The code
33
+ misbehaving triggers the first: a bug report, a red test, behaviour you cannot
34
+ account for. An integration event, merging, pushing, or opening a PR, triggers
35
+ the second. Handing the work back triggers the third, whether or not it ever
36
+ reaches an integration event. The first two fire in every channel, `bypass`
37
+ included; `meter` cannot, because `bypass` announces nothing to measure from.
38
+
39
+ ## The rules
40
+
41
+ One line each. Read the reference only on friction: the moment you notice
42
+ yourself wanting to skip the rule, or arguing that this one is the exception.
43
+
44
+ - **Agree intent** before building. One question at a time. Propose approaches
45
+ with a recommendation, not a survey. `main` agrees in a message, `deep` writes
46
+ it down. `references/intent.md`
47
+ - **Test first.** The test comes before the code; run it while it should
48
+ still be failing, then write the least code that turns it green. Skip that
49
+ watching step and a green result is only an unchecked guess.
50
+ `references/test-first.md`
51
+ - **Root cause** before fix. A fix that only hides the symptom has not fixed
52
+ anything. Three failed fixes point at the design, not your guesswork.
53
+ `references/root-cause.md`
54
+ - **Verify** before claiming. Run the command in this turn and read its
55
+ output; the claim comes after that, never before. How sure you feel is not
56
+ something anyone else can check. `references/verify.md`
57
+ - **Review** before merge. Dispatch a reviewer with fresh context and put the
58
+ diff on disk for it to read, so those bytes fill their context instead of
59
+ yours. `references/review.md`
60
+ - **Finish** deliberately. Green suite first, then let your partner pick
61
+ merge, PR, or leave it. Never pick for them. `references/finish.md`
62
+ - **Meter the run** as you hand it back. `scripts/run-stats.sh` reads the
63
+ ledger out of the session transcript: elapsed, tools, tokens, and what each
64
+ dispatched agent cost. A summary you assemble from memory is the one that
65
+ flatters you. `references/meter.md`
66
+
67
+ ## Changing channel
68
+
69
+ Escalate out loud. A `fast` task that turns out to need a new interface becomes
70
+ `main`, and you say so. Finishing quietly in the wrong channel is the failure
71
+ this prevents; the same goes for dropping to a shallower one. Explicit
72
+ instruction wins: "just do it" collapses to `fast`.
73
+
74
+ ## Deep channel
75
+
76
+ Design to `docs/specs/YYYY-MM-DD-<topic>.md`, plan to
77
+ `docs/plans/YYYY-MM-DD-<topic>.md`, unless the repo has a convention or
78
+ your partner states a preference. Get the design signed off before code.
79
+
80
+ The plan needs sign-off as well whenever agents will execute it, because each
81
+ one sees only its own task and so nobody ever reads the plan whole. Executing
82
+ it yourself makes it a worklist instead: write it and carry on.
83
+
84
+ Then read `references/deep-channel.md` for the plan format, the dispatch rules,
85
+ and when a task actually needs a reviewer. Three that catch people out: never
86
+ run two implementers at once, review is tiered rather than automatic, and a
87
+ `deep` run that cannot dispatch has to replace the review tier with something,
88
+ not quietly ship without one.
89
+
90
+ ## Conflicts
91
+
92
+ Sluice cannot run alongside the superpowers plugin. Superpowers requires its
93
+ own fixed pipeline up front for anything that adds to or changes what the
94
+ software does, not just code edits, and that pipeline overrides this router
95
+ outright, so the two cannot be installed together.
@@ -0,0 +1,114 @@
1
+ # Deep channel
2
+
3
+ ## Plan format
4
+
5
+ - A plan opens with **Goal**, **Architecture** and **Ground Rules**. The ground
6
+ rules are the limits the whole plan answers to, each recorded at its literal
7
+ value, and each one binds every task without being repeated in it.
8
+ - No implementer sees a neighbouring task, so each task carries a
9
+ **Contract**, not optional: a symbol absent from it does not exist for
10
+ whoever builds the task. `Needs` names what this task calls but another
11
+ task defines; `Offers` names what later tasks will call. Both sides are
12
+ spelled out whole, argument lists and return shapes.
13
+ - A **Touches** line lists the exact paths the task creates, edits and tests.
14
+ - A **Review** field may name why the task needs the stronger tier (auth,
15
+ data, money, concurrency); the table below decides otherwise.
16
+ - Steps are checkboxes: an action, and the proof it worked. Skip the
17
+ test-first ritual per step; `references/test-first.md` owns it.
18
+ - Code goes in only where exact characters matter and paraphrase breaks
19
+ something: a signature, a literal the code must match, a command, a test
20
+ body. Prose deliverables get their claims and their length, not a draft.
21
+ - A step a stranger could not carry out from its own text is unfinished.
22
+ "Same as Task 3" is one such step: tasks get read out of order, so write
23
+ the instruction out again in full. "TBD" is another. So is naming a type
24
+ or a function that no task in the plan ever creates.
25
+
26
+ ```
27
+ # Plan: <topic>
28
+ ## Ground Rules
29
+ - <exact value>
30
+ ### Task N: <name>
31
+ **Contract:** Needs: <sig> | Offers: <sig>
32
+ **Touches:** <path> (new) | <path> (edit) | <path> (test)
33
+ **Review:** <reason, or omit>
34
+ - [ ] <action> -> <proof>
35
+ ```
36
+
37
+ ## Dispatch rules
38
+
39
+ - One `TaskCreate` per task, marked in progress then complete. That state
40
+ outlives compaction; your memory doesn't.
41
+ - Each task goes to a fresh agent with that task's text and nothing else.
42
+ What this session accumulated is yours to hold, not theirs.
43
+ - **Never run two implementers at once.** They collide in the same files.
44
+ - Fan out for work that doesn't write: investigations or searches, one
45
+ agent per question, all dispatched in one message so they run at once.
46
+ The test: could two agents touch the same file?
47
+ - Isolate the workspace before a multi-task plan: the harness's worktree
48
+ tool, not `git worktree` yourself. Implementing straight onto main or
49
+ master needs your partner's say-so.
50
+ - Match model to task: cheap for mechanical work, stronger for judgment
51
+ and final review.
52
+
53
+ ## When dispatch is unavailable
54
+
55
+ A session may forbid subagents outright. `deep` then loses most of the
56
+ machinery this file describes, and the place to say so is the routing
57
+ announcement, where your partner can still act on it, not the summary at the
58
+ end where it reads as an excuse.
59
+
60
+ Three things change. The plan becomes your own worklist and needs no sign-off,
61
+ since you are the only one who will ever read it. Task isolation is gone, so
62
+ `TaskCreate` now carries all of the state that outlives compaction and matters
63
+ more, not less. And fresh context is unavailable, which was the entire thing
64
+ review was buying.
65
+
66
+ One thing does not change: the work still owes a review. Reading your own diff
67
+ is not one, and the table below still names which tasks needed the stronger
68
+ tier. List those tasks when you hand back, as review outstanding rather than
69
+ review passed. A `deep` run that ships with nobody having read it has become a
70
+ `fast` run with a design document attached, and your partner is entitled to
71
+ know that before they decide anything.
72
+
73
+ ## Review policy
74
+
75
+ A review costs about what the implementation cost, so reviewing every task
76
+ doubles the plan. Confirming Offers landed and nothing outside Touches moved
77
+ is free, one `git diff --stat`; only quality judgment needs a dispatch.
78
+
79
+ | Task shape | Review |
80
+ |------------|--------|
81
+ | Created files only, executable tests exist and pass, Contract matches | No dispatch. Read the diff stat yourself. |
82
+ | Modified existing code, or later tasks build on it | One reviewer dispatch |
83
+ | Auth, data, money, concurrency, or the plan flags it | One reviewer dispatch, stronger model |
84
+ | No executable test covers it: prose, config, docs | One reviewer dispatch; a diff stat can't confirm the words are right |
85
+
86
+ A task that matches more than one row takes the strongest review of them.
87
+
88
+ The diff goes to disk and the reviewer gets its path: `git diff <base>
89
+ <head> > <file>`. Base means where that task began, which is why `HEAD~1` is
90
+ wrong: on a five-commit task it shows the fifth and buries the rest.
91
+ Findings return to whoever wrote the code.
92
+
93
+ **Most fixes are too small to earn a second review.** Read the fix diff
94
+ yourself and check the test it names ran; dispatch again only for
95
+ substantial logic changes. Three rounds is the cap either way: a finding
96
+ still open then is structural, so escalate it to your partner.
97
+
98
+ **A finding surviving two rounds may be a defect in the criterion, not the
99
+ work.** Before a third round, ask whether any output could satisfy it. A
100
+ criterion that rejects every attempt the same way never converges, and the
101
+ work degrades each round as it contorts toward an unpassable test. Fixing
102
+ the criterion is your partner's call.
103
+
104
+ Never hand yourself a finding to fix while you are the one coordinating.
105
+ Coordination and repair are separate jobs, and doing both leaves your own
106
+ patch as the one nobody reviewed, bought with context the later tasks are
107
+ going to need. A finding has two destinations: fixed now by the agent that
108
+ wrote it, or recorded in the task's `TaskCreate` entry for the final review.
109
+ A reviewer may describe severity in words; a third disposition is not
110
+ available, and neither is a step that adjudicates findings and sorts them
111
+ into one.
112
+
113
+ The final review covers cross-task integration and anything deferred, not
114
+ lines a per-task review cleared.
@@ -0,0 +1,37 @@
1
+ # Finish
2
+
3
+ `finish` fires at an integration event, merging, pushing, or opening a PR,
4
+ in every channel. A commit made in passing during `fast` channel work is
5
+ not one of those: the branch as a whole has to be about to leave your
6
+ hands.
7
+
8
+ Start here: run every test the project has, not a sample of them. A red
9
+ result stops the process; there is no menu after a failure. A pass from
10
+ earlier in the session doesn't count: the tree has changed since, and
11
+ only a run against what's here now proves anything.
12
+
13
+ Confirm the base branch instead of assuming it; untangling a wrong merge
14
+ costs far more than asking would have.
15
+
16
+ With the suite green and the base confirmed, put exactly three options to
17
+ your partner, with the run ledger above them so the choice is made against
18
+ what the work actually cost rather than against your account of it;
19
+ `references/meter.md` owns that. The three: merge it locally, push it and
20
+ open a PR, or leave the branch as it stands. Those three exhaust what you may offer. Your partner may still
21
+ ask for something off the list, most notably scrapping the branch, but the
22
+ request has to originate with them and be unmistakable. Then stop. Which of
23
+ the three it is belongs to them, however obvious the choice looks from where
24
+ you are standing, so nothing moves until they say.
25
+
26
+ After a local merge, run the whole suite again over the merged tree before
27
+ deleting anything. A failure there stops the cleanup; you haven't pushed
28
+ anything yet, so you can still walk it back.
29
+
30
+ While a PR is open, the workspace survives: it is where the review
31
+ comments get answered, and tearing it down means rebuilding it the moment
32
+ the first one arrives. Discarding needs an explicit, confirmed ask from
33
+ your partner. This tooling removes only the workspaces it created;
34
+ anything else stays put.
35
+
36
+ The friction line: "picking for them saves everyone a turn." Saving a
37
+ turn is not the same as having their answer. Wait for it.
@@ -0,0 +1,29 @@
1
+ # Agree intent
2
+
3
+ Ask one question at a time. Use multiple choice when the answer set is
4
+ bounded.
5
+
6
+ Offer two or three approaches, never a survey. Put your top pick first
7
+ and explain what makes it the better bet. Cut every feature YAGNI would
8
+ cut before you present any of them; a lean option judged against a
9
+ padded one is not a fair comparison.
10
+
11
+ Size the request before you start refining it. "A CLI, a web dashboard and a
12
+ sync daemon" is three projects wearing one sentence, and a question about the
13
+ internals of any one of them comes too early. Say so the moment you notice, cut
14
+ the work at its seams into pieces that could each ship alone, agree the order
15
+ they go in, and take only the first into the channel. The rest wait their turn,
16
+ each with a design and a plan of its own. One design covering four subsystems
17
+ produces a plan wrong in four places, found only once tasks are dispatched
18
+ against it.
19
+
20
+ Scale with channel. `main` agrees in one message and writes nothing. `deep`
21
+ writes the design and gets sign-off before code. `fast` and `bypass` never
22
+ reach this rule.
23
+
24
+ Some questions are better shown than told; `references/show-or-say.md`
25
+ decides which. Do not restate it here.
26
+
27
+ The friction line: "I already know what they want." You know the goal,
28
+ not the constraints, and the shape in your head rarely matches theirs. One
29
+ question costs a turn. A wrong build costs the task.
@@ -0,0 +1,38 @@
1
+ # Meter the run
2
+
3
+ Run `scripts/run-stats.sh` as part of the message that hands the work back,
4
+ and paste its output into that message unedited:
5
+
6
+ ```
7
+ bash <skill-dir>/scripts/run-stats.sh --tests "<what the suite actually printed>"
8
+ ```
9
+
10
+ It reads the session transcript, so it needs no state of its own and cannot
11
+ drift from what happened. `--tests` is the one field it cannot know: only you
12
+ watched the suite run. Fill it from the output you read in this session, and
13
+ leave it off entirely if no suite ran, which prints "not reported" rather
14
+ than a number nobody checked. `--base <ref>` overrides the diff base when the
15
+ merge-base with `main` or `master` is not where this branch actually began.
16
+
17
+ The run starts at your channel announcement, not at the session, so three
18
+ unrelated tasks in one session report as three runs. A previous ledger closes
19
+ the run before it. `bypass` announces nothing, so there is nothing to meter
20
+ and the script exits quietly.
21
+
22
+ What the ledger is for: the cost of a channel is otherwise invisible, and a
23
+ channel nobody can price is a channel nobody can choose between. Six agents
24
+ and four hours of agent wall-clock on a two-file change is the sort of thing
25
+ that only becomes obvious once it is written down next to the diff. Expect
26
+ some runs to make the case for a shallower channel next time. That is the
27
+ ledger working, not the ledger complaining.
28
+
29
+ Read it before you paste it. A row showing an agent that errored, or an agent
30
+ whose token count dwarfs every other row, is a finding about the run and
31
+ belongs in your prose, not left for your partner to spot in a table.
32
+
33
+ Exit 2 means there was no run to report. That is a fact about the work, not a
34
+ failure: do not synthesise a ledger to fill the gap.
35
+
36
+ The friction line: "I know roughly what this cost." Roughly is the problem.
37
+ Every number here is already on disk, and the remembered version is reliably
38
+ the flattering one.
@@ -0,0 +1,42 @@
1
+ # Review
2
+
3
+ `main` and `deep` both take a review before anything merges. What routed the
4
+ work there, a new interface or a second subsystem, is what makes one reader
5
+ insufficient.
6
+
7
+ Write the diff out and send the path: `git diff <base> <head> > <file>`. A
8
+ pasted diff fills your context; a file fills the reviewer's, which is what
9
+ you dispatched one for. Get the base right: `HEAD~1` is the standing
10
+ mistake, showing the last of five commits and burying the rest. Send what
11
+ you built and what it is meant to do alongside the path, and nothing about
12
+ how you got there.
13
+
14
+ Leave every finding open to the reviewer; steering them away from an issue
15
+ first is the same mistake as reviewing it yourself. A finding that looks
16
+ wrong still gets raised, then argued.
17
+
18
+ Every finding has one of two destinations. Either it blocks, and the work
19
+ stays where it is until the fix lands, or it goes onto the task's record,
20
+ which is what the final review reads. Reviewers grade findings Critical,
21
+ Important or Minor, and the grade picks between the two: only Minor may wait
22
+ for the record, and anything graded above it blocks. A third destination is
23
+ not on offer, so neither is the adjudication step that would sort findings
24
+ into it; that sorting costs more than the findings are worth.
25
+
26
+ Send findings back to the agent that wrote the code: it already holds the
27
+ task and its reasoning, memory you would otherwise rebuild. Three rounds is
28
+ the cap, and a finding still open when the third one ends is structural, not
29
+ local, so stop there and hand it to your partner.
30
+
31
+ Receiving a finding: check it against the codebase before acting, and argue
32
+ back with specifics when it is wrong. Agreeing just to move things along is
33
+ not engagement.
34
+
35
+ For a small fix, read the diff and confirm the covering test ran; re-review
36
+ only for substantial logic changes. While you are the one coordinating,
37
+ findings are not yours to fix: your patch would be the single patch nobody
38
+ reviews, and it spends context the plan still needs.
39
+
40
+ The friction line: "dispatching a reviewer for this is overkill." Skipping
41
+ the dispatch doesn't skip the cost, it just moves the cost onto you, and
42
+ self-review is not review.
@@ -0,0 +1,38 @@
1
+ # Root cause
2
+
3
+ This rule is trigger-based, not channel-assigned. Anything the code does that
4
+ nobody intended fires it, in every channel, `bypass` included: a crash, a
5
+ test that has just turned red, output no one can account for.
6
+
7
+ It rules out patching first and understanding later. A change aimed at the
8
+ symptom buys quiet, and the quiet ends: the defect comes back, usually
9
+ worse.
10
+
11
+ **Reproduce it first.** A fault you cannot trigger on demand is not something
12
+ you can fix, only guess at. Then read the error to the end, stack trace and
13
+ all; the part you skim is often the part naming the cause.
14
+
15
+ **Find the origin, not the blast site.** Follow the bad value back to
16
+ whatever produced it and repair it there. Two things shorten the walk. One is
17
+ whatever moved recently, a commit or a dependency bump. The other is a nearby
18
+ case that still works: set it beside the broken one and list every way the
19
+ two diverge, including the ones you are certain cannot matter, since that is
20
+ usually where it hides.
21
+
22
+ **One hypothesis, written down.** Alter two things at once and a green
23
+ result cannot say which earned it, so state the theory plainly, pick the
24
+ smallest change that would confirm or kill it, and change exactly that.
25
+
26
+ **The fix travels with a test that would have caught it.** Write it, see it
27
+ fail, make the single change your hypothesis called for, then run it again.
28
+ With the cause dead, put validation on the layers that let the bad value
29
+ pass, so its next variant trips something loud instead of slipping by.
30
+
31
+ Three failed fixes point at the design, not your guesswork. Stop and raise
32
+ it rather than trying a fourth.
33
+
34
+ A test that waits by sleeping a fixed duration will flake eventually. Poll
35
+ for the condition it is really waiting on and fail on a timeout.
36
+
37
+ The friction line: "I have seen this exact error before, I know the fix."
38
+ Recognising the pattern skips the step where you check it still applies here.
@@ -0,0 +1,36 @@
1
+ # Show or say
2
+
3
+ This is never offered at the start. What triggers it is a specific moment in
4
+ the conversation: a question arrives that turns on how something looks rather
5
+ than on what it means. Offer then, in a message carrying nothing else, and
6
+ wait. Plenty of conversations never raise such a question, and in those the
7
+ offer is simply never made.
8
+
9
+ Apply the test to each question rather than deciding once: could you settle
10
+ this in a sentence, or do the candidates have to sit side by side where an
11
+ eye can compare them? Being about the interface does not settle it. "Should
12
+ deleting a record ask for confirmation first?" is a policy call, so argue it
13
+ in words. "Should the confirm button be red and set apart, or match the row
14
+ it belongs to?" has to be looked at.
15
+
16
+ Appearance is the dividing line, not subject matter. A screen layout, a
17
+ colour pairing, a diagram of how the pieces connect, a state machine,
18
+ anything with a spatial arrangement: show it. Anything you could write down
19
+ as a sentence, what's in scope, which architecture to use, what a term means:
20
+ say it.
21
+
22
+ Delivery: write the page to a file and publish it with the `Artifact` tool.
23
+ To iterate, edit that same file and republish it; the URL stays the same. If
24
+ `artifact-design` or `artifact-diagramming` guidance is available, follow it
25
+ instead of restating page-design rules here.
26
+
27
+ Two to four options per screen, no more, and print the question on the screen
28
+ itself rather than leaving it behind in chat. Fidelity follows the kind of
29
+ question being asked: a question about layout wants rough wireframes, and
30
+ real detail is worth drawing only when polish is the thing being decided.
31
+
32
+ Answers come back in chat. The page puts the options up; it does not collect
33
+ the reply.
34
+
35
+ If `Artifact` is unavailable, write a self-contained HTML file instead and
36
+ hand your partner the path.
@@ -0,0 +1,35 @@
1
+ # Test first
2
+
3
+ Write one test for the smallest slice of behaviour you intend to add. Run it
4
+ and watch it fail before you write anything else. Then write the minimal code
5
+ that makes it pass, and watch it pass.
6
+
7
+ The watching is the point, not a formality. A test you never saw fail might be
8
+ broken, aimed at the wrong behaviour, or not running at all; a green result
9
+ alone cannot tell you which. A test that passes the first time you run it is
10
+ not testing your change, it is testing behaviour that already existed. When
11
+ that happens, fix the test, not the code.
12
+
13
+ A test is only a test if some change to the implementation would turn it red.
14
+ Work out which change before you write the body; if there isn't one, what you
15
+ have is an assertion that stays green whatever you build.
16
+
17
+ Assertions belong on what the run actually produced: the value returned, the
18
+ state left behind, the output written. Never point one at a mock: a green
19
+ result then proves only that you called the mock the way you meant to, which
20
+ you knew already. Before a mock stands in for a dependency, learn what the real
21
+ one does on the paths your test never exercises; one that quietly drops a side
22
+ effect will hold a broken change green.
23
+
24
+ Keep helpers that exist only for tests inside the test files. If a production
25
+ class grows a method whose only caller is a test reaching inside it, the test
26
+ has started reshaping your design.
27
+
28
+ Three cases are worth asking to skip: generated or scaffolded code, a config
29
+ file with no logic in it, and a prototype headed for the bin before anyone
30
+ sees it. Ask rather than assume, and treat that list as closed.
31
+
32
+ The friction line: "this case is obvious enough to skip straight to the
33
+ code." A test written once the code already works can only confirm what you
34
+ already believe about it. By that point you have stopped hunting for the cases
35
+ you never thought of, so the test does not find them either.
@@ -0,0 +1,26 @@
1
+ # Verify
2
+
3
+ Claiming that something works has a fixed sequence in front of it: pick the
4
+ command that proves the claim rather than the one that would make it feel
5
+ true, run that command in full during this turn, read its output and its exit
6
+ code, and write the sentence only once you have. What you remember from an
7
+ earlier run is no substitute for reading this one, however convincing it was
8
+ at the time.
9
+
10
+ | Evidence in hand | What it lets you say |
11
+ |---|---|
12
+ | the original symptom, retested and gone | "bug fixed" |
13
+ | the actual diff, not its own status report | "subagent finished" |
14
+ | a fresh full run, zero failures, exit code checked | "tests pass" |
15
+ | a real build command at exit 0, not a clean linter | "build succeeds" |
16
+
17
+ A regression test counts only once you have seen it go both ways: red with
18
+ the fix backed out, green with the fix back in. A test that has only ever
19
+ passed proves nothing about what it would catch.
20
+
21
+ Wording is not a loophole. "Looks right", "should be good" and "that's
22
+ sorted" are completion claims in other clothes. So is pleasure at your own
23
+ work: "beautiful", "there we go", "nailed it" each announce that the thing
24
+ landed, and each needs the same command run beforehand as "it passes" does.
25
+
26
+ The friction line: "the change was too small to need a full run." Run it.