Skip to content

Commit 9c1a295

Browse files
authored
feat: improve cli update workflow
2 parents cb81a63 + f8b3705 commit 9c1a295

19 files changed

Lines changed: 1011 additions & 116 deletions
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: PR Title Lint
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, reopened, ready_for_review]
6+
7+
permissions:
8+
pull-requests: read
9+
10+
jobs:
11+
lint-pr-title:
12+
name: Lint PR Title
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: amannn/action-semantic-pull-request@v5
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
with:
19+
types: |
20+
feat
21+
fix
22+
docs
23+
style
24+
refactor
25+
perf
26+
test
27+
build
28+
ci
29+
chore
30+
revert
31+
scopes: |
32+
cli
33+
commands
34+
core
35+
skills
36+
assets
37+
scripts
38+
docs
39+
ci
40+
deps
41+
release
42+
requireScope: false
43+
subjectPattern: ^.{1,72}$
44+
subjectPatternError: |
45+
PR title subject must be 72 characters or fewer.
46+
Found: "{subject}" ({length} characters)

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,35 @@
22

33
All notable changes to @rpamis/comet will be documented in this file.
44

5+
## What's Changed [0.2.5] - 2026-05-22
6+
7+
### Added
8+
9+
- **PR title lint workflow**: Added GitHub Actions validation for semantic PR titles with Comet-specific scopes (`cli`, `commands`, `core`, `skills`, `assets`, `scripts`, `docs`, `ci`, `deps`, `release`)
10+
- **Structured JSON output**: `comet init --json` and `comet update --json` now emit machine-readable results instead of mixed human logs
11+
- **`doctor --scope`**: `comet doctor` can diagnose `auto`, `project`, or `global` scope, with `auto` checking both project and global installs
12+
- **Next-step status hint**: `comet status` now reports the next workflow command (`/comet-open`, `/comet-design`, `/comet-build`, `/comet-verify`, `/comet-archive`) in text and JSON output
13+
- **README asset guard**: Added tests and prepublish validation to keep README images on npm-friendly absolute URLs
14+
15+
### Changed
16+
17+
- **`comet update` preserves installed context**: Update now detects existing Comet skill targets across project/global scopes, preserves installed scope, detects Chinese vs English skills, and updates only platforms where Comet skills are already installed
18+
- **`comet update` self-updates npm package**: Update now prints and runs the matching npm update command for the detected package scope before refreshing installed skills
19+
- **Friendlier update output**: Update logs the npm command, per-target skill copy command, final npm status, updated target count, scope, and language summary
20+
- **Init overwrite flow**: Interactive `comet init` now offers a bulk overwrite/skip choice when multiple existing components are detected on the same platform
21+
- **CLI option validation**: `update --language`, `update --scope`, and `doctor --scope` now validate accepted values through Commander choices
22+
- **README CLI docs**: Updated English and Chinese README command sections to document JSON output, doctor scope, update behavior, status next-step hints, and init overwrite behavior
23+
- **CONTRIBUTING link**: Added contribution guide references to both English and Chinese README development sections
24+
25+
### Fixed
26+
27+
- **Doctor false positives**: `comet doctor` now recognizes current `.comet.yaml` fields including `verification_report` and `branch_status`
28+
- **npm README images**: README images now use absolute GitHub URLs so package pages can render them
29+
30+
### Tests
31+
32+
- Added coverage for update language/scope detection, JSON output, friendly command display, status next-step hints, doctor current-state validation, README image URLs, init bulk overwrite selection, and PR title workflow configuration
33+
534
## What's Changed [0.2.4] - 2026-05-21
635

736
### Added

README-zh.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<p align="center">
2-
<a href="https://github.com/rpamis/comet">
2+
<a href="https://github.com/rpamis/comet/blob/master/img/title-log.png">
33
<picture>
4-
<source srcset="img/title-log.png">
5-
<img src="img/title-log.png" alt="Comet logo">
4+
<source srcset="https://github.com/rpamis/comet/blob/master/img/title-log.png">
5+
<img src="https://github.com/rpamis/comet/blob/master/img/title-log.png" alt="Comet logo">
66
</picture>
77
</a>
88
</p>
@@ -72,7 +72,7 @@ comet init
7272
## 运行截图
7373

