@curdx/flow 6.0.2 → 6.0.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.
- package/CHANGELOG.md +12 -0
- package/dist/index.mjs +79 -34
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
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.4 — 2026-04-29
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **Drop `Available tools/plugins` listing from injected `~/.claude/CLAUDE.md` block.** Each plugin's own SKILL.md `description` is already injected into Claude Code's system prompt at session start, so re-listing every tool's name + version + `whenToUse` was duplicate context that cost tokens for no judgement value. `renderBlock` now emits only the three decision sections — `Tool Combination Patterns`, `Skip Rules`, `Decision Tree` — which carry the cross-tool routing logic that single-skill descriptions cannot. `renderItemLine` removed (dead code); `ManagedItem`'s `name` / `version` / `slashNamespace` / `whenToUse` fields kept for forward compat with any external consumers, but no longer rendered.
|
|
10
|
+
|
|
11
|
+
## 6.0.3 — 2026-04-29
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- **`~/.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.
|
|
16
|
+
|
|
5
17
|
## 6.0.2 — 2026-04-29
|
|
6
18
|
|
|
7
19
|
### Added
|
package/dist/index.mjs
CHANGED
|
@@ -809,49 +809,94 @@ var BLOCK_RE = /<!-- BEGIN @curdx\/flow v\d+[^>]*-->[\s\S]*?<!-- END @curdx\/flo
|
|
|
809
809
|
function claudeMdPath() {
|
|
810
810
|
return path3.join(os3.homedir(), ".claude", "CLAUDE.md");
|
|
811
811
|
}
|
|
812
|
-
function
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
if (
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
812
|
+
function buildCombinationPatterns(ids) {
|
|
813
|
+
const has = (k) => ids.has(k);
|
|
814
|
+
const out = ["\u6309\u573A\u666F\u4E32\u8054\uFF0C\u4E0D\u8981\u4E00\u4E2A\u4E2A\u5B64\u7ACB\u8C03\u7528\uFF1A", ""];
|
|
815
|
+
if (has("claude-mem") || has("context7") || has("curdx-flow")) {
|
|
816
|
+
out.push("- **\u63A5\u5230\u65B0\u9700\u6C42 / \u65B0 feature \u8D77\u624B\u5F0F**");
|
|
817
|
+
let step = 1;
|
|
818
|
+
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"`);
|
|
819
|
+
if (has("context7")) out.push(` ${step++}. \u6D89\u53CA\u5916\u90E8\u5E93 \u2192 \`context7\` \u62C9\u6700\u65B0\u6587\u6863`);
|
|
820
|
+
const planners = [];
|
|
821
|
+
if (has("claude-mem")) planners.push("`claude-mem:make-plan` \u51FA phased plan");
|
|
822
|
+
if (has("curdx-flow")) planners.push("`/curdx-flow:new` \u8D77 spec");
|
|
823
|
+
if (planners.length > 0) out.push(` ${step++}. \u590D\u6742\u591A\u6B65 \u2192 ${planners.join("\uFF0C\u6216 ")}`);
|
|
824
|
+
out.push(` ${step++}. \u7B80\u5355\u4E00\u6B21\u6027\u6539\u52A8 \u2192 \u76F4\u63A5\u52A8\u624B\uFF0C\u8DF3\u8FC7\u4E0A\u9762\u51E0\u6B65`);
|
|
825
|
+
out.push("");
|
|
826
|
+
}
|
|
827
|
+
const stuckLines = [];
|
|
828
|
+
let s = 1;
|
|
829
|
+
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`);
|
|
830
|
+
if (has("chrome-devtools-mcp")) stuckLines.push(` ${s++}. \u6D4F\u89C8\u5668\u4FA7 bug \u2192 \`chrome-devtools-mcp\`\uFF08network / console / perf trace\uFF09`);
|
|
831
|
+
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`);
|
|
832
|
+
const stillStuck = [];
|
|
833
|
+
if (has("sequential-thinking")) stillStuck.push("`sequential-thinking` \u62C6\u5047\u8BBE");
|
|
834
|
+
if (has("pua")) stillStuck.push("`/pua:pua-loop` \u81EA\u52A8\u8FED\u4EE3");
|
|
835
|
+
if (stillStuck.length > 0) stuckLines.push(` ${s++}. \u8FD8\u5361 \u2192 ${stillStuck.join("\uFF0C\u6216 ")}`);
|
|
836
|
+
if (stuckLines.length > 0) {
|
|
837
|
+
out.push("- **\u9047\u5230 bug / \u5361\u4F4F 2 \u6B21\u4EE5\u4E0A**", ...stuckLines, "");
|
|
838
|
+
}
|
|
839
|
+
if (has("frontend-design") || has("chrome-devtools-mcp")) {
|
|
840
|
+
out.push("- **\u505A UI / \u524D\u7AEF\u9875\u9762**");
|
|
841
|
+
if (has("frontend-design")) out.push(" - `frontend-design` \u81EA\u52A8 fire\uFF0C\u65E0\u9700\u624B\u52A8\u8C03");
|
|
842
|
+
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");
|
|
843
|
+
out.push("");
|
|
844
|
+
}
|
|
845
|
+
if (has("pua") || has("curdx-flow")) {
|
|
846
|
+
out.push("- **\u5927\u578B / \u8DE8\u6A21\u5757 / \u591A agent \u534F\u4F5C**");
|
|
847
|
+
if (has("pua")) out.push(" - `/pua:p9` \u62C6 task prompt + \u7BA1 P8 \u56E2\u961F");
|
|
848
|
+
if (has("curdx-flow")) out.push(" - `/curdx-flow:triage` \u628A\u5927 feature \u62C6\u6210\u591A\u4E2A spec");
|
|
849
|
+
if (has("pua")) out.push(" - \u6218\u7565\u7EA7 \u2192 `/pua:p10`");
|
|
850
|
+
}
|
|
851
|
+
while (out.length > 0 && out[out.length - 1] === "") out.pop();
|
|
852
|
+
return out;
|
|
853
|
+
}
|
|
854
|
+
function buildSkipRules(ids) {
|
|
855
|
+
const has = (k) => ids.has(k);
|
|
856
|
+
const out = [];
|
|
857
|
+
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");
|
|
858
|
+
const skips = [];
|
|
859
|
+
if (has("pua")) skips.push("`/pua:pua`");
|
|
860
|
+
if (has("sequential-thinking")) skips.push("`sequential-thinking`");
|
|
861
|
+
if (skips.length > 0) {
|
|
862
|
+
out.push(`- \u5DF2\u77E5\u786E\u5B9A\u7684 fix \u2014\u2014 \u4E0D\u8981 ${skips.join("\u3001")}`);
|
|
863
|
+
}
|
|
864
|
+
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');
|
|
865
|
+
if (has("curdx-flow")) {
|
|
866
|
+
out.push("- \u5355\u6587\u4EF6\u5C40\u90E8\u91CD\u6784 \u2014\u2014 \u4E0D\u8D77 spec\uFF0C\u4E0D\u8FDB curdx-flow");
|
|
867
|
+
}
|
|
868
|
+
return out;
|
|
869
|
+
}
|
|
870
|
+
function buildDecisionTree(ids) {
|
|
871
|
+
const has = (k) => ids.has(k);
|
|
824
872
|
const out = [];
|
|
873
|
+
out.push("1. \u80FD 1\u20132 \u6B65\u641E\u5B9A\uFF1F\u2192 \u76F4\u63A5\u505A");
|
|
874
|
+
out.push("2. \u591A\u6B65\u9AA4\u4F46\u8DEF\u5F84\u6E05\u6670\uFF1F\u2192 TaskCreate \u62C6\u4EFB\u52A1\uFF0C\u4E0D\u8FDB spec");
|
|
825
875
|
const planners = [];
|
|
826
|
-
if (
|
|
827
|
-
if (
|
|
876
|
+
if (has("curdx-flow")) planners.push("`/curdx-flow:new`");
|
|
877
|
+
if (has("claude-mem")) planners.push("`claude-mem:make-plan`");
|
|
828
878
|
if (planners.length > 0) {
|
|
829
|
-
out.push(`
|
|
830
|
-
}
|
|
831
|
-
if (installedIds.has("context7")) {
|
|
832
|
-
out.push("For library / SDK lookups, prefer context7 over web search.");
|
|
879
|
+
out.push(`3. \u9700\u6C42\u6A21\u7CCA / \u8DE8\u6A21\u5757 / \u8981\u5206\u9636\u6BB5\u4EA4\u4ED8\uFF1F\u2192 ${planners.join(" \u6216 ")}`);
|
|
833
880
|
}
|
|
834
|
-
if (
|
|
835
|
-
out.push("
|
|
881
|
+
if (has("claude-mem")) {
|
|
882
|
+
out.push("4. \u540C\u6837\u7684\u6D3B\u4EE5\u524D\u53EF\u80FD\u5E72\u8FC7\uFF1F\u2192 \u5148 `claude-mem:mem-search`");
|
|
836
883
|
}
|
|
837
884
|
return out;
|
|
838
885
|
}
|
|
839
886
|
function renderBlock(items) {
|
|
840
887
|
const installedIds = new Set(items.map((i) => i.id));
|
|
841
|
-
const
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
"##
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
"
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
END_MARKER
|
|
854
|
-
].join("\n");
|
|
888
|
+
const sections = [
|
|
889
|
+
["## Tool Combination Patterns\uFF08\u7EC4\u5408\u5DE5\u4F5C\u6D41\uFF09", buildCombinationPatterns(installedIds)],
|
|
890
|
+
["## Skip Rules\uFF08\u9632\u8FC7\u5EA6\u5DE5\u5177\u5316\uFF09", buildSkipRules(installedIds)],
|
|
891
|
+
["## Decision Tree\uFF08\u9047\u5230\u6A21\u7CCA\u8BF7\u6C42\u65F6\uFF09", buildDecisionTree(installedIds)]
|
|
892
|
+
];
|
|
893
|
+
const lines = [BEGIN_MARKER];
|
|
894
|
+
for (const [heading, body] of sections) {
|
|
895
|
+
if (body.length === 0) continue;
|
|
896
|
+
lines.push(heading, "", ...body, "");
|
|
897
|
+
}
|
|
898
|
+
lines.push("Run `npx @curdx/flow` to install / update / uninstall.", END_MARKER);
|
|
899
|
+
return lines.join("\n");
|
|
855
900
|
}
|
|
856
901
|
function withEol(s, eol) {
|
|
857
902
|
return eol === "\n" ? s : s.split("\n").join(eol);
|