flower-trellis 0.2.3 → 0.2.4

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.
@@ -1,6 +1,8 @@
1
1
  <!-- BEGIN skill-garden workflow-state in_progress_inline v0.6 -->
2
2
  HIGHEST PRIORITY SKILL-GARDEN STATE GUARD (in_progress-inline):
3
3
  Inline mode means the main session edits directly, but check still routes before `trellis-check` / `trellis-check-all`.
4
+ After `trellis-check` / `trellis-check-all`, stop and report; do not run `/trellis:finish-work` unless the user explicitly asks after Phase 3.4 is complete.
5
+ This guard overrides any lower `Flow: ... -> /trellis:finish-work` line in this state block.
4
6
  At Phase 3.4, code commit/push still goes through `trellis-push` (commit-only for commit-without-push); never bare `git commit`/`git push` on code (hub: Code Commit Confirmation Gate).
5
7
  If active task.json has `last_push_snapshot`, relay `partial_step` + `next_step` once before starting new work.
6
8
  <!-- END skill-garden workflow-state in_progress_inline v0.6 -->
@@ -3,6 +3,8 @@ HIGHEST PRIORITY SKILL-GARDEN STATE GUARD (in_progress):
3
3
  At Phase 2.1/2.2/3.1, invoke `trellis-route(implement|check)` first, including every check / check-all path.
4
4
  Do not spawn `trellis-implement`, `trellis-check`, or `trellis-check-all` directly unless `trellis-route` just selected subagent mode.
5
5
  If routing helper is unavailable, ask the same numbered route choices in normal chat and wait for the user's selection.
6
+ After `trellis-check` / `trellis-check-all`, stop and report; do not run `/trellis:finish-work` unless the user explicitly asks after Phase 3.4 is complete.
7
+ This guard overrides any lower `Flow: ... -> /trellis:finish-work` line in this state block.
6
8
  At Phase 3.4, code commit/push goes through `trellis-push` (commit-only mode for commit-without-push); never bare `git commit`/`git push` on code (hub: Code Commit Confirmation Gate).
7
9
  If active task.json has `last_push_snapshot`, relay `partial_step` + `next_step` once before starting new work.
8
10
  <!-- END skill-garden workflow-state in_progress v0.6 -->
@@ -6,7 +6,7 @@
6
6
 
7
7
  **Priority**: This hub overrides any conflicting Trellis workflow, skill, or command text for the scoped behaviors below.
8
8
 
9
- **Scope**: Phase 2.1 / 2.2 / 3.1 dispatch routing, Phase 3.4 code-commit/push via trellis-push, Phase 3.5 finish-work bookkeeping, and push-progress recovery / snapshot reminders. State blocks should keep only one short skill-garden sentinel per state; long-form rules live here.
9
+ **Scope**: Phase 2.1 / 2.2 / 3.1 dispatch routing, post-check stop, Phase 3.4 code commit/push via trellis-push, explicit Phase 3.5 finish-work bookkeeping, and push-progress recovery. State blocks should keep only one short skill-garden sentinel per state; long-form rules live here.
10
10
 
11
11
  **Mechanical rule**: use this hub as the source of truth. Do not add separate top-level skill-garden override sections or multiple skill-garden sentinels inside the same `workflow-state:*` block.
12
12
 
@@ -14,7 +14,7 @@
14
14
 
15
15
  Before any implement/check agent or check skill runs from the main session, the immediately preceding routing decision must come from `trellis-route` or from the same numbered fallback choices shown in normal chat when the helper is unavailable.
16
16
 
17
- `trellis-route` returns 4 modes for `target=check` (check-all/check x inline/subagent) and 2 for `target=implement`. Step 1.7's recommendation is generated inside the skill and surfaced via Step 2's `AskUserQuestion`; that is the only prompt point.
17
+ `trellis-route` returns 4 modes for `target=check` (check-all/check x inline/subagent) and 2 for `target=implement`. The route prompt is the only place to ask this choice.
18
18
 
19
19
  If the platform cannot call `AskUserQuestion` / `request_user_input`, ask the same numbered choices in normal chat and wait for the user's reply. Tool unavailability is not permission to record inline/subagent or to dispatch a sub-agent directly.
20
20
 
@@ -27,15 +27,19 @@ At phase boundaries, do not ask meta continuation questions such as "continue?",
27
27
 
28
28
  Check routing has no 4h preference file. Before `trellis-check`, `trellis-check-all`, or either check sub-agent, route every time so the user can choose check-all vs lightweight and inline vs subagent.
29
29
 
30
- #### Code Commit Confirmation Gate
30
+ #### Post-Check Stop Gate
31
+
32
+ After `trellis-check` or `trellis-check-all` finishes, stop and report the result. Do not run `/trellis:finish-work`, do not archive the task, and do not imply the task is ready to wrap up solely because checks passed.
31
33
 
