@ck123pm/harness-kit 0.1.0 → 0.1.1

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/README.md CHANGED
@@ -1,2 +1,185 @@
1
- # harness-kit
2
- init harness repo
1
+ # @ck123pm/harness-kit
2
+
3
+ CLI for installing and managing Claude Code harness capabilities.
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ npx @ck123pm/harness-kit install
9
+ ```
10
+
11
+ 或全局安装后使用:
12
+
13
+ ```bash
14
+ npm install -g @ck123pm/harness-kit
15
+ harness-kit install
16
+ ```
17
+
18
+ ## 使用流程
19
+
20
+ 三步初始化模型:
21
+
22
+ ```
23
+ 第一步:CLI 安装能力
24
+ npx @ck123pm/harness-kit install
25
+
26
+ 第二步:Claude 执行智能初始化
27
+ /harness-init
28
+
29
+ 第三步:CLI 或 Claude 执行 comet 初始化
30
+ comet init
31
+ ```
32
+
33
+ ## CLI 命令
34
+
35
+ ### `harness-kit install`
36
+
37
+ 安装 harness 能力到 Claude 环境:
38
+
39
+ - 复制 `harness-init.md` → `~/.claude/commands/`
40
+ - 复制 `harness-update-spec.md` → `~/.claude/commands/`
41
+ - 复制 `md-to-html-doc.md` → `~/.claude/skills/`
42
+ - 检查/安装 `@ck123pm/comet`
43
+ - 检查/安装 `@fission-ai/openspec`
44
+ - 写入安装记录 `~/.claude/harness-kit.json`
45
+
46
+ **选项:**
47
+
48
+ | 选项 | 说明 |
49
+ |------|------|
50
+ | `--scope <scope>` | `global`(默认)或 `local`(安装到项目 `.claude/`) |
51
+ | `--skip-comet` | 跳过 comet 安装 |
52
+ | `--skip-openspec` | 跳过 openspec 安装 |
53
+ | `--force` | 覆盖已有文件 |
54
+
55
+ **示例:**
56
+
57
+ ```bash
58
+ # 全局安装(默认)
59
+ harness-kit install
60
+
61
+ # 安装到项目级 .claude/
62
+ harness-kit install --scope local
63
+
64
+ # 跳过 comet 和 openspec
65
+ harness-kit install --skip-comet --skip-openspec
66
+ ```
67
+
68
+ ### `harness-kit doctor`
69
+
70
+ 环境健康检查,打印各项状态:
71
+
72
+ ```
73
+ 🔍 harness-kit doctor
74
+
75
+ ✓ Claude command harness-init Found
76
+ ✓ Claude command harness-update-spec Found
77
+ ✓ Claude skill md-to-html-doc Found
78
+ ✗ comet Not found
79
+ ✗ openspec Not found
80
+ ✓ superpowers Built-in
81
+ ✗ .harness/ Not found
82
+ ✗ .comet.yaml Not found
83
+ ✗ openspec/ Not found
84
+ ```
85
+
86
+ 末尾给出修复建议。
87
+
88
+ ### `harness-kit update`
89
+
90
+ 升级已安装的 command/skill:
91
+
92
+ - 对比已安装文件与包内文件的哈希
93
+ - 有更新时提示确认后覆盖
94
+ - 已是最新时打印 "All files up to date"
95
+
96
+ **选项:**
97
+
98
+ | 选项 | 说明 |
99
+ |------|------|
100
+ | `--check` | 仅检查不升级 |
101
+ | `--force` | 强制覆盖不提示 |
102
+
103
+ **示例:**
104
+
105
+ ```bash
106
+ # 检查是否有更新
107
+ harness-kit update --check
108
+
109
+ # 执行更新
110
+ harness-kit update
111
+ ```
112
+
113
+ ### `harness-kit uninstall`
114
+
115
+ 卸载已安装的 command/skill:
116
+
117
+ ```bash
118
+ harness-kit uninstall
119
+ ```
120
+
121
+ 删除 `~/.claude/commands/harness-init.md`、`harness-update-spec.md`、`skills/md-to-html-doc.md` 和 `harness-kit.json`。
122
+
123
+ ## Claude Commands
124
+
125
+ 安装后在 Claude 中可用的斜杠命令:
126
+
127
+ | 命令 | 说明 |
128
+ |------|------|
129
+ | `/harness-init` | 智能初始化 `.harness/` 目录,基于项目代码推导生成全部 spec |
130
+ | `/harness-update-spec` | 分析当前项目状态,对比现有 `.harness/` spec,交互式建议更新或新增 |
131
+
132
+ ## .harness/ 目录结构
133
+
134
+ `/harness-init` 生成的目录:
135
+
136
+ ```
137
+ .harness/
138
+ ├── README.md # 使用说明
139
+ ├── index/
140
+ │ ├── routing.md # 任务→上下文路由
141
+ │ ├── priority.md # 注入优先级 (MUST/SHOULD/HINT)
142
+ │ ├── module-map.md # 模块→spec 映射
143
+ │ └── project-profile.md # 项目身份卡片
144
+ ├── rules/
145
+ │ ├── architecture.md # 架构约束
146
+ │ ├── coding.md # 编码规范
147
+ │ ├── testing.md # 测试规则
148
+ │ └── security.md # 安全约束
149
+ ├── domain/
150
+ │ ├── glossary.md # 领域术语
151
+ │ ├── business-rules.md # 业务规则
152
+ │ └── runtime-semantics.md # 运行时语义
153
+ ├── decisions/
154
+ │ ├── adr/ # 架构决策记录
155
+ │ └── tradeoffs.md # 设计权衡
156
+ ├── guides/
157
+ │ ├── backend.md # 后端执行手册
158
+ │ └── ops.md # 运维操作指南
159
+ ├── memory/
160
+ │ ├── pitfalls.md # 踩坑经验
161
+ │ ├── regressions.md # 回归问题
162
+ │ ├── patterns.md # 可复用模式
163
+ │ └── lessons.md # 经验总结
164
+ └── human-docs/
165
+ ├── onboarding.html # 新人手册
166
+ ├── architecture-intro.html # 架构介绍
167
+ └── operation-manual.html # 操作手册
168
+ ```
169
+
170
+ ## Claude Skill
171
+
172
+ | Skill | 说明 |
173
+ |-------|------|
174
+ | `md-to-html-doc` | Markdown 转响应式 HTML(含侧边栏导航、flexbox 流程图) |
175
+
176
+ ## 环境要求
177
+
178
+ - Node.js >= 20
179
+ - Claude Code CLI
180
+ - `@ck123pm/comet`(可选)
181
+ - `@fission-ai/openspec`(可选)
182
+
183
+ ## License
184
+
185
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ck123pm/harness-kit",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "CLI for installing and managing Claude Code harness capabilities",
5
5
  "type": "module",
6
6
  "bin": {
@@ -88,7 +88,7 @@ export async function detectGlobalCommand(binName) {
88
88
  const exec = promisify(execFile);
89
89
 
90
90
  try {
91
- const { stdout } = await exec(binName, ['--version']);
91
+ const { stdout } = await exec(binName, ['--version'], { shell: true });
92
92
  return { available: true, version: stdout.trim() };
93
93
  } catch {
94
94
  return { available: false, version: null };
@@ -100,7 +100,7 @@ export async function installGlobalPackage(packageName) {
100
100
  const { promisify } = await import('node:util');
101
101
  const exec = promisify(execFile);
102
102
 
103
- await exec('npm', ['install', '-g', packageName], { stdio: 'inherit' });
103
+ await exec('npm', ['install', '-g', packageName], { shell: true });
104
104
  }
105
105
 
106
106
  export async function getPackageVersion() {