7474
<p align="center">
75-
<img src="img/runner.png" alt="runner">
75+
<img src="https://github.com/rpamis/comet/blob/master/img/runner.png" alt="runner">
7676
</p>
7777
<p align="center">自动安装 OpenSpec、Superpowers,一键配置开发环境</p>
7878
<p align="center">多阶段 Skill 入口,自动识别当前 Spec 阶段,核心流程自动触发,关键节点人工审核</p>
@@ -82,9 +82,9 @@ comet init
8282
| 命令 | 描述 |
8383
|---------|-------------|
8484
| `comet init [path]` | 初始化 Comet 工作流 |
85-
| `comet status [path]` | 显示活跃更改和工作流状态 |
86-
| `comet doctor [path]` | 诊断 Comet 安装健康状态 |
87-
| `comet update [path]` | 更新 comet 技能到最新版本 |
85+
| `comet status [path]` | 显示活跃更改、任务进度和下一步工作流命令 |
86+
| `comet doctor [path]` | 诊断项目级/全局 Comet 安装健康状态 |
87+
| `comet update [path]` | 更新 npm 包和已安装的 Comet 技能 |
8888
| `comet --help` | 显示帮助 |
8989
| `comet --version` | 显示版本 |
9090

@@ -97,13 +97,28 @@ comet init
9797
| `--overwrite` | 覆盖已安装的组件 |
9898
| `--json` | 输出结构化 JSON |
9999

100-
### status / doctor / update 选项
100+
当同一平台检测到多个已安装组件时,交互式 init 会先提供一次批量选择:全部覆盖、全部跳过,或逐项选择。
101101

