@house365/comate 0.1.0 → 0.1.2

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 CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Jian Liang
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jian Liang
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.
package/README.md CHANGED
@@ -1,78 +1,78 @@
1
- # comate
2
-
3
- OpenSpec + Superpowers 规约驱动的 AI 开发编排器。
4
-
5
- comate 把 **OpenSpec**(WHAT:提案、规约生命周期、归档)和 **Superpowers**(HOW:设计、规划、执行、收尾)整合成统一的五阶段工作流。核心原则:每个变更都要经过深度设计(hotfix / tweak 预设除外)。
6
-
7
- ## 五阶段
8
-
9
- ```
10
- /comate ──自动探测阶段──┐
11
- ▼
12
- open → design → build → verify → archive
13
- ```
14
-
15
- | 阶段 | skill | 职责 |
16
- |------|-------|------|
17
- | open | `/comate-open` | 探索想法,创建 change 结构并初始化 `.comate.yaml` |
18
- | design | `/comate-design` | 技术设计与方案 brainstorming |
19
- | build | `/comate-build` | 按任务实现并提交 |
20
- | verify | `/comate-verify` | 验证、出报告、处理分支 |
21
- | archive | `/comate-archive` | 同步增量规约并归档 |
22
-
23
- 预设路径:`/comate-hotfix`(热修)、`/comate-tweak`(文案/配置小调整)。
24
-
25
- ## 安装
26
-
27
- ```bash
28
- npx @house365/comate init # 装 comate + 依赖到当前项目 ./.agents/skills/
29
- npx @house365/comate init -g # 装到用户全局
30
- ```
31
-
32
- `init` 会一并装齐两个依赖(OpenSpec CLI、Superpowers),已装的自动跳过,可重复执行。
33
-
34
- 只装 comate 本身、不碰依赖:
35
-
36
- ```bash
37
- npx @house365/comate # 装到当前项目 ./.agents/skills/
38
- npx @house365/comate -g # 装到用户全局
39
- npx @house365/comate --list # 只看有哪些 skill,不安装
40
- ```
41
-
42
- 需要同时创建 `openspec/` 项目结构时加 `--openspec-init`。
43
-
44
- 支持 Claude Code、Codex、Cursor 等 70+ agent(底层复用 [`skills`](https://www.npmjs.com/package/skills) CLI,自动探测当前 agent)。
45
-
46
- 装完跑一次健康检查:
47
-
48
- ```bash
49
- bash .agents/skills/comate/scripts/comate.sh doctor
50
- ```
51
-
52
- 依赖详情见 [docs/COMATE_MANUAL.md](docs/COMATE_MANUAL.md) 第 2 节。
53
-
54
- ## 用法
55
-
56
- 输入 `/comate` 自动探测当前阶段并分派,或直接调用某个阶段 skill。状态记录在每个 change 的 `openspec/changes/<name>/.comate.yaml` 中,支持上下文压缩后断点恢复。
57
-
58
- ## 目录结构
59
-
60
- ```
61
- skills/
62
- comate/ 主编排器:SKILL.md + 脚本 + 参考文档 + 测试
63
- scripts/ comate.sh(CLI)、comate-lib.sh(共享库)
64
- reference/ 决策点、脏工作树协议、前置条件
65
- tests/ bats 测试
66
- comate-open/ design/ build/ verify/ archive/ 各阶段 skill
67
- comate-hotfix/ tweak/ 预设路径 skill
68
- docs/
69
- COMATE_MANUAL.md 完整操作手册
70
- ```
71
-
72
- ## 文档
73
-
74
- 完整说明见 [docs/COMATE_MANUAL.md](docs/COMATE_MANUAL.md):安装前置、命令参考、阶段详解、状态文件字段、决策阻塞点、故障排除。
75
-
76
- ## License
77
-
78
- [MIT](LICENSE)
1
+ # comate
2
+
3
+ OpenSpec + Superpowers 规约驱动的 AI 开发编排器。
4
+
5
+ comate 把 **OpenSpec**(WHAT:提案、规约生命周期、归档)和 **Superpowers**(HOW:设计、规划、执行、收尾)整合成统一的五阶段工作流。核心原则:每个变更都要经过深度设计(hotfix / tweak 预设除外)。
6
+
7
+ ## 五阶段
8
+
9
+ ```
10
+ /comate ──自动探测阶段──┐
11
+ ▼
12
+ open → design → build → verify → archive
13
+ ```
14
+
15
+ | 阶段 | skill | 职责 |
16
+ |------|-------|------|
17
+ | open | `/comate-open` | 探索想法,创建 change 结构并初始化 `.comate.yaml` |
18
+ | design | `/comate-design` | 技术设计与方案 brainstorming |
19
+ | build | `/comate-build` | 按任务实现并提交 |
20
+ | verify | `/comate-verify` | 验证、出报告、处理分支 |
21
+ | archive | `/comate-archive` | 同步增量规约并归档 |
22
+
23
+ 预设路径:`/comate-hotfix`(热修)、`/comate-tweak`(文案/配置小调整)。
24
+
25
+ ## 安装
26
+
27
+ ```bash
28
+ npx @house365/comate init # 装 comate + 依赖到当前项目 ./.agents/skills/
29
+ npx @house365/comate init -g # 装到用户全局
30
+ ```
31
+
32
+ `init` 会一并装齐两个依赖(OpenSpec CLI、Superpowers),已装的自动跳过,可重复执行。
33
+
34
+ 只装 comate 本身、不碰依赖:
35
+
36
+ ```bash
37
+ npx @house365/comate # 装到当前项目 ./.agents/skills/
38
+ npx @house365/comate -g # 装到用户全局
39
+ npx @house365/comate --list # 只看有哪些 skill,不安装
40
+ ```
41
+
42
+ 需要同时创建 `openspec/` 项目结构时加 `--openspec-init`。
43
+
44
+ 支持 Claude Code、Codex、Cursor 等 70+ agent(底层复用 [`skills`](https://www.npmjs.com/package/skills) CLI,自动探测当前 agent)。
45
+
46
+ 装完跑一次健康检查:
47
+
48
+ ```bash
49
+ bash .agents/skills/comate/scripts/comate.sh doctor
50
+ ```
51
+
52
+ 依赖详情见 [docs/COMATE_MANUAL.md](docs/COMATE_MANUAL.md) 第 2 节。
53
+
54
+ ## 用法
55
+
56
+ 输入 `/comate` 自动探测当前阶段并分派,或直接调用某个阶段 skill。状态记录在每个 change 的 `openspec/changes/<name>/.comate.yaml` 中,支持上下文压缩后断点恢复。
57
+
58
+ ## 目录结构
59
+
60
+ ```
61
+ skills/
62
+ comate/ 主编排器:SKILL.md + 脚本 + 参考文档 + 测试
63
+ scripts/ comate.sh(CLI)、comate-lib.sh(共享库)
64
+ reference/ 决策点、脏工作树协议、前置条件
65
+ tests/ bats 测试
66
+ comate-open/ design/ build/ verify/ archive/ 各阶段 skill
67
+ comate-hotfix/ tweak/ 预设路径 skill
68
+ docs/
69
+ COMATE_MANUAL.md 完整操作手册
70
+ ```
71
+
72
+ ## 文档
73
+
74
+ 完整说明见 [docs/COMATE_MANUAL.md](docs/COMATE_MANUAL.md):安装前置、命令参考、阶段详解、状态文件字段、决策阻塞点、故障排除。
75
+
76
+ ## License
77
+
78
+ [MIT](LICENSE)
package/bin/init.mjs CHANGED
@@ -50,16 +50,27 @@ function packedFiles() {
50
50
  });
51
51
  if (status !== 0) throw new Error(`npm pack failed:\n${stderr ?? '(no stderr)'}`);
52
52
 
53
- // Lifecycle scripts can print ahead of npm's payload, so scan `[` positions
54
- // left-to-right and take the first that parses as a whole array.
53
+ return parsePackOutput(stdout);
54
+ }
55
+
56
+ // npm changed this payload's shape, so both are accepted:
57
+ // older [ { files: [...] } ] (array of packed tarballs)
58
+ // newer { "<pkg name>": { files: [...] } } (keyed by package name)
59
+ // Lifecycle scripts can also print ahead of the JSON, hence the scan for the
60
+ // first `[` or `{` that parses whole rather than assuming it starts at index 0.
61
+ function parsePackOutput(stdout) {
55
62
  const clean = stdout.replace(/\[[0-9;]*m/g, '').trim();
56
- for (let i = clean.indexOf('['); i !== -1; i = clean.indexOf('[', i + 1)) {
63
+ for (let i = 0; i < clean.length; i++) {
64
+ if (clean[i] !== '[' && clean[i] !== '{') continue;
65
+ let parsed;
57
66
  try {
58
- const [packed] = JSON.parse(clean.slice(i));
59
- if (Array.isArray(packed?.files)) return packed.files.map((f) => f.path.replace(/\\/g, '/'));
67
+ parsed = JSON.parse(clean.slice(i));
60
68
  } catch {
61
- // Not the payload's opening bracket (e.g. a nested array); keep looking.
69
+ continue; // not a payload boundary (e.g. a nested array); keep scanning
62
70
  }
71
+ const entries = Array.isArray(parsed) ? parsed : Object.values(parsed);
72
+ const packed = entries.find((e) => Array.isArray(e?.files));
73
+ if (packed) return packed.files.map((f) => f.path.replace(/\\/g, '/'));
63
74
  }
64
75
  throw new Error(`no usable file list in npm pack output:\n${stdout}`);
65
76
  }
@@ -150,6 +161,7 @@ export {
150
161
  findNpmCli,
151
162
  npmInvocation,
152
163
  packedFiles,
164
+ parsePackOutput,
153
165
  skillsInvocation,
154
166
  run,
155
167
  capture,
package/package.json CHANGED
@@ -1,52 +1,52 @@
1
- {
2
- "name": "@house365/comate",
3
- "version": "0.1.0",
4
- "description": "comate —— OpenSpec + Superpowers 规约驱动的 AI 开发编排器(Agent Skills)",
5
- "type": "module",
6
- "license": "MIT",
7
- "publishConfig": {
8
- "access": "public",
9
- "registry": "https://registry.npmjs.org"
10
- },
11
- "bin": {
12
- "comate-skills": "./bin/cli.mjs"
13
- },
14
- "files": [
15
- "skills",
16
- "bin",
17
- "!bin/*.test.mjs",
18
- "docs",
19
- "README.md",
20
- "LICENSE"
21
- ],
22
- "keywords": [
23
- "agent-skills",
24
- "skills",
25
- "claude-code",
26
- "openspec",
27
- "superpowers",
28
- "spec-driven-development",
29
- "ai-agents"
30
- ],
31
- "repository": {
32
- "type": "git",
33
- "url": "git+https://github.com/liangjiankk/comate.git"
34
- },
35
- "homepage": "https://github.com/liangjiankk/comate#readme",
36
- "bugs": {
37
- "url": "https://github.com/liangjiankk/comate/issues"
38
- },
39
- "engines": {
40
- "node": ">=20"
41
- },
42
- "dependencies": {
43
- "skills": "^1.5.21"
44
- },
45
- "scripts": {
46
- "test": "node bin/init.test.mjs && bash skills/comate/tests/run.sh",
47
- "doctor": "cd skills && bash comate/scripts/comate.sh doctor",
48
- "prepublish-check": "node scripts/prepublish-check.mjs",
49
- "pack-check": "node scripts/pack-check.mjs",
50
- "prepublishOnly": "npm run prepublish-check && npm run pack-check && npm run doctor && npm test"
51
- }
52
- }
1
+ {
2
+ "name": "@house365/comate",
3
+ "version": "0.1.2",
4
+ "description": "comate —— OpenSpec + Superpowers 规约驱动的 AI 开发编排器(Agent Skills)",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "publishConfig": {
8
+ "access": "public",
9
+ "registry": "https://registry.npmjs.org"
10
+ },
11
+ "bin": {
12
+ "comate-skills": "bin/cli.mjs"
13
+ },
14
+ "files": [
15
+ "skills",
16
+ "bin",
17
+ "!bin/*.test.mjs",
18
+ "docs",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "keywords": [
23
+ "agent-skills",
24
+ "skills",
25
+ "claude-code",
26
+ "openspec",
27
+ "superpowers",
28
+ "spec-driven-development",
29
+ "ai-agents"
30
+ ],
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/liangjiankk/comate.git"
34
+ },
35
+ "homepage": "https://github.com/liangjiankk/comate#readme",
36
+ "bugs": {
37
+ "url": "https://github.com/liangjiankk/comate/issues"
38
+ },
39
+ "engines": {
40
+ "node": ">=20"
41
+ },
42
+ "dependencies": {
43
+ "skills": "^1.5.21"
44
+ },
45
+ "scripts": {
46
+ "test": "node bin/init.test.mjs && bash skills/comate/tests/run.sh",
47
+ "doctor": "cd skills && bash comate/scripts/comate.sh doctor",
48
+ "prepublish-check": "node scripts/prepublish-check.mjs",
49
+ "pack-check": "node scripts/pack-check.mjs",
50
+ "prepublishOnly": "npm run prepublish-check && npm run pack-check && npm run doctor && npm test"
51
+ }
52
+ }