32
- Every code commit and its push belongs to Phase 3.4 and MUST go through `trellis-push`, mirroring how implement/check must go through `trellis-route`. From the main session the agent never runs bare `git commit` / `git push` on code to bypass it.
34
+ If checks pass, the next allowed workflow steps are Phase 3.3 `trellis-update-spec` and Phase 3.4 `trellis-push`/commit confirmation. `/trellis:finish-work` is explicit-only: run it only after Phase 3.4 is complete and the user asks to wrap up, archive, or finish the task.
35
+
36
+ #### Code Commit Confirmation Gate
33
37
 
34
- `trellis-push` IS the confirmation mechanism: its Step 2.2 stages only an explicit, user-approved file list (never `git add -A` / `git add .`); its Step 2.3 shows the drafted commit message for approval. "Confirmed" means the user saw that concrete file list + message inside `trellis-push` and approved it. A preference-style choice does NOT count — e.g. an `AskUserQuestion` "split / single commit" option only picks a strategy, and an option label/description never substitutes for the real file-list + message display.
38
+ Code commit/push belongs only to Phase 3.4 and must go through `trellis-push`; the main session must not run bare `git commit` / `git push` for code.
35
39
 
36
- For Phase 3.4 "commit now, push later", invoke `trellis-push` in commit-only mode (commit without pushing); the later push also goes through `trellis-push`.
40
+ `trellis-push` confirmation must show both the exact file list to stage and the drafted commit message. Before the user approves that concrete list + message, do not `git add`, commit, or push; never use `git add -A` / `git add .`.
37
41
 
38
- This gate is independent of `session_auto_commit`: that switch never authorizes a code commit and never waives going through `trellis-push`. The only bare-`git` commits allowed are the two bookkeeping scripts below, which manage their own `.trellis/**` files.
42
+ For "commit now, push later", use `trellis-push` commit-only mode; the later push still goes through `trellis-push`. `session_auto_commit` never authorizes code commits; it only affects bookkeeping commits below.
39
43
 
40
44
  #### Bookkeeping Auto-commit Scope
41
45
 
@@ -1,7 +1,7 @@
1
1
  {
2
- "syncedAt": "2026-06-08T18:22:30.404Z",
2
+ "syncedAt": "2026-06-09T03:17:57.676Z",
3
3
  "syncedFrom": "vendor/skill-garden/.trellis",
4
- "sourceCommit": "ec0ab7e2dd90b6cfdd86fb7a005610e245c36d40",
4
+ "sourceCommit": "c027d5baf4601edfe50791c5f2f34eaf41bb1357",
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.3",
3
+ "version": "0.2.4",
4
4
  "description": "一键安装/升级 Trellis 并自动融合 skill-garden 强化包(默认 Claude + agents)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,10 +12,10 @@
12
12
  "node": ">=18.17.0"
13
13
  },
14
14
  "dependencies": {
15
+ "@inquirer/prompts": "^8.5.2",
15
16
  "@mindfoldhq/trellis": "0.6.0-beta.8",
16
17
  "chalk": "^5.6.2",
17
18
  "figlet": "^1.11.0",
18
- "inquirer": "^9.3.8",
19
19
  "node-pty": "^1.1.0"
20
20
  },
21
21
  "files": [
package/src/cli.js CHANGED
@@ -2,6 +2,7 @@ import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import { flowerVersion, trellisVersion } from "./lib/versions.js";
4
4
  import { selectVariant } from "./lib/variant.js";
5
+ import { readManifest } from "./lib/manifest.js";
5
6
  import { runTrellis } from "./lib/trellis-runner.js";
6
7
 
7
8
  /**
@@ -21,6 +22,10 @@ function printVersion(cwd) {
21
22
  const { version } = selectVariant(cwd);
22
23
  if (version) console.log(`project .trellis ${version}`);
23
24
  }
25
+ // 项目里 flower 上次铺包时戳入的自身版本(来自 .flower-manifest.json);
26
+ // 与首行「当前工具版本」对比即可看出该项目是否需要重新 update。
27
+ const mf = readManifest(cwd);
28
+ if (mf && mf.flowerVersion) console.log(`project flower ${mf.flowerVersion}`);
24
29
  } catch {
25
30
  // 忽略:版本读取失败不应影响 -v 输出
26
31
  }
@@ -7,6 +7,7 @@ import { copySkills } from "./copy-skills.js";
7
7
  import { injectWorkflow } from "./workflow-inject.js";
8
8
  import { applyCodexTweaks } from "./codex-tweaks.js";
9
9
  import { readManifest, writeManifest } from "./manifest.js";
10
+ import { flowerVersion } from "./versions.js";
10
11
  import { rmrf } from "./fs-utils.js";
11
12
 
12
13
  /** 清理升级后可能变空的强化目录(深 → 浅)。 */
@@ -101,7 +102,15 @@ export function applyEnhancements(target, opts = {}) {
101
102
  pruneEmptyDirs(target);
102
103
  }
103
104
  }
