@curdx/flow 6.0.1 → 6.0.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  All notable changes to `@curdx/flow` are documented here. Format follows [Keep a Changelog](https://keepachangelog.com/) and the project follows [Semantic Versioning](https://semver.org/).
4
4
 
5
+ ## 6.0.3 — 2026-04-29
6
+
7
+ ### Changed
8
+
9
+ - **`~/.claude/CLAUDE.md` injected block now uses combination-pattern playbook instead of flat rules list.** `src/runner/claudeMd.ts::renderBlock` emits three new sections — `Tool Combination Patterns`, `Skip Rules`, `Decision Tree` — all conditional on installed package ids so users only see guidance for tools they actually have. Previous `ALWAYS_ON_RULES` + `buildConditionalRules` (4 short bullets) replaced by `buildCombinationPatterns` / `buildSkipRules` / `buildDecisionTree` (≈40 lines). BEGIN/END markers + idempotent upsert behavior unchanged, so existing user-authored content above/below the block is preserved.
10
+
11
+ ## 6.0.2 — 2026-04-29
12
+
13
+ ### Added
14
+
15
+ - **`CLAUDE.md` release runbook.** Documents the 5-field version-sync gate (`package.json` + `package-lock.json` root / `packages[""]` + `plugin.json` + `marketplace.json`), the tag-triggered npm publish workflow, and the historical drift incidents (v5.0.0 marketplace, v6.0.0 lockfile) so future sessions have a single-source SOP for cutting releases.
16
+ - **`scripts/bump-version.mjs` + `npm run bump-version`.** Atomically writes the target version into all 5 fields, then shells out to `check-versions` to confirm. `npm version` handles `package.json` + lockfile; the two plugin manifests are patched via targeted regex so inline arrays (e.g. `plugin.json`'s `keywords`) stay byte-identical. Supports `<X.Y.Z|patch|minor|major>` and `--dry-run`.
17
+
18
+ ### Notes
19
+
20
+ - Both additions are repo-internal — neither file ships in the npm tarball (`files: ["dist", "CHANGELOG.md"]` is unchanged), so the published artifact is byte-identical to 6.0.1 modulo version metadata. This release exists to dogfood the new `bump-version` flow end-to-end.
21
+
5
22
  ## 4.0.1 — 2026-04-27
6
23
 
7
24
  ### Fixed
package/dist/index.mjs CHANGED
@@ -816,42 +816,103 @@ function renderItemLine(item) {
816
816
  if (item.whenToUse) line += ` \u2014 ${item.whenToUse}`;
817
817
  return line;
818
818
  }
819
- var ALWAYS_ON_RULES = [
820
- "Do not call every tool by default; pick by the trigger condition above.",
821
- "For first-attempt failures or simple edits, skip extra tools."
822
- ];
823
- function buildConditionalRules(installedIds) {
819
+ function buildCombinationPatterns(ids) {
820
+ const has = (k) => ids.has(k);
821
+ const out = ["\u6309\u573A\u666F\u4E32\u8054\uFF0C\u4E0D\u8981\u4E00\u4E2A\u4E2A\u5B64\u7ACB\u8C03\u7528\uFF1A", ""];
822
+ if (has("claude-mem") || has("context7") || has("curdx-flow")) {
823
+ out.push("- **\u63A5\u5230\u65B0\u9700\u6C42 / \u65B0 feature \u8D77\u624B\u5F0F**");
824
+ let step = 1;
825
+ if (has("claude-mem")) out.push(` ${step++}. \`claude-mem:mem-search\` \u67E5\u5386\u53F2\u2014\u2014"\u4EE5\u524D\u6709\u6CA1\u6709\u7C7B\u4F3C\u7684\u6D3B/\u5751"`);
826
+ if (has("context7")) out.push(` ${step++}. \u6D89\u53CA\u5916\u90E8\u5E93 \u2192 \`context7\` \u62C9\u6700\u65B0\u6587\u6863`);
827
+ const planners = [];
828
+ if (has("claude-mem")) planners.push("`claude-mem:make-plan` \u51FA phased plan");
829
+ if (has("curdx-flow")) planners.push("`/curdx-flow:new` \u8D77 spec");
830
+ if (planners.length > 0) out.push(` ${step++}. \u590D\u6742\u591A\u6B65 \u2192 ${planners.join("\uFF0C\u6216 ")}`);
831
+ out.push(` ${step++}. \u7B80\u5355\u4E00\u6B21\u6027\u6539\u52A8 \u2192 \u76F4\u63A5\u52A8\u624B\uFF0C\u8DF3\u8FC7\u4E0A\u9762\u51E0\u6B65`);
832
+ out.push("");
833
+ }
834
+ const stuckLines = [];
835
+ let s = 1;
836
+ if (has("claude-mem")) stuckLines.push(` ${s++}. \u5148\u770B \`claude-mem:mem-search\`\u2014\u2014\u4EE5\u524D\u662F\u5426\u89E3\u8FC7\u540C\u6837\u7684 bug`);
837
+ if (has("chrome-devtools-mcp")) stuckLines.push(` ${s++}. \u6D4F\u89C8\u5668\u4FA7 bug \u2192 \`chrome-devtools-mcp\`\uFF08network / console / perf trace\uFF09`);
838
+ if (has("context7")) stuckLines.push(` ${s++}. \u5E93 / API \u884C\u4E3A\u4E0D\u7B26\u9884\u671F \u2192 \`context7\` \u67E5\u5B98\u65B9 doc\uFF0C\u4E0D\u8981\u51ED\u8BB0\u5FC6`);
839
+ const stillStuck = [];
840
+ if (has("sequential-thinking")) stillStuck.push("`sequential-thinking` \u62C6\u5047\u8BBE");
841
+ if (has("pua")) stillStuck.push("`/pua:pua-loop` \u81EA\u52A8\u8FED\u4EE3");
842
+ if (stillStuck.length > 0) stuckLines.push(` ${s++}. \u8FD8\u5361 \u2192 ${stillStuck.join("\uFF0C\u6216 ")}`);
843
+ if (stuckLines.length > 0) {
844
+ out.push("- **\u9047\u5230 bug / \u5361\u4F4F 2 \u6B21\u4EE5\u4E0A**", ...stuckLines, "");
845
+ }
846
+ if (has("frontend-design") || has("chrome-devtools-mcp")) {
847
+ out.push("- **\u505A UI / \u524D\u7AEF\u9875\u9762**");
848
+ if (has("frontend-design")) out.push(" - `frontend-design` \u81EA\u52A8 fire\uFF0C\u65E0\u9700\u624B\u52A8\u8C03");
849
+ if (has("chrome-devtools-mcp")) out.push(" - \u6E32\u67D3\u5F02\u5E38\u6216\u4EA4\u4E92 bug \u2192 `chrome-devtools-mcp` \u9A8C\u8BC1\uFF0C\u4E0D\u9760\u8089\u773C");
850
+ out.push("");
851
+ }
852
+ if (has("pua") || has("curdx-flow")) {
853
+ out.push("- **\u5927\u578B / \u8DE8\u6A21\u5757 / \u591A agent \u534F\u4F5C**");
854
+ if (has("pua")) out.push(" - `/pua:p9` \u62C6 task prompt + \u7BA1 P8 \u56E2\u961F");
855
+ if (has("curdx-flow")) out.push(" - `/curdx-flow:triage` \u628A\u5927 feature \u62C6\u6210\u591A\u4E2A spec");
856
+ if (has("pua")) out.push(" - \u6218\u7565\u7EA7 \u2192 `/pua:p10`");
857
+ }
858
+ while (out.length > 0 && out[out.length - 1] === "") out.pop();
859
+ return out;
860
+ }
861
+ function buildSkipRules(ids) {
862
+ const has = (k) => ids.has(k);
863
+ const out = [];
864
+ out.push("- \u4E00\u884C\u6539\u52A8 / typo / \u91CD\u547D\u540D\u53D8\u91CF \u2014\u2014 \u4E0D\u8981 plan\uFF0C\u4E0D\u8981 mem-search\uFF0C\u76F4\u63A5 Edit");
865
+ const skips = [];
866
+ if (has("pua")) skips.push("`/pua:pua`");
867
+ if (has("sequential-thinking")) skips.push("`sequential-thinking`");
868
+ if (skips.length > 0) {
869
+ out.push(`- \u5DF2\u77E5\u786E\u5B9A\u7684 fix \u2014\u2014 \u4E0D\u8981 ${skips.join("\u3001")}`);
870
+ }
871
+ out.push('- \u7528\u6237\u95EE"\u8FD9\u662F\u4EC0\u4E48\u610F\u601D"\u7C7B\u7684\u89E3\u91CA\u9898 \u2014\u2014 \u4E0D\u8C03\u4EFB\u4F55\u5DE5\u5177\uFF0C\u76F4\u63A5\u7B54');
872
+ if (has("curdx-flow")) {
873
+ out.push("- \u5355\u6587\u4EF6\u5C40\u90E8\u91CD\u6784 \u2014\u2014 \u4E0D\u8D77 spec\uFF0C\u4E0D\u8FDB curdx-flow");
874
+ }
875
+ return out;
876
+ }
877
+ function buildDecisionTree(ids) {
878
+ const has = (k) => ids.has(k);
824
879
  const out = [];
880
+ out.push("1. \u80FD 1\u20132 \u6B65\u641E\u5B9A\uFF1F\u2192 \u76F4\u63A5\u505A");
881
+ out.push("2. \u591A\u6B65\u9AA4\u4F46\u8DEF\u5F84\u6E05\u6670\uFF1F\u2192 TaskCreate \u62C6\u4EFB\u52A1\uFF0C\u4E0D\u8FDB spec");
825
882
  const planners = [];
826
- if (installedIds.has("sequential-thinking")) planners.push("sequential-thinking");
827
- if (installedIds.has("claude-mem")) planners.push("claude-mem `make-plan`");
883
+ if (has("curdx-flow")) planners.push("`/curdx-flow:new`");
884
+ if (has("claude-mem")) planners.push("`claude-mem:make-plan`");
828
885
  if (planners.length > 0) {
829
- out.push(`For complex / risky changes, plan first (${planners.join(" or ")}).`);
886
+ out.push(`3. \u9700\u6C42\u6A21\u7CCA / \u8DE8\u6A21\u5757 / \u8981\u5206\u9636\u6BB5\u4EA4\u4ED8\uFF1F\u2192 ${planners.join(" \u6216 ")}`);
830
887
  }
831
- if (installedIds.has("context7")) {
832
- out.push("For library / SDK lookups, prefer context7 over web search.");
833
- }
834
- if (installedIds.has("chrome-devtools-mcp")) {
835
- out.push("For browser-rendered behavior, verify in chrome-devtools-mcp instead of guessing.");
888
+ if (has("claude-mem")) {
889
+ out.push("4. \u540C\u6837\u7684\u6D3B\u4EE5\u524D\u53EF\u80FD\u5E72\u8FC7\uFF1F\u2192 \u5148 `claude-mem:mem-search`");
836
890
  }
837
891
  return out;
838
892
  }
839
893
  function renderBlock(items) {
840
894
  const installedIds = new Set(items.map((i) => i.id));
841
- const rules = [...ALWAYS_ON_RULES, ...buildConditionalRules(installedIds)];
842
- return [
895
+ const lines = [
843
896
  BEGIN_MARKER,
844
897
  "## Tool Usage",
845
898
  "",
846
899
  "Available tools/plugins:",
847
- ...items.map(renderItemLine),
848
- "",
849
- "Rules:",
850
- ...rules.map((r) => `- ${r}`),
851
- "",
852
- "Run `npx @curdx/flow` to install / update / uninstall.",
853
- END_MARKER
854
- ].join("\n");
900
+ ...items.map(renderItemLine)
901
+ ];
902
+ const combo = buildCombinationPatterns(installedIds);
903
+ if (combo.length > 0) {
904
+ lines.push("", "## Tool Combination Patterns\uFF08\u7EC4\u5408\u5DE5\u4F5C\u6D41\uFF09", "", ...combo);
905
+ }
906
+ const skip = buildSkipRules(installedIds);
907
+ if (skip.length > 0) {
908
+ lines.push("", "## Skip Rules\uFF08\u9632\u8FC7\u5EA6\u5DE5\u5177\u5316\uFF09", "", ...skip);
909
+ }
910
+ const tree = buildDecisionTree(installedIds);
911
+ if (tree.length > 0) {
912
+ lines.push("", "## Decision Tree\uFF08\u9047\u5230\u6A21\u7CCA\u8BF7\u6C42\u65F6\uFF09", "", ...tree);
913
+ }
914
+ lines.push("", "Run `npx @curdx/flow` to install / update / uninstall.", END_MARKER);
915
+ return lines.join("\n");
855
916
  }
856
917
  function withEol(s, eol) {
857
918
  return eol === "\n" ? s : s.split("\n").join(eol);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curdx/flow",
3
- "version": "6.0.1",
3
+ "version": "6.0.3",
4
4
  "description": "Interactive installer for Claude Code plugins and MCP servers",
5
5
  "type": "module",
6
6
  "bin": "./dist/index.mjs",
@@ -17,6 +17,7 @@
17
17
  "start": "node ./dist/index.mjs",
18
18
  "typecheck": "tsc --noEmit",
19
19
  "check-versions": "node scripts/check-versions.mjs",
20
+ "bump-version": "node scripts/bump-version.mjs",
20
21
  "prepublishOnly": "node scripts/check-versions.mjs && npm run typecheck && npm run build"
21
22
  },
22
23
  "keywords": [