@2cmddev/2cmd 0.0.0-stage → 0.1.5

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 (93) hide show
  1. package/.opencode/command/2cmd-audit.md +5 -0
  2. package/.opencode/command/2cmd-debt.md +5 -0
  3. package/.opencode/command/2cmd-gain.md +5 -0
  4. package/.opencode/command/2cmd-help.md +5 -0
  5. package/.opencode/command/2cmd-review.md +5 -0
  6. package/.opencode/command/2cmd.md +5 -0
  7. package/.opencode/plugins/2cmd-frontmatter.cjs +63 -0
  8. package/.opencode/plugins/2cmd.mjs +206 -0
  9. package/.opencode/plugins/index.js +4 -0
  10. package/.qoder/rules/2cmd.md +31 -0
  11. package/.qoder-plugin/plugin.json +16 -0
  12. package/.zcode-plugin/plugin.json +13 -0
  13. package/AGENTS.md +33 -0
  14. package/LICENSE +22 -0
  15. package/README.md +133 -2
  16. package/codex/answer.mjs +164 -0
  17. package/codex/data.mjs +31 -0
  18. package/codex/pty.py +80 -0
  19. package/codex/stats.mjs +105 -0
  20. package/codex/terminal.mjs +388 -0
  21. package/dsh/LICENSE +22 -0
  22. package/dsh/board.js +782 -0
  23. package/dsh/build.mjs +47 -0
  24. package/dsh/bundle.json +2104 -0
  25. package/dsh/client.js +877 -0
  26. package/dsh/cordis.patch.yml +3 -0
  27. package/dsh/index.js +185 -0
  28. package/dsh/ledger.js +50 -0
  29. package/dsh/market.js +152 -0
  30. package/dsh/package.json +24 -0
  31. package/dsh/prices.json +1812 -0
  32. package/dsh/settings-text.mjs +520 -0
  33. package/dsh/settings.js +42 -0
  34. package/dsh/stats.js +106 -0
  35. package/dsh/store.js +32 -0
  36. package/dsh/update-prices.mjs +9 -0
  37. package/dsh/update.js +27 -0
  38. package/dsh/voice-helper/Info.plist +13 -0
  39. package/dsh/voice-helper/Transcript.swift +21 -0
  40. package/dsh/voice-helper/build.sh +10 -0
  41. package/dsh/voice-helper/main.swift +70 -0
  42. package/dsh/voice-helper/test.swift +17 -0
  43. package/dsh/voice.js +63 -0
  44. package/hooks/2cmd-activate.js +219 -0
  45. package/hooks/2cmd-antigravity.js +64 -0
  46. package/hooks/2cmd-band-import.js +305 -0
  47. package/hooks/2cmd-config.js +186 -0
  48. package/hooks/2cmd-instructions.js +104 -0
  49. package/hooks/2cmd-map.js +200 -0
  50. package/hooks/2cmd-mode-tracker.js +248 -0
  51. package/hooks/2cmd-runtime.js +245 -0
  52. package/hooks/2cmd-statusline.ps1 +24 -0
  53. package/hooks/2cmd-statusline.sh +18 -0
  54. package/hooks/2cmd-subagent.js +100 -0
  55. package/hooks/band/board.ts +720 -0
  56. package/hooks/band/buttons.ts +60 -0
  57. package/hooks/band/i18n/de.ts +149 -0
  58. package/hooks/band/i18n/en.ts +150 -0
  59. package/hooks/band/i18n/es.ts +149 -0
  60. package/hooks/band/i18n/fr.ts +149 -0
  61. package/hooks/band/i18n/index.ts +42 -0
  62. package/hooks/band/i18n/ja.ts +149 -0
  63. package/hooks/band/i18n/ko.ts +149 -0
  64. package/hooks/band/i18n/pt.ts +149 -0
  65. package/hooks/band/i18n/ru.ts +149 -0
  66. package/hooks/band/i18n/vi.ts +149 -0
  67. package/hooks/band/i18n/zh-Hans.ts +149 -0
  68. package/hooks/band/i18n/zh-Hant.ts +149 -0
  69. package/hooks/band/logo.ts +3 -0
  70. package/hooks/band/metrics.ts +373 -0
  71. package/hooks/band/register.tsx +681 -0
  72. package/hooks/band/types.d.ts +45 -0
  73. package/hooks/band/windows-board.mjs +20 -0
  74. package/hooks/claude-band.json +6 -0
  75. package/hooks/claude-codex-hooks.json +41 -0
  76. package/hooks/codebuddy-hooks.json +20 -0
  77. package/hooks/copilot-hooks.json +21 -0
  78. package/hooks/cursor-hooks.json +17 -0
  79. package/hooks/qoder-hooks.json +26 -0
  80. package/hooks/zcode-hooks.json +26 -0
  81. package/package.json +56 -4
  82. package/pi-extension/index.js +258 -0
  83. package/pi-extension/names.js +19 -0
  84. package/pi-extension/package.json +8 -0
  85. package/scripts/cursor-hooks.js +145 -0
  86. package/scripts/uninstall.js +92 -0
  87. package/skills/2cmd/SKILL.md +55 -0
  88. package/skills/2cmd-audit/SKILL.md +105 -0
  89. package/skills/2cmd-debt/SKILL.md +46 -0
  90. package/skills/2cmd-gain/SKILL.md +53 -0
  91. package/skills/2cmd-help/SKILL.md +87 -0
  92. package/skills/2cmd-review/SKILL.md +143 -0
  93. package/skills/plugin.json +5 -0