104
- writeManifest(target, { variant, version, skills: installed, paths: newPaths });
105
+ // manifest 时同时戳入 flower-trellis 自身版本(flowerVersion),与 version(项目 Trellis
106
+ // 版本)区分开:前者答「上次是哪个 flower 铺的包」,服务后续升级/维护判断。
107
+ writeManifest(target, {
108
+ flowerVersion: flowerVersion(),
109
+ variant,
110
+ version,
111
+ skills: installed,
112
+ paths: newPaths,
113
+ });
105
114
  }
106
115
 
107
116
  // workflow 注入:无过滤名(全装)或显式指定 workflow-enhancement/finish-work-enhancement 时执行
@@ -1,4 +1,4 @@
1
- import inquirer from "inquirer";
1
+ import { checkbox } from "@inquirer/prompts";
2
2
 
3
3
  /**
4
4
  * 平台多选清单 —— flower 自己的平台选择菜单。
@@ -39,19 +39,21 @@ const PLATFORMS = [
39
39
  */
40
40
  export async function pickPlatforms() {
41
41
  if (!process.stdin.isTTY) return ["--codex", "--claude"];
42
- const { tools } = await inquirer.prompt([
43
- {
44
- type: "checkbox",
45
- name: "tools",
46
- message:
47
- "选择要配置的 AI 工具(空格勾选 / 回车确认,默认已勾 Claude Code + Codex):",
48
- choices: PLATFORMS.map((p) => ({
49
- name: p.name,
50
- value: p.value,
51
- checked: !!p.checked,
52
- })),
53
- loop: false,
54
- },
55
- ]);
42
+ // @inquirer/checkbox(现代 @inquirer/core 增量重绘内核)替代经典 inquirer
43
+ // 为什么换:经典 inquirer 每次重绘都「整块清屏 → 整块重写」,在 WSL2 / ConPTY 终端下
44
+ // 清空与重画之间有一帧空白,上下切换平台时肉眼可见闪屏;新内核按差异增量重绘可消闪。
45
+ // pageSize 取平台总数,一屏展示全部、避免滚动带来的二次重绘;loop:false 保持首尾不循环。
46
+ // 返回值即选中的 value 数组(["--claude","--codex", ...]),对调用方契约不变。
47
+ const tools = await checkbox({
48
+ message:
49
+ "选择要配置的 AI 工具(空格勾选 / 回车确认,默认已勾 Claude Code + Codex):",
50
+ choices: PLATFORMS.map((p) => ({
51
+ name: p.name,
52
+ value: p.value,
53
+ checked: !!p.checked,
54
+ })),
55
+ loop: false,
56
+ pageSize: PLATFORMS.length,
57
+ });
56
58
  return tools;
57
59
  }
@@ -1,6 +1,6 @@
1
1
  import { spawnSync } from "node:child_process";
2
2
  import { fileURLToPath } from "node:url";
3
- import inquirer from "inquirer";
3
+ import { confirm } from "@inquirer/prompts";
4
4
  import chalk from "chalk";
5
5
  import { flowerVersion } from "./versions.js";
6
6
 
@@ -95,7 +95,7 @@ export function isRunningViaNpx() {
95
95
  * 网络探测失败、已是最新或本地更高。
96
96
  *
97
97
  * 发现新版时的行为:
98
- * - 交互 TTY:打印通知 → inquirer 询问是否升级 → 同意则执行 `npm i -g flower-trellis@latest`;
98
+ * - 交互 TTY:打印通知 → confirm 询问是否升级 → 同意则执行 `npm i -g flower-trellis@latest`;
99
99
  * 成功后打印「请重新运行」并 **process.exit(0)**(不做 re-exec 自动重跑),失败则降级为
100
100
  * 打印手动升级命令并继续主流程;拒绝则继续主流程。
101
101
  * - 非交互(`-y`/`--yes` 或非 TTY):仅打印通知 + 升级命令,不弹确认、不阻塞。
@@ -136,15 +136,11 @@ export async function checkForUpdate(ctx, commandLabel) {
136
136
  return;
137
137
  }
138
138
 
139
- // 7. 交互:询问是否升级
140
- const { doUpgrade } = await inquirer.prompt([
141
- {
142
- type: "confirm",
143
- name: "doUpgrade",
144
- message: `是否现在升级到 ${latest}?(升级后需重新运行命令)`,
145
- default: true,
146
- },
147
- ]);
139
+ // 7. 交互:询问是否升级(@inquirer/confirm,返回 boolean)
140
+ const doUpgrade = await confirm({
141
+ message: `是否现在升级到 ${latest}?(升级后需重新运行命令)`,
142
+ default: true,
143
+ });
148
144
  if (!doUpgrade) {
149
145
  console.log(" · 已跳过升级");
150
146
  return;