@weotro/dx 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +755 -0
  3. package/bin/dx-with-version-env.js +8 -0
  4. package/bin/dx.js +187 -0
  5. package/lib/artifact-deploy/artifact-builder.js +144 -0
  6. package/lib/artifact-deploy/config.js +180 -0
  7. package/lib/artifact-deploy/remote-script.js +301 -0
  8. package/lib/artifact-deploy/remote-transport.js +86 -0
  9. package/lib/artifact-deploy.js +70 -0
  10. package/lib/backend-artifact-deploy/artifact-builder.js +267 -0
  11. package/lib/backend-artifact-deploy/config.js +218 -0
  12. package/lib/backend-artifact-deploy/path-utils.js +18 -0
  13. package/lib/backend-artifact-deploy/remote-phases.js +14 -0
  14. package/lib/backend-artifact-deploy/remote-result.js +44 -0
  15. package/lib/backend-artifact-deploy/remote-script.js +507 -0
  16. package/lib/backend-artifact-deploy/remote-transport.js +123 -0
  17. package/lib/backend-artifact-deploy/rollback.js +5 -0
  18. package/lib/backend-artifact-deploy/runtime-package.js +46 -0
  19. package/lib/backend-artifact-deploy.js +91 -0
  20. package/lib/backend-package.js +674 -0
  21. package/lib/cli/args.js +38 -0
  22. package/lib/cli/command-result.js +1 -0
  23. package/lib/cli/commands/contracts.js +60 -0
  24. package/lib/cli/commands/core.js +533 -0
  25. package/lib/cli/commands/db.js +231 -0
  26. package/lib/cli/commands/deploy.js +175 -0
  27. package/lib/cli/commands/env.js +120 -0
  28. package/lib/cli/commands/export.js +39 -0
  29. package/lib/cli/commands/package.js +22 -0
  30. package/lib/cli/commands/release.js +55 -0
  31. package/lib/cli/commands/stack.js +427 -0
  32. package/lib/cli/commands/start.js +58 -0
  33. package/lib/cli/commands/worktree.js +145 -0
  34. package/lib/cli/dx-cli.js +1072 -0
  35. package/lib/cli/flags.js +123 -0
  36. package/lib/cli/help-model.js +222 -0
  37. package/lib/cli/help-renderer.js +137 -0
  38. package/lib/cli/help-schema.js +552 -0
  39. package/lib/cli/help.js +141 -0
  40. package/lib/cli/index.js +4 -0
  41. package/lib/cli/nx-command.js +13 -0
  42. package/lib/codex-initial.js +271 -0
  43. package/lib/confirm.js +213 -0
  44. package/lib/env-policy.js +134 -0
  45. package/lib/env-profile.js +435 -0
  46. package/lib/env.js +261 -0
  47. package/lib/exec.js +692 -0
  48. package/lib/logger.js +239 -0
  49. package/lib/nx-ignore.js +45 -0
  50. package/lib/run-with-version-env.js +163 -0
  51. package/lib/sdk-build.js +424 -0
  52. package/lib/start-dev.js +401 -0
  53. package/lib/telegram-webhook.js +431 -0
  54. package/lib/validate-env.js +317 -0
  55. package/lib/vercel-deploy.js +549 -0
  56. package/lib/version.js +14 -0
  57. package/lib/worktree.js +1052 -0
  58. package/package.json +45 -0
  59. package/skills/create-issue/SKILL.md +90 -0
  60. package/skills/delivering-design-handoff/SKILL.md +290 -0
  61. package/skills/doctor/SKILL.md +76 -0
  62. package/skills/gh-dependabot-cleanup/SKILL.md +54 -0
  63. package/skills/gh-dependabot-cleanup/agents/openai.yaml +7 -0
  64. package/skills/git-release/SKILL.md +194 -0
  65. package/skills/git-release/agents/openai.yaml +7 -0
  66. package/skills/online-debug-guard/SKILL.md +111 -0
  67. package/skills/ship-issue-pr/SKILL.md +676 -0
  68. package/skills/stagewise-ui-debugging/SKILL.md +48 -0
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@weotro/dx",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+ssh://git@github.com/rangershi/dx.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/rangershi/dx/issues"
12
+ },
13
+ "homepage": "https://github.com/rangershi/dx#readme",
14
+ "bin": {
15
+ "dx": "bin/dx.js",
16
+ "dx-with-version-env": "bin/dx-with-version-env.js"
17
+ },
18
+ "files": [
19
+ "bin/",
20
+ "lib/",
21
+ "skills/",
22
+ "LICENSE",
23
+ "README.md",
24
+ "package.json"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "dependencies": {
30
+ "strip-json-comments": "^5.0.3",
31
+ "yaml": "^2.8.1"
32
+ },
33
+ "devDependencies": {
34
+ "jest": "^29.7.0",
35
+ "nx": "22.4.4"
36
+ },
37
+ "scripts": {
38
+ "test": "NODE_OPTIONS=--experimental-vm-modules jest"
39
+ },
40
+ "engines": {
41
+ "node": ">=20.11.0"
42
+ },
43
+ "nx": {},
44
+ "packageManager": "pnpm@10.30.0+sha512.2b5753de015d480eeb88f5b5b61e0051f05b4301808a82ec8b840c9d2adf7748eb352c83f5c1593ca703ff1017295bc3fdd3119abb9686efc96b9fcb18200937"
45
+ }
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: create-issue
3
+ description: 仅在用户显式调用 $create-issue、/create-issue 或明确要求使用 create-issue 技能时使用;不要通过关键词、任务类型或上下文自动触发。
4
+ ---
5
+
6
+ # Create Issue
7
+
8
+ ## Overview
9
+
10
+ Turn a converged discussion into issue(s) that read like **an architect handing a spec to a programmer**: the programmer can locate the work, understand the plan without asking back, and verify done objectively — without the user re-issuing instructions each time.
11
+
12
+ **Core principle — write it as a task dispatch, not a bug note.** Every issue must let a programmer execute end-to-end on first read. That means three things per finding:
13
+ 1. **Stable location** — anchor to a durable identifier (`file` + function/class/symbol/section name, or a short quoted snippet). Line numbers are a *navigation hint only*, always approximate, never the anchor — code shifts and a hard line pin rots immediately and over-constrains the fix.
14
+ 2. **An unambiguous plan** — what to change and why, with no decision left dangling that forces the programmer to come back and ask.
15
+ 3. **An objective acceptance check** — verifiable by behavior/text/data-state plus a runnable command where applicable.
16
+
17
+ An issue that says "the button is wrong" forces the developer to re-investigate what you already know. An issue pinned to `Button.tsx:42` sends them to the wrong line after one edit. Anchor by symbol, plan the work, define done.
18
+
19
+ **Manual-only:** this skill NEVER auto-triggers on keywords (提issue / file an issue / etc.). Run it only when the user explicitly invokes `/create-issue` or names the skill.
20
+
21
+ ## When to Use
22
+
23
+ Only on explicit invocation. Appropriate when a review/investigation has converged — you've already located code and compared against a source of truth, and actionable items emerged.
24
+
25
+ **Not for:** still-exploring discussions, trivial one-line fixes the user is about to do themselves, or vague ideas with no verifiable outcome.
26
+
27
+ ## Workflow
28
+
29
+ 1. **Probe the repo's issue conventions first.** Read `CONTRIBUTING`, issue templates (`.github/`), or any `git-workflow`/ruler docs; skim a recent `gh issue list`. Match their template, labels, title style. Never hardcode another repo's format.
30
+ 2. **Group issues:**
31
+ - **3+ issues → always auto-create one parent/umbrella tracking issue + child issues. Do NOT ask, do NOT discuss.** Children link back with `Refs: #<parent>`; the parent lists children as a checklist and holds the cross-issue map.
32
+ - **Fewer than 3 → apply the Merge vs. Split table.** Confirm via AskUserQuestion only when genuinely ambiguous; otherwise state the default and proceed.
33
+ 3. **Anchor every finding to a stable location.** Anchor by `file` + durable identifier (function/class/method/symbol name, or a short quoted snippet), NOT by a hard line number. A line number may ride along as an approximate hint (`Button.tsx · onSubmit() (~L42)`), but the symbol is the anchor — it survives edits, a line pin doesn't. Pair each with its source-of-truth location (design section, spec criterion). Present as a table: `维度 | 期望(真源) | 现状(代码) | 位置(符号/锚点)`.
34
+ 4. **Plan the work like an architect.** State the intended approach so a programmer can execute without coming back to ask. Resolve the decisions you can already resolve; for genuinely open ones, say so explicitly and give the constraint/tradeoff rather than leaving a silent gap. Name the shared root cause once. Avoid ambiguity: if a phrasing could be read two ways, rewrite it.
35
+ 5. **Draw the boundary.** Explicitly list what's OUT of scope, what stays unchanged, and any knock-on effects on other files/modules — so the developer doesn't "fix" intentional things or miss a ripple. Call out adjacent code the change must NOT break.
36
+ 6. **Make acceptance criteria objective.** Each checkbox judges ONE thing, verifiable by behavior/text/data-state PLUS a runnable command (lint/build/test) where applicable. No "code is cleaner" subjective items.
37
+ 7. **Create via heredoc**, not `-m`/`--body` single-line (literal `\n` won't become newlines). Title in Conventional Commits style. For plain ordinals use `A1`/`第1项`/`` `#1` `` — never bare `#1`/`#2` (GitHub resolves them to issue links).
38
+ 8. **Review created issues — both plan AND code (MANDATORY).** After ALL issues are created, dispatch a subagent to audit them (see section below). The audit has TWO jobs: (a) verify claims match the codebase, and (b) read each issue as the programmer who'll execute it and flag any plan-level defect — ambiguity, missing decision, wrong/risky approach, undefined scope. Fix EVERY problem it reports via `gh issue edit` before reporting done.
39
+ 9. **Report back** the created URL(s) + one-line grouping/boundary summary + what the review found and fixed.
40
+
41
+ ## Post-Creation Review (mandatory)
42
+
43
+ After creating every issue, dispatch a subagent (Explore or general-purpose). Hand it the issue numbers/URLs and have it run BOTH passes below per issue. Reading code consistency alone is not enough — a factually-correct issue can still be unexecutable.
44
+
45
+ **Pass A — Code consistency (does it match reality?):**
46
+ - Every location anchor (file + symbol) actually exists and points at the claimed code. (Don't fail an issue over a stale line-number hint — anchors are symbols; line numbers are approximate by design.)
47
+ - Each acceptance criterion is objectively verifiable (a real command / path / behavior), not aspirational.
48
+ - Claims about current state (bugs, missing permissions/config, signatures) are true in the code TODAY.
49
+ - No finding contradicts the codebase or describes work already done.
50
+
51
+ **Pass B — Plan soundness (read it as the assigned programmer):** Ask "could I execute this start-to-finish without coming back to ask a question?"
52
+ - **Ambiguity:** any sentence open to two readings; vague pronouns; "fix the handling" with no defined target behavior.
53
+ - **Missing decision:** the issue defers a choice it should have made (which API, which file, which pattern) and leaves the programmer guessing.
54
+ - **Wrong/risky approach:** the proposed plan would break adjacent code, fight an existing convention (check ruler/CLAUDE.md), or pick a clearly worse path.
55
+ - **Undefined scope/boundary:** no out-of-scope statement, or knock-on effects on other modules not called out.
56
+ - **Acceptance ≠ goal:** the checkboxes, even if objective, don't actually prove the stated goal is met.
57
+ - **Structural:** `Refs:`/parent links correct; no bare `#n` ordinal mis-links; 3+ issues have an umbrella.
58
+
59
+ The subagent returns a per-issue defect list spanning both passes. **You MUST fix ALL reported problems** via `gh issue edit` (heredoc), then re-verify. Do not report the task complete while any reported problem stands unfixed.
60
+
61
+ ## Merge vs. Split (only when <3 issues)
62
+
63
+ | Signal | Action |
64
+ |--------|--------|
65
+ | Same component / source-of-truth target / change cycle, mutually non-blocking | One issue, internal groups (A/B/C) |
66
+ | Different host (e.g. web vs. mobile/Flutter), independent tracking/rollback, one item far heavier | Split, link with `Refs:` |
67
+ | User explicitly asks to split/merge | Follow user, link related ones |
68
+
69
+ ## Common Mistakes
70
+
71
+ - **Pinning to a hard line number** → after one edit the anchor points at the wrong code and over-constrains the fix. Anchor by file + symbol; line numbers are an approximate hint only.
72
+ - **Filename with no symbol anchor at all** → developer re-hunts. Always name the function/class/section.
73
+ - **Writing a bug note, not a task spec** → "X is wrong" with no plan leaves the programmer to redesign. State the intended approach.
74
+ - **Leaving a decision dangling** → "handle this better" forces a round-trip question. Resolve it, or state the constraint explicitly if genuinely open.
75
+ - **Acceptance criteria all subjective/visual** → not verifiable. Attach a command or observable behavior.
76
+ - **Acceptance that doesn't prove the goal** → objective but checks the wrong thing. Tie each checkbox to the stated goal.
77
+ - **Asking about grouping for 3+ issues** → don't. Auto-create umbrella + children.
78
+ - **Post-creation review only checks code, not the plan** → ships factually-correct but unexecutable/ambiguous issues. Run BOTH passes (code consistency + plan soundness).
79
+ - **No out-of-scope section** → developer changes intentional things or misses a ripple. Always state the boundary and knock-on effects.
80
+ - **`-m "...\n..."`** → literal `\n` in the issue body. Use heredoc `--body-file -`.
81
+ - **Bare `#1`/`#2` for ordinals** → GitHub mis-links them. Use `A1` / backticks.
82
+
83
+ ## Red Flags — stop and fix before reporting done
84
+
85
+ - About to anchor a finding to a bare line number, or with no symbol/source-of-truth reference at all.
86
+ - The issue describes what's wrong but not what to do about it — a programmer would have to design the fix from scratch.
87
+ - A sentence in the issue could be read two ways, or defers a decision the issue should have made.
88
+ - An acceptance checkbox you can't verify by running something or observing a concrete state — or that doesn't actually prove the goal.
89
+ - 3+ issues created without an umbrella, or related issues without `Refs:`.
90
+ - Reported done without running BOTH review passes (code + plan) and fixing every finding.
@@ -0,0 +1,290 @@
1
+ ---
2
+ name: delivering-design-handoff
3
+ description: 仅在用户显式调用 $delivering-design-handoff 或明确要求使用 delivering-design-handoff 技能时使用;不要通过关键词、任务类型或上下文自动触发。
4
+ ---
5
+
6
+ # Delivering Design Handoff
7
+
8
+ ## Overview
9
+
10
+ Turn an approved design into a ready-to-assign engineering package with one closed loop: spec, spec review and fixes, implementation plan, plan review and fixes, handoff doc, issue, branch, commit, push, issue assignment comment, and copyable assignment text.
11
+
12
+ **Core principle:** after the design is approved, the user should not have to restate the delivery choreography. Each review gate must be completed and fixed before the next artifact is written.
13
+
14
+ ## When To Use
15
+
16
+ Use this only after the solution direction is already approved. If the design is still being explored, first use `brainstorming`.
17
+
18
+ Typical user asks:
19
+
20
+ - “把这个方案写成设计文档并提 issue”
21
+ - “写计划和交接文档,提交到 issue 分支”
22
+ - “后续不想重复输入,从设计文档到 issue/分支/提交都自动做”
23
+ - “给我一段可以直接复制给工程师的任务分配文字”
24
+
25
+ ## Required Output Contract
26
+
27
+ By the end, produce all of these or clearly state the blocker:
28
+
29
+ | Item | Required shape |
30
+ | --- | --- |
31
+ | Design spec | `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md`, created using the design-doc discipline from `brainstorming` |
32
+ | Spec adversarial review | Reviewer subagent completed before the plan exists; valid findings applied to the spec, or explicit rejected findings with reasons |
33
+ | Implementation plan | `docs/superpowers/plans/YYYY-MM-DD-<topic>.md`, created by using `writing-plans` |
34
+ | Plan adversarial review | Reviewer subagent findings applied to the plan, or explicit rejected findings with reasons |
35
+ | Handoff doc | `docs/superpowers/handoffs/YYYY-MM-DD-<topic>-handoff.md` |
36
+ | GitHub issue | Structured issue with background, goals, plan, acceptance criteria, and doc paths |
37
+ | Issue branch | `codex/docs/<issue-id>-<slug>` for docs-only handoff, or matching repo convention |
38
+ | Commit | Conventional commit ending with `Refs: #<issue-id>` |
39
+ | Push | Branch pushed with upstream |
40
+ | Issue comment | Comment linking branch, commit, spec, plan, and handoff, plus the same project-manager-style assignment block from the final answer |
41
+ | Final answer | Short status plus a copyable project-manager-style assignment block |
42
+
43
+ ## Workflow
44
+
45
+ ### 1. Confirm starting state
46
+
47
+ - Read project instructions: `AGENTS.md`, referenced ruler docs, and git workflow docs.
48
+ - Check branch and worktree:
49
+
50
+ ```bash
51
+ rtk git status --short --branch
52
+ rtk git remote -v
53
+ rtk gh auth status
54
+ ```
55
+
56
+ - If there are unrelated dirty changes, do not overwrite them. If the handoff docs are the only dirty files, continue.
57
+
58
+ ### 2. Write the design spec
59
+
60
+ Use `brainstorming` for the design-document phase. If the conversation already contains an approved design, do not restart exploratory questioning; treat that approved discussion as the input and apply `brainstorming`'s write-design-doc and self-review standards.
61
+
62
+ Create `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md`.
63
+
64
+ Spec sections:
65
+
66
+ - Background
67
+ - Goals
68
+ - Non-goals
69
+ - Chosen approach and rejected alternatives
70
+ - Backend/frontend/data/API design as applicable
71
+ - Error handling
72
+ - Testing and verification
73
+ - Compatibility and risks
74
+ - Acceptance criteria
75
+
76
+ Run a self-review:
77
+
78
+ ```bash
79
+ rtk rg -n "TBD|TODO|待定|占位|\\.\\.\\." <spec-path>
80
+ ```
81
+
82
+ Fix every hit that is a placeholder. A literal example such as `new BasePaginationResponseDto(total, page, limit, items)` is allowed; vague ellipses are not.
83
+
84
+ ### 3. Dispatch adversarial review
85
+
86
+ Spawn one reviewer subagent. The prompt must include:
87
+
88
+ - spec path
89
+ - repo root
90
+ - current approved design context
91
+ - review axes: correctness, missing edge cases, repo convention violations, testability, and handoff ambiguity
92
+ - “read-only, do not modify files”
93
+
94
+ Apply all valid findings to the spec. If rejecting a finding, record the reason in the handoff doc's review notes and mention it briefly in the final answer only if material.
95
+
96
+ **Gate before planning:** do not create the implementation plan until the reviewer subagent has returned, every valid spec finding has been fixed, every rejected finding has a recorded reason, and the spec placeholder scan has passed again. If the reviewer subagent is still running, timed out, or failed, this gate is not complete. If the user asks to save time by writing the plan while review or fixes are pending, decline that shortcut and finish this gate first.
97
+
98
+ ### 4. Create the implementation plan
99
+
100
+ Announce and use `writing-plans`:
101
+
102
+ > I'm using the writing-plans skill to create the implementation plan.
103
+
104
+ Start this step only after Step 3 is complete.
105
+
106
+ Create `docs/superpowers/plans/YYYY-MM-DD-<topic>.md` using the `writing-plans` required structure:
107
+
108
+ - header with goal, architecture, tech stack, and global constraints
109
+ - file map before tasks
110
+ - bite-sized tasks with exact files, interfaces, steps, commands, and expected results
111
+ - self-review for spec coverage, placeholders, and type consistency
112
+
113
+ Run placeholder scan:
114
+
115
+ ```bash
116
+ rtk rg -n "TBD|TODO|待定|占位|\\.\\.\\." <plan-path>
117
+ ```
118
+
119
+ Fix every true placeholder. Do not proceed to handoff until the plan can guide an engineer without asking back.
120
+
121
+ ### 5. Dispatch plan adversarial review
122
+
123
+ Spawn one reviewer subagent for the plan. The prompt must include:
124
+
125
+ - spec path
126
+ - plan path
127
+ - repo root
128
+ - review axes: spec coverage, task order, file ownership, testability, missing code/commands, placeholders, type/interface consistency, and repo convention violations
129
+ - “read-only, do not modify files”
130
+
131
+ Apply all valid findings to the plan. If a finding reveals a spec defect, fix the spec too and re-check plan consistency.
132
+
133
+ ### 6. Write the handoff document
134
+
135
+ Create `docs/superpowers/handoffs/YYYY-MM-DD-<topic>-handoff.md`.
136
+
137
+ This is separate from the implementation plan. It is the short assignment packet for a human engineer:
138
+
139
+ - Issue title and eventual issue id placeholder until issue exists
140
+ - branch name placeholder until branch exists
141
+ - links/paths to spec and plan
142
+ - why the work matters
143
+ - implementation order summary
144
+ - top risks and invariants
145
+ - required verification commands
146
+ - delivery boundary and acceptance checklist pointer
147
+
148
+ Run placeholder scan over all docs. Placeholders that must be filled before commit, such as issue id after creation, must not remain.
149
+
150
+ ```bash
151
+ rtk rg -n "TBD|TODO|待定|占位|\\.\\.\\." <spec-path> <plan-path> <handoff-path>
152
+ ```
153
+
154
+ ### 7. Create the GitHub issue
155
+
156
+ Use heredoc, never `-m` or literal `\n`.
157
+
158
+ Issue body must include:
159
+
160
+ - Background
161
+ - Goals
162
+ - Plan
163
+ - Acceptance criteria with objective checkboxes
164
+ - Links or paths to the spec, implementation plan, and handoff doc
165
+
166
+ Labels should match repo conventions. Prefer labels for backend/frontend/admin/database/api/docs when they exist.
167
+
168
+ After issue creation, fill the concrete issue id and URL into the handoff doc if it used placeholders.
169
+
170
+ ### 8. Create the issue branch
171
+
172
+ Fetch the base and create a clean issue branch:
173
+
174
+ ```bash
175
+ rtk git fetch origin main --prune
176
+ rtk git switch -c codex/docs/<issue-id>-<slug> origin/main
177
+ ```
178
+
179
+ If the spec was created before switching, remember that untracked files usually follow the checkout but tracked edits may not. Verify both docs are present after the switch. If content disappears, recover it intentionally with `git show`, `git stash`, or re-apply the patch; never use destructive checkout/reset.
180
+
181
+ After branch creation, fill the concrete branch name into the handoff doc if needed. Run final placeholder scan:
182
+
183
+ ```bash
184
+ rtk rg -n "TBD|TODO|待定|占位|\\.\\.\\." <spec-path> <plan-path> <handoff-path>
185
+ ```
186
+
187
+ ### 9. Commit and push
188
+
189
+ Stage only the intended docs:
190
+
191
+ ```bash
192
+ rtk git add <spec-path> <plan-path> <handoff-path>
193
+ rtk git diff --cached --stat
194
+ rtk git diff --cached --check
195
+ ```
196
+
197
+ Commit:
198
+
199
+ ```bash
200
+ rtk git commit -F - <<'MSG'
201
+ docs: add <topic> handoff
202
+
203
+ 变更说明:
204
+ - 新增设计文档,固化已确认方案、风险、测试和验收标准。
205
+ - 新增实施计划和交接文档,拆分实现任务、文件范围和验证命令。
206
+
207
+ Refs: #<issue-id>
208
+ MSG
209
+ ```
210
+
211
+ Push:
212
+
213
+ ```bash
214
+ rtk git push -u origin <branch>
215
+ ```
216
+
217
+ Comment on the issue with branch, commit, spec path, plan path, handoff path, and the copyable project-manager-style assignment block from the final answer. This issue comment is mandatory; do not finish with only a local final answer.
218
+
219
+ ### 10. Do not create a pull request
220
+
221
+ This skill stops after the handoff docs are committed, pushed to the remote issue branch, and linked from the GitHub issue comment. Do not create or update a PR for the docs-only handoff branch as part of this workflow, even when the repository's normal implementation flow expects PRs.
222
+
223
+ If the user explicitly asks for a PR, treat that as a separate follow-up workflow after this handoff is complete.
224
+
225
+ ### 11. Final verification
226
+
227
+ Before claiming completion, run:
228
+
229
+ ```bash
230
+ rtk git status --short --branch
231
+ rtk git log -1 --oneline
232
+ rtk git rev-parse --abbrev-ref --symbolic-full-name @{u}
233
+ ```
234
+
235
+ Report actual state. If no tests/builds were run because this is docs-only, say that.
236
+
237
+ Read back the issue comments and verify that the latest handoff comment contains the branch, commit, spec path, plan path, handoff path, and the same assignment block shown in the final answer. If `gh issue comment` failed, the comment is missing, or the readback does not match the final assignment block, fix that before claiming completion.
238
+
239
+ ## Final Answer Template
240
+
241
+ Keep it short, then include this copyable block:
242
+
243
+ ```markdown
244
+ 已准备好交接资料:
245
+
246
+ - Issue:#<issue-id> <issue-url>
247
+ - 分支:`<branch>`
248
+ - 提交:`<sha> <subject>`
249
+ - 设计文档:`<spec-path>`
250
+ - 实施计划:`<plan-path>`
251
+ - 交接文档:`<handoff-path>`
252
+
253
+ 以下交接评论已同步写入 Issue,可直接派发给开发工程师:
254
+
255
+ 请基于 `<branch>` 接手实现 Issue #<issue-id>:<issue-title>。
256
+
257
+ 先阅读:
258
+ 1. `<spec-path>`
259
+ 2. `<plan-path>`
260
+ 3. `<handoff-path>`
261
+
262
+ 实现时请按实施计划的 Task 顺序推进,并重点守住以下约束:
263
+ - <top-risk-or-constraint-1>
264
+ - <top-risk-or-constraint-2>
265
+ - <top-risk-or-constraint-3>
266
+
267
+ 完成后请至少运行:
268
+ - `<verification-command-1>`
269
+ - `<verification-command-2>`
270
+ - `<verification-command-3>`
271
+
272
+ 验收标准以 Issue #<issue-id> 的 checklist 为准。实现过程中如遇到与设计文档冲突的细节,先在 Issue 中同步风险和建议处理方式。
273
+ ```
274
+
275
+ In Codex app, after successful git actions, also emit the app directives for branch creation, staging, commit, and push.
276
+
277
+ ## Common Mistakes
278
+
279
+ - Writing the issue before the spec is stable and then forgetting to update links.
280
+ - Writing the implementation plan before spec adversarial review has completed and valid findings have been fixed.
281
+ - Skipping adversarial review because the spec “looks obvious”.
282
+ - Treating the handoff doc as the implementation plan. The implementation plan must be produced with `writing-plans`, reviewed, and fixed before the handoff doc.
283
+ - Skipping adversarial review of the implementation plan.
284
+ - Creating the branch from the current stale feature branch instead of `origin/main`.
285
+ - Committing on an unrelated branch.
286
+ - Writing a handoff that says “add tests” without exact files, behaviors, and commands.
287
+ - Forgetting the issue comment, leaving the receiving engineer to hunt for branch and docs.
288
+ - Posting an issue comment with links only, but omitting the project-manager-style assignment block.
289
+ - Creating or updating a PR for the docs-only handoff branch instead of stopping after commit, push, and issue comment.
290
+ - Final answer lists artifacts but omits the copyable project-manager-style assignment block.
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: doctor
3
+ description: 仅在用户显式调用 $doctor 或明确要求使用 doctor 技能时使用;不要通过关键词、任务类型或上下文自动触发。
4
+ ---
5
+
6
+ # Doctor
7
+
8
+ ## 概览
9
+
10
+ 本技能用于把当前机器调整到可稳定运行 agent 开发工作流的状态。
11
+
12
+ 不要把执行路径写死。模型应先识别当前系统、shell、包管理器、已有工具版本与用户权限,再自行选择最合适的检测和修复方式。完成修复后必须复检,并给出可读报告。
13
+
14
+ ## 目标状态
15
+
16
+ 最终环境应尽量满足:
17
+
18
+ - `python3` 可用。
19
+ - `python` 可调用 Python 3,或有清晰说明当前系统无需/不应创建该别名。
20
+ - `node`、`npm`、`pnpm` 可用,且满足当前工作流需要。
21
+ - `dx` 可用,并已完成必要初始化。
22
+ - `agent-browser` 可用,且 Chromium/浏览器依赖已安装到可运行状态。
23
+ - `rg`(rip grep)可用。
24
+ - `gh`(GitHub CLI)可用;若当前工作流需要 GitHub 操作,还应完成认证。
25
+ - `rtk` 可用,且明确是 [rtk-ai/rtk](https://github.com/rtk-ai/rtk);不能把其他同名二进制当作通过。
26
+ - [rtk-ai/rtk](https://github.com/rtk-ai/rtk) 已分别完成 Codex CLI 与 Claude Code 的初始化。
27
+ - 常用 PATH 配置在当前 shell 中可生效;若需要持久化,说明写入了哪个 shell 配置文件。
28
+
29
+ ## 执行原则
30
+
31
+ - 先诊断,再修复;不要未经确认就重复安装已经健康的工具。
32
+ - 优先使用系统已有的包管理器和用户态安装路径。
33
+ - 遇到多个可行方案时,选择对系统影响最小、最容易回滚的方案。
34
+ - 对需要管理员权限、网络下载或会修改 shell 配置的动作,执行前简短说明影响。
35
+ - 不要求固定轮次;根据实际结果迭代,直到通过验收或明确无法继续。
36
+ - 不要强制执行远程安装文档。只有当诊断显示确实需要外部安装指引时,才读取可信来源并按实际情况采用。
37
+
38
+ ## 建议工作流
39
+
40
+ 1. 收集上下文:
41
+ - 操作系统与架构
42
+ - 当前 shell 与 PATH
43
+ - `python3`、`python`、`node`、`npm`、`pnpm`、`dx`、`agent-browser`、`rg`、`gh`、`rtk` 的存在性与版本
44
+ - `gh` 的认证状态(例如 `gh auth status`)
45
+ - `rtk` 是否为 [rtk-ai/rtk](https://github.com/rtk-ai/rtk),以及它对 Codex CLI 与 Claude Code 的初始化状态
46
+ 2. 对照目标状态判断缺口。
47
+ 3. 制定最小修复动作并执行。
48
+ 4. 每次修复后重新验证相关项。
49
+ 5. 所有项目完成后运行一次最终复检。
50
+ 6. 输出报告。
51
+
52
+ ## 验证要求
53
+
54
+ 最终复检至少覆盖:
55
+
56
+ - 每个目标命令是否可被当前 shell 找到。
57
+ - 每个目标命令的版本或基本健康输出。
58
+ - `dx` 的初始化结果或当前初始化状态。
59
+ - `gh --version` 能正常运行;若需要 GitHub 操作,`gh auth status` 应显示可用账号,否则报告未认证原因。
60
+ - `rtk` 必须确认来源为 [rtk-ai/rtk](https://github.com/rtk-ai/rtk)。至少用 `rtk --version`、`rtk --help`、安装来源或命令特征交叉验证;若发现同名非 rtk-ai/rtk 工具,判定为未通过。
61
+ - [rtk-ai/rtk](https://github.com/rtk-ai/rtk) 的 `rtk gain` 能正常运行。
62
+ - [rtk-ai/rtk](https://github.com/rtk-ai/rtk) 的 Codex CLI 初始化必须有明确证据。优先使用 `rtk init --show --codex`,确认全局或本地 Codex 配置已包含 `RTK.md` 与 `AGENTS.md` 引用;若当前 `rtk` 版本命令不同,使用等价的只读检查并在报告中说明。
63
+ - [rtk-ai/rtk](https://github.com/rtk-ai/rtk) 的 Claude Code 初始化必须有明确证据。优先使用 `rtk init --show --agent claude`,确认 Claude Code hook、`RTK.md`、`CLAUDE.md` 引用与 `settings.json` hook 配置处于健康状态;若当前 `rtk` 版本命令不同,使用等价的只读检查并在报告中说明。
64
+ - `agent-browser` 是否能找到并使用已安装的浏览器依赖。
65
+ - 对未通过项给出失败原因、已尝试动作和下一步建议。
66
+
67
+ ## 报告格式
68
+
69
+ 最终报告使用中文,至少包含:
70
+
71
+ - 环境摘要:系统、shell、关键 PATH 变更。
72
+ - 检查结果表:检查项、状态、版本/证据、说明。
73
+ - RTK 初始化:分别列出 Codex CLI 与 Claude Code 的检查命令、通过/失败状态、关键证据文件或 hook。
74
+ - 已执行修复:实际执行过的安装、链接、初始化或配置变更。
75
+ - 未完成项:若存在,说明阻塞原因和用户需要做什么。
76
+ - 结论:通过 / 部分通过 / 未通过。
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: gh-dependabot-cleanup
3
+ description: 仅在用户显式调用 $gh-dependabot-cleanup 或明确要求使用 gh-dependabot-cleanup 技能时使用;不要通过关键词、任务类型或上下文自动触发。
4
+ ---
5
+
6
+ # GH Dependabot Cleanup
7
+
8
+ ## Overview
9
+ Use this skill to complete a Dependabot remediation loop with minimal manual input. Rely on `gh` directly, fix all patchable alerts in scope, and document unpatched alerts without auto-dismiss.
10
+
11
+ ## Closed Loop Workflow
12
+ 1. Confirm target and scope in one sentence.
13
+ 2. Fetch open alerts with `gh api`.
14
+ 3. Classify alerts into:
15
+ - patchable: has `first_patched_version`
16
+ - unpatched: no `first_patched_version`
17
+ - direct vs transitive
18
+ 4. Announce remediation plan before edits.
19
+ 5. Apply dependency changes (prefer overrides/resolutions for transitive alerts).
20
+ 6. Refresh lockfile.
21
+ 7. Run required project verification commands.
22
+ 8. Commit, push, and open exactly one PR.
23
+ 9. Report residual risk (unpatched alerts) in PR and final reply.
24
+
25
+ ## Default Commands
26
+ ```bash
27
+ # 1) Fetch open alerts JSON
28
+ gh api -H 'Accept: application/vnd.github+json' \
29
+ '/repos/OWNER/REPO/dependabot/alerts?state=open&per_page=100'
30
+
31
+ # 2) Tabular triage view
32
+ gh api -H 'Accept: application/vnd.github+json' \
33
+ '/repos/OWNER/REPO/dependabot/alerts?state=open&per_page=100' \
34
+ | jq -r '.[] | [.number, .security_vulnerability.package.name, .dependency.relationship, .security_advisory.severity, (.security_vulnerability.first_patched_version.identifier // "none"), .security_vulnerability.vulnerable_version_range, .html_url] | @tsv'
35
+
36
+ # 3) Typical lock refresh (adapt to repo)
37
+ pnpm install --lockfile-only
38
+ ```
39
+
40
+ ## Decision Rules
41
+ - Keep unpatched alerts open by default; do not dismiss unless explicitly requested.
42
+ - If one package maps to multiple alerts, upgrade once to the highest required safe version.
43
+ - Keep the PR focused on security dependency remediation only.
44
+ - If repo has branch/issue conventions, follow them strictly.
45
+
46
+ ## PR Requirements
47
+ Include these sections:
48
+ 1. Fixed alerts: alert id, package, target version
49
+ 2. Remaining alerts: alert id, reason (for example, no upstream patch)
50
+ 3. Verification: exact commands run and outcomes
51
+ 4. Risk note: what is deferred and why
52
+
53
+ ## Fast Trigger
54
+ 修复安全警告
@@ -0,0 +1,7 @@
1
+ interface:
2
+ display_name: "Dependabot Cleanup PR"
3
+ short_description: "Fix GitHub Dependabot alerts in one PR workflow"
4
+ default_prompt: "Use $gh-dependabot-cleanup to remediate open Dependabot alerts and create one PR."
5
+
6
+ policy:
7
+ allow_implicit_invocation: false