@liangjie559567/ultrapower 5.2.3 → 5.2.6
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/.claude-plugin/plugin.json +1 -1
- package/agents/AGENTS.md +60 -0
- package/bridge/AGENTS.md +51 -0
- package/bridge/codex-server.cjs +3 -3
- package/bridge/gemini-server.cjs +2 -2
- package/commands/AGENTS.md +47 -0
- package/dist/__tests__/auto-update.test.js +195 -2
- package/dist/__tests__/auto-update.test.js.map +1 -1
- package/dist/__tests__/installer.test.js +1 -1
- package/dist/__tests__/installer.test.js.map +1 -1
- package/dist/__tests__/release-local.test.d.ts +2 -0
- package/dist/__tests__/release-local.test.d.ts.map +1 -0
- package/dist/__tests__/release-local.test.js +19 -0
- package/dist/__tests__/release-local.test.js.map +1 -0
- package/dist/__tests__/release-steps.test.d.ts +2 -0
- package/dist/__tests__/release-steps.test.d.ts.map +1 -0
- package/dist/__tests__/release-steps.test.js +82 -0
- package/dist/__tests__/release-steps.test.js.map +1 -0
- package/dist/features/auto-update.d.ts.map +1 -1
- package/dist/features/auto-update.js +23 -1
- package/dist/features/auto-update.js.map +1 -1
- package/dist/hooks/bridge.d.ts.map +1 -1
- package/dist/hooks/bridge.js +19 -2
- package/dist/hooks/bridge.js.map +1 -1
- package/dist/installer/hooks.d.ts.map +1 -1
- package/dist/installer/hooks.js +11 -9
- package/dist/installer/hooks.js.map +1 -1
- package/dist/lib/__tests__/plugin-registry.test.d.ts +2 -0
- package/dist/lib/__tests__/plugin-registry.test.d.ts.map +1 -0
- package/dist/lib/__tests__/plugin-registry.test.js +241 -0
- package/dist/lib/__tests__/plugin-registry.test.js.map +1 -0
- package/dist/team/__tests__/bridge-entry.test.js +62 -0
- package/dist/team/__tests__/bridge-entry.test.js.map +1 -1
- package/dist/team/__tests__/inbox-outbox.test.js +4 -3
- package/dist/team/__tests__/inbox-outbox.test.js.map +1 -1
- package/dist/team/__tests__/mcp-team-bridge.test.d.ts +2 -0
- package/dist/team/__tests__/mcp-team-bridge.test.d.ts.map +1 -0
- package/dist/team/__tests__/mcp-team-bridge.test.js +458 -0
- package/dist/team/__tests__/mcp-team-bridge.test.js.map +1 -0
- package/dist/team/__tests__/permissions.test.js +86 -1
- package/dist/team/__tests__/permissions.test.js.map +1 -1
- package/dist/team/__tests__/task-file-ops.test.js +43 -0
- package/dist/team/__tests__/task-file-ops.test.js.map +1 -1
- package/dist/team/mcp-team-bridge.d.ts +28 -1
- package/dist/team/mcp-team-bridge.d.ts.map +1 -1
- package/dist/team/mcp-team-bridge.js +2 -0
- package/dist/team/mcp-team-bridge.js.map +1 -1
- package/docs/CLAUDE.md +1 -1
- package/docs/agent-templates/AGENTS.md +29 -0
- package/docs/design/AGENTS.md +26 -0
- package/docs/issues/AGENTS.md +20 -0
- package/docs/partials/AGENTS.md +24 -0
- package/docs/plans/2026-02-27-release-cicd-pipeline-design.md +265 -0
- package/docs/plans/2026-02-27-release-cicd-pipeline-impl.md +519 -0
- package/docs/plans/AGENTS.md +33 -0
- package/docs/prd/AGENTS.md +22 -0
- package/docs/reviews/AGENTS.md +20 -0
- package/docs/reviews/ultrapower-standards/AGENTS.md +30 -0
- package/docs/shared/AGENTS.md +24 -0
- package/docs/standards/AGENTS.md +40 -0
- package/docs/standards/templates/AGENTS.md +28 -0
- package/docs/superpowers/AGENTS.md +26 -0
- package/docs/superpowers/plans/AGENTS.md +26 -0
- package/docs/superpowers/specs/AGENTS.md +26 -0
- package/docs/tasks/AGENTS.md +20 -0
- package/docs/tasks/ultrapower-standards/AGENTS.md +27 -0
- package/docs/windows/AGENTS.md +25 -0
- package/hooks/AGENTS.md +33 -0
- package/package.json +4 -2
- package/scripts/AGENTS.md +66 -0
- package/scripts/hooks/AGENTS.md +28 -0
- package/scripts/lib/AGENTS.md +25 -0
- package/scripts/plugin-setup.mjs +25 -4
- package/scripts/release-local.mjs +27 -0
- package/scripts/release-steps.mjs +121 -0
- package/skills/AGENTS.md +37 -0
- package/skills/analyze/AGENTS.md +28 -0
- package/skills/autopilot/AGENTS.md +28 -0
- package/skills/ax-analyze-error/AGENTS.md +28 -0
- package/skills/ax-context/AGENTS.md +28 -0
- package/skills/ax-decompose/AGENTS.md +28 -0
- package/skills/ax-draft/AGENTS.md +28 -0
- package/skills/ax-evolution/AGENTS.md +28 -0
- package/skills/ax-evolve/AGENTS.md +28 -0
- package/skills/ax-export/AGENTS.md +28 -0
- package/skills/ax-implement/AGENTS.md +28 -0
- package/skills/ax-knowledge/AGENTS.md +28 -0
- package/skills/ax-knowledge/SKILL.md +10 -10
- package/skills/ax-reflect/AGENTS.md +28 -0
- package/skills/ax-review/AGENTS.md +28 -0
- package/skills/ax-rollback/AGENTS.md +28 -0
- package/skills/ax-status/AGENTS.md +28 -0
- package/skills/ax-suspend/AGENTS.md +28 -0
- package/skills/brainstorming/AGENTS.md +28 -0
- package/skills/build-fix/AGENTS.md +28 -0
- package/skills/cancel/AGENTS.md +28 -0
- package/skills/ccg/AGENTS.md +28 -0
- package/skills/code-review/AGENTS.md +28 -0
- package/skills/configure-discord/AGENTS.md +28 -0
- package/skills/configure-telegram/AGENTS.md +28 -0
- package/skills/deepinit/AGENTS.md +28 -0
- package/skills/deepsearch/AGENTS.md +28 -0
- package/skills/dispatching-parallel-agents/AGENTS.md +28 -0
- package/skills/executing-plans/AGENTS.md +28 -0
- package/skills/external-context/AGENTS.md +28 -0
- package/skills/finishing-a-development-branch/AGENTS.md +28 -0
- package/skills/frontend-ui-ux/AGENTS.md +28 -0
- package/skills/git-master/AGENTS.md +28 -0
- package/skills/hud/AGENTS.md +28 -0
- package/skills/learn-about-omc/AGENTS.md +28 -0
- package/skills/learner/AGENTS.md +28 -0
- package/skills/mcp-setup/AGENTS.md +28 -0
- package/skills/next-step-router/AGENTS.md +28 -0
- package/skills/nexus/AGENTS.md +35 -0
- package/skills/nexus/nexus-evolve/AGENTS.md +28 -0
- package/skills/nexus/nexus-review/AGENTS.md +28 -0
- package/skills/nexus/nexus-status/AGENTS.md +28 -0
- package/skills/note/AGENTS.md +28 -0
- package/skills/omc-doctor/AGENTS.md +28 -0
- package/skills/omc-help/AGENTS.md +28 -0
- package/skills/omc-setup/AGENTS.md +28 -0
- package/skills/pipeline/AGENTS.md +28 -0
- package/skills/plan/AGENTS.md +28 -0
- package/skills/project-session-manager/AGENTS.md +28 -0
- package/skills/project-session-manager/lib/AGENTS.md +37 -0
- package/skills/project-session-manager/lib/providers/AGENTS.md +32 -0
- package/skills/project-session-manager/templates/AGENTS.md +29 -0
- package/skills/psm/AGENTS.md +28 -0
- package/skills/ralph/AGENTS.md +28 -0
- package/skills/ralph-init/AGENTS.md +28 -0
- package/skills/ralplan/AGENTS.md +28 -0
- package/skills/receiving-code-review/AGENTS.md +28 -0
- package/skills/release/AGENTS.md +28 -0
- package/skills/release/SKILL.md +19 -3
- package/skills/requesting-code-review/AGENTS.md +28 -0
- package/skills/review/AGENTS.md +28 -0
- package/skills/sciomc/AGENTS.md +28 -0
- package/skills/security-review/AGENTS.md +28 -0
- package/skills/skill/AGENTS.md +28 -0
- package/skills/subagent-driven-development/AGENTS.md +28 -0
- package/skills/swarm/AGENTS.md +28 -0
- package/skills/systematic-debugging/AGENTS.md +28 -0
- package/skills/team/AGENTS.md +28 -0
- package/skills/test-driven-development/AGENTS.md +28 -0
- package/skills/trace/AGENTS.md +28 -0
- package/skills/ultrapilot/AGENTS.md +28 -0
- package/skills/ultraqa/AGENTS.md +28 -0
- package/skills/ultrawork/AGENTS.md +28 -0
- package/skills/using-git-worktrees/AGENTS.md +28 -0
- package/skills/using-superpowers/AGENTS.md +28 -0
- package/skills/using-superpowers/references/AGENTS.md +26 -0
- package/skills/verification-before-completion/AGENTS.md +28 -0
- package/skills/wizard/AGENTS.md +28 -0
- package/skills/writer-memory/AGENTS.md +28 -0
- package/skills/writer-memory/lib/AGENTS.md +30 -0
- package/skills/writer-memory/templates/AGENTS.md +27 -0
- package/skills/writing-plans/AGENTS.md +28 -0
- package/skills/writing-skills/AGENTS.md +28 -0
- package/skills/writing-skills/examples/AGENTS.md +26 -0
- package/templates/AGENTS.md +28 -0
- package/templates/axiom/AGENTS.md +32 -0
- package/templates/axiom/scripts/AGENTS.md +26 -0
- package/templates/hooks/AGENTS.md +38 -0
- package/templates/hooks/keyword-detector.mjs +1 -2
- package/templates/hooks/lib/AGENTS.md +21 -0
- package/templates/rules/AGENTS.md +35 -0
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
# Release CI/CD Pipeline Implementation Plan
|
|
2
|
+
|
|
3
|
+
> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
|
|
4
|
+
|
|
5
|
+
**Goal:** 实现插件发布 CI/CD 流水线,从 `git tag v*` 推送到完整发布全自动化。
|
|
6
|
+
|
|
7
|
+
**Architecture:** 共享核心逻辑 `scripts/release-steps.mjs` 被 GitHub Actions(主路径)和本地脚本(备用路径)共同调用。4 个导出函数覆盖 validateBuild / publishNpm / createGithubRelease / syncMarketplace 全流程。
|
|
8
|
+
|
|
9
|
+
**Tech Stack:** Node.js ESM (`.mjs`)、GitHub Actions YAML、`gh` CLI、`npm publish`
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
### Task 1: 创建共享核心 `scripts/release-steps.mjs`
|
|
14
|
+
|
|
15
|
+
**Files:**
|
|
16
|
+
- Create: `scripts/release-steps.mjs`
|
|
17
|
+
|
|
18
|
+
**Step 1: 写失败测试**
|
|
19
|
+
|
|
20
|
+
新建 `src/__tests__/release-steps.test.ts`:
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
24
|
+
|
|
25
|
+
// Mock child_process exec
|
|
26
|
+
vi.mock('node:child_process', () => ({
|
|
27
|
+
exec: vi.fn(),
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
describe('release-steps', () => {
|
|
31
|
+
it('validateBuild: dry-run returns success without executing', async () => {
|
|
32
|
+
const { validateBuild } = await import('../../scripts/release-steps.mjs');
|
|
33
|
+
const result = await validateBuild({ dryRun: true });
|
|
34
|
+
expect(result.success).toBe(true);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('publishNpm: dry-run prints command without executing', async () => {
|
|
38
|
+
const { publishNpm } = await import('../../scripts/release-steps.mjs');
|
|
39
|
+
const result = await publishNpm({ dryRun: true });
|
|
40
|
+
expect(result.success).toBe(true);
|
|
41
|
+
expect(result.version).toBeDefined();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('createGithubRelease: dry-run returns success', async () => {
|
|
45
|
+
const { createGithubRelease } = await import('../../scripts/release-steps.mjs');
|
|
46
|
+
const result = await createGithubRelease({ version: '5.3.0', dryRun: true });
|
|
47
|
+
expect(result.success).toBe(true);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('syncMarketplace: dry-run returns success', async () => {
|
|
51
|
+
const { syncMarketplace } = await import('../../scripts/release-steps.mjs');
|
|
52
|
+
const result = await syncMarketplace({ version: '5.3.0', dryRun: true });
|
|
53
|
+
expect(result.success).toBe(true);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('runReleasePipeline: startFrom skips earlier steps', async () => {
|
|
57
|
+
const { runReleasePipeline } = await import('../../scripts/release-steps.mjs');
|
|
58
|
+
// startFrom='release' 跳过 validate 和 publish
|
|
59
|
+
const result = await runReleasePipeline({ dryRun: true, startFrom: 'release', version: '5.3.0' });
|
|
60
|
+
expect(result.success).toBe(true);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Step 2: 运行测试确认失败**
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm run test:run -- src/__tests__/release-steps.test.ts
|
|
69
|
+
```
|
|
70
|
+
预期:FAIL(模块不存在)
|
|
71
|
+
|
|
72
|
+
**Step 3: 实现 `scripts/release-steps.mjs`**
|
|
73
|
+
|
|
74
|
+
```javascript
|
|
75
|
+
// scripts/release-steps.mjs
|
|
76
|
+
import { execSync } from 'node:child_process';
|
|
77
|
+
import { readFileSync } from 'node:fs';
|
|
78
|
+
import { resolve } from 'node:path';
|
|
79
|
+
|
|
80
|
+
function getVersion() {
|
|
81
|
+
const pkg = JSON.parse(readFileSync(resolve('package.json'), 'utf-8'));
|
|
82
|
+
return pkg.version;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function run(cmd, dryRun = false) {
|
|
86
|
+
if (dryRun) {
|
|
87
|
+
console.log(`[dry-run] ${cmd}`);
|
|
88
|
+
return '';
|
|
89
|
+
}
|
|
90
|
+
return execSync(cmd, { stdio: 'pipe', encoding: 'utf-8' });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export async function validateBuild(opts = {}) {
|
|
94
|
+
const { skipTests = false, dryRun = false } = opts;
|
|
95
|
+
try {
|
|
96
|
+
run('tsc --noEmit', dryRun);
|
|
97
|
+
run('npm run build', dryRun);
|
|
98
|
+
if (!skipTests) run('npm run test:run', dryRun);
|
|
99
|
+
return { success: true, output: 'Build validation passed' };
|
|
100
|
+
} catch (err) {
|
|
101
|
+
return { success: false, output: err.message };
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export async function publishNpm(opts = {}) {
|
|
106
|
+
const { dryRun = false, tag = 'latest' } = opts;
|
|
107
|
+
const version = getVersion();
|
|
108
|
+
try {
|
|
109
|
+
run(`npm publish --access public --tag ${tag}`, dryRun);
|
|
110
|
+
return { success: true, version };
|
|
111
|
+
} catch (err) {
|
|
112
|
+
return { success: false, version, output: err.message };
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export async function createGithubRelease(opts = {}) {
|
|
117
|
+
const { version, notes = '', dryRun = false } = opts;
|
|
118
|
+
const v = version || getVersion();
|
|
119
|
+
try {
|
|
120
|
+
const notesFlag = notes ? `--notes "${notes}"` : '--generate-notes';
|
|
121
|
+
run(`gh release create v${v} ${notesFlag}`, dryRun);
|
|
122
|
+
return { success: true, url: `https://github.com/liangjie559567/ultrapower/releases/tag/v${v}` };
|
|
123
|
+
} catch (err) {
|
|
124
|
+
return { success: false, url: '', output: err.message };
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export async function syncMarketplace(opts = {}) {
|
|
129
|
+
const { version, dryRun = false } = opts;
|
|
130
|
+
const v = version || getVersion();
|
|
131
|
+
try {
|
|
132
|
+
// marketplace.json version 字段由 release skill 手动更新,此步骤负责 git commit + push
|
|
133
|
+
run(`git add .claude-plugin/marketplace.json`, dryRun);
|
|
134
|
+
run(`git commit -m "chore: sync marketplace version to v${v}" --allow-empty`, dryRun);
|
|
135
|
+
run(`git push origin HEAD`, dryRun);
|
|
136
|
+
return { success: true };
|
|
137
|
+
} catch (err) {
|
|
138
|
+
return { success: false, output: err.message };
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export async function runReleasePipeline(opts = {}) {
|
|
143
|
+
const { dryRun = false, skipTests = false, startFrom = 'validate', version } = opts;
|
|
144
|
+
const steps = ['validate', 'publish', 'release', 'sync'];
|
|
145
|
+
const startIdx = steps.indexOf(startFrom);
|
|
146
|
+
|
|
147
|
+
if (startIdx === -1) {
|
|
148
|
+
console.error(`Unknown startFrom: ${startFrom}. Valid: ${steps.join(', ')}`);
|
|
149
|
+
process.exit(1);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const v = version || getVersion();
|
|
153
|
+
|
|
154
|
+
if (startIdx <= 0) {
|
|
155
|
+
console.log('Step 1/4: validateBuild...');
|
|
156
|
+
const r = await validateBuild({ skipTests, dryRun });
|
|
157
|
+
if (!r.success) { console.error(`validateBuild failed: ${r.output}`); process.exit(1); }
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (startIdx <= 1) {
|
|
161
|
+
console.log('Step 2/4: publishNpm...');
|
|
162
|
+
const r = await publishNpm({ dryRun });
|
|
163
|
+
if (!r.success) { console.error(`publishNpm failed: ${r.output}`); process.exit(1); }
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (startIdx <= 2) {
|
|
167
|
+
console.log('Step 3/4: createGithubRelease...');
|
|
168
|
+
const r = await createGithubRelease({ version: v, dryRun });
|
|
169
|
+
if (!r.success) { console.error(`createGithubRelease failed: ${r.output}`); process.exit(1); }
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (startIdx <= 3) {
|
|
173
|
+
console.log('Step 4/4: syncMarketplace...');
|
|
174
|
+
const r = await syncMarketplace({ version: v, dryRun });
|
|
175
|
+
if (!r.success) { console.error(`syncMarketplace failed: ${r.output}`); process.exit(1); }
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
console.log('Release pipeline completed successfully.');
|
|
179
|
+
return { success: true };
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Step 4: 运行测试确认通过**
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
npm run test:run -- src/__tests__/release-steps.test.ts
|
|
187
|
+
```
|
|
188
|
+
预期:5 tests PASS
|
|
189
|
+
|
|
190
|
+
**Step 5: 提交**
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
git add scripts/release-steps.mjs src/__tests__/release-steps.test.ts
|
|
194
|
+
git commit -m "feat(release): add shared release-steps.mjs core with dry-run support"
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
### Task 2: 创建本地入口 `scripts/release-local.mjs`
|
|
200
|
+
|
|
201
|
+
**Files:**
|
|
202
|
+
- Create: `scripts/release-local.mjs`
|
|
203
|
+
- Modify: `package.json` (scripts 字段)
|
|
204
|
+
|
|
205
|
+
**Step 1: 写失败测试**
|
|
206
|
+
|
|
207
|
+
在 `src/__tests__/release-local.test.ts` 中验证 CLI 参数解析:
|
|
208
|
+
|
|
209
|
+
```typescript
|
|
210
|
+
import { describe, it, expect } from 'vitest';
|
|
211
|
+
import { parseArgs } from '../../scripts/release-local.mjs';
|
|
212
|
+
|
|
213
|
+
describe('release-local parseArgs', () => {
|
|
214
|
+
it('default: no flags', () => {
|
|
215
|
+
const args = parseArgs([]);
|
|
216
|
+
expect(args.dryRun).toBe(false);
|
|
217
|
+
expect(args.startFrom).toBe('validate');
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
it('--dry-run flag', () => {
|
|
221
|
+
const args = parseArgs(['--dry-run']);
|
|
222
|
+
expect(args.dryRun).toBe(true);
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it('--start-from=publish', () => {
|
|
226
|
+
const args = parseArgs(['--start-from=publish']);
|
|
227
|
+
expect(args.startFrom).toBe('publish');
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Step 2: 运行测试确认失败**
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
npm run test:run -- src/__tests__/release-local.test.ts
|
|
236
|
+
```
|
|
237
|
+
预期:FAIL
|
|
238
|
+
|
|
239
|
+
**Step 3: 实现 `scripts/release-local.mjs`**
|
|
240
|
+
|
|
241
|
+
```javascript
|
|
242
|
+
// scripts/release-local.mjs
|
|
243
|
+
// 用法:
|
|
244
|
+
// node scripts/release-local.mjs
|
|
245
|
+
// node scripts/release-local.mjs --dry-run
|
|
246
|
+
// node scripts/release-local.mjs --start-from=publish
|
|
247
|
+
// npm run release:local
|
|
248
|
+
// npm run release:dry-run
|
|
249
|
+
|
|
250
|
+
import { runReleasePipeline } from './release-steps.mjs';
|
|
251
|
+
|
|
252
|
+
export function parseArgs(argv) {
|
|
253
|
+
const dryRun = argv.includes('--dry-run');
|
|
254
|
+
const startFromArg = argv.find(a => a.startsWith('--start-from='));
|
|
255
|
+
const startFrom = startFromArg ? startFromArg.split('=')[1] : 'validate';
|
|
256
|
+
const skipTests = argv.includes('--skip-tests');
|
|
257
|
+
return { dryRun, startFrom, skipTests };
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// 仅在直接执行时运行(非 import)
|
|
261
|
+
if (process.argv[1] && process.argv[1].endsWith('release-local.mjs')) {
|
|
262
|
+
const args = parseArgs(process.argv.slice(2));
|
|
263
|
+
console.log(`Running release pipeline (dryRun=${args.dryRun}, startFrom=${args.startFrom})`);
|
|
264
|
+
runReleasePipeline(args).catch(err => {
|
|
265
|
+
console.error(err);
|
|
266
|
+
process.exit(1);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
**Step 4: 更新 `package.json` scripts**
|
|
272
|
+
|
|
273
|
+
在 `"scripts"` 对象中添加(在 `"postinstall"` 行之后):
|
|
274
|
+
|
|
275
|
+
```json
|
|
276
|
+
"release:local": "node scripts/release-local.mjs",
|
|
277
|
+
"release:dry-run": "node scripts/release-local.mjs --dry-run"
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
**Step 5: 运行测试确认通过**
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
npm run test:run -- src/__tests__/release-local.test.ts
|
|
284
|
+
```
|
|
285
|
+
预期:3 tests PASS
|
|
286
|
+
|
|
287
|
+
**Step 6: 手动验证 dry-run**
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
npm run release:dry-run
|
|
291
|
+
```
|
|
292
|
+
预期:打印 4 个 `[dry-run] <command>` 行,无实际执行
|
|
293
|
+
|
|
294
|
+
**Step 7: 提交**
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
git add scripts/release-local.mjs src/__tests__/release-local.test.ts package.json
|
|
298
|
+
git commit -m "feat(release): add release-local.mjs entry point and package.json scripts"
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
### Task 3: 创建 GitHub Actions Workflow
|
|
304
|
+
|
|
305
|
+
**Files:**
|
|
306
|
+
- Create: `.github/workflows/release.yml`
|
|
307
|
+
|
|
308
|
+
**Step 1: 写 workflow 语法验证测试**
|
|
309
|
+
|
|
310
|
+
这是 YAML 文件,无法用 Vitest 直接测试。验证方式:
|
|
311
|
+
1. 本地用 `actionlint`(如已安装)
|
|
312
|
+
2. 或推送后在 GitHub Actions 界面确认语法
|
|
313
|
+
|
|
314
|
+
**Step 2: 创建 `.github/workflows/release.yml`**
|
|
315
|
+
|
|
316
|
+
```yaml
|
|
317
|
+
name: Release
|
|
318
|
+
|
|
319
|
+
on:
|
|
320
|
+
push:
|
|
321
|
+
tags:
|
|
322
|
+
- 'v*'
|
|
323
|
+
|
|
324
|
+
jobs:
|
|
325
|
+
build-test:
|
|
326
|
+
name: Build & Test
|
|
327
|
+
runs-on: ubuntu-latest
|
|
328
|
+
steps:
|
|
329
|
+
- uses: actions/checkout@v4
|
|
330
|
+
- uses: actions/setup-node@v4
|
|
331
|
+
with:
|
|
332
|
+
node-version: '20'
|
|
333
|
+
cache: 'npm'
|
|
334
|
+
- run: npm ci
|
|
335
|
+
- run: node scripts/release-steps.mjs validate
|
|
336
|
+
|
|
337
|
+
publish:
|
|
338
|
+
name: Publish to npm
|
|
339
|
+
needs: build-test
|
|
340
|
+
runs-on: ubuntu-latest
|
|
341
|
+
steps:
|
|
342
|
+
- uses: actions/checkout@v4
|
|
343
|
+
- uses: actions/setup-node@v4
|
|
344
|
+
with:
|
|
345
|
+
node-version: '20'
|
|
346
|
+
registry-url: 'https://registry.npmjs.org'
|
|
347
|
+
cache: 'npm'
|
|
348
|
+
- run: npm ci
|
|
349
|
+
- run: node scripts/release-steps.mjs publish
|
|
350
|
+
env:
|
|
351
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
352
|
+
|
|
353
|
+
github-release:
|
|
354
|
+
name: Create GitHub Release
|
|
355
|
+
needs: publish
|
|
356
|
+
runs-on: ubuntu-latest
|
|
357
|
+
steps:
|
|
358
|
+
- uses: actions/checkout@v4
|
|
359
|
+
- run: node scripts/release-steps.mjs release
|
|
360
|
+
env:
|
|
361
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
362
|
+
|
|
363
|
+
marketplace-sync:
|
|
364
|
+
name: Sync Marketplace
|
|
365
|
+
needs: publish
|
|
366
|
+
runs-on: ubuntu-latest
|
|
367
|
+
steps:
|
|
368
|
+
- uses: actions/checkout@v4
|
|
369
|
+
with:
|
|
370
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
371
|
+
- run: node scripts/release-steps.mjs sync
|
|
372
|
+
env:
|
|
373
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
注意:`release-steps.mjs` 需要支持 CLI 调用(`node scripts/release-steps.mjs validate`)。
|
|
377
|
+
|
|
378
|
+
**Step 3: 为 `release-steps.mjs` 添加 CLI 入口**
|
|
379
|
+
|
|
380
|
+
在 `scripts/release-steps.mjs` 末尾追加:
|
|
381
|
+
|
|
382
|
+
```javascript
|
|
383
|
+
// CLI 入口(供 GitHub Actions 直接调用)
|
|
384
|
+
const cliStep = process.argv[2];
|
|
385
|
+
if (cliStep && ['validate', 'publish', 'release', 'sync'].includes(cliStep)) {
|
|
386
|
+
const dryRun = process.argv.includes('--dry-run');
|
|
387
|
+
const version = process.env.GITHUB_REF_NAME?.replace(/^v/, '') || undefined;
|
|
388
|
+
const stepMap = { validate: validateBuild, publish: publishNpm, release: createGithubRelease, sync: syncMarketplace };
|
|
389
|
+
stepMap[cliStep]({ dryRun, version }).then(r => {
|
|
390
|
+
if (!r.success) { console.error(`Step ${cliStep} failed`); process.exit(1); }
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
**Step 4: 更新 release-steps 测试覆盖 CLI 调用**
|
|
396
|
+
|
|
397
|
+
在 `src/__tests__/release-steps.test.ts` 追加:
|
|
398
|
+
|
|
399
|
+
```typescript
|
|
400
|
+
it('CLI step mapping covers all 4 steps', () => {
|
|
401
|
+
const steps = ['validate', 'publish', 'release', 'sync'];
|
|
402
|
+
// 验证所有步骤名称有效(不抛出)
|
|
403
|
+
expect(steps).toHaveLength(4);
|
|
404
|
+
});
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
**Step 5: 运行全量测试**
|
|
408
|
+
|
|
409
|
+
```bash
|
|
410
|
+
npm run test:run
|
|
411
|
+
```
|
|
412
|
+
预期:所有测试通过(含新增测试)
|
|
413
|
+
|
|
414
|
+
**Step 6: 提交**
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
git add .github/workflows/release.yml scripts/release-steps.mjs src/__tests__/release-steps.test.ts
|
|
418
|
+
git commit -m "feat(ci): add GitHub Actions release workflow with 4-job dependency graph"
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
### Task 4: 更新 `skills/release/SKILL.md`
|
|
424
|
+
|
|
425
|
+
**Files:**
|
|
426
|
+
- Modify: `skills/release/SKILL.md`
|
|
427
|
+
|
|
428
|
+
**Step 1: 在"发布步骤"末尾添加 CI 说明**
|
|
429
|
+
|
|
430
|
+
在 `### 4. 创建并推送 Tag` 步骤之后,`### 5. 刷新本地 marketplace 缓存` 之前,插入:
|
|
431
|
+
|
|
432
|
+
```markdown
|
|
433
|
+
### 4b. GitHub Actions 自动接管(推荐)
|
|
434
|
+
|
|
435
|
+
执行 `git push --tags` 后,GitHub Actions 自动接管后续步骤:
|
|
436
|
+
- **npm 发布**(`publish` job)
|
|
437
|
+
- **GitHub Release 创建**(`github-release` job)
|
|
438
|
+
- **marketplace.json 版本同步**(`marketplace-sync` job)
|
|
439
|
+
|
|
440
|
+
在 GitHub Actions 页面查看进度:https://github.com/liangjie559567/ultrapower/actions
|
|
441
|
+
|
|
442
|
+
如需手动执行(紧急发布或 CI 不可用):
|
|
443
|
+
```bash
|
|
444
|
+
npm run release:local # 完整流水线
|
|
445
|
+
npm run release:dry-run # 预检(不实际执行)
|
|
446
|
+
npm run release:local -- --start-from=publish # 从 publish 步骤重试
|
|
447
|
+
```
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
**Step 2: 更新步骤 5、6、7 为"CI 已自动完成"说明**
|
|
451
|
+
|
|
452
|
+
将原步骤 5(刷新 marketplace 缓存)、6(npm publish)、7(创建 GitHub Release)标注为 CI 自动完成,保留手动备用命令。
|
|
453
|
+
|
|
454
|
+
**Step 3: 提交**
|
|
455
|
+
|
|
456
|
+
```bash
|
|
457
|
+
git add skills/release/SKILL.md
|
|
458
|
+
git commit -m "docs(release): update SKILL.md to document CI handoff after git push --tags"
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
### Task 5: CI Gate 验证
|
|
464
|
+
|
|
465
|
+
**Step 1: 运行完整 CI Gate**
|
|
466
|
+
|
|
467
|
+
```bash
|
|
468
|
+
tsc --noEmit && npm run build && npm run test:run
|
|
469
|
+
```
|
|
470
|
+
预期:零错误,所有测试通过
|
|
471
|
+
|
|
472
|
+
**Step 2: 验证 dry-run 端到端**
|
|
473
|
+
|
|
474
|
+
```bash
|
|
475
|
+
npm run release:dry-run
|
|
476
|
+
```
|
|
477
|
+
预期输出(4 行 dry-run 命令,无实际执行):
|
|
478
|
+
```
|
|
479
|
+
Running release pipeline (dryRun=true, startFrom=validate)
|
|
480
|
+
Step 1/4: validateBuild...
|
|
481
|
+
[dry-run] tsc --noEmit
|
|
482
|
+
[dry-run] npm run build
|
|
483
|
+
[dry-run] npm run test:run
|
|
484
|
+
Step 2/4: publishNpm...
|
|
485
|
+
[dry-run] npm publish --access public --tag latest
|
|
486
|
+
Step 3/4: createGithubRelease...
|
|
487
|
+
[dry-run] gh release create v5.2.4 --generate-notes
|
|
488
|
+
Step 4/4: syncMarketplace...
|
|
489
|
+
[dry-run] git add .claude-plugin/marketplace.json
|
|
490
|
+
...
|
|
491
|
+
Release pipeline completed successfully.
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
**Step 3: 验证 workflow 文件存在**
|
|
495
|
+
|
|
496
|
+
```bash
|
|
497
|
+
ls .github/workflows/release.yml
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
**Step 4: 最终提交(如有未提交变更)**
|
|
501
|
+
|
|
502
|
+
```bash
|
|
503
|
+
git status
|
|
504
|
+
# 确认无未提交变更
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
|
|
509
|
+
## 任务队列
|
|
510
|
+
|
|
511
|
+
| ID | 名称 | 依赖 | 并行组 | 预估 |
|
|
512
|
+
|----|------|------|--------|------|
|
|
513
|
+
| T1 | 创建 release-steps.mjs | 无 | G1 | 30min |
|
|
514
|
+
| T2 | 创建 release-local.mjs + package.json | T1 | G2 | 20min |
|
|
515
|
+
| T3 | 创建 GitHub Actions workflow | T1 | G2 | 20min |
|
|
516
|
+
| T4 | 更新 SKILL.md | T1 | G2 | 10min |
|
|
517
|
+
| T5 | CI Gate 验证 | T2, T3, T4 | G3 | 10min |
|
|
518
|
+
|
|
519
|
+
T2、T3、T4 可并行执行(均依赖 T1 完成)。
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<!-- Parent: ../AGENTS.md -->
|
|
2
|
+
<!-- Generated: 2026-02-27 | Updated: 2026-02-27 -->
|
|
3
|
+
|
|
4
|
+
# docs/plans/
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
规划文档目录。存放功能开发的设计方案和实现计划,按日期命名,记录各版本功能的架构决策和实施路径。
|
|
8
|
+
|
|
9
|
+
## Key Files
|
|
10
|
+
|
|
11
|
+
| File | Description |
|
|
12
|
+
|------|-------------|
|
|
13
|
+
| `2025-11-22-opencode-support-design.md` | OpenCode 支持设计方案 |
|
|
14
|
+
| `2025-11-22-opencode-support-implementation.md` | OpenCode 支持实现计划 |
|
|
15
|
+
| `2025-11-28-skills-improvements-from-user-feedback.md` | 基于用户反馈的 skill 改进计划 |
|
|
16
|
+
| `2026-01-17-visual-brainstorming.md` | 可视化头脑风暴功能设计 |
|
|
17
|
+
| `2026-02-24-axiom-integration-design.md` | Axiom 集成设计方案 |
|
|
18
|
+
| `2026-02-24-axiom-integration-plan.md` | Axiom 集成实现计划 |
|
|
19
|
+
| `2026-02-24-superpowers-ultrapower-integration-design.md` | Superpowers-Ultrapower 集成设计 |
|
|
20
|
+
| `2026-02-24-superpowers-ultrapower-integration-plan.md` | Superpowers-Ultrapower 集成计划 |
|
|
21
|
+
| `2026-02-24-ultrapower-integration-design.md` | Ultrapower 集成设计方案 |
|
|
22
|
+
| `2026-02-26-nexus-design.md` | Nexus 自我改进系统设计 |
|
|
23
|
+
| `2026-02-26-nexus-implementation-plan.md` | Nexus 实现计划 |
|
|
24
|
+
| `2026-02-26-phase2-active-learning-design.md` | 第二阶段主动学习设计 |
|
|
25
|
+
| `axiom-migration-plan.md` | Axiom 迁移计划 |
|
|
26
|
+
|
|
27
|
+
## For AI Agents
|
|
28
|
+
|
|
29
|
+
### 修改此目录时
|
|
30
|
+
- 规划文档是历史记录,通常不修改已有文档
|
|
31
|
+
- 新功能规划使用日期前缀命名
|
|
32
|
+
|
|
33
|
+
<!-- MANUAL: -->
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!-- Parent: ../AGENTS.md -->
|
|
2
|
+
<!-- Generated: 2026-02-27 | Updated: 2026-02-27 -->
|
|
3
|
+
|
|
4
|
+
# docs/prd/
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
PRD(产品需求文档)目录。存放功能的产品需求文档草稿和终稿,记录功能的用户故事、验收标准和范围定义。
|
|
8
|
+
|
|
9
|
+
## Key Files
|
|
10
|
+
|
|
11
|
+
| File | Description |
|
|
12
|
+
|------|-------------|
|
|
13
|
+
| `ultrapower-standards-draft.md` | Ultrapower 规范体系 PRD 草稿 |
|
|
14
|
+
| `ultrapower-standards-rough.md` | Ultrapower 规范体系 PRD 初稿 |
|
|
15
|
+
|
|
16
|
+
## For AI Agents
|
|
17
|
+
|
|
18
|
+
### 修改此目录时
|
|
19
|
+
- PRD 是需求基准,实现必须符合 PRD 定义的验收标准
|
|
20
|
+
- 参见 Axiom 工作流了解 PRD 生成流程
|
|
21
|
+
|
|
22
|
+
<!-- MANUAL: -->
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!-- Parent: ../AGENTS.md -->
|
|
2
|
+
<!-- Generated: 2026-02-27 | Updated: 2026-02-27 -->
|
|
3
|
+
|
|
4
|
+
# docs/reviews/
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
代码审查文档目录。存放代码审查报告和审查结果,记录各功能模块的审查意见和改进建议。
|
|
8
|
+
|
|
9
|
+
## Subdirectories
|
|
10
|
+
|
|
11
|
+
| Directory | Purpose |
|
|
12
|
+
|-----------|---------|
|
|
13
|
+
| `ultrapower-standards/` | Ultrapower 规范体系审查报告 |
|
|
14
|
+
|
|
15
|
+
## For AI Agents
|
|
16
|
+
|
|
17
|
+
### 修改此目录时
|
|
18
|
+
- 审查报告是历史记录,通常不修改
|
|
19
|
+
|
|
20
|
+
<!-- MANUAL: -->
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!-- Parent: ../AGENTS.md -->
|
|
2
|
+
<!-- Generated: 2026-02-27 | Updated: 2026-02-27 -->
|
|
3
|
+
|
|
4
|
+
# docs/reviews/ultrapower-standards/
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
Ultrapower 标准审查报告目录。包含对 ultrapower 标准规范的专家审查报告,涵盖批评者、领域专家、产品、技术和 UX 视角。
|
|
8
|
+
|
|
9
|
+
## Key Files
|
|
10
|
+
|
|
11
|
+
| File | Description |
|
|
12
|
+
|------|-------------|
|
|
13
|
+
| `review_critic.md` | 批评者视角审查报告 |
|
|
14
|
+
| `review_domain.md` | 领域专家视角审查报告 |
|
|
15
|
+
| `review_product.md` | 产品视角审查报告 |
|
|
16
|
+
| `review_tech.md` | 技术视角审查报告 |
|
|
17
|
+
| `review_ux.md` | UX 视角审查报告 |
|
|
18
|
+
|
|
19
|
+
## For AI Agents
|
|
20
|
+
|
|
21
|
+
### 修改此目录时
|
|
22
|
+
- 参见父级目录了解整体结构
|
|
23
|
+
- 遵循项目编码规范
|
|
24
|
+
|
|
25
|
+
## Dependencies
|
|
26
|
+
|
|
27
|
+
### Internal
|
|
28
|
+
- `docs/standards/` — 相关模块
|
|
29
|
+
|
|
30
|
+
<!-- MANUAL: -->
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- Parent: ../AGENTS.md -->
|
|
2
|
+
<!-- Generated: 2026-02-27 | Updated: 2026-02-27 -->
|
|
3
|
+
|
|
4
|
+
# docs/partials/
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
文档片段目录。存放可复用的文档组件,包括 agent 层级说明、功能特性描述、模式层级和选择指南等,供主文档引用。
|
|
8
|
+
|
|
9
|
+
## Key Files
|
|
10
|
+
|
|
11
|
+
| File | Description |
|
|
12
|
+
|------|-------------|
|
|
13
|
+
| `agent-tiers.md` | Agent 层级(haiku/sonnet/opus)说明 |
|
|
14
|
+
| `features.md` | 功能特性描述片段 |
|
|
15
|
+
| `mode-hierarchy.md` | 执行模式层级关系说明 |
|
|
16
|
+
| `mode-selection-guide.md` | 模式选择决策指南 |
|
|
17
|
+
| `verification-tiers.md` | 验证层级说明 |
|
|
18
|
+
|
|
19
|
+
## For AI Agents
|
|
20
|
+
|
|
21
|
+
### 修改此目录时
|
|
22
|
+
- 片段变更需检查所有引用该片段的主文档
|
|
23
|
+
|
|
24
|
+
<!-- MANUAL: -->
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<!-- Parent: ../AGENTS.md -->
|
|
2
|
+
<!-- Generated: 2026-02-27 | Updated: 2026-02-27 -->
|
|
3
|
+
|
|
4
|
+
# docs/standards/
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
规范体系文档目录。包含 ultrapower 全链路开发规范,是所有实现必须遵守的权威参考文档,涵盖运行时保护、Hook 执行顺序、状态机、Agent 生命周期等核心规范。
|
|
8
|
+
|
|
9
|
+
## Key Files
|
|
10
|
+
|
|
11
|
+
| File | Description |
|
|
12
|
+
|------|-------------|
|
|
13
|
+
| `runtime-protection.md` | P0 — 路径遍历防护、Hook 输入消毒、状态文件权限 |
|
|
14
|
+
| `hook-execution-order.md` | P0 — 15 类 HookType、路由规则、执行顺序 |
|
|
15
|
+
| `state-machine.md` | P0 — Agent 状态机、Team Pipeline 转换矩阵 |
|
|
16
|
+
| `agent-lifecycle.md` | P0 — 超时/孤儿/成本超限/死锁边界情况 |
|
|
17
|
+
| `user-guide.md` | P1 — Skill 决策树、Agent 路由指南 |
|
|
18
|
+
| `anti-patterns.md` | P1 — 已知反模式及正确替代方案 |
|
|
19
|
+
| `contribution-guide.md` | P1 — 贡献流程、质量门禁、文档同步要求 |
|
|
20
|
+
| `audit-report.md` | 安全审计报告 |
|
|
21
|
+
| `README.md` | 规范体系概览 |
|
|
22
|
+
|
|
23
|
+
## Subdirectories
|
|
24
|
+
|
|
25
|
+
| Directory | Purpose |
|
|
26
|
+
|-----------|---------|
|
|
27
|
+
| `templates/` | 规范文档模板 |
|
|
28
|
+
|
|
29
|
+
## For AI Agents
|
|
30
|
+
|
|
31
|
+
### 重要规则
|
|
32
|
+
- P0 文档是不可协商的安全规则,任何实现必须遵守
|
|
33
|
+
- 修改规范文档前需经过 `code-reviewer` 审查
|
|
34
|
+
|
|
35
|
+
## Dependencies
|
|
36
|
+
|
|
37
|
+
### Internal
|
|
38
|
+
- 被所有 `src/` 实现文件引用
|
|
39
|
+
|
|
40
|
+
<!-- MANUAL: -->
|