@jspg-ai/coding-bb 0.0.1 → 0.0.2-beta.23
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/cbb/bin/cbb.js +6 -0
- package/cbb/bin/cbbm.js +6 -0
- package/cbb/dev-standards/rules/cbb-ai-behavior.md +103 -103
- package/cbb/dev-standards/rules/cbb-priority.md +55 -55
- package/cbb/lib/install/claude-code.js +2 -0
- package/cbb/lib/install/init.js +496 -290
- package/cbb/lib/install/opencode.js +31 -0
- package/cbb/lib/install/qoder.js +2 -0
- package/cbb/lib/install/workspaces.js +53 -13
- package/cbb/lib/openspec/index.js +3 -3
- package/cbb/lib/superpowers/index.js +1 -1
- package/cbb/lib/utils/check-update.js +16 -14
- package/cbb/lib/utils/gitignore.js +2 -1
- package/cbb/lib/utils/output.js +92 -4
- package/cbb/lib/utils/version.js +2 -31
- package/cbb/lib/wiki/cli.js +25 -25
- package/cbb/lib/wiki/index.js +16 -16
- package/cbb/tools/cbb-design-to-wiki/SKILL.md +14 -14
- package/cbb/tools/cbb-wiki-ops/SKILL.md +22 -22
- package/cbb/worktrees/_shared/scripts/find-target-worktree.js +2 -2
- package/cbb/worktrees/_shared/scripts/find-workspace-root.js +7 -7
- package/cbb/worktrees/_shared/scripts/push-core.js +18 -0
- package/cbb/worktrees/commands/{close.md → worktree-close.md} +8 -8
- package/cbb/worktrees/commands/{init.md → worktree-init.md} +9 -9
- package/cbb/worktrees/commands/{push.md → worktree-push.md} +3 -3
- package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/SKILL.md +20 -20
- package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/check-env.js +4 -4
- package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/check-unarchived.js +1 -1
- package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/delete-branches.js +3 -3
- package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/discover-apps.js +6 -6
- package/cbb/worktrees/skills/{openspec-extend-worktree → cbb-worktree-close}/scripts/find-target-worktree.js +2 -2
- package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-close}/scripts/find-workspace-root.js +7 -7
- package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/remove-worktrees.js +4 -4
- package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/safety-check.js +4 -4
- package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/SKILL.md +81 -107
- package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/auto-open.js +1 -1
- package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/check-env-deep.js +4 -4
- package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/check-env.js +6 -6
- package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/check-repos.js +4 -4
- package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/create-branches.js +4 -4
- package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/create-worktrees.js +8 -7
- package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-init}/scripts/find-workspace-root.js +7 -7
- package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/install-ai.js +33 -33
- package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/parse-config.js +7 -7
- package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/push-branches.js +9 -7
- package/cbb/worktrees/skills/{openspec-extend-worktree → cbb-worktree-init}/scripts/push-core.js +18 -0
- package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/sync-repos.js +10 -12
- package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/update-gitignore.js +19 -6
- package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/SKILL.md +16 -16
- package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/scripts/commit-worktrees.js +2 -2
- package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/scripts/find-target-worktree.js +2 -2
- package/cbb/worktrees/skills/{openspec-extend-worktree → cbb-worktree-push}/scripts/find-workspace-root.js +7 -7
- package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/scripts/push-core.js +18 -0
- package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/scripts/push-worktrees.js +7 -5
- package/config/workspace-config.sample.json +18 -0
- package/config/workspaces.json +11 -6
- package/openspec/.version +6 -6
- package/openspec/commands/apply.md +7 -7
- package/openspec/commands/archive.md +7 -7
- package/openspec/commands/bulk-archive.md +7 -7
- package/openspec/commands/continue.md +7 -7
- package/openspec/commands/explore.md +7 -7
- package/openspec/commands/ff.md +7 -7
- package/openspec/commands/new.md +7 -7
- package/openspec/commands/onboard.md +7 -7
- package/openspec/commands/propose.md +7 -7
- package/openspec/commands/sync.md +7 -7
- package/openspec/commands/update.md +7 -7
- package/openspec/commands/verify.md +7 -7
- package/openspec/skills/openspec-apply-change/SKILL.md +187 -187
- package/openspec/skills/openspec-archive-change/SKILL.md +181 -181
- package/openspec/skills/openspec-bulk-archive-change/SKILL.md +338 -338
- package/openspec/skills/openspec-continue-change/SKILL.md +117 -117
- package/openspec/skills/openspec-explore/SKILL.md +342 -342
- package/openspec/skills/openspec-ff-change/SKILL.md +116 -116
- package/openspec/skills/openspec-new-change/SKILL.md +76 -76
- package/openspec/skills/openspec-onboard/SKILL.md +560 -560
- package/openspec/skills/openspec-propose/SKILL.md +162 -162
- package/openspec/skills/openspec-sync-specs/SKILL.md +261 -261
- package/openspec/skills/openspec-update-change/SKILL.md +90 -90
- package/openspec/skills/openspec-verify-change/SKILL.md +174 -174
- package/package.json +4 -3
- package/superpowers/.version +6 -6
- package/superpowers/skills/brainstorming/SKILL.md +250 -250
- package/superpowers/skills/brainstorming/scripts/helper.js +167 -167
- package/superpowers/skills/brainstorming/scripts/start-server.sh +209 -209
- package/superpowers/skills/brainstorming/scripts/stop-server.sh +120 -120
- package/superpowers/skills/brainstorming/spec-document-reviewer-prompt.md +49 -49
- package/superpowers/skills/brainstorming/visual-companion.md +299 -299
- package/superpowers/skills/dispatching-parallel-agents/SKILL.md +167 -167
- package/superpowers/skills/executing-plans/SKILL.md +64 -64
- package/superpowers/skills/finishing-a-development-branch/SKILL.md +225 -225
- package/superpowers/skills/receiving-code-review/SKILL.md +205 -205
- package/superpowers/skills/requesting-code-review/SKILL.md +95 -95
- package/superpowers/skills/requesting-code-review/code-reviewer.md +181 -181
- package/superpowers/skills/subagent-driven-development/SKILL.md +568 -568
- package/superpowers/skills/subagent-driven-development/implementer-prompt.md +154 -154
- package/superpowers/skills/subagent-driven-development/re-review-prompt.md +115 -115
- package/superpowers/skills/subagent-driven-development/task-reviewer-prompt.md +207 -207
- package/superpowers/skills/systematic-debugging/CREATION-LOG.md +119 -119
- package/superpowers/skills/systematic-debugging/SKILL.md +283 -283
- package/superpowers/skills/systematic-debugging/condition-based-waiting-example.ts +158 -158
- package/superpowers/skills/systematic-debugging/condition-based-waiting.md +115 -115
- package/superpowers/skills/systematic-debugging/defense-in-depth.md +122 -122
- package/superpowers/skills/systematic-debugging/find-polluter.sh +72 -72
- package/superpowers/skills/systematic-debugging/root-cause-tracing.md +169 -169
- package/superpowers/skills/systematic-debugging/test-academic.md +14 -14
- package/superpowers/skills/systematic-debugging/test-pressure-1.md +58 -58
- package/superpowers/skills/systematic-debugging/test-pressure-2.md +68 -68
- package/superpowers/skills/systematic-debugging/test-pressure-3.md +69 -69
- package/superpowers/skills/test-driven-development/SKILL.md +320 -320
- package/superpowers/skills/test-driven-development/writing-good-tests.md +198 -198
- package/superpowers/skills/using-git-worktrees/SKILL.md +167 -167
- package/superpowers/skills/using-superpowers/SKILL.md +63 -63
- package/superpowers/skills/using-superpowers/references/antigravity-tools.md +23 -23
- package/superpowers/skills/using-superpowers/references/codex-tools.md +108 -108
- package/superpowers/skills/using-superpowers/references/gemini-tools.md +63 -63
- package/superpowers/skills/using-superpowers/references/hermes-tools.md +56 -56
- package/superpowers/skills/using-superpowers/references/pi-tools.md +16 -16
- package/superpowers/skills/verification-before-completion/SKILL.md +120 -120
- package/superpowers/skills/writing-plans/SKILL.md +171 -171
- package/superpowers/skills/writing-plans/plan-document-reviewer-prompt.md +49 -49
- package/superpowers/skills/writing-skills/SKILL.md +679 -679
- package/superpowers/skills/writing-skills/anthropic-best-practices.md +1150 -1150
- package/superpowers/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -189
- package/superpowers/skills/writing-skills/persuasion-principles.md +187 -187
- package/superpowers/skills/writing-skills/render-graphs.js +169 -169
- package/superpowers/skills/writing-skills/testing-skills-with-subagents.md +384 -384
- package/cbb/worktrees/commands/extend.md +0 -65
- package/cbb/worktrees/skills/openspec-close-worktree/scripts/find-target-worktree.js +0 -96
- package/cbb/worktrees/skills/openspec-extend-worktree/SKILL.md +0 -390
- package/cbb/worktrees/skills/openspec-extend-worktree/scripts/check-env.js +0 -95
- package/cbb/worktrees/skills/openspec-extend-worktree/scripts/check-repos.js +0 -98
- package/cbb/worktrees/skills/openspec-extend-worktree/scripts/create-branches-and-worktrees.js +0 -135
- package/cbb/worktrees/skills/openspec-extend-worktree/scripts/install-ai.js +0 -150
- package/cbb/worktrees/skills/openspec-extend-worktree/scripts/list-available-apps.js +0 -88
- package/cbb/worktrees/skills/openspec-extend-worktree/scripts/sync-repos.js +0 -93
- package/cbb/worktrees/skills/openspec-init-worktree/scripts/find-workspace-root.js +0 -67
- package/cbb/worktrees/skills/openspec-init-worktree/scripts/generate-app-options.js +0 -93
- package/cbb/worktrees/skills/openspec-init-worktree/scripts/push-core.js +0 -136
- package/cbb/worktrees/skills/openspec-push-worktrees/scripts/silence-popup.js +0 -23
- package/config/config.sample.json +0 -16
- /package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/silence-popup.js +0 -0
- /package/cbb/worktrees/skills/{openspec-extend-worktree → cbb-worktree-init}/scripts/silence-popup.js +0 -0
- /package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-push}/scripts/silence-popup.js +0 -0
package/cbb/lib/wiki/index.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Wiki 发布命令 — 将 Markdown 文件发布到Confluence Wiki。
|
|
5
5
|
*
|
|
6
6
|
* 用法:
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* cbbm wp <file> --page-id <id> 更新已有页面
|
|
8
|
+
* cbbm wp <file> --parent-id <id> --title "..." 创建新页面
|
|
9
|
+
* cbbm wp <file> --page-id <id> --dry-run 仅输出 XHTML,不发布
|
|
10
10
|
*
|
|
11
11
|
* 认证:
|
|
12
12
|
* 环境变量 CBB_WIKI_EMAIL + CBB_WIKI_TOKEN,或 ~/.cbb/wiki-config.json
|
|
@@ -62,11 +62,11 @@ function parseArgs(argv) {
|
|
|
62
62
|
log(`未知选项: ${arg}`, 'warn');
|
|
63
63
|
log(`提示:选项 --${key} 后面接的是另一个选项名或为空。`, 'warn');
|
|
64
64
|
log(` --flag 的值必须用空格分隔:--${key} <value>(或写为 --${key}=<value>,但不要漏 value)`, 'warn');
|
|
65
|
-
log(` 执行 \`
|
|
65
|
+
log(` 执行 \`cbbm wp --help\` 查看完整用法`, 'warn');
|
|
66
66
|
process.exit(1);
|
|
67
67
|
}
|
|
68
68
|
log(`未知选项: ${arg}`, 'warn');
|
|
69
|
-
log('提示:参数格式为 --flag <value> 或 --flag=<value>,执行 `
|
|
69
|
+
log('提示:参数格式为 --flag <value> 或 --flag=<value>,执行 `cbbm wp --help` 查看完整用法', 'warn');
|
|
70
70
|
process.exit(1);
|
|
71
71
|
}
|
|
72
72
|
i++;
|
|
@@ -78,8 +78,8 @@ function parseArgs(argv) {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
if (!opts.file) {
|
|
81
|
-
log('用法:
|
|
82
|
-
log('提示:参数格式为 --flag <value> 或 --flag=<value>,执行 `
|
|
81
|
+
log('用法: cbbm wp <file> [--page-id <id> | --parent-id <id> --title "..."] [--dry-run]', 'warn');
|
|
82
|
+
log('提示:参数格式为 --flag <value> 或 --flag=<value>,执行 `cbbm wp --help` 查看完整用法', 'warn');
|
|
83
83
|
process.exit(1);
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -99,7 +99,7 @@ function applyKnownOption(key, value, opts) {
|
|
|
99
99
|
// ── 工具 ──────────────────────────────────────────────
|
|
100
100
|
|
|
101
101
|
function showHelp() {
|
|
102
|
-
log(`
|
|
102
|
+
log(`cbbm wp — 将 Markdown 发布到Confluence Wiki
|
|
103
103
|
|
|
104
104
|
参数格式:
|
|
105
105
|
本工具同时支持两种写法,请按习惯任选其一:
|
|
@@ -110,15 +110,15 @@ function showHelp() {
|
|
|
110
110
|
布尔开关:--dry-run(出现即视为 true,不能带值)
|
|
111
111
|
|
|
112
112
|
用法:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
cbbm wp <file> --page-id <pageId> # 更新已有页面
|
|
114
|
+
cbbm wp <file> --page-id=<pageId> # 等价写法
|
|
115
|
+
cbbm wp <file> --parent-id <parentId> --title "..." # 在父页面下创建新页面
|
|
116
|
+
cbbm wp <file> --parent-id=<parentId> --title="..." # 等价写法
|
|
117
|
+
cbbm wp <file> --page-id <pageId> --dry-run # 仅输出 XHTML,不发布
|
|
118
118
|
|
|
119
119
|
示例:
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
cbbm wp design.md --page-id 123456
|
|
121
|
+
cbbm wp "D:\\path with space\\design.md" --page-id 123456 --dry-run
|
|
122
122
|
|
|
123
123
|
认证:环境变量 CBB_WIKI_EMAIL + CBB_WIKI_TOKEN,或 ~/.cbb/wiki-config.json
|
|
124
124
|
令牌获取: https://wiki.amh-group.com/plugins/tokens/view.action`, 'info');
|
|
@@ -149,7 +149,7 @@ async function publish(argv) {
|
|
|
149
149
|
// 1. 验证参数
|
|
150
150
|
if (!opts.pageId && !(opts.parentId && opts.title)) {
|
|
151
151
|
log('必须指定 --page-id(更新)或 --parent-id + --title(创建)', 'error');
|
|
152
|
-
log('用法:
|
|
152
|
+
log('用法: cbbm wp <file> [--page-id <id> | --parent-id <id> --title "..."] [--dry-run]', 'warn');
|
|
153
153
|
process.exit(1);
|
|
154
154
|
}
|
|
155
155
|
|
|
@@ -67,8 +67,8 @@ cbb --help
|
|
|
67
67
|
**先查 CLI 帮助**(不熟悉时必看,命令清单与最新选项以 help 为准):
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
cbbm wp --help # 发布命令帮助
|
|
71
|
+
cbbm wiki --help # 查询/管理子命令帮助
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
**参数格式约定**(两种写法等价,混用不报错):
|
|
@@ -79,35 +79,35 @@ cbb wiki --help # 查询/管理子命令帮助
|
|
|
79
79
|
- 文件路径含空格或中文时**必须用引号包住**:`--file "D:\path with space\design.md"`
|
|
80
80
|
- 参数顺序不限,文件名可写在最前(位置参数)也可写 `--file <path>`
|
|
81
81
|
|
|
82
|
-
**仅使用 `
|
|
82
|
+
**仅使用 `cbbm wp` 命令发布,不做自动降级。**
|
|
83
83
|
|
|
84
84
|
**创建新页面:**
|
|
85
85
|
|
|
86
86
|
```bash
|
|
87
87
|
# GNU 风格(推荐)
|
|
88
|
-
|
|
88
|
+
cbbm wp <file> --parent-id <parentPageId> --title "设计方案:<change-name>"
|
|
89
89
|
# 等价写法(等号风格)
|
|
90
|
-
|
|
90
|
+
cbbm wp --file <file> --parent-id=<parentPageId> --title="设计方案:<change-name>"
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
**更新已有页面:**
|
|
94
94
|
|
|
95
95
|
```bash
|
|
96
|
-
|
|
97
|
-
# 等价:
|
|
96
|
+
cbbm wp <file> --page-id <pageId>
|
|
97
|
+
# 等价:cbbm wp <file> --page-id=<pageId>
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
**Dry-run 预览**(不实际发布,仅输出 XHTML):
|
|
101
101
|
|
|
102
102
|
```bash
|
|
103
|
-
|
|
103
|
+
cbbm wp <file> --page-id <pageId> --dry-run
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
**常见拼错及修正**:
|
|
107
107
|
|
|
108
108
|
| 用户写法 | 报错 | 修正 |
|
|
109
109
|
|---------|------|------|
|
|
110
|
-
| `
|
|
110
|
+
| `cbbm wp` 不带参数 | `用法: cbbm wp <file> ...` | 加 `<file>` 或 `--file <path>` |
|
|
111
111
|
| `--page-id 123456 --dry-run` 拼成 `--page-id=123456 --dry-run-true` | `未知选项: --dry-run-true` | 改为 `--dry-run`(布尔开关不能带值) |
|
|
112
112
|
| 文件路径含空格未引号包住 | 报"文件不存在"或解析错乱 | 用引号包:`--file "C:\My Docs\design.md"` |
|
|
113
113
|
| 把 `--page-id=123456` 中的 `=` 写成了空格 | 不会报错(两种写法都支持) | — |
|
|
@@ -120,7 +120,7 @@ cbb wp <file> --page-id <pageId> --dry-run
|
|
|
120
120
|
| 版本冲突 (409) | "页面版本冲突,请重新执行发布命令" |
|
|
121
121
|
| 页面不存在 (404) | "页面不存在,请确认 pageId 是否正确,或使用 --parent-id 创建新页面" |
|
|
122
122
|
| 网络超时 | "网络超时,请检查 VPN/网络连接后重试" |
|
|
123
|
-
|
|
|
123
|
+
| cbbm wp 不可用 | "cbbm wp 命令不可用,请确认已安装 v1.0.4+ 版本:`cbbm --version`" |
|
|
124
124
|
| 参数格式错误 | CLI 已自带提示(含"参数格式为 --flag <value> 或 --flag=<value>") |
|
|
125
125
|
| 其他错误 | 输出完整错误信息,提示用户排查 |
|
|
126
126
|
|
|
@@ -128,12 +128,12 @@ cbb wp <file> --page-id <pageId> --dry-run
|
|
|
128
128
|
|
|
129
129
|
### 第五步:验证与修复
|
|
130
130
|
|
|
131
|
-
> **禁止调用 mb-wiki-rest 或其他外部 Wiki 技能。** 使用 `
|
|
131
|
+
> **禁止调用 mb-wiki-rest 或其他外部 Wiki 技能。** 使用 `cbbm wp --dry-run` 和 `cbbm wiki get` 完成验证。
|
|
132
132
|
|
|
133
133
|
**5.1 Dry-run 检查 XHTML**
|
|
134
134
|
|
|
135
135
|
```bash
|
|
136
|
-
|
|
136
|
+
cbbm wp <file> --page-id <pageId> --dry-run | Select-String "mermaid-macro|plantuml|ac:structured-macro"
|
|
137
137
|
```
|
|
138
138
|
|
|
139
139
|
确认输出中包含正确的 Confluence 宏标签(`<ac:structured-macro>`),而非原始 Markdown 代码块。
|
|
@@ -141,7 +141,7 @@ cbb wp <file> --page-id <pageId> --dry-run | Select-String "mermaid-macro|plantu
|
|
|
141
141
|
**5.2 页面内容验证**
|
|
142
142
|
|
|
143
143
|
```bash
|
|
144
|
-
|
|
144
|
+
cbbm wiki get <pageId> --full
|
|
145
145
|
```
|
|
146
146
|
|
|
147
147
|
确认页面已创建/更新成功,正文内容完整。
|
|
@@ -163,7 +163,7 @@ cbb wiki get <pageId> --full
|
|
|
163
163
|
- `@Tool`、`@ConfigurationValue` 等被误解析为用户提及 → Confluence `@` 宏冲突
|
|
164
164
|
- 表格/代码块格式异常 → XHTML 结构问题
|
|
165
165
|
2. **修复 design.md 源内容**:针对性修改(如 mermaid 语法调整、`@` 转义等)
|
|
166
|
-
3. **重新发布**:回到第四步重新执行 `
|
|
166
|
+
3. **重新发布**:回到第四步重新执行 `cbbm wp`
|
|
167
167
|
4. **重新验证**:回到 5.3 再次检查
|
|
168
168
|
|
|
169
169
|
**循环此过程直到所有渲染问题修复、Wiki 页面显示正常为止。**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cbb-wiki-ops
|
|
3
|
-
description: Wiki (wiki.amh-group.com) 命令行操作工具。遇到 wiki.amh-group.com 链接时**必须**使用本技能,禁止用 WebFetch(Wiki 需认证,WebFetch 必然失败)。触发场景:读取/查询/搜索 Wiki 页面、列子页/评论/空间/版本/附件、创建/更新页面、创建评论、任何涉及 wiki.amh-group.com 的操作。所有操作通过 `
|
|
3
|
+
description: Wiki (wiki.amh-group.com) 命令行操作工具。遇到 wiki.amh-group.com 链接时**必须**使用本技能,禁止用 WebFetch(Wiki 需认证,WebFetch 必然失败)。触发场景:读取/查询/搜索 Wiki 页面、列子页/评论/空间/版本/附件、创建/更新页面、创建评论、任何涉及 wiki.amh-group.com 的操作。所有操作通过 `cbbm wiki` 子命令完成。即使用户只给了 Wiki 链接没有明确说"用 wiki 工具",也要优先用本技能而非 WebFetch。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# 行为规则
|
|
@@ -15,10 +15,10 @@ node .claude/skills/cbb-wiki-ops/scripts/check-auth.js
|
|
|
15
15
|
|
|
16
16
|
| 输出 | 含义 | 下一步 |
|
|
17
17
|
|------|------|--------|
|
|
18
|
-
| `AUTH_OK` | 环境变量已配置 | 继续执行用户请求的 `
|
|
18
|
+
| `AUTH_OK` | 环境变量已配置 | 继续执行用户请求的 `cbbm wiki` 操作 |
|
|
19
19
|
| `AUTH_MISSING` | 未配置凭据 | → §2 认证配置 |
|
|
20
20
|
|
|
21
|
-
注意:只在 `AUTH_OK` 后才执行 `
|
|
21
|
+
注意:只在 `AUTH_OK` 后才执行 `cbbm wiki` 命令。如果执行时遇到 401/403,按 §3 处理。
|
|
22
22
|
|
|
23
23
|
## 2. 认证配置(首次使用)
|
|
24
24
|
|
|
@@ -36,7 +36,7 @@ setx CBB_WIKI_TOKEN "你的PAT"
|
|
|
36
36
|
**方式 B — 配置文件:**
|
|
37
37
|
创建 `~/.cbb/wiki-config.json`,内容:`{"email": "邮箱@amh-group.com", "token": "PAT"}`
|
|
38
38
|
|
|
39
|
-
用户确认配置完成后,重新执行 `
|
|
39
|
+
用户确认配置完成后,重新执行 `cbbm wiki user --current` 验证通过,再继续原操作。
|
|
40
40
|
|
|
41
41
|
## 3. 凭据过期(401/403)
|
|
42
42
|
|
|
@@ -58,20 +58,20 @@ setx CBB_WIKI_TOKEN "你的PAT"
|
|
|
58
58
|
|
|
59
59
|
### 读页面
|
|
60
60
|
```bash
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
cbbm wiki get <pageId> # 标题/空间/版本(正文折叠)
|
|
62
|
+
cbbm wiki get <pageId> --full # 含完整 XHTML 正文
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
### 列子页
|
|
66
66
|
```bash
|
|
67
|
-
|
|
67
|
+
cbbm wiki children <pageId> [--limit=50] [--start=0]
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
### CQL 搜索
|
|
71
71
|
```bash
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
cbbm wiki search "type=page AND title~\"关键词\"" [--limit=20]
|
|
73
|
+
cbbm wiki search "type=page AND text~\"关键词\"" --excerpt=highlight
|
|
74
|
+
cbbm wiki search "type=page AND space=KEY" --order=lastmodified desc
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
**CQL 语法速查:**
|
|
@@ -83,32 +83,32 @@ cbb wiki search "type=page AND space=KEY" --order=lastmodified desc
|
|
|
83
83
|
|
|
84
84
|
### 列空间
|
|
85
85
|
```bash
|
|
86
|
-
|
|
86
|
+
cbbm wiki spaces [--limit=100] [--type=global]
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
### 列评论
|
|
90
90
|
```bash
|
|
91
|
-
|
|
91
|
+
cbbm wiki comments <pageId> [--limit=50]
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
### 查用户
|
|
95
95
|
```bash
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
cbbm wiki user --current
|
|
97
|
+
cbbm wiki user --account-id=<accountId>
|
|
98
|
+
cbbm wiki user --username=<name>
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
### 历史版本
|
|
102
102
|
```bash
|
|
103
|
-
|
|
103
|
+
cbbm wiki versions <pageId> [--limit=20]
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
## 附件
|
|
107
107
|
|
|
108
108
|
```bash
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
cbbm wiki attachments <pageId> list [--limit=50]
|
|
110
|
+
cbbm wiki attachments <pageId> upload --file=<path> [--comment="说明"]
|
|
111
|
+
cbbm wiki attachments <pageId> delete --attachment-id=<id>
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
> 下载附件:Basic 认证下不可用,请在浏览器打开页面下载。
|
|
@@ -117,18 +117,18 @@ cbb wiki attachments <pageId> delete --attachment-id=<id>
|
|
|
117
117
|
|
|
118
118
|
### 创建页面
|
|
119
119
|
```bash
|
|
120
|
-
|
|
120
|
+
cbbm wiki create --parent-id <父页面Id> --title "标题" --file <markdown文件路径>
|
|
121
121
|
```
|
|
122
122
|
读取 Markdown 文件,自动转换为 Confluence XHTML 后创建。
|
|
123
123
|
|
|
124
124
|
### 更新页面
|
|
125
125
|
```bash
|
|
126
|
-
|
|
126
|
+
cbbm wiki update --page-id <pageId> --file <markdown文件路径>
|
|
127
127
|
```
|
|
128
128
|
读取 Markdown 文件,自动转换为 Confluence XHTML 后更新(自动取版本号 +1)。
|
|
129
129
|
|
|
130
130
|
### 创建评论
|
|
131
131
|
```bash
|
|
132
|
-
|
|
132
|
+
cbbm wiki comment <pageId> --body-file=<xhtml文件路径> [--parent=<父评论Id>]
|
|
133
133
|
```
|
|
134
134
|
评论 body 须为 Confluence Storage XHTML 格式。
|
|
@@ -47,7 +47,7 @@ if (cwdMatch) {
|
|
|
47
47
|
const worktreesDir = path.join(wsRoot, '.worktrees');
|
|
48
48
|
if (!fs.existsSync(worktreesDir)) {
|
|
49
49
|
console.error('❌ .worktrees 目录不存在:' + worktreesDir);
|
|
50
|
-
console.error(' 请先执行
|
|
50
|
+
console.error(' 请先执行 cbb-worktree-init 创建 worktree');
|
|
51
51
|
console.log('---');
|
|
52
52
|
console.log('NO_WORKTREE');
|
|
53
53
|
process.exit(2);
|
|
@@ -65,7 +65,7 @@ const entries = fs.readdirSync(worktreesDir, { withFileTypes: true })
|
|
|
65
65
|
|
|
66
66
|
if (entries.length === 0) {
|
|
67
67
|
console.error('❌ 未找到任何 worktree');
|
|
68
|
-
console.error(' 请先执行
|
|
68
|
+
console.error(' 请先执行 cbb-worktree-init 创建 worktree');
|
|
69
69
|
console.log('---');
|
|
70
70
|
console.log('NO_WORKTREE');
|
|
71
71
|
process.exit(2);
|
|
@@ -5,8 +5,8 @@ require('./silence-popup');
|
|
|
5
5
|
* 唯一真源:cbb/worktrees/_shared/scripts/find-workspace-root.js
|
|
6
6
|
* 由 scripts/sync-shared.js 展开到各 skill 的 scripts/ 下(init / extend / close / push)。
|
|
7
7
|
*
|
|
8
|
-
* 优先:git worktree list 第一行(主仓库根目录,不受 worktree 内
|
|
9
|
-
* 兜底:当前目录含
|
|
8
|
+
* 优先:git worktree list 第一行(主仓库根目录,不受 worktree 内 workspace-config.json 副本干扰)
|
|
9
|
+
* 兜底:当前目录含 workspace-config.json
|
|
10
10
|
*
|
|
11
11
|
* 退出码:
|
|
12
12
|
* 0 - 定位成功,输出 WS_ROOT 绝对路径
|
|
@@ -44,19 +44,19 @@ if (worktreeList.ok) {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
// 兜底:当前目录含
|
|
47
|
+
// 兜底:当前目录含 workspace-config.json
|
|
48
48
|
if (!wsRoot) {
|
|
49
49
|
const cwd = process.cwd();
|
|
50
|
-
if (fs.existsSync(path.join(cwd, '
|
|
50
|
+
if (fs.existsSync(path.join(cwd, 'workspace-config.json'))) {
|
|
51
51
|
wsRoot = cwd;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
// 校验
|
|
56
|
-
if (!wsRoot || !fs.existsSync(path.join(wsRoot, '
|
|
56
|
+
if (!wsRoot || !fs.existsSync(path.join(wsRoot, 'workspace-config.json'))) {
|
|
57
57
|
console.error('❌ 未找到工作空间根目录');
|
|
58
|
-
console.error(' 原因:git worktree list 失败且当前目录无
|
|
59
|
-
console.error(' 请在业务工作空间根目录(由 cbb setup 初始化、包含
|
|
58
|
+
console.error(' 原因:git worktree list 失败且当前目录无 workspace-config.json');
|
|
59
|
+
console.error(' 请在业务工作空间根目录(由 cbb setup 初始化、包含 workspace-config.json)下执行本技能');
|
|
60
60
|
process.exit(1);
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -12,6 +12,12 @@ require('./silence-popup');
|
|
|
12
12
|
* - pushSingle(repoPath, repoName, branch) 推送单个仓库并建立 upstream
|
|
13
13
|
* - collectRemoteMetadata(repoPath, branch, remote) 采集远程 commit 元信息
|
|
14
14
|
*
|
|
15
|
+
* pushSingle 状态契约:
|
|
16
|
+
* - pushed 本次推送成功(新建分支或快进)
|
|
17
|
+
* - skipped 远程同名分支已存在且与本地一致 → 无需推送(幂等,重跑 init 场景)
|
|
18
|
+
* - remote-exists 远程同名分支存在但与本地不一致 → 需用户决策(附 metadata)
|
|
19
|
+
* - failed 推送失败,error 见错误码契约
|
|
20
|
+
*
|
|
15
21
|
* 错误码契约(classifyError 输出):
|
|
16
22
|
* - ssh-auth-failed Permission denied (publickey)
|
|
17
23
|
* - https-auth-failed Authentication failed
|
|
@@ -115,6 +121,18 @@ function pushSingle(repoPath, repoName, branch, opts) {
|
|
|
115
121
|
const r = remote.out.split(/\r?\n/)[0];
|
|
116
122
|
const branchEsc = escapeBranch(branch);
|
|
117
123
|
const remoteEsc = '"' + String(r).replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"';
|
|
124
|
+
|
|
125
|
+
// 幂等:远程同名分支已存在且 hash 与本地完全一致 → 此前已推送,直接跳过。
|
|
126
|
+
// 让 init-worktree 可安全重跑(补齐新增应用/中断恢复),且不会重复推送或误报 remote-exists。
|
|
127
|
+
const lsRemote = tryExec('git ls-remote --heads ' + remoteEsc + ' ' + escapeBranch('refs/heads/' + branch), repoPath, execImpl);
|
|
128
|
+
if (lsRemote.ok && lsRemote.out) {
|
|
129
|
+
const remoteHash = lsRemote.out.split(/\s+/)[0];
|
|
130
|
+
const localHash = tryExec('git rev-parse --verify ' + branchEsc, repoPath, execImpl);
|
|
131
|
+
if (localHash.ok && localHash.out && localHash.out === remoteHash) {
|
|
132
|
+
return { name: repoName, status: 'skipped', upstream: r + '/' + branch, message: '远程分支与本地一致,无需推送' };
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
118
136
|
const pushResult = tryExec('git push -u ' + remoteEsc + ' ' + branchEsc, repoPath, execImpl);
|
|
119
137
|
if (pushResult.ok) {
|
|
120
138
|
return { name: repoName, status: 'pushed', upstream: r + '/' + branch };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: "
|
|
2
|
+
name: "CBB: Worktree Close"
|
|
3
3
|
description: 关闭/清理由 init-worktree 创建的多仓库联动 worktree 工作空间,移除 worktree 并按用户选择处理特性分支
|
|
4
4
|
category: Workflow
|
|
5
5
|
tags: [worktree, cleanup, worktree, git-worktree]
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# CBB: Worktree Close - 关闭 Worktree
|
|
9
9
|
|
|
10
10
|
## 重要:第一步必须用 Read 工具直接打开 SKILL.md
|
|
11
11
|
|
|
12
12
|
**禁止**用 `ls` / `find` / `cat` / `head` / `grep` 等 bash 命令搜索 SKILL.md。这些命令在 Qoder Windows PowerShell 沙箱中经常失败。
|
|
13
13
|
|
|
14
14
|
**直接路径**:
|
|
15
|
-
- Qoder 适配器:`.qoder/skills/
|
|
16
|
-
- Claude Code 适配器:`.claude/skills/
|
|
15
|
+
- Qoder 适配器:`.qoder/skills/cbb-worktree-close/SKILL.md`
|
|
16
|
+
- Claude Code 适配器:`.claude/skills/cbb-worktree-close/SKILL.md`
|
|
17
17
|
|
|
18
18
|
**第一步**:
|
|
19
19
|
1. 用 Read 工具直接打开 SKILL.md
|
|
@@ -26,9 +26,9 @@ tags: [worktree, cleanup, worktree, git-worktree]
|
|
|
26
26
|
|
|
27
27
|
**Steps 概述**(完整流程见 SKILL.md)
|
|
28
28
|
|
|
29
|
-
1. Step 0:前置校验(Git 仓库检测、
|
|
29
|
+
1. Step 0:前置校验(Git 仓库检测、workspace-config.json 检测,支持向上查找)
|
|
30
30
|
2. Step 1:确定要关闭的目标 worktree(列出 `.worktrees/` 下的工作空间 worktree,用户选择或自动选取)
|
|
31
|
-
3. Step 2:发现关联应用 worktree(读
|
|
31
|
+
3. Step 2:发现关联应用 worktree(读 workspace-config.json,按实际存在性确定关联清单)
|
|
32
32
|
4. Step 3:安全检查(未提交修改 / 是否合并到主分支 / 是否推到远程,含主动 fetch 刷新远程引用)
|
|
33
33
|
5. Step 4:用户决策(未提交修改处理方式 + 分支处理方式,AskUserQuestion 固定选项)
|
|
34
34
|
6. Step 5:移除 Worktree(三层降级策略:正常移除 → prune+物理删除 → 仅 prune 延迟清理)
|
|
@@ -55,10 +55,10 @@ tags: [worktree, cleanup, worktree, git-worktree]
|
|
|
55
55
|
|
|
56
56
|
**Guardrails**
|
|
57
57
|
|
|
58
|
-
- 必须在业务工作空间根目录执行(包含
|
|
58
|
+
- 必须在业务工作空间根目录执行(包含 workspace-config.json 的目录),支持从 worktree 内部向上查找
|
|
59
59
|
- 顺序硬约束:**先移除所有 worktree,再删除分支**(先删分支会报 `Cannot delete branch checked out at`)
|
|
60
60
|
- 破坏性操作必须先报告、经用户确认才执行(未提交修改、未合并分支绝不静默 `--force` 或 `-D`)
|
|
61
61
|
- 只操作 `.worktrees/worktree-<需求名>` 路径,绝不碰其它 worktree(如 IDE 会话 worktree)
|
|
62
|
-
- 关联应用以实际存在的 worktree 为准,不假设
|
|
62
|
+
- 关联应用以实际存在的 worktree 为准,不假设 workspace-config.json 中所有应用都有关联
|
|
63
63
|
- 依赖 shell 函数的脚本必须整段在一次 Bash 调用中执行(函数不跨调用保留)
|
|
64
64
|
- git 操作一律用 `git -C <仓库>` 绝对路径,不依赖跨调用的 cwd
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: "
|
|
2
|
+
name: "CBB: Worktree Init"
|
|
3
3
|
description: 为一个需求在 workspace 与各关联应用仓库同步创建同名 git worktree,物理直聚在 `.worktrees/<需求名>/` 目录
|
|
4
4
|
category: Workflow
|
|
5
5
|
tags: [worktree, isolation, worktree, git-worktree]
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# CBB: Worktree Init - 创建 Worktree
|
|
9
9
|
|
|
10
10
|
## 重要:第一步必须用 Read 工具直接打开 SKILL.md
|
|
11
11
|
|
|
12
12
|
**禁止**用 `ls` / `find` / `cat` / `head` / `grep` 等 bash 命令搜索 SKILL.md 是否存在。**这些命令在 Qoder Windows PowerShell 沙箱中经常失败**(如 `head` 不存在、stderr 重定向无效等)。
|
|
13
13
|
|
|
14
14
|
**直接路径**:
|
|
15
|
-
- Qoder 适配器:`.qoder/skills/
|
|
16
|
-
- Claude Code 适配器:`.claude/skills/
|
|
15
|
+
- Qoder 适配器:`.qoder/skills/cbb-worktree-init/SKILL.md`
|
|
16
|
+
- Claude Code 适配器:`.claude/skills/cbb-worktree-init/SKILL.md`
|
|
17
17
|
|
|
18
18
|
**第一步**:
|
|
19
|
-
1. 用 Read 工具直接打开 `.qoder/skills/
|
|
19
|
+
1. 用 Read 工具直接打开 `.qoder/skills/cbb-worktree-init/SKILL.md`(或 `.claude/skills/...`)
|
|
20
20
|
2. 按 SKILL.md 的 Step 0 → 1 → 2 → 3 → 4 → 5 → 6 顺序执行
|
|
21
21
|
3. 每次调用 Node.js 脚本时,使用**绝对路径**(避免依赖相对路径):
|
|
22
22
|
```
|
|
23
|
-
node "D:\workspace\<用户工作空间>\.qoder\skills\
|
|
23
|
+
node "D:\workspace\<用户工作空间>\.qoder\skills\cbb-worktree-init\scripts\<name>.js" <参数>
|
|
24
24
|
```
|
|
25
25
|
- 参数形式:
|
|
26
26
|
- `check-env.js`:无参数
|
|
@@ -39,12 +39,12 @@ tags: [worktree, isolation, worktree, git-worktree]
|
|
|
39
39
|
|
|
40
40
|
## 流程总览(完整流程见 SKILL.md)
|
|
41
41
|
|
|
42
|
-
1. Step 0:环境探活 + 解析
|
|
43
|
-
2. Step 1:同步 .
|
|
42
|
+
1. Step 0:环境探活 + 解析 workspace-config.json
|
|
43
|
+
2. Step 1:同步 .codespace/ 仓库(fetch --all)
|
|
44
44
|
3. Step 2:状态检查(5 项 / 3 项分级)
|
|
45
45
|
4. Step 3:创建分支(workspace 从 HEAD,app 从 origin/master)
|
|
46
46
|
5. Step 4:创建 worktree(workspace + 嵌套 app)
|
|
47
|
-
6. Step 5:在 worktree 中安装 AI 配置(
|
|
47
|
+
6. Step 5:在 worktree 中安装 AI 配置(cbbm init -y)
|
|
48
48
|
7. Step 6:环境感知 + 进入工作目录
|
|
49
49
|
|
|
50
50
|
## 关键 Guardrails
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: "
|
|
2
|
+
name: "CBB: Worktree Push"
|
|
3
3
|
description: 跨 worktree 提交并推送当前需求的所有关联仓库到 origin
|
|
4
4
|
category: Workflow
|
|
5
5
|
tags: [workflow, push, commit, worktree, experimental]
|
|
@@ -7,7 +7,7 @@ tags: [workflow, push, commit, worktree, experimental]
|
|
|
7
7
|
|
|
8
8
|
跨 worktree 提交并推送当前需求的所有关联仓库到 origin。
|
|
9
9
|
|
|
10
|
-
**Input**: 可选指定需求名(如 `/
|
|
10
|
+
**Input**: 可选指定需求名(如 `/cbb:worktree-push ft-diff-on-cargo`)。省略时从 cwd 的 `.worktrees/worktree-<需求名>/` 路径推断(cwd 在工作空间根目录时由 Step 0 定位)。
|
|
11
11
|
|
|
12
12
|
**何时使用**:
|
|
13
13
|
|
|
@@ -16,7 +16,7 @@ tags: [workflow, push, commit, worktree, experimental]
|
|
|
16
16
|
- 开发过程中想保存中间进度
|
|
17
17
|
- 用户口语化说"提交并push" / "推一下"
|
|
18
18
|
|
|
19
|
-
**Steps 摘要**(详细见 [
|
|
19
|
+
**Steps 摘要**(详细见 [cbb-worktree-push SKILL.md](../../skills/cbb-worktree-push/SKILL.md)):
|
|
20
20
|
|
|
21
21
|
1. **Step 0**:定位工作空间根(find-workspace-root.js)
|
|
22
22
|
2. **Step 1**:识别目标 worktree(find-target-worktree.js)
|