flower-trellis 0.2.0 → 0.2.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/README.md CHANGED
@@ -108,16 +108,57 @@ flower banner → 平台多选菜单 → Trellis 原生交互(模板 / monorepo
108
108
 
109
109
  ## 开发
110
110
 
111
+ skill-garden 强化包源以 **git submodule** 形式挂在 `vendor/skill-garden`,克隆时需一并拉取:
112
+
113
+ ```bash
114
+ # 首次克隆(连同 submodule)
115
+ git clone --recurse-submodules https://github.com/SilentFlower/flower-trellis.git
116
+
117
+ # 已普通克隆过、vendor/skill-garden 为空时补拉
118
+ git submodule update --init --recursive
119
+ ```
120
+
111
121
  ```bash
112
122
  npm install # 安装依赖
113
- npm run sync # 从 skill-garden 同步强化包快照到 enhancements/
123
+ npm run sync # 从 vendor/skill-garden 同步强化包快照到 enhancements/
114
124
  node bin/flower-trellis.js init -u you --target /tmp/test-project # 本地试跑(勿在本仓库根直接 init)
115
125
  ```
116
126
 
117
- 修改强化包后务必重新 `npm run sync`,再发布新版本。
127
+ > `npm run sync` 默认从 submodule `vendor/skill-garden` 读取;可用环境变量 `SKILL_GARDEN_DIR=/path/to/skill-garden` 覆盖到外部副本(旧布局逃生通道)。
128
+
129
+ **更新强化包**(skill-garden 有新提交时,先动 pin 再重建快照):
130
+
131
+ ```bash
132
+ cd vendor/skill-garden && git fetch && git checkout origin/main && cd ../..
133
+ git add vendor/skill-garden # 登记新的 submodule pin
134
+ npm run sync # 重建 enhancements/ 快照(sourceCommit 跟随新 pin)
135
+ git add enhancements && git commit -m "chore: 更新强化包快照到 <sha>"
136
+ ```
118
137
 
119
138
  > **维护约束**:`workflow.md` 的旧块清理依赖 `src/lib/workflow-inject.js` 中硬编码的 sentinel 名单。修改现有块的内容无需改动名单;但当 skill-garden **新增一种 workflow 块类型**(新的 `BEGIN/END` 名)时,必须同步更新该名单,否则旧块无法被清除。
120
139
 
140
+ ## 发布
141
+
142
+ 采用「本地把关 + CI 发布」的混合流程,版本更新内容以 `CHANGELOG.md`(由 Conventional Commits 自动生成)为唯一来源:
143
+
144
+ ```bash
145
+ # 1) 本地:按约定式提交自动定版本号 + 写 CHANGELOG + 打 tag(不 push、不 publish)
146
+ npm run release # = check-snapshot(校验快照一致)+ commit-and-tag-version
147
+ npm run release:dry # 仅预览版本号与 CHANGELOG,不落盘
148
+
149
+ # 2) 检查 CHANGELOG / package.json 版本 diff,确认无误后连 tag 一起推送
150
+ git push --follow-tags origin main
151
+ ```
152
+
153
+ 推送 `vX.Y.Z` tag 后,GitHub Actions(`.github/workflows/release.yml`)自动完成:
154
+
155
+ - **`npm publish`** —— 经 npm **OIDC Trusted Publishing** 发布,自动带 provenance 来源证明,**无需** `NPM_TOKEN`。
156
+ - **`gh release create`** —— 创建 GitHub Release,notes 取自 `CHANGELOG.md` 对应版本段(与 CHANGELOG 同源)。
157
+
158
+ > **一次性前置**:首次发布前需在 [npmjs.com](https://www.npmjs.com) 的本包设置里配置 **Trusted Publisher**,绑定 `SilentFlower/flower-trellis` 仓库与 `release.yml`,否则 OIDC 发布会失败。
159
+ >
160
+ > **发布前自检**:`npm run release` 会先跑 `scripts/check-snapshot.mjs`,确保 `enhancements/` 快照与 `vendor/skill-garden` 当前 pin 一致且已提交,杜绝发布陈旧快照。
161
+
121
162
  ## 相关项目
122
163
 
123
164
  | 项目 | 作用 |
@@ -3,4 +3,6 @@ HIGHEST PRIORITY SKILL-GARDEN STATE GUARD (no_task):
3
3
  Creating/resuming a task is not implementation permission.
4
4
  After PRD ready and task started, next implementation action = `trellis-route(implement)`.
5
5
  If no active task exists, scan `.trellis/tasks/*/task.json` once per session for in-progress tasks with `last_push_snapshot`; surface completed_steps + next_step and suggest rebinding the active task before resuming.
6
+ Do NOT use the harness built-in plan mode (`EnterPlanMode` / `ExitPlanMode`) as a substitute for this gate. Planning is Trellis-only: classify the turn, ask for task-creation consent, then `trellis-brainstorm` for complex work.
7
+ If the turn is a meta edit to Trellis itself (Trellis tracking would be overkill), say so and ask to skip Trellis — never silently swap built-in plan mode in for the consent gate.
6
8
  <!-- END skill-garden workflow-state no_task v0.6 -->
@@ -29,18 +29,20 @@ Check routing has no 4h preference file. Before `trellis-check`, `trellis-check-
29
29
 
30
30
  #### Finish-work Bookkeeping Guard
31
31
 
32
- `session_auto_commit` only controls script-managed bookkeeping commits for Trellis task archives and workspace journals. It does not disable Phase 3.4 code-work commits that the user explicitly confirms.
32
+ `session_auto_commit` governs ONLY the script-managed bookkeeping commits that `task.py archive` and `add_session.py` make for their own files (`.trellis/tasks/**` archive moves and `.trellis/workspace/**` journal/index). It is NOT a global auto-commit switch, and it has NO authority over code commits.
33
33
 
34
- If `.trellis/config.yaml` contains `session_auto_commit: false`, finish-work must treat archive and journal writes as disk-only bookkeeping:
34
+ Code commits always belong to Phase 3.4: the agent drafts the batched commit plan and commits only after the user confirms — in EVERY case, whether `session_auto_commit` is `true` or `false`. Never treat `session_auto_commit: true` as permission to auto-commit code, to skip the Phase 3.4 confirmation prompt, or to commit any path outside the two scripts' own bookkeeping files. The two are independent: this switch never decides whether code is committed, and it never decides whether to ask first.
35
+
36
+ When `session_auto_commit: true` (the default): `task.py archive` produces a `chore(task): archive ...` commit and `add_session.py` produces a `chore: record journal` commit, each touching only its own bookkeeping files. Code stays dirty for the Phase 3.4 plan.
37
+
38
+ When `.trellis/config.yaml` sets `session_auto_commit: false`, finish-work must treat archive and journal writes as disk-only bookkeeping:
35
39
 
36
40
  - Running `python3 ./.trellis/scripts/task.py archive <task>` may move task files, but must not be described as producing a `chore(task): archive ...` commit.
37
41
  - Running `python3 ./.trellis/scripts/add_session.py ...` may write workspace journal/index files, but must not be described as producing a `chore: record journal` commit.
38
42
  - Do not run a compensating `git add` / `git commit` for `.trellis/tasks/**` or `.trellis/workspace/**` just because those scripts skipped auto-commit.
39
43
  - Report the resulting `.trellis/tasks/**` and `.trellis/workspace/**` dirty paths to the user as bookkeeping changes for manual review.
40
44
 
41
- Phase 3.4 code-work commits are unchanged. If code files from the task are dirty, the agent may still present the normal one-shot commit plan and commit only after the user confirms.
42
-
43
- This guard only prevents archive/journal bookkeeping commits from being forced when `session_auto_commit: false`.
45
+ This guard scopes `session_auto_commit` to the two bookkeeping commits above; Phase 3.4 code-work commits stay confirmation-gated regardless of its value.
44
46
 
45
47
  #### Push Progress Recovery / Snapshot
46
48
 
@@ -1,7 +1,7 @@
1
1
  {
2
- "syncedAt": "2026-06-08T15:47:02.818Z",
3
- "syncedFrom": "/root/project/skill-garden/.trellis",
4
- "sourceCommit": "824727cb279202c65bb653529fc84f5e135c25e2",
2
+ "syncedAt": "2026-06-08T17:00:12.577Z",
3
+ "syncedFrom": "vendor/skill-garden/.trellis",
4
+ "sourceCommit": "1dcf26869e7c90be0777ebe3448501f340e05b45",
5
5
  "variants": {
6
6
  "old": {
7
7
  "claudeSkills": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flower-trellis",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "一键安装/升级 Trellis 并自动融合 skill-garden 强化包(默认 Claude + agents)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -26,7 +26,9 @@
26
26
  ],
27
27
  "scripts": {
28
28
  "sync": "node scripts/sync-enhancements.mjs",
29
- "prepublishOnly": "node scripts/sync-enhancements.mjs"
29
+ "prepublishOnly": "node scripts/sync-enhancements.mjs",
30
+ "release": "node scripts/check-snapshot.mjs && commit-and-tag-version",
31
+ "release:dry": "commit-and-tag-version --dry-run"
30
32
  },
31
33
  "keywords": [
32
34
  "trellis",
@@ -36,5 +38,16 @@
36
38
  "claude",
37
39
  "cli"
38
40
  ],
39
- "license": "MIT"
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "git+https://github.com/SilentFlower/flower-trellis.git"
44
+ },
45
+ "bugs": {
46
+ "url": "https://github.com/SilentFlower/flower-trellis/issues"
47
+ },
48
+ "homepage": "https://github.com/SilentFlower/flower-trellis#readme",
49
+ "license": "MIT",
50
+ "devDependencies": {
51
+ "commit-and-tag-version": "^12.7.3"
52
+ }
40
53
  }