@jspg-ai/coding-bb 0.0.3-beta.3 → 0.0.3-beta.31
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/dev-standards/rules/cbb-ai-behavior.md +135 -116
- package/cbb/lib/external/index.js +228 -0
- package/cbb/lib/install/agents-nav.js +92 -0
- package/cbb/lib/install/claude-code.js +7 -2
- package/cbb/lib/install/command-skill.js +105 -0
- package/cbb/lib/install/init.js +502 -168
- package/cbb/lib/install/minimax.js +60 -0
- package/cbb/lib/install/opencode.js +3 -5
- package/cbb/lib/install/qoder.js +1 -3
- package/cbb/lib/install/rule-rewrite.js +27 -0
- package/cbb/lib/install/setup-decision.js +48 -0
- package/cbb/lib/install/tool-selection.js +45 -0
- package/cbb/lib/install/trae.js +43 -0
- package/cbb/lib/install/workbuddy.js +36 -0
- package/cbb/lib/install/workspaces.js +21 -17
- package/cbb/lib/openspec/index.js +337 -554
- package/cbb/lib/superpowers/index.js +246 -265
- package/cbb/lib/utils/check-update.js +17 -2
- package/cbb/lib/utils/githook.js +226 -0
- package/cbb/lib/utils/gitignore.js +16 -3
- package/cbb/lib/utils/plugin-hook.js +92 -0
- package/cbb/lib/utils/settings.js +17 -4
- package/cbb/lib/utils/tar.js +92 -0
- package/cbb/lib/utils/upstream.js +90 -0
- package/cbb/worktrees/_shared/scripts/check-local-state.js +114 -0
- package/cbb/worktrees/_shared/scripts/find-target-worktree.js +148 -96
- package/cbb/worktrees/_shared/scripts/find-workspace-root.js +7 -7
- package/cbb/worktrees/_shared/scripts/install-git-hook.js +70 -0
- package/cbb/worktrees/_shared/scripts/junction-ai-config.js +127 -0
- package/cbb/worktrees/_shared/scripts/start-local.js +180 -0
- package/cbb/worktrees/skills/cbb-local-mode/SKILL.md +158 -0
- package/cbb/worktrees/skills/cbb-local-mode/scripts/check-local-state.js +114 -0
- package/cbb/worktrees/skills/cbb-local-mode/scripts/install-git-hook.js +70 -0
- package/cbb/worktrees/skills/cbb-local-mode/scripts/silence-popup.js +23 -0
- package/cbb/worktrees/skills/cbb-local-mode/scripts/start-local.js +180 -0
- package/cbb/worktrees/skills/cbb-worktree-close/SKILL.md +60 -43
- package/cbb/worktrees/skills/cbb-worktree-close/scripts/check-env.js +3 -3
- package/cbb/worktrees/skills/cbb-worktree-close/scripts/check-unarchived.js +75 -48
- package/cbb/worktrees/skills/cbb-worktree-close/scripts/delete-branches.js +1 -1
- package/cbb/worktrees/skills/cbb-worktree-close/scripts/discover-apps.js +14 -5
- package/cbb/worktrees/skills/cbb-worktree-close/scripts/find-target-worktree.js +148 -96
- package/cbb/worktrees/skills/cbb-worktree-close/scripts/find-workspace-root.js +7 -7
- package/cbb/worktrees/skills/cbb-worktree-close/scripts/remove-worktrees.js +13 -4
- package/cbb/worktrees/skills/cbb-worktree-close/scripts/safety-check.js +11 -2
- package/cbb/worktrees/skills/cbb-worktree-init/SKILL.md +138 -129
- package/cbb/worktrees/skills/cbb-worktree-init/scripts/check-env.js +1 -1
- package/cbb/worktrees/skills/cbb-worktree-init/scripts/check-repos.js +2 -2
- package/cbb/worktrees/skills/cbb-worktree-init/scripts/create-branches.js +33 -8
- package/cbb/worktrees/skills/cbb-worktree-init/scripts/create-worktrees.js +60 -46
- package/cbb/worktrees/skills/cbb-worktree-init/scripts/find-workspace-root.js +7 -7
- package/cbb/worktrees/skills/cbb-worktree-init/scripts/install-git-hook.js +70 -0
- package/cbb/worktrees/skills/cbb-worktree-init/scripts/junction-ai-config.js +127 -0
- package/cbb/worktrees/skills/cbb-worktree-init/scripts/parse-config.js +7 -7
- package/cbb/worktrees/skills/cbb-worktree-init/scripts/push-branches.js +3 -3
- package/cbb/worktrees/skills/cbb-worktree-init/scripts/sync-repos.js +11 -7
- package/cbb/worktrees/skills/cbb-worktree-init/scripts/update-gitignore.js +37 -9
- package/cbb/worktrees/skills/cbb-worktree-push/SKILL.md +140 -71
- package/cbb/worktrees/skills/cbb-worktree-push/scripts/commit-worktrees.js +70 -12
- package/cbb/worktrees/skills/cbb-worktree-push/scripts/find-target-worktree.js +148 -96
- package/cbb/worktrees/skills/cbb-worktree-push/scripts/find-workspace-root.js +7 -7
- package/cbb/worktrees/skills/cbb-worktree-push/scripts/make-mr-urls.js +211 -0
- package/cbb/worktrees/skills/cbb-worktree-push/scripts/push-worktrees.js +67 -20
- package/config/{workspace-config.sample.json → CBB-WORKSPACE.sample.json} +1 -1
- package/config/openspec/schemas/spec-driven/schema.yaml +40 -30
- package/config/openspec/schemas/spec-driven/templates/design.md +0 -18
- package/config/openspec/schemas/spec-driven/templates/proposal.md +4 -3
- package/config/upstream-mirrors.json +17 -0
- package/config/workspace-agents.sample.md +4 -33
- package/external/frontend-design/.version +6 -0
- package/external/frontend-design/LICENSE.txt +177 -0
- package/external/frontend-design/SKILL.md +71 -0
- package/openspec/.version +2 -3
- package/openspec/commands/apply.md +189 -175
- package/openspec/commands/archive.md +244 -216
- package/openspec/commands/bulk-archive.md +362 -327
- package/openspec/commands/continue.md +115 -105
- package/openspec/commands/explore.md +230 -199
- package/openspec/commands/ff.md +115 -104
- package/openspec/commands/new.md +74 -63
- package/openspec/commands/onboard.md +562 -548
- package/openspec/commands/propose.md +161 -150
- package/openspec/commands/sync.md +277 -249
- package/openspec/commands/update.md +98 -80
- package/openspec/commands/verify.md +206 -162
- package/openspec/skills/openspec-apply-change/SKILL.md +20 -5
- package/openspec/skills/openspec-archive-change/SKILL.md +40 -11
- package/openspec/skills/openspec-bulk-archive-change/SKILL.md +46 -9
- package/openspec/skills/openspec-continue-change/SKILL.md +14 -3
- package/openspec/skills/openspec-explore/SKILL.md +22 -10
- package/openspec/skills/openspec-ff-change/SKILL.md +15 -3
- package/openspec/skills/openspec-new-change/SKILL.md +13 -1
- package/openspec/skills/openspec-onboard/SKILL.md +58 -43
- package/openspec/skills/openspec-propose/SKILL.md +15 -3
- package/openspec/skills/openspec-sync-specs/SKILL.md +31 -2
- package/openspec/skills/openspec-update-change/SKILL.md +34 -15
- package/openspec/skills/openspec-verify-change/SKILL.md +72 -26
- package/package.json +3 -2
- package/superpowers/.version +4 -4
- package/superpowers/skills/brainstorming/SKILL.md +47 -12
- package/superpowers/skills/brainstorming/scripts/frame-template.html +213 -213
- package/superpowers/skills/brainstorming/scripts/server.cjs +723 -723
- package/superpowers/skills/brainstorming/visual-companion.md +6 -6
- package/superpowers/skills/diagnosing-superpowers/SKILL.md +120 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/analyst-common.md +38 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/cost-and-time.md +28 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/plan-adherence.md +29 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/quality-evidence.md +26 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/repeated-work.md +30 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/request-conflicts.md +20 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/scrub-audit.md +33 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/scrub.md +29 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/similar-session.md +38 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/skill-timeline.md +30 -0
- package/superpowers/skills/diagnosing-superpowers/prompts/stumbles.md +28 -0
- package/superpowers/skills/diagnosing-superpowers/references/context-safety.md +22 -0
- package/superpowers/skills/diagnosing-superpowers/references/github-issues.md +47 -0
- package/superpowers/skills/diagnosing-superpowers/references/redaction-policy.md +34 -0
- package/superpowers/skills/diagnosing-superpowers/references/session-discovery.md +31 -0
- package/superpowers/skills/diagnosing-superpowers/templates/bundle-README.md +77 -0
- package/superpowers/skills/diagnosing-superpowers/templates/case.md +64 -0
- package/superpowers/skills/diagnosing-superpowers/templates/issue.md +51 -0
- package/superpowers/skills/diagnosing-superpowers/templates/report.md +82 -0
- package/superpowers/skills/executing-plans/SKILL.md +350 -41
- package/superpowers/skills/executing-plans/scripts/task-done +52 -0
- package/superpowers/skills/executing-plans/scripts/task-start +28 -0
- package/superpowers/skills/requesting-code-review/SKILL.md +1 -1
- package/superpowers/skills/requesting-code-review/code-reviewer.md +17 -0
- package/superpowers/skills/subagent-driven-development/SKILL.md +18 -18
- package/superpowers/skills/subagent-driven-development/re-review-prompt.md +1 -1
- package/superpowers/skills/subagent-driven-development/scripts/review-package +53 -46
- package/superpowers/skills/subagent-driven-development/scripts/sdd-workspace +82 -40
- package/superpowers/skills/subagent-driven-development/scripts/task-brief +43 -41
- package/superpowers/skills/subagent-driven-development/task-reviewer-prompt.md +2 -2
- package/superpowers/skills/systematic-debugging/root-cause-tracing.md +1 -1
- package/superpowers/skills/test-driven-development/SKILL.md +10 -0
- package/superpowers/skills/using-superpowers/SKILL.md +2 -0
- package/superpowers/skills/using-superpowers/references/claude-code-tools.md +29 -0
- package/superpowers/skills/using-superpowers/references/muse-tools.md +35 -0
- package/superpowers/skills/writing-plans/SKILL.md +62 -29
- package/superpowers/skills/writing-skills/SKILL.md +4 -2
- package/superpowers/skills/writing-skills/graphviz-conventions.dot +171 -171
- package/cbb/worktrees/commands/worktree-close.md +0 -64
- package/cbb/worktrees/commands/worktree-init.md +0 -51
- package/cbb/worktrees/commands/worktree-push.md +0 -42
- package/superpowers/skills/writing-plans/plan-document-reviewer-prompt.md +0 -49
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* openspec 命令 → skill 形态转换(commandsAsSkills 适配器用,当前仅 MiniMax Code)。
|
|
5
|
+
*
|
|
6
|
+
* MiniMax Code 无项目级 commands 目录,skill 即其命令形态:每个 openspec 命令
|
|
7
|
+
* 落为 <skillsDir>/<prefix><name>/SKILL.md,目录名 = frontmatter name(Agent
|
|
8
|
+
* Skills 约定),/opsx-propose 斜杠照常可用。
|
|
9
|
+
*
|
|
10
|
+
* 同时承接命令 frontmatter 消毒(sanitizeCommandFrontmatter):opencode 新版
|
|
11
|
+
* 校验命令配置(description 必须为 string | undefined),上游个别命令
|
|
12
|
+
* (openspec/commands/update.md)的 description 为空值(YAML 解析为 null),
|
|
13
|
+
* 会拒绝加载整个项目配置。此处对部署副本回填正文首句作为描述(超过 120 字
|
|
14
|
+
* 截断),上游源文件不动(CLI 接管区)。
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const path = require('path');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 命令文件 → skill 目录名(文件名基准,保证目录名稳定)。
|
|
21
|
+
* @param {string} fileName 如 propose.md
|
|
22
|
+
* @param {string} prefix 如 opsx-
|
|
23
|
+
* @returns {string} 如 opsx-propose
|
|
24
|
+
*/
|
|
25
|
+
function skillNameFor(fileName, prefix) {
|
|
26
|
+
return (prefix || '') + path.basename(fileName, '.md');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** 取 frontmatter(首个 --- 到闭合 --- 之间);无 frontmatter 返回 -1 */
|
|
30
|
+
function findFrontmatterEnd(lines) {
|
|
31
|
+
if ((lines[0] || '').trim() !== '---') return -1;
|
|
32
|
+
for (let i = 1; i < lines.length; i++) {
|
|
33
|
+
if ((lines[i] || '').trim() === '---') return i;
|
|
34
|
+
}
|
|
35
|
+
return -1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 命令 frontmatter 消毒(见文件头注释)。无 frontmatter 或无需改动时原样返回。
|
|
40
|
+
*/
|
|
41
|
+
function sanitizeCommandFrontmatter(content) {
|
|
42
|
+
const lines = content.split('\n');
|
|
43
|
+
if ((lines[0] || '').trim() !== '---') return content;
|
|
44
|
+
const end = findFrontmatterEnd(lines);
|
|
45
|
+
if (end === -1) return content;
|
|
46
|
+
let sentence = '';
|
|
47
|
+
for (let i = end + 1; i < lines.length; i++) {
|
|
48
|
+
const t = (lines[i] || '').trim();
|
|
49
|
+
if (t) { sentence = t; break; }
|
|
50
|
+
}
|
|
51
|
+
let changed = false;
|
|
52
|
+
for (let i = 1; i < end; i++) {
|
|
53
|
+
if (/^description:\s*(null|~)?\s*\r?$/.test(lines[i])) {
|
|
54
|
+
if (sentence) {
|
|
55
|
+
if (sentence.length > 120) sentence = sentence.slice(0, 117) + '...';
|
|
56
|
+
lines[i] = 'description: ' + JSON.stringify(sentence) + (lines[i].endsWith('\r') ? '\r' : '');
|
|
57
|
+
} else {
|
|
58
|
+
lines[i] = null; // 无正文可回填则移除(undefined 同样合法)
|
|
59
|
+
}
|
|
60
|
+
changed = true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return changed ? lines.filter(l => l !== null).join('\n') : content;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* 把命令内容转换为 skill 的 SKILL.md 内容:
|
|
68
|
+
* 1. frontmatter description 消毒(null → 回填正文首句);
|
|
69
|
+
* 2. frontmatter name 强制为 skillName —— 目录名 = name 是 Agent Skills 约定,
|
|
70
|
+
* 也规避上游标题与文件名不一致(如 ff.md 的 "OPSX: Fast Forward")。
|
|
71
|
+
*
|
|
72
|
+
* 上游 frontmatter 的其余字段(category / tags 等)原样保留。
|
|
73
|
+
*
|
|
74
|
+
* @param {string} content 命令原文(调用方已应用 contentRewrites)
|
|
75
|
+
* @param {string} skillName 目标 skill 名(= 目录名)
|
|
76
|
+
* @returns {string} SKILL.md 内容
|
|
77
|
+
*/
|
|
78
|
+
function convertCommandToSkill(content, skillName) {
|
|
79
|
+
const sanitized = sanitizeCommandFrontmatter(content);
|
|
80
|
+
const lines = sanitized.split('\n');
|
|
81
|
+
|
|
82
|
+
// 无 frontmatter:补建(name 必填;description 回填正文首句)
|
|
83
|
+
if ((lines[0] || '').trim() !== '---') {
|
|
84
|
+
const sentence = (lines.find(l => l.trim()) || '').trim().slice(0, 120);
|
|
85
|
+
const fm = ['---', `name: "${skillName}"`];
|
|
86
|
+
if (sentence) fm.push(`description: ${JSON.stringify(sentence)}`);
|
|
87
|
+
fm.push('---', '');
|
|
88
|
+
return fm.concat(lines).join('\n');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const end = findFrontmatterEnd(lines);
|
|
92
|
+
if (end === -1) return sanitized; // 开了没闭合的异常 frontmatter:不动
|
|
93
|
+
|
|
94
|
+
let nameLine = -1;
|
|
95
|
+
for (let i = 1; i < end; i++) {
|
|
96
|
+
if (/^name:/.test(lines[i])) { nameLine = i; break; }
|
|
97
|
+
}
|
|
98
|
+
const nameValue = `name: "${skillName}"`;
|
|
99
|
+
if (nameLine === -1) lines.splice(1, 0, nameValue); // 缺 name:紧跟开标记插入
|
|
100
|
+
else lines[nameLine] = nameValue + (lines[nameLine].endsWith('\r') ? '\r' : '');
|
|
101
|
+
|
|
102
|
+
return lines.join('\n');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
module.exports = { skillNameFor, sanitizeCommandFrontmatter, convertCommandToSkill };
|