@shirlytaylor73/superharness 1.5.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/LICENSE +21 -0
- package/README.md +202 -0
- package/bin/lib/codex-installer.js +228 -0
- package/bin/lib/interactive-select.js +96 -0
- package/bin/superharness.js +67 -0
- package/package.json +52 -0
- package/plugins/superharness/.claude-plugin/plugin.json +19 -0
- package/plugins/superharness/.codex-plugin/plugin.json +31 -0
- package/plugins/superharness/.mcp.json +9 -0
- package/plugins/superharness/CODE_OF_CONDUCT.md +79 -0
- package/plugins/superharness/LICENSE +21 -0
- package/plugins/superharness/README.md +57 -0
- package/plugins/superharness/agents/code-reviewer.md +48 -0
- package/plugins/superharness/archived-skills/using-superpowers/SKILL.md +140 -0
- package/plugins/superharness/archived-skills/using-superpowers/references/codex-tools.md +25 -0
- package/plugins/superharness/archived-skills/using-superpowers/references/copilot-tools.md +52 -0
- package/plugins/superharness/archived-skills/using-superpowers/references/gemini-tools.md +33 -0
- package/plugins/superharness/archived-skills/using-superpowers/references/hermes-tools.md +44 -0
- package/plugins/superharness/commands/free.md +6 -0
- package/plugins/superharness/commands/rollback.md +30 -0
- package/plugins/superharness/commands-codex/free.md +29 -0
- package/plugins/superharness/commands-codex/rollback.md +33 -0
- package/plugins/superharness/hooks/hooks-codex.json +50 -0
- package/plugins/superharness/hooks/hooks.json +50 -0
- package/plugins/superharness/hooks/lib/free-mode-check.mjs +27 -0
- package/plugins/superharness/hooks/run-hook.cmd +58 -0
- package/plugins/superharness/hooks/workflow-context +4 -0
- package/plugins/superharness/hooks/workflow-context.mjs +184 -0
- package/plugins/superharness/hooks/workflow-post-transition +4 -0
- package/plugins/superharness/hooks/workflow-post-transition.mjs +89 -0
- package/plugins/superharness/hooks/workflow-pre-tool-use +4 -0
- package/plugins/superharness/hooks/workflow-pre-tool-use.mjs +97 -0
- package/plugins/superharness/hooks/workflow-stop +4 -0
- package/plugins/superharness/hooks/workflow-stop.mjs +136 -0
- package/plugins/superharness/scripts/rollback.mjs +86 -0
- package/plugins/superharness/scripts/set-free-mode.mjs +77 -0
- package/plugins/superharness/skills/brainstorming/SKILL.md +182 -0
- package/plugins/superharness/skills/brainstorming/scripts/frame-template.html +214 -0
- package/plugins/superharness/skills/brainstorming/scripts/helper.js +88 -0
- package/plugins/superharness/skills/brainstorming/scripts/server.cjs +338 -0
- package/plugins/superharness/skills/brainstorming/scripts/start-server.sh +153 -0
- package/plugins/superharness/skills/brainstorming/scripts/stop-server.sh +55 -0
- package/plugins/superharness/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/plugins/superharness/skills/brainstorming/visual-companion.md +286 -0
- package/plugins/superharness/skills/chinese-code-review/SKILL.md +277 -0
- package/plugins/superharness/skills/chinese-commit-conventions/SKILL.md +364 -0
- package/plugins/superharness/skills/chinese-documentation/SKILL.md +448 -0
- package/plugins/superharness/skills/chinese-git-workflow/SKILL.md +547 -0
- package/plugins/superharness/skills/dispatching-parallel-agents/SKILL.md +186 -0
- package/plugins/superharness/skills/exploration/SKILL.md +197 -0
- package/plugins/superharness/skills/finishing/SKILL.md +200 -0
- package/plugins/superharness/skills/intake/SKILL.md +134 -0
- package/plugins/superharness/skills/mcp-builder/SKILL.md +255 -0
- package/plugins/superharness/skills/parallel-execution/SKILL.md +368 -0
- package/plugins/superharness/skills/parallel-execution/implementer-prompt.md +144 -0
- package/plugins/superharness/skills/parallel-execution/spec-reviewer-prompt.md +84 -0
- package/plugins/superharness/skills/parallel-execution/wave-final-manual-qa-prompt.md +61 -0
- package/plugins/superharness/skills/parallel-execution/wave-final-quality-prompt.md +59 -0
- package/plugins/superharness/skills/parallel-execution/wave-final-scope-fidelity-prompt.md +69 -0
- package/plugins/superharness/skills/parallel-execution/wave-final-spec-prompt.md +56 -0
- package/plugins/superharness/skills/planning/SKILL.md +265 -0
- package/plugins/superharness/skills/planning/plan-document-reviewer-prompt.md +80 -0
- package/plugins/superharness/skills/receiving-code-review/SKILL.md +213 -0
- package/plugins/superharness/skills/requesting-code-review/SKILL.md +107 -0
- package/plugins/superharness/skills/requesting-code-review/code-reviewer.md +146 -0
- package/plugins/superharness/skills/serial-execution/SKILL.md +183 -0
- package/plugins/superharness/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/plugins/superharness/skills/systematic-debugging/SKILL.md +320 -0
- package/plugins/superharness/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/plugins/superharness/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/plugins/superharness/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/plugins/superharness/skills/systematic-debugging/find-polluter.sh +63 -0
- package/plugins/superharness/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/plugins/superharness/skills/systematic-debugging/test-academic.md +14 -0
- package/plugins/superharness/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/plugins/superharness/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/plugins/superharness/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/plugins/superharness/skills/test-driven-development/SKILL.md +371 -0
- package/plugins/superharness/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/plugins/superharness/skills/trivial/SKILL.md +118 -0
- package/plugins/superharness/skills/using-git-worktrees/SKILL.md +218 -0
- package/plugins/superharness/skills/verification/SKILL.md +139 -0
- package/plugins/superharness/skills/workflow-runner/SKILL.md +172 -0
- package/plugins/superharness/skills/writing-skills/SKILL.md +655 -0
- package/plugins/superharness/skills/writing-skills/anthropic-best-practices.md +1149 -0
- package/plugins/superharness/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/plugins/superharness/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/plugins/superharness/skills/writing-skills/persuasion-principles.md +187 -0
- package/plugins/superharness/skills/writing-skills/render-graphs.js +168 -0
- package/plugins/superharness/skills/writing-skills/testing-skills-with-subagents.md +385 -0
- package/plugins/superharness/workflow/default-workflow.yaml +84 -0
- package/plugins/superharness/workflow-state-server/bootstrap.js +44 -0
- package/plugins/superharness/workflow-state-server/package-lock.json +2853 -0
- package/plugins/superharness/workflow-state-server/package.json +22 -0
- package/plugins/superharness/workflow-state-server/render-context.js +124 -0
- package/plugins/superharness/workflow-state-server/schema.sql +39 -0
- package/plugins/superharness/workflow-state-server/server.js +290 -0
- package/plugins/superharness/workflow-state-server/state.js +424 -0
- package/plugins/superharness/workflow-state-server/validate-workflow.js +165 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "superharness",
|
|
3
|
+
"description": "Programmatic workflow harness for AI coding agents: state-machine driven skills, hooks, and MCP state management.",
|
|
4
|
+
"version": "1.5.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "ShirlyTaylor73",
|
|
7
|
+
"url": "https://github.com/ShirlyTaylor73"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/ShirlyTaylor73/superharness",
|
|
10
|
+
"repository": "https://github.com/ShirlyTaylor73/superharness",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": ["skills", "tdd", "debugging", "chinese", "中文", "best-practices", "workflows"],
|
|
13
|
+
"skills": "./skills/",
|
|
14
|
+
"hooks": "./hooks/hooks-codex.json",
|
|
15
|
+
"mcpServers": "./.mcp.json",
|
|
16
|
+
"interface": {
|
|
17
|
+
"displayName": "Superharness",
|
|
18
|
+
"shortDescription": "AI coding workflow harness with skills, hooks, and state MCP.",
|
|
19
|
+
"longDescription": "Superharness provides state-machine driven skills, workflow-state hooks, and a state MCP for AI coding agents. It injects current workflow context, guards .superharness state files, and supports Claude Code and Codex.",
|
|
20
|
+
"developerName": "ShirlyTaylor73",
|
|
21
|
+
"category": "Productivity",
|
|
22
|
+
"capabilities": ["Interactive", "Write", "Hooks"],
|
|
23
|
+
"websiteURL": "https://github.com/ShirlyTaylor73/superharness",
|
|
24
|
+
"defaultPrompt": [
|
|
25
|
+
"使用 superharness 帮我制定开发计划。",
|
|
26
|
+
"用系统化调试方法分析这个问题。",
|
|
27
|
+
"按中文代码审查标准 review 当前改动。"
|
|
28
|
+
],
|
|
29
|
+
"brandColor": "#D97706"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# 贡献者公约行为准则
|
|
2
|
+
|
|
3
|
+
## 我们的承诺
|
|
4
|
+
|
|
5
|
+
作为成员、贡献者和领导者,我们承诺让每个人都能在我们的社区中获得无骚扰的体验,无论其年龄、体型、可见或不可见的残疾、民族、性别特征、性别认同与表达、经验水平、教育程度、社会经济地位、国籍、外貌、种族、宗教或性取向如何。
|
|
6
|
+
|
|
7
|
+
我们承诺以有助于建设一个开放、友好、多元、包容且健康的社区的方式行事和互动。
|
|
8
|
+
|
|
9
|
+
## 我们的标准
|
|
10
|
+
|
|
11
|
+
有助于为社区营造积极环境的行为包括:
|
|
12
|
+
|
|
13
|
+
* 对他人表现出同理心和善意
|
|
14
|
+
* 尊重不同的观点、看法和经历
|
|
15
|
+
* 给予和优雅地接受建设性反馈
|
|
16
|
+
* 为自己的错误承担责任并向受影响者道歉,同时从中吸取教训
|
|
17
|
+
* 关注的不仅是个人的最佳利益,还有整个社区的最佳利益
|
|
18
|
+
|
|
19
|
+
不可接受的行为包括:
|
|
20
|
+
|
|
21
|
+
* 使用性暗示的语言或图像,以及任何形式的性关注或挑逗
|
|
22
|
+
* 挑衅、侮辱性或贬低性评论,以及人身攻击或政治攻击
|
|
23
|
+
* 公开或私下的骚扰
|
|
24
|
+
* 未经明确许可,发布他人的私人信息,如物理地址或电子邮件地址
|
|
25
|
+
* 其他在专业环境中被合理认为不恰当的行为
|
|
26
|
+
|
|
27
|
+
## 执行责任
|
|
28
|
+
|
|
29
|
+
社区领导者负责阐明和执行我们的行为标准,并对任何他们认为不恰当、具有威胁性、冒犯性或有害的行为采取适当且公平的纠正措施。
|
|
30
|
+
|
|
31
|
+
社区领导者有权利和责任删除、编辑或拒绝不符合本行为准则的评论、提交、代码、Wiki 编辑、Issue 和其他贡献,并在适当时说明审核决定的原因。
|
|
32
|
+
|
|
33
|
+
## 适用范围
|
|
34
|
+
|
|
35
|
+
本行为准则适用于所有社区空间,也适用于个人在公共空间中正式代表社区的情况。代表社区的例子包括使用官方电子邮件地址、通过官方社交媒体账号发帖,或在线上或线下活动中担任指定代表。
|
|
36
|
+
|
|
37
|
+
## 执行
|
|
38
|
+
|
|
39
|
+
可以向负责执行的社区领导者报告滥用、骚扰或其他不可接受的行为,联系方式为 jesse@primeradiant.com。所有投诉将被及时、公正地审查和调查。
|
|
40
|
+
|
|
41
|
+
所有社区领导者都有义务尊重事件报告者的隐私和安全。
|
|
42
|
+
|
|
43
|
+
## 执行指南
|
|
44
|
+
|
|
45
|
+
社区领导者将遵循以下社区影响指南,以确定对违反本行为准则的行为的处理方式:
|
|
46
|
+
|
|
47
|
+
### 1. 纠正
|
|
48
|
+
|
|
49
|
+
**社区影响**:使用不恰当的语言或其他在社区中被视为不专业或不受欢迎的行为。
|
|
50
|
+
|
|
51
|
+
**后果**:社区领导者发出私下书面警告,说明违规的性质以及该行为不恰当的原因。可能会要求公开道歉。
|
|
52
|
+
|
|
53
|
+
### 2. 警告
|
|
54
|
+
|
|
55
|
+
**社区影响**:通过单次事件或一系列行为造成的违规。
|
|
56
|
+
|
|
57
|
+
**后果**:发出警告,说明持续此类行为的后果。在指定时间内,不得与相关人员互动,包括与执行行为准则的人员进行非主动的互动。这包括避免在社区空间以及社交媒体等外部渠道中的互动。违反这些条款可能导致临时或永久封禁。
|
|
58
|
+
|
|
59
|
+
### 3. 临时封禁
|
|
60
|
+
|
|
61
|
+
**社区影响**:严重违反社区标准,包括持续的不恰当行为。
|
|
62
|
+
|
|
63
|
+
**后果**:在指定时间内临时禁止与社区进行任何形式的互动或公开沟通。在此期间,不允许与相关人员进行任何公开或私下互动,包括与执行行为准则的人员进行非主动的互动。违反这些条款可能导致永久封禁。
|
|
64
|
+
|
|
65
|
+
### 4. 永久封禁
|
|
66
|
+
|
|
67
|
+
**社区影响**:表现出持续违反社区标准的模式,包括持续的不恰当行为、对个人的骚扰,或对某类群体的攻击或贬低。
|
|
68
|
+
|
|
69
|
+
**后果**:永久禁止在社区内进行任何形式的公开互动。
|
|
70
|
+
|
|
71
|
+
## 来源
|
|
72
|
+
|
|
73
|
+
本行为准则改编自[贡献者公约][homepage] 2.0 版本,可在 https://www.contributor-covenant.org/version/2/0/code_of_conduct.html 查看。
|
|
74
|
+
|
|
75
|
+
社区影响指南受到 [Mozilla 行为准则执行阶梯](https://github.com/mozilla/diversity)的启发。
|
|
76
|
+
|
|
77
|
+
[homepage]: https://www.contributor-covenant.org
|
|
78
|
+
|
|
79
|
+
有关本行为准则的常见问题,请参阅 https://www.contributor-covenant.org/faq。翻译版本可在 https://www.contributor-covenant.org/translations 查看。
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 jnMetaCode
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Superharness Plugin
|
|
2
|
+
|
|
3
|
+
This plugin package contains the Superharness runtime for AI coding agents.
|
|
4
|
+
|
|
5
|
+
It provides:
|
|
6
|
+
|
|
7
|
+
- State-machine driven skills for structured software development workflows.
|
|
8
|
+
- Claude Code / Codex hooks for workflow context injection and `.superharness/` write protection.
|
|
9
|
+
- A programmatic workflow state server backed by SQLite and configured by YAML.
|
|
10
|
+
- User-controlled workflow rollback through `/rollback [state]`, limited to states that appear in `transition_log`.
|
|
11
|
+
- Session-level workflow context pause and resume through `/free on|off|status`, with mutating state tools locked while free mode is on.
|
|
12
|
+
|
|
13
|
+
## Layout
|
|
14
|
+
|
|
15
|
+
| Path | Purpose |
|
|
16
|
+
|---|---|
|
|
17
|
+
| `.claude-plugin/` | Claude Code plugin metadata |
|
|
18
|
+
| `.codex-plugin/` | Codex plugin metadata and interface metadata |
|
|
19
|
+
| `skills/` | Active skills discovered by supported agents |
|
|
20
|
+
| `workflow/` | Workflow graph configuration |
|
|
21
|
+
| `workflow-state-server/` | MCP server, state store, renderer, and tests |
|
|
22
|
+
| `hooks/` | Claude Code / Codex hook config and commands |
|
|
23
|
+
| `commands/` | Claude Code slash command markdown |
|
|
24
|
+
| `commands-codex/` | Codex command templates rendered by the npx installer |
|
|
25
|
+
| `archived-skills/` | Historical disabled skills that must not be registered |
|
|
26
|
+
|
|
27
|
+
## Runtime Entry
|
|
28
|
+
|
|
29
|
+
The old text bootstrap entry has been removed from runtime. Superharness starts from workflow context:
|
|
30
|
+
|
|
31
|
+
- Claude Code / Codex: `UserPromptSubmit -> workflow-context`
|
|
32
|
+
- Claude Code / Codex: `PreToolUse -> workflow-pre-tool-use`
|
|
33
|
+
- State tools: `superharness-workflow-state`
|
|
34
|
+
|
|
35
|
+
## Codex npx Install
|
|
36
|
+
|
|
37
|
+
Codex skills and command support are installed through the root package:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx @shirlytaylor73/superharness@latest
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The installer asks whether to install into the current project directories or the user-level directories. Project installs write skills to `.agents/skills/` and commands/runtime to `.codex/`; user installs write skills to `~/.agents/skills/` and commands/runtime to `~/.codex/`. Non-interactive installs can use:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx @shirlytaylor73/superharness@latest --project
|
|
47
|
+
npx @shirlytaylor73/superharness@latest --user
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The installer copies active skills from `skills/` into `.agents/skills/`. Codex command markdown currently supports `free` and `rollback`. `commands/` is the Claude Code version; `commands-codex/` is the Codex template source. During install, `commands-codex/` is rendered into `.codex/commands/` with the concrete absolute plugin path because Codex does not support Claude Code's `!node` native command execution syntax.
|
|
51
|
+
|
|
52
|
+
## Development
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
cd workflow-state-server
|
|
56
|
+
npm.cmd test
|
|
57
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-reviewer
|
|
3
|
+
description: |
|
|
4
|
+
当一个主要项目步骤完成并需要根据原始计划和编码标准进行审查时使用此智能体。示例:<example>Context: 用户正在创建一个代码审查智能体,应在逻辑代码块编写完成后调用。user: "我已经按照计划第 3 步完成了用户认证系统的实现" assistant: "干得好!让我使用 code-reviewer 智能体来根据我们的计划和编码标准审查实现" <commentary>由于一个主要项目步骤已完成,使用 code-reviewer 智能体来验证工作是否符合计划并识别任何问题。</commentary></example> <example>Context: 用户完成了一个重要功能的实现。user: "任务管理系统的 API 端点现在完成了——这涵盖了我们架构文档中的第 2 步" assistant: "很好!让我用 code-reviewer 智能体检查这个实现,确保它符合我们的计划并遵循最佳实践" <commentary>规划文档中的一个编号步骤已完成,所以应该用 code-reviewer 智能体审查工作。</commentary></example>
|
|
5
|
+
model: inherit
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
你是一位高级代码审查员,精通软件架构、设计模式和最佳实践。你的角色是根据原始计划审查已完成的项目步骤,确保代码质量标准得到满足。
|
|
9
|
+
|
|
10
|
+
审查已完成的工作时,你将:
|
|
11
|
+
|
|
12
|
+
1. **计划对齐分析**:
|
|
13
|
+
- 将实现与原始规划文档或步骤描述进行对比
|
|
14
|
+
- 识别与计划的方案、架构或需求的任何偏差
|
|
15
|
+
- 评估偏差是合理的改进还是有问题的偏离
|
|
16
|
+
- 验证所有计划的功能是否都已实现
|
|
17
|
+
|
|
18
|
+
2. **代码质量评估**:
|
|
19
|
+
- 审查代码是否遵循已建立的模式和约定
|
|
20
|
+
- 检查错误处理、类型安全和防御性编程是否恰当
|
|
21
|
+
- 评估代码组织、命名约定和可维护性
|
|
22
|
+
- 评估测试覆盖率和测试实现的质量
|
|
23
|
+
- 寻找潜在的安全漏洞或性能问题
|
|
24
|
+
|
|
25
|
+
3. **架构和设计审查**:
|
|
26
|
+
- 确保实现遵循 SOLID 原则和已建立的架构模式
|
|
27
|
+
- 检查关注点分离和松耦合是否恰当
|
|
28
|
+
- 验证代码与现有系统的集成是否良好
|
|
29
|
+
- 评估可扩展性和可延展性的考虑
|
|
30
|
+
|
|
31
|
+
4. **文档和标准**:
|
|
32
|
+
- 验证代码包含适当的注释和文档
|
|
33
|
+
- 检查文件头、函数文档和内联注释是否存在且准确
|
|
34
|
+
- 确保遵循项目特定的编码标准和约定
|
|
35
|
+
|
|
36
|
+
5. **问题识别和建议**:
|
|
37
|
+
- 将问题明确分类为:关键(必须修复)、重要(应该修复)或建议(锦上添花)
|
|
38
|
+
- 对每个问题提供具体示例和可操作的建议
|
|
39
|
+
- 识别计划偏差时,解释它们是有问题的还是有益的
|
|
40
|
+
- 在有帮助时提供带有代码示例的具体改进建议
|
|
41
|
+
|
|
42
|
+
6. **沟通协议**:
|
|
43
|
+
- 如果发现与计划的重大偏差,请编码智能体审查并确认更改
|
|
44
|
+
- 如果识别出原始计划本身的问题,建议更新计划
|
|
45
|
+
- 对于实现问题,提供明确的修复指导
|
|
46
|
+
- 在指出问题之前始终先肯定做得好的地方
|
|
47
|
+
|
|
48
|
+
你的输出应该是结构化的、可操作的,聚焦于帮助保持高代码质量同时确保项目目标的达成。要全面但简洁,始终提供建设性的反馈,帮助改进当前实现和未来的开发实践。
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: using-superpowers
|
|
3
|
+
description: 在开始任何对话时使用——确立如何查找和使用技能,要求在任何响应(包括澄清性问题)之前调用 Skill 工具
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<SUBAGENT-STOP>
|
|
7
|
+
如果你是作为子智能体被分派来执行特定任务的,跳过此技能。
|
|
8
|
+
</SUBAGENT-STOP>
|
|
9
|
+
|
|
10
|
+
<EXTREMELY-IMPORTANT>
|
|
11
|
+
如果你认为哪怕只有 1% 的可能性某个技能适用于你正在做的事情,你绝对必须调用该技能。
|
|
12
|
+
|
|
13
|
+
如果一个技能适用于你的任务,你没有选择。你必须使用它。
|
|
14
|
+
|
|
15
|
+
这不可协商。这不是可选的。你不能通过合理化来逃避。
|
|
16
|
+
</EXTREMELY-IMPORTANT>
|
|
17
|
+
|
|
18
|
+
## 指令优先级
|
|
19
|
+
|
|
20
|
+
Superpowers 技能覆盖默认系统提示行为,但**用户指令始终具有最高优先级**:
|
|
21
|
+
|
|
22
|
+
1. **用户的明确指令**(CLAUDE.md、GEMINI.md、AGENTS.md、直接请求)——最高优先级
|
|
23
|
+
2. **Superpowers 技能** ——在冲突处覆盖默认系统行为
|
|
24
|
+
3. **默认系统提示** ——最低优先级
|
|
25
|
+
|
|
26
|
+
如果 CLAUDE.md、GEMINI.md 或 AGENTS.md 说"不要使用 TDD",而某个技能说"始终使用 TDD",遵循用户的指令。用户拥有控制权。
|
|
27
|
+
|
|
28
|
+
## 如何访问技能
|
|
29
|
+
|
|
30
|
+
**在 Claude Code 中:** 使用 `Skill` 工具。当你调用一个技能时,其内容会被加载并呈现给你——直接遵循即可。绝不要用 Read 工具读取技能文件。
|
|
31
|
+
|
|
32
|
+
**在 Copilot CLI 中:** 使用 `skill` 工具。技能从已安装的插件中自动发现。`skill` 工具的工作方式与 Claude Code 的 `Skill` 工具相同。
|
|
33
|
+
|
|
34
|
+
**在 Hermes Agent 中:** 使用 `skill_view` 工具加载技能。Hermes 支持三级渐进式加载:`skills_list` 浏览 → `skill_view(name)` 加载完整内容 → `skill_view(name, path)` 查看引用文件。
|
|
35
|
+
|
|
36
|
+
**在 Gemini CLI 中:** 技能通过 `activate_skill` 工具激活。Gemini 在会话开始时加载技能元数据,并按需激活完整内容。
|
|
37
|
+
|
|
38
|
+
**在其他环境中:** 查看你的平台文档了解技能的加载方式。
|
|
39
|
+
|
|
40
|
+
## 平台适配
|
|
41
|
+
|
|
42
|
+
技能使用 Claude Code 的工具名称。非 CC 平台:查看 `references/copilot-tools.md`(Copilot CLI)、`references/hermes-tools.md`(Hermes Agent)、`references/codex-tools.md`(Codex)了解工具对应关系。Gemini CLI 用户通过 GEMINI.md 自动获得工具映射。
|
|
43
|
+
|
|
44
|
+
# 使用技能
|
|
45
|
+
|
|
46
|
+
## 规则
|
|
47
|
+
|
|
48
|
+
**在任何响应或操作之前调用相关或被请求的技能。** 哪怕只有 1% 的可能性某个技能适用,你都应该调用该技能来检查。如果调用后发现技能不适合当前情况,你不需要使用它。
|
|
49
|
+
|
|
50
|
+
```dot
|
|
51
|
+
digraph skill_flow {
|
|
52
|
+
"收到用户消息" [shape=doublecircle];
|
|
53
|
+
"即将进入 EnterPlanMode?" [shape=doublecircle];
|
|
54
|
+
"已经头脑风暴过?" [shape=diamond];
|
|
55
|
+
"调用头脑风暴技能" [shape=box];
|
|
56
|
+
"可能有技能适用?" [shape=diamond];
|
|
57
|
+
"调用 Skill 工具" [shape=box];
|
|
58
|
+
"宣布:'使用 [技能] 来 [目的]'" [shape=box];
|
|
59
|
+
"有检查清单?" [shape=diamond];
|
|
60
|
+
"为每个条目创建 TodoWrite 待办" [shape=box];
|
|
61
|
+
"严格遵循技能" [shape=box];
|
|
62
|
+
"响应(包括澄清)" [shape=doublecircle];
|
|
63
|
+
|
|
64
|
+
"即将进入 EnterPlanMode?" -> "已经头脑风暴过?";
|
|
65
|
+
"已经头脑风暴过?" -> "调用头脑风暴技能" [label="否"];
|
|
66
|
+
"已经头脑风暴过?" -> "可能有技能适用?" [label="是"];
|
|
67
|
+
"调用头脑风暴技能" -> "可能有技能适用?";
|
|
68
|
+
|
|
69
|
+
"收到用户消息" -> "可能有技能适用?";
|
|
70
|
+
"可能有技能适用?" -> "调用 Skill 工具" [label="是,哪怕只有 1%"];
|
|
71
|
+
"可能有技能适用?" -> "响应(包括澄清)" [label="确定不适用"];
|
|
72
|
+
"调用 Skill 工具" -> "宣布:'使用 [技能] 来 [目的]'";
|
|
73
|
+
"宣布:'使用 [技能] 来 [目的]'" -> "有检查清单?";
|
|
74
|
+
"有检查清单?" -> "为每个条目创建 TodoWrite 待办" [label="是"];
|
|
75
|
+
"有检查清单?" -> "严格遵循技能" [label="否"];
|
|
76
|
+
"为每个条目创建 TodoWrite 待办" -> "严格遵循技能";
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## 红线
|
|
81
|
+
|
|
82
|
+
这些想法意味着停下——你在合理化:
|
|
83
|
+
|
|
84
|
+
| 想法 | 现实 |
|
|
85
|
+
|------|------|
|
|
86
|
+
| "这只是一个简单的问题" | 问题就是任务。检查技能。 |
|
|
87
|
+
| "我需要先了解更多上下文" | 技能检查在澄清性问题之前。 |
|
|
88
|
+
| "让我先探索一下代码库" | 技能告诉你如何探索。先检查。 |
|
|
89
|
+
| "我可以快速查一下 git/文件" | 文件缺少对话上下文。检查技能。 |
|
|
90
|
+
| "让我先收集信息" | 技能告诉你如何收集信息。 |
|
|
91
|
+
| "这不需要正式的技能" | 如果技能存在,就使用它。 |
|
|
92
|
+
| "我记得这个技能" | 技能会迭代更新。阅读当前版本。 |
|
|
93
|
+
| "这不算一个任务" | 行动 = 任务。检查技能。 |
|
|
94
|
+
| "技能太小题大做了" | 简单的事会变复杂。使用它。 |
|
|
95
|
+
| "让我先做这一件事" | 在做任何事之前先检查。 |
|
|
96
|
+
| "这样做感觉很高效" | 无纪律的行动浪费时间。技能防止这一点。 |
|
|
97
|
+
| "我知道那是什么意思" | 知道概念 ≠ 使用技能。调用它。 |
|
|
98
|
+
|
|
99
|
+
## 技能优先级
|
|
100
|
+
|
|
101
|
+
当多个技能可能适用时,使用此顺序:
|
|
102
|
+
|
|
103
|
+
1. **流程技能优先**(头脑风暴、调试)- 这些决定如何处理任务
|
|
104
|
+
2. **实现技能其次**(前端设计、mcp-builder)- 这些指导执行
|
|
105
|
+
|
|
106
|
+
"让我们构建 X" → 先头脑风暴,再使用实现技能。
|
|
107
|
+
"修复这个 bug" → 先调试,再使用领域特定技能。
|
|
108
|
+
"编写、修订、压缩、审查或修复实现计划/plan" → 使用 writing-plans。
|
|
109
|
+
"修改现有实现计划、清理 plan 漂移、同步任务/metadata/并行执行图" → 使用 writing-plans。
|
|
110
|
+
|
|
111
|
+
## 中国特色技能路由
|
|
112
|
+
|
|
113
|
+
当检测到以下场景时,**必须**优先调用对应的中国特色技能:
|
|
114
|
+
|
|
115
|
+
| 场景 | 调用技能 |
|
|
116
|
+
|------|---------|
|
|
117
|
+
| 代码审查且团队使用中文沟通 | **superpowers:chinese-code-review** |
|
|
118
|
+
| 使用 Gitee/Coding/极狐 GitLab | **superpowers:chinese-git-workflow** |
|
|
119
|
+
| 编写中文技术文档或 README | **superpowers:chinese-documentation** |
|
|
120
|
+
| 编写 git commit message(中文项目) | **superpowers:chinese-commit-conventions** |
|
|
121
|
+
| 构建 MCP 服务器/工具 | **superpowers:mcp-builder** |
|
|
122
|
+
|
|
123
|
+
**判断依据:**
|
|
124
|
+
- 项目中有中文注释、中文 README、或 .gitee 目录 → 启用中文系列技能
|
|
125
|
+
- commit 历史中有中文 → 使用中文提交规范
|
|
126
|
+
- 用户用中文交流 → 所有输出使用中文,优先考虑中国特色技能
|
|
127
|
+
|
|
128
|
+
中国特色技能与翻译技能**叠加使用**,不互斥。例如:做代码审查时,同时使用 requesting-code-review(流程)+ chinese-code-review(风格)。
|
|
129
|
+
|
|
130
|
+
## 技能类型
|
|
131
|
+
|
|
132
|
+
**刚性的**(TDD、调试):严格遵循。不要偏离纪律。
|
|
133
|
+
|
|
134
|
+
**灵活的**(模式):根据上下文调整原则。
|
|
135
|
+
|
|
136
|
+
技能本身会告诉你它属于哪种。
|
|
137
|
+
|
|
138
|
+
## 用户指令
|
|
139
|
+
|
|
140
|
+
指令说明做什么,而非怎么做。"添加 X"或"修复 Y"不意味着跳过工作流。
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Codex 工具映射
|
|
2
|
+
|
|
3
|
+
Skills 使用 Claude Code 的工具名称。在 Codex 中遇到这些名称时,请使用对应的平台等价工具:
|
|
4
|
+
|
|
5
|
+
| Skill 中的引用 | Codex 等价工具 |
|
|
6
|
+
|---------------|---------------|
|
|
7
|
+
| `Task` 工具(派遣子 agent) | `spawn_agent` |
|
|
8
|
+
| 多个 `Task` 调用(并行) | 多个 `spawn_agent` 调用 |
|
|
9
|
+
| Task 返回结果 | `wait` |
|
|
10
|
+
| Task 自动完成 | `close_agent` 释放槽位 |
|
|
11
|
+
| `TodoWrite`(任务跟踪) | `update_plan` |
|
|
12
|
+
| `Skill` 工具(调用 skill) | Skills 原生加载——直接按说明操作 |
|
|
13
|
+
| `Read`、`Write`、`Edit`(文件) | 使用原生文件工具 |
|
|
14
|
+
| `Bash`(执行命令) | 使用原生 shell 工具 |
|
|
15
|
+
|
|
16
|
+
## 子 Agent 派遣需要多 Agent 支持
|
|
17
|
+
|
|
18
|
+
在 Codex 配置文件(`~/.codex/config.toml`)中添加:
|
|
19
|
+
|
|
20
|
+
```toml
|
|
21
|
+
[features]
|
|
22
|
+
multi_agent = true
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
启用后可使用 `spawn_agent`、`wait` 和 `close_agent`,支持 `dispatching-parallel-agents` 和 `parallel-executing-plans` 等 skills。
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Copilot CLI 工具映射
|
|
2
|
+
|
|
3
|
+
技能使用 Claude Code 的工具名称。当你在技能中遇到这些工具时,使用你平台的等价工具:
|
|
4
|
+
|
|
5
|
+
| 技能中引用的工具 | Copilot CLI 等价工具 |
|
|
6
|
+
|-----------------|----------------------|
|
|
7
|
+
| `Read`(读取文件) | `view` |
|
|
8
|
+
| `Write`(创建文件) | `create` |
|
|
9
|
+
| `Edit`(编辑文件) | `edit` |
|
|
10
|
+
| `Bash`(运行命令) | `bash` |
|
|
11
|
+
| `Grep`(搜索文件内容) | `grep` |
|
|
12
|
+
| `Glob`(按名称搜索文件) | `glob` |
|
|
13
|
+
| `Skill` 工具(调用技能) | `skill` |
|
|
14
|
+
| `WebFetch` | `web_fetch` |
|
|
15
|
+
| `Task` 工具(分派子智能体) | `task`(参见[智能体类型](#智能体类型)) |
|
|
16
|
+
| 多个 `Task` 调用(并行) | 多个 `task` 调用 |
|
|
17
|
+
| Task 状态/输出 | `read_agent`、`list_agents` |
|
|
18
|
+
| `TodoWrite`(任务跟踪) | `sql` 配合内置 `todos` 表 |
|
|
19
|
+
| `WebSearch` | 无等价工具 — 使用 `web_fetch` 配合搜索引擎 URL |
|
|
20
|
+
| `EnterPlanMode` / `ExitPlanMode` | 无等价工具 — 留在主会话中 |
|
|
21
|
+
|
|
22
|
+
## 智能体类型
|
|
23
|
+
|
|
24
|
+
Copilot CLI 的 `task` 工具接受 `agent_type` 参数:
|
|
25
|
+
|
|
26
|
+
| Claude Code 智能体 | Copilot CLI 等价 |
|
|
27
|
+
|-------------------|----------------------|
|
|
28
|
+
| `general-purpose` | `"general-purpose"` |
|
|
29
|
+
| `Explore` | `"explore"` |
|
|
30
|
+
| 命名的插件智能体(如 `superpowers:code-reviewer`) | 从已安装的插件中自动发现 |
|
|
31
|
+
|
|
32
|
+
## 异步 Shell 会话
|
|
33
|
+
|
|
34
|
+
Copilot CLI 支持持久化的异步 shell 会话,这在 Claude Code 中没有直接等价物:
|
|
35
|
+
|
|
36
|
+
| 工具 | 用途 |
|
|
37
|
+
|------|---------|
|
|
38
|
+
| `bash` 配合 `async: true` | 在后台启动长时间运行的命令 |
|
|
39
|
+
| `write_bash` | 向运行中的异步会话发送输入 |
|
|
40
|
+
| `read_bash` | 读取异步会话的输出 |
|
|
41
|
+
| `stop_bash` | 终止异步会话 |
|
|
42
|
+
| `list_bash` | 列出所有活跃的 shell 会话 |
|
|
43
|
+
|
|
44
|
+
## 额外的 Copilot CLI 工具
|
|
45
|
+
|
|
46
|
+
| 工具 | 用途 |
|
|
47
|
+
|------|---------|
|
|
48
|
+
| `store_memory` | 持久化代码库相关事实供未来会话使用 |
|
|
49
|
+
| `report_intent` | 更新 UI 状态行显示当前意图 |
|
|
50
|
+
| `sql` | 查询会话的 SQLite 数据库(待办、元数据) |
|
|
51
|
+
| `fetch_copilot_cli_documentation` | 查阅 Copilot CLI 文档 |
|
|
52
|
+
| GitHub MCP 工具(`github-mcp-server-*`) | 原生 GitHub API 访问(issue、PR、代码搜索) |
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Gemini CLI 工具映射
|
|
2
|
+
|
|
3
|
+
Skills 使用 Claude Code 的工具名称。在 Gemini CLI 中遇到这些名称时,请使用对应的平台等价工具:
|
|
4
|
+
|
|
5
|
+
| Skill 中的引用 | Gemini CLI 等价工具 |
|
|
6
|
+
|---------------|-------------------|
|
|
7
|
+
| `Read`(读取文件) | `read_file` |
|
|
8
|
+
| `Write`(创建文件) | `write_file` |
|
|
9
|
+
| `Edit`(编辑文件) | `replace` |
|
|
10
|
+
| `Bash`(执行命令) | `run_shell_command` |
|
|
11
|
+
| `Grep`(搜索文件内容) | `grep_search` |
|
|
12
|
+
| `Glob`(按名称搜索文件) | `glob` |
|
|
13
|
+
| `TodoWrite`(任务跟踪) | `write_todos` |
|
|
14
|
+
| `Skill` 工具(调用 skill) | `activate_skill` |
|
|
15
|
+
| `WebSearch` | `google_web_search` |
|
|
16
|
+
| `WebFetch` | `web_fetch` |
|
|
17
|
+
| `Task` 工具(派遣子 agent) | 无等价工具——Gemini CLI 不支持子 agent |
|
|
18
|
+
|
|
19
|
+
## 不支持子 Agent
|
|
20
|
+
|
|
21
|
+
Gemini CLI 没有 Claude Code `Task` 工具的等价物。依赖子 agent 派遣的 skills(`parallel-executing-plans`、`dispatching-parallel-agents`)将退化为通过 `serial-executing-plans` 进行单会话执行。
|
|
22
|
+
|
|
23
|
+
## Gemini CLI 额外工具
|
|
24
|
+
|
|
25
|
+
以下工具在 Gemini CLI 中可用,但 Claude Code 中没有对应工具:
|
|
26
|
+
|
|
27
|
+
| 工具 | 用途 |
|
|
28
|
+
|------|------|
|
|
29
|
+
| `list_directory` | 列出文件和子目录 |
|
|
30
|
+
| `save_memory` | 将信息持久化到 GEMINI.md,跨会话保留 |
|
|
31
|
+
| `ask_user` | 向用户请求结构化输入 |
|
|
32
|
+
| `tracker_create_task` | 丰富的任务管理(创建、更新、列表、可视化) |
|
|
33
|
+
| `enter_plan_mode` / `exit_plan_mode` | 切换到只读研究模式,在修改前先调研 |
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Hermes Agent 工具映射
|
|
2
|
+
|
|
3
|
+
技能使用 Claude Code 的工具名称。当你在技能中遇到这些工具时,使用你平台的等价工具:
|
|
4
|
+
|
|
5
|
+
| 技能中引用的工具 | Hermes Agent 等价工具 |
|
|
6
|
+
|-----------------|----------------------|
|
|
7
|
+
| `Read`(读取文件) | `read_file` |
|
|
8
|
+
| `Write`(创建文件) | `write_file` |
|
|
9
|
+
| `Edit`(编辑文件) | `patch` |
|
|
10
|
+
| `Bash`(运行命令) | `terminal` |
|
|
11
|
+
| `Grep`(搜索文件内容) | `search_files` |
|
|
12
|
+
| `Glob`(按名称搜索文件) | `search_files` |
|
|
13
|
+
| `Skill` 工具(调用技能) | `skill_view` |
|
|
14
|
+
| `WebFetch` | `web_extract` |
|
|
15
|
+
| `WebSearch` | `web_search` |
|
|
16
|
+
| `Task` 工具(分派子智能体) | `delegate_task` |
|
|
17
|
+
| 多个 `Task` 调用(并行) | 多个 `delegate_task` 调用 |
|
|
18
|
+
| `TodoWrite`(任务跟踪) | `todo` |
|
|
19
|
+
| `EnterPlanMode` / `ExitPlanMode` | 无等价工具 — 留在主会话中 |
|
|
20
|
+
|
|
21
|
+
## 技能管理
|
|
22
|
+
|
|
23
|
+
Hermes Agent 使用三级渐进式技能加载:
|
|
24
|
+
|
|
25
|
+
| 操作 | 工具 |
|
|
26
|
+
|------|------|
|
|
27
|
+
| 列出所有可用技能 | `skills_list` |
|
|
28
|
+
| 查看技能完整内容 | `skill_view(name)` |
|
|
29
|
+
| 查看技能的引用文件 | `skill_view(name, path)` |
|
|
30
|
+
| 管理技能(安装/更新) | `skill_manage` |
|
|
31
|
+
|
|
32
|
+
## 额外的 Hermes Agent 工具
|
|
33
|
+
|
|
34
|
+
| 工具 | 用途 |
|
|
35
|
+
|------|---------|
|
|
36
|
+
| `memory` | 持久化知识供未来会话使用 |
|
|
37
|
+
| `session_search` | 搜索历史会话记录 |
|
|
38
|
+
| `execute_code` | 在沙箱中执行代码 |
|
|
39
|
+
| `process` | 后台进程管理 |
|
|
40
|
+
| `vision_analyze` | 图像分析 |
|
|
41
|
+
| `image_generate` | 图像生成 |
|
|
42
|
+
| `clarify` | 向用户提出澄清性问题 |
|
|
43
|
+
| `browser_*` | 浏览器自动化工具集 |
|
|
44
|
+
| `mixture_of_agents` | 多智能体高级推理 |
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 回退 workflow state 到 transition_log 中走过的某个 state(用户控制)
|
|
3
|
+
allowed-tools: mcp__plugin_superharness_superharness-workflow-state__list_history, AskUserQuestion, Bash
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /rollback $ARGS
|
|
7
|
+
|
|
8
|
+
用户输入了 `/rollback $ARGS`。按以下步骤执行:
|
|
9
|
+
|
|
10
|
+
**步骤 1**:调 `list_history(workspaceRoot=$PWD)` 拿历史。
|
|
11
|
+
|
|
12
|
+
**步骤 2 解析参数**:
|
|
13
|
+
|
|
14
|
+
- 若 `$ARGS` 非空:把 `$ARGS` 当目标 state 名。从 transition_log 中过滤 `to_state == $ARGS` 是否存在:
|
|
15
|
+
- 存在 → 跳到步骤 4,目标 = `$ARGS`
|
|
16
|
+
- 不存在 → 报错并列出"曾走过的 state"让用户重新指定
|
|
17
|
+
|
|
18
|
+
- 若 `$ARGS` 为空:
|
|
19
|
+
- 从 transition_log 提取 to_state,按时间倒序去重,取**最近 5 个独特 state**
|
|
20
|
+
- 用 AskUserQuestion 让用户选 → 选中作为目标 state,跳到步骤 4
|
|
21
|
+
|
|
22
|
+
**步骤 4 执行 rollback**:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
!node "${CLAUDE_PLUGIN_ROOT}/scripts/rollback.mjs" "$PWD" "<chosen_state>" "[rollback] 用户 /rollback $ARGS"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**步骤 5 报告**:根据脚本 stdout 简短报告"已从 X 回到 Y"。
|
|
29
|
+
|
|
30
|
+
**不要**继续做其他事:不要补 transition_state、不要继续之前 state 的任务。下一轮 UserPromptSubmit hook 会注入新 state SKILL.md。
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 进入或退出 free-mode;暂停 superharness workflow context 注入(Codex)
|
|
3
|
+
allowed-tools: shell_command
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /free $ARGS
|
|
7
|
+
|
|
8
|
+
用户输入了 `/free $ARGS`。这是 Codex 兼容 command:不要把下面的命令展示给用户后停止,必须由 agent 调用 shell tool 直接执行。
|
|
9
|
+
|
|
10
|
+
解析 `$ARGS`:
|
|
11
|
+
|
|
12
|
+
- 空或 `status`:查询状态
|
|
13
|
+
- `on`:进入 free mode
|
|
14
|
+
- `off`:退出 free mode
|
|
15
|
+
- 其他值:报告用法 `/free [on|off|status]` 并停止
|
|
16
|
+
|
|
17
|
+
在 PowerShell 中执行:
|
|
18
|
+
|
|
19
|
+
```powershell
|
|
20
|
+
node "{{SUPERHARNESS_PLUGIN_ROOT}}\scripts\set-free-mode.mjs" (Get-Location).Path "$ARGS"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
在 bash/Git Bash 中执行:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
node "{{SUPERHARNESS_PLUGIN_ROOT}}/scripts/set-free-mode.mjs" "$PWD" "$ARGS"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
根据 stdout 简短报告结果。不要继续做其他事,不要补 transition_state。
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 回退 workflow state 到 transition_log 中走过的某个 state(Codex 用户控制)
|
|
3
|
+
allowed-tools: mcp__plugin_superharness_superharness-workflow-state__list_history, shell_command, request_user_input
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /rollback $ARGS
|
|
7
|
+
|
|
8
|
+
用户输入了 `/rollback $ARGS`。这是 Codex 兼容 command:最终 rollback 命令必须由 agent 调用 shell tool 直接执行。
|
|
9
|
+
|
|
10
|
+
步骤 1:调用 `list_history(workspaceRoot=<当前工作目录>)` 获取历史。
|
|
11
|
+
|
|
12
|
+
步骤 2:解析参数。
|
|
13
|
+
|
|
14
|
+
- `$ARGS` 非空:把 `$ARGS` 当目标 state 名。从 transition_log 中过滤 `to_state == $ARGS` 是否存在。不存在就报错,并列出曾走过的 state。
|
|
15
|
+
- `$ARGS` 为空:从 transition_log 提取 `to_state`,按时间倒序去重,取最近 5 个独特 state,让用户选择。
|
|
16
|
+
|
|
17
|
+
步骤 3:执行 rollback。
|
|
18
|
+
|
|
19
|
+
PowerShell:
|
|
20
|
+
|
|
21
|
+
```powershell
|
|
22
|
+
node "{{SUPERHARNESS_PLUGIN_ROOT}}\scripts\rollback.mjs" (Get-Location).Path "<chosen_state>" "[rollback] 用户 /rollback $ARGS"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
bash/Git Bash:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
node "{{SUPERHARNESS_PLUGIN_ROOT}}/scripts/rollback.mjs" "$PWD" "<chosen_state>" "[rollback] 用户 /rollback $ARGS"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
步骤 4:根据 stdout 简短报告“已从 X 回到 Y”。
|
|
32
|
+
|
|
33
|
+
不要调用 `transition_state`,不要继续之前 state 的任务。下一轮 UserPromptSubmit hook 会注入新 state SKILL.md。
|