102-
| 选项 | 适用于 | 描述 |
103-
|--------|-----------|-------------|
104-
| `--json` | `status`, `doctor` | 输出结构化 JSON |
105-
| `--language <lang>` | `update` | 技能语言 (`en`, `zh`) |
106-
| `--scope <scope>` | `update` | 安装范围 (`global`, `project`)|
102+
### status 选项
103+
104+
| 选项 | 描述 |
105+
|--------|-------------|
106+
| `--json` | 输出活跃更改,并包含 `nextCommand` |
107+
108+
### doctor 选项
109+
110+
| 选项 | 描述 |
111+
|--------|-------------|
112+
| `--json` | 输出结构化诊断结果 |
113+
| `--scope <scope>` | 诊断 `auto``project``global` 范围(默认:`auto`|
114+
115+
### update 选项
116+
117+
| 选项 | 描述 |
118+
|--------|-------------|
119+
| `--json` | 以 JSON 输出 npm 和 skill 更新结果 |
120+
| `--language <lang>` | 覆盖自动检测到的 skill 语言 (`en`, `zh`) |
121+
| `--scope <scope>` | 仅更新 `global``project` 范围 |
107122

108123
## 支持平台
109124

@@ -296,6 +311,8 @@ your-project/
296311
297312
## 开发
298313
314+
贡献流程、提交规范、PR 流程,以及新增平台或 Skill 的说明见 [CONTRIBUTING.md](CONTRIBUTING.md)。
315+
299316
```bash
300317
# 克隆
301318
git clone https://github.com/rpamis/comet

README.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<p align="center">
2-
<a href="https://github.com/rpamis/comet">
2+
<a href="https://github.com/rpamis/comet/blob/master/img/title-log.png">
33
<picture>
4-
<source srcset="img/title-log.png">
5-
<img src="img/title-log.png" alt="Comet logo">
4+
<source srcset="https://github.com/rpamis/comet/blob/master/img/title-log.png">
5+
<img src="https://github.com/rpamis/comet/blob/master/img/title-log.png" alt="Comet logo">
66
</picture>
77
</a>
88
</p>
@@ -72,7 +72,7 @@ comet init
7272
## Screenshots
7373

7474
<p align="center">
75-
<img src="img/runner.png" alt="runner">
75+
<img src="https://github.com/rpamis/comet/blob/master/img/runner.png" alt="runner">
7676
</p>
7777

7878
<p align="center">Auto-install OpenSpec & Superpowers, one-click dev environment setup</p>
@@ -83,9 +83,9 @@ comet init
8383
| Command | Description |
8484
|---------|-------------|
8585
| `comet init [path]` | Initialize Comet workflow |
86-
| `comet status [path]` | Show active changes and workflow status |
87-
| `comet doctor [path]` | Diagnose Comet installation health |
88-
| `comet update [path]` | Update comet skills to latest version |
86+
| `comet status [path]` | Show active changes, task progress, and next workflow command |
87+
| `comet doctor [path]` | Diagnose project/global Comet installation health |
88+
| `comet update [path]` | Update the npm package and installed Comet skills |
8989
| `comet --help` | Show help |
9090
| `comet --version` | Show version |
9191

@@ -98,13 +98,28 @@ comet init
9898
| `--overwrite` | Overwrite already installed components |
9999
| `--json` | Output structured JSON |
100100

101-
### status / doctor / update Options
101+
When multiple existing components are found on the same platform, interactive init offers one bulk choice: overwrite all, skip all, or choose per component.
102102

103-
| Option | Applies to | Description |
104-
|--------|-----------|-------------|
105-
| `--json` | `status`, `doctor` | Output structured JSON |
106-
| `--language <lang>` | `update` | Language for skills (`en`, `zh`) |
107-
| `--scope <scope>` | `update` | Install scope (`global`, `project`)|
103+
### status Options
104+
105+
| Option | Description |
106+
|--------|-------------|
107+
| `--json` | Output active changes with `nextCommand` |
108+
109+
### doctor Options
110+
111+
| Option | Description |
112+
|--------|-------------|
113+
| `--json` | Output structured diagnostic results |
114+
| `--scope <scope>` | Diagnose `auto`, `project`, or `global` scope (default: `auto`) |
115+
116+
### update Options
117+
118+
| Option | Description |
119+
|--------|-------------|
120+
| `--json` | Output npm and skill update results as JSON |
121+
| `--language <lang>` | Override detected skill language (`en`, `zh`) |
122+
| `--scope <scope>` | Update only `global` or `project` scope |
108123

109124
## Supported Platforms
110125

@@ -297,6 +312,8 @@ Long-term Skill users know these capabilities can be freely combined, but exactl
297312
298313
## Development
299314
315+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, commit conventions, PR process, and guidance for adding platforms or skills.
316+
300317
```bash
301318
# Clone
302319
git clone https://github.com/rpamis/comet

assets/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.2.4",
2+
"version": "0.2.5",
33
"skills": [
44
"comet/SKILL.md",
55
"comet/scripts/comet-guard.sh",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rpamis/comet",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"description": "OpenSpec + Superpowers dual-star development workflow",
55
"keywords": [
66
"comet",

scripts/prepublish-check.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const SECRET_PATTERNS = [
2020

2121
const SKIP_DIRS = new Set(['node_modules', '.git', 'dist']);
2222
const TEXT_EXTENSIONS = new Set(['.js', '.ts', '.json', '.md', '.txt', '.yml', '.yaml', '.toml']);
23+
const README_IMAGE_PATTERN = /\b(?:src|srcset)=["'](?:\.\/)?img\//;
2324

2425
function* walkFiles(dir) {
2526
for (const entry of readdirSync(dir)) {
@@ -54,6 +55,13 @@ for (const filePath of walkFiles('.')) {
5455
found++;
5556
}
5657
}
58+
59+
if (/README(?:-zh)?\.md$/.test(filePath) && README_IMAGE_PATTERN.test(content)) {
60+
console.error(
61+
`[PACKAGE] npm README images must use absolute URLs, not local img/ paths: ${filePath}`,
62+
);
63+
found++;
64+
}
5765
}
5866

5967
if (found > 0) {

src/cli/index.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Command } from 'commander';
1+
import { Command, Option } from 'commander';
22
import { createRequire } from 'module';
33
import { initCommand } from '../commands/init.js';
44
import { statusCommand } from '../commands/status.js';
@@ -46,6 +46,13 @@ program
4646
.command('doctor [path]')
4747
.description('Diagnose Comet installation health')
4848
.option('--json', 'Output as JSON')
49+
.addOption(
50+
new Option('--scope <scope>', 'Install scope to diagnose').choices([
51+
'auto',
52+
'global',
53+
'project',
54+
]),
55+
)
4956
.action(async (targetPath = '.', options) => {
5057
await doctorCommand(targetPath, options);
5158
});
@@ -54,8 +61,9 @@ program
5461
.command('update [path]')
5562
.description('Update comet skill files to latest version')
5663
.option('--json', 'Output as JSON')
57-
.option('--language <lang>', 'Language for skills (en, zh)')
58-
.option('--scope <scope>', 'Install scope (global, project)')
64+
.addOption(new Option('--language <lang>', 'Language for skills').choices(['en', 'zh']))
65+
.addOption(new Option('--scope <scope>', 'Install scope').choices(['global', 'project']))
66+
.addOption(new Option('--skip-npm', 'Skip npm package self-update').hideHelp())
5967
.action(async (targetPath = '.', options) => {
6068
await updateCommand(targetPath, options);
6169
});

0 commit comments

Comments
 (0)