@@ -0,0 +1,143 @@
1
+ ---
2
+ name: 2cmd-review
3
+ description: >
4
+ Quality review of a change: is the logic right, is it safe, does it hold
5
+ under real load, is risky code tested, is it fast enough, and is every line
6
+ needed. Reads the connected code, not only the diff. Each finding is
7
+ explained in plain English. Use for "review this", "code review", "review
8
+ the last commit", "review my PR", "is this over-engineered", /2cmd-review.
9
+ With fix, commit or push it then fixes the findings, commits and pushes.
10
+ ---
11
+
12
+ Review a change like the senior developer who will be paged when it breaks.
13
+ Order of importance: correct, safe, holds under load, tested, fast, lean.
14
+ Lean still matters: every extra line must be read, tested and fixed later.
15
+ This is a report the user asked for, so give it in full.
16
+
17
+ Reply in the user's language, including reports and their headings. Keep code, commands and file names as they are.
18
+
19
+ ## 1. Understand first
20
+
21
+ - Review what the user names: uncommitted or staged changes, a branch, a PR
22
+ link, or files. Nothing named: the uncommitted changes, or the last commit
23
+ if there are none.
24
+ - Read the diff, then the code it touches: callers of every changed function,
25
+ the functions it calls, the tests, the README.
26
+ - Trace the real flow: where data comes in, what is stored, what goes out.
27
+ - A change can break code it does not touch. When a signature, return value
28
+ or behavior changes, grep every caller.
29
+ - Find the expected load in the repo (README, deploy config): one person
30
+ running a script, or many users and processes at once. Judge scale against
31
+ that, and say which load you assumed.
32
+ - If the repo has a `REVIEW.md` (at the root or next to the changed files),
33
+ follow it: what this project fears most, what to skip, house rules. It
34
+ outranks the defaults here.
35
+ - Reviewed this change before in this conversation? Review only what changed
36
+ since. Do not report a finding again; if it is still unfixed, say so in one
37
+ line. On the third round on the same problem, say so and suggest a
38
+ different approach instead of another patch.
39
+
40
+ ## 2. Look for
41
+
42
+ 1. **Bug:** wrong result, crash, missed edge case (empty, zero, last item,
43
+ rounding, time zones), a caller broken by the change, a fix applied in one
44
+ caller while the shared function stays broken.
45
+ 2. **Risk:** security holes (injection, weak randomness, secrets, missing
46
+ checks on input from users), data loss (errors swallowed, writes in the
47
+ wrong order, no transaction).
48
+ 3. **Scale:** fine for one user, wrong for many: check-then-write races, the
49
+ same work done by every process, memory or lists that only grow, a query
50
+ per item, O(n^2) on big input, per-process state that must be shared.
51
+ 4. **Missing test:** risky new logic (a branch, a parser, money, security,
52
+ data writes, a bug fix) with no test that fails when it breaks. One good
53
+ test, not coverage.
54
+ 5. **Speed:** big slowdowns are problems. Small wins (work repeated in a hot
55
+ loop) are suggestions; some software counts every millisecond.
56
+ 6. **Lean:** code that should not exist or should be smaller.
57
+ - delete: dead code, unused options, speculative features
58
+ - reuse: the repo already has this helper (name the path)
59
+ - stdlib / native: the standard library or platform already does it; a
60
+ new dependency for a few lines
61
+ - yagni: abstraction with one implementation, config nobody sets
62
+ - merge: near-copies that must change together
63
+ - split: one function doing several unrelated jobs, so it is hard to read
64
+ or test. Split by job, never by line count, and never into helpers that
65
+ exist only to make a function shorter.
66
+
67
+ ## 3. Check before you report
68
+
69
+ - Every finding needs a concrete case: "this input or situation leads to this
70
+ wrong result". No case, no finding.
71
+ - Re-read the lines and confirm: the caller exists, the value can really be
72
+ empty, the code really is unused.
73
+ - Found a bug? Name its kind (missing check, wrong time zone, unescaped
74
+ input...) and grep for the same pattern in the change and the code it
75
+ touches. List every place in that one finding, so all of them get fixed.
76
+ - A shortcut marked with a `shortcut:` (or older `2cmd:`) comment that names its limit is a
77
+ decision, not a finding, unless the expected load already crosses it.
78
+ - Propose the smallest fix that works. Prefer fixes that delete code. Never
79
+ add layers, frameworks or config the problem does not need.
80
+ - No style taste, no "consider", no vague worries.
81
+
82
+ ## 4. Output
83
+
84
+ Very simple words: short sentences, everyday words. Explain a technical
85
+ term the first time you use it. The reader may never have seen this code.
86
+
87
+ Start with `What this change does:` in two or three sentences.
88
+
89
+ Then the findings in three groups, skip empty groups:
90
+ - **Must fix:** bug, security, data loss, breaks at the expected load.
91
+ - **Should fix:** risky code without a test, real slowness, duplication, a
92
+ function that mixes jobs, code that should not exist.
93
+ - **Nice to have:** small speed-ups, shorter forms.
94
+ - **Already there:** a real problem in code this change neither touches nor
95
+ makes worse. One line each with the place. It does not change the verdict.
96
+
97
+ Number findings across all groups, so the user can say "fix 2 and 5".
98
+ Every finding has all four parts, each one or two short sentences:
99
+
100
+ 2. **Orders land on the wrong day** (`billing/close_day.py:L40-52`)
101
+ - **What this is:** At midnight this job closes the day and bills all orders of that day.
102
+ - **Problem:** It takes "today" from the server clock, which runs in UTC. An order placed
103
+ at 00:30 in Berlin is billed on the day before.
104
+ - **Fix:** Compute the day once in the shop's time zone:
105
+ `datetime.now(ZoneInfo("Europe/Berlin")).date()`. One line, nothing else changes.
106
+ - **If we skip it:** Late orders show the wrong date, and accounting fixes them by hand.
107
+
108
+ End with:
109
+ - `Verdict: Ship.` or `Verdict: fix 1 and 3 first.`
110
+ - `Needs you:` where the user's own time should go. High risk means sign-in
111
+ and permissions, money, deleting or migrating data, secrets, CI, release
112
+ and install scripts, or what users rely on (public API, pricing, core
113
+ screens). Easy to verify means a test or check covers it. Low risk and
114
+ covered: `Needs you: nothing, the checks cover it.` Otherwise name the
115
+ place and why: `Needs you: billing/close_day.py, it moves money and no test
116
+ runs it.`
117
+ - `Lean: -<N> lines possible.` when lean findings exist.
118
+ - `Not checked:` one line, if something mattered and you could not check it.
119
+
120
+ Nothing found: `What this change does:`, then `Looks good. Ship.`, one line
121
+ on what you checked, and the `Needs you:` line.
122
+
123
+ ## 5. Fix, commit, push
124
+
125
+ Only when the request says `fix`, `commit` or `push` (the panel's buttons send
126
+ these). Each one includes the steps before it. Without them: list findings,
127
+ change no code.
128
+
129
+ - **fix:** after the report, fix every Must fix and Should fix finding, and the
130
+ Nice to have ones that make the code shorter. Leave Already there alone. A
131
+ fix that needs the user's decision (a change users would notice, data,
132
+ money, a public API) is not made: name it under `Needs you:`. Then run the
133
+ project's tests or checks and review your own fixes once.
134
+ - **commit:** commit only when no Must fix is left, the checks pass and
135
+ nothing waits on the user; otherwise stop and say why. Stage the reviewed
136
+ change and your fixes, never unrelated files or secrets. Write the message
137
+ in the repo's style. Never skip hooks, change git config or the author.
138
+ - **push:** after the commit, `git push` the current branch to its upstream.
139
+ Never force, never another branch. No upstream, or the push is rejected:
140
+ say so and stop; do not pull, rebase or merge on your own.
141
+
142
+ Stop at the first step that fails and say which one. End with one line each:
143
+ `Fixed: 1, 2, 4`, `Committed: <hash> <message>`, `Pushed: <branch> → <remote>`.
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "2cmd",
3
+ "description": "Your AI coding agent takes fewer detours and stops reinventing the wheel: faster, more correct and safer. Four modes and review commands.",
4
+ "skills": "."
5
+ }