@curdx/flow 1.1.1
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/LICENSE +21 -0
- package/README.md +161 -0
- package/README.zh.md +149 -0
- package/bin/curdx-flow.js +125 -0
- package/cli/README.md +87 -0
- package/cli/doctor.js +155 -0
- package/cli/init.js +296 -0
- package/cli/install.js +213 -0
- package/cli/protocols.js +124 -0
- package/cli/uninstall.js +238 -0
- package/cli/upgrade.js +75 -0
- package/cli/utils.js +337 -0
- package/package.json +35 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 wdx
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# CurDX-Flow
|
|
2
|
+
|
|
3
|
+
> **AI Engineering Workflow Meta-Framework for Claude Code**
|
|
4
|
+
> Turn Claude Code into a disciplined engineering team — orchestrate MCPs and plugins, enforce Karpathy's 4 principles, and ship quality software with spec-driven workflows.
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/@curdx/flow)
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
[](https://code.claude.com)
|
|
9
|
+
[-red)](./README.zh.md)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## What It Is
|
|
14
|
+
|
|
15
|
+
CurDX-Flow is a Claude Code plugin that distills six proven AI-engineering workflows (Karpathy guidelines, BMAD-METHOD, get-shit-done, gstack, smart-ralph, superpowers) into a single composable system — then delegates infrastructure to specialized third-party plugins (context7, sequential-thinking, chrome-devtools, claude-mem, pua, frontend-design).
|
|
16
|
+
|
|
17
|
+
**It doesn't reinvent wheels. It orchestrates good ones.**
|
|
18
|
+
|
|
19
|
+
## At a Glance (v1.1.0)
|
|
20
|
+
|
|
21
|
+
- **31 commands** — initialize, research, design, execute, verify, review, debug, QA, security, ...
|
|
22
|
+
- **24 agents** — 15 functional + 9 personas (Mary, John, Winston, Amelia, Rachel, David, Oliver, Serena, Emma)
|
|
23
|
+
- **8 composable gates** — Karpathy / Verification / TDD / Coverage / Adversarial / Edge-Case / Security / DevEx
|
|
24
|
+
- **4 execution strategies** — linear / subagent / stop-hook / wave (auto-routed)
|
|
25
|
+
- **10 knowledge docs** — spec-driven dev, POC-first, atomic commits, execution strategies, ...
|
|
26
|
+
- **5 hook events** — SessionStart / InstructionsLoaded / Stop / PreToolUse / PostToolUseFailure
|
|
27
|
+
- **3 auto-installed MCPs** — context7, sequential-thinking, chrome-devtools
|
|
28
|
+
- **Graceful degradation** — missing deps → fallback modes with clear notices
|
|
29
|
+
|
|
30
|
+
## Why Use It
|
|
31
|
+
|
|
32
|
+
Existing AI-coding workflows suffer from:
|
|
33
|
+
|
|
34
|
+
| Problem | CurDX-Flow's Answer |
|
|
35
|
+
|---------|---------------------|
|
|
36
|
+
| Context rot (long sessions degrade) | Subagent isolation + stop-hook loops + claude-mem |
|
|
37
|
+
| No discipline (AI skips, hallucinates) | Karpathy L1 + verification-gate + TDD-gate enforcement |
|
|
38
|
+
| Scattered best practices | Six workflows distilled into one meta-framework |
|
|
39
|
+
| Weak verification (claim "done" without proof) | Goal-backward verification + forbidden-word detection |
|
|
40
|
+
| Single-viewpoint decisions | Party Mode (real multi-agent, not role-play) + adversarial review |
|
|
41
|
+
|
|
42
|
+
## Install
|
|
43
|
+
|
|
44
|
+
### Recommended: one-shot via npm (works in any project, fast on Chinese npm mirrors)
|
|
45
|
+
```bash
|
|
46
|
+
# Interactive (picks recommended plugins)
|
|
47
|
+
npx @curdx/flow install
|
|
48
|
+
|
|
49
|
+
# Or install everything automatically
|
|
50
|
+
npx @curdx/flow install --all
|
|
51
|
+
|
|
52
|
+
# Health check
|
|
53
|
+
npx @curdx/flow doctor
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### From the Claude Code marketplace
|
|
57
|
+
```
|
|
58
|
+
/plugin marketplace add curdx/curdx-flow
|
|
59
|
+
/plugin install curdx-flow
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Local dev
|
|
63
|
+
```bash
|
|
64
|
+
git clone https://github.com/curdx/curdx-flow
|
|
65
|
+
claude --plugin-dir ./curdx-flow
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
3 MCPs auto-install. Then run:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
/curdx-flow:install-deps # interactive install of pua / claude-mem / frontend-design
|
|
72
|
+
/curdx-flow:doctor # verify health
|
|
73
|
+
/curdx-flow:init # initialize your project
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
See [`docs/getting-started.md`](./docs/getting-started.md) for a 5-minute walkthrough.
|
|
77
|
+
|
|
78
|
+
## Quick Start
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# 1. In your project
|
|
82
|
+
/curdx-flow:init
|
|
83
|
+
|
|
84
|
+
# 2. Start a feature
|
|
85
|
+
/curdx-flow:start jwt-auth "Add JWT authentication to REST API"
|
|
86
|
+
|
|
87
|
+
# 3. Generate full spec (research → requirements → design → tasks)
|
|
88
|
+
/curdx-flow:spec
|
|
89
|
+
|
|
90
|
+
# 4. Execute (auto-picks best strategy)
|
|
91
|
+
/curdx-flow:implement
|
|
92
|
+
|
|
93
|
+
# 5. Verify + review
|
|
94
|
+
/curdx-flow:verify
|
|
95
|
+
/curdx-flow:review
|
|
96
|
+
|
|
97
|
+
# Done. git push.
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
For more scenarios (brownfield, epic, fast, UI-heavy), see [`docs/workflows.md`](./docs/workflows.md).
|
|
101
|
+
|
|
102
|
+
## Five Pillars
|
|
103
|
+
|
|
104
|
+
1. **Mind (L1 baseline)** — Karpathy 4 principles + mandatory tool rules + 3 red lines
|
|
105
|
+
2. **Spec** — Research → Requirements → Design → Tasks (scalable, 4-file lite to 12-file enterprise)
|
|
106
|
+
3. **Agents** — 15 functional + 9 persona (Mary / John / Winston / ...)
|
|
107
|
+
4. **Flow** — 4 execution strategies, auto-routed
|
|
108
|
+
5. **Memory** — claude-mem (implicit) + `.flow/STATE.md` (explicit decisions as D-NN)
|
|
109
|
+
|
|
110
|
+
See [`docs/ethos.md`](./docs/ethos.md) for design philosophy.
|
|
111
|
+
|
|
112
|
+
## Documentation
|
|
113
|
+
|
|
114
|
+
| Doc | When to read |
|
|
115
|
+
|-----|--------------|
|
|
116
|
+
| [`docs/getting-started.md`](./docs/getting-started.md) | First time, 5-minute walkthrough |
|
|
117
|
+
| [`docs/command-reference.md`](./docs/command-reference.md) | All 31 commands with usage |
|
|
118
|
+
| [`docs/agent-reference.md`](./docs/agent-reference.md) | All 24 agents + personas |
|
|
119
|
+
| [`docs/workflows.md`](./docs/workflows.md) | 5 typical scenarios (greenfield/brownfield/epic/fast/UI) |
|
|
120
|
+
| [`docs/architecture.md`](./docs/architecture.md) | Internal design for extenders |
|
|
121
|
+
| [`docs/ethos.md`](./docs/ethos.md) | Why it's built this way |
|
|
122
|
+
| [`docs/troubleshoot.md`](./docs/troubleshoot.md) | Fix common problems |
|
|
123
|
+
|
|
124
|
+
## What's Not Here (Yet)
|
|
125
|
+
|
|
126
|
+
**Intentionally skipped in v1.0**:
|
|
127
|
+
- **Phase 6** (ship / land / canary / retro) — Low ROI for private-repo use cases. Future release if community asks.
|
|
128
|
+
- **Integration checker** — For Epic cross-spec validation. Manual for now.
|
|
129
|
+
- **Checkpoint save/restore** — Current `.flow/STATE.md` covers most needs.
|
|
130
|
+
- **Multi-runtime support** — Claude Code only. Other tools later if their plugin API matures.
|
|
131
|
+
|
|
132
|
+
See [`CHANGELOG.md`](./CHANGELOG.md) for full version history.
|
|
133
|
+
|
|
134
|
+
## Credits
|
|
135
|
+
|
|
136
|
+
CurDX-Flow is a distillation, not an invention. Deeply indebted to:
|
|
137
|
+
|
|
138
|
+
- [**andrej-karpathy-skills**](https://github.com/forrestchang/andrej-karpathy-skills) — the 4 principles
|
|
139
|
+
- [**smart-ralph**](https://github.com/Nibzard/smart-ralph) — spec engine + stop-hook loops
|
|
140
|
+
- [**superpowers**](https://github.com/obra/superpowers) — subagent discipline + TDD + two-stage review
|
|
141
|
+
- [**BMAD-METHOD**](https://github.com/bmad-code-org/BMAD-METHOD) — personas + party mode + adversarial review
|
|
142
|
+
- [**get-shit-done**](https://github.com/ryangentry/get-shit-done) — wave execution + decision locking + multi-source audit
|
|
143
|
+
- [**gstack**](https://github.com/garrytan/gstack) (Garry Tan) — planning reviews + DX philosophy
|
|
144
|
+
- [**pua**](https://github.com/tanweai/pua) — persistence + 3 red lines
|
|
145
|
+
- [**claude-mem**](https://github.com/thedotmack/claude-mem) — automatic cross-session memory
|
|
146
|
+
- [**frontend-design skill**](https://claude.ai/skills/frontend-design) — distinctive UI (Anthropic official)
|
|
147
|
+
- **context7** (Upstash) + **sequential-thinking** (Anthropic) + **chrome-devtools-mcp** (Chrome team)
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
MIT. See [`LICENSE`](./LICENSE).
|
|
152
|
+
|
|
153
|
+
## Contributing
|
|
154
|
+
|
|
155
|
+
- Issues: https://github.com/wdx/curdx-flow/issues
|
|
156
|
+
- PRs welcome but please walk through `/curdx-flow:spec` yourself first (eat your own dogfood)
|
|
157
|
+
- Code of conduct: be kind + specific + don't rage at the LLM
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
_CurDX = "Current Developer eXperience" in the AI-coding era._
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# CurDX-Flow
|
|
2
|
+
|
|
3
|
+
> **Claude Code 的 AI 工程工作流元框架**
|
|
4
|
+
> 把 Claude Code 变成有工程纪律的 AI 团队 — 编排 MCP 和插件,强制 Karpathy 4 原则,用规格驱动工作流交付高质量软件。
|
|
5
|
+
|
|
6
|
+
[](./CHANGELOG.md)
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
[](https://code.claude.com)
|
|
9
|
+
[](./README.md)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 是什么
|
|
14
|
+
|
|
15
|
+
CurDX-Flow 是一个 Claude Code 插件,把 6 个验证过的 AI 工程工作流(Karpathy guidelines / BMAD / get-shit-done / gstack / smart-ralph / superpowers)蒸馏成一个可组合系统,然后把基础设施委托给专业的第三方插件(context7 / sequential-thinking / chrome-devtools / claude-mem / pua / frontend-design)。
|
|
16
|
+
|
|
17
|
+
**不重造轮子。编排好轮子。**
|
|
18
|
+
|
|
19
|
+
## 一览(v1.1.0)
|
|
20
|
+
|
|
21
|
+
- **31 个命令** — 初始化 / 研究 / 设计 / 执行 / 验证 / 审查 / 调试 / QA / 安全 / ...
|
|
22
|
+
- **24 个代理** — 15 职能 + 9 人格(Mary / John / Winston / Amelia / Rachel / David / Oliver / Serena / Emma)
|
|
23
|
+
- **8 个可组合 Gate** — Karpathy / Verification / TDD / Coverage / Adversarial / Edge-Case / Security / DevEx
|
|
24
|
+
- **4 种执行策略** — linear / subagent / stop-hook / wave(自动路由)
|
|
25
|
+
- **10 个知识文档** — 规格驱动 / POC-First / 原子提交 / 执行策略 / ...
|
|
26
|
+
- **5 个 hook 事件** — SessionStart / InstructionsLoaded / Stop / PreToolUse / PostToolUseFailure
|
|
27
|
+
- **3 个自动安装的 MCP** — context7 / sequential-thinking / chrome-devtools
|
|
28
|
+
- **优雅降级** — 依赖缺失时进入 fallback 模式并清晰告知
|
|
29
|
+
|
|
30
|
+
## 为什么用
|
|
31
|
+
|
|
32
|
+
现有 AI 编程工作流常见问题:
|
|
33
|
+
|
|
34
|
+
| 问题 | CurDX-Flow 的答案 |
|
|
35
|
+
|-----|-----------------|
|
|
36
|
+
| 上下文腐烂(长会话质量下降) | Subagent 隔离 + stop-hook 循环 + claude-mem |
|
|
37
|
+
| 无工程纪律(AI 跳步、幻觉) | Karpathy L1 + verification-gate + TDD-gate |
|
|
38
|
+
| 最佳实践分散 | 6 个工作流蒸馏到一个元框架 |
|
|
39
|
+
| 验证薄弱(无证据声称"完成") | 目标反向验证 + 禁用词检测 |
|
|
40
|
+
| 单视角决策 | Party Mode(真正多代理,非角色扮演)+ 对抗审查 |
|
|
41
|
+
|
|
42
|
+
## 安装
|
|
43
|
+
|
|
44
|
+
### 从 marketplace(发布后)
|
|
45
|
+
```
|
|
46
|
+
/plugin marketplace add wdx/curdx-flow
|
|
47
|
+
/plugin install curdx-flow
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 本地 dev
|
|
51
|
+
```bash
|
|
52
|
+
git clone https://github.com/wdx/curdx-flow
|
|
53
|
+
claude --plugin-dir ./curdx-flow
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
3 个 MCP 自动装。然后运行:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
/curdx-flow:install-deps # 交互式安装 pua / claude-mem / frontend-design
|
|
60
|
+
/curdx-flow:doctor # 验证健康
|
|
61
|
+
/curdx-flow:init # 初始化你的项目
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
详细教程见 [`docs/getting-started.md`](./docs/getting-started.md)(5 分钟上手)。
|
|
65
|
+
|
|
66
|
+
## 快速开始
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# 1. 在你的项目
|
|
70
|
+
/curdx-flow:init
|
|
71
|
+
|
|
72
|
+
# 2. 启动一个功能
|
|
73
|
+
/curdx-flow:start jwt-auth "给 REST API 加 JWT 认证"
|
|
74
|
+
|
|
75
|
+
# 3. 生成完整规格(研究 → 需求 → 设计 → 任务)
|
|
76
|
+
/curdx-flow:spec
|
|
77
|
+
|
|
78
|
+
# 4. 执行(自动选最佳策略)
|
|
79
|
+
/curdx-flow:implement
|
|
80
|
+
|
|
81
|
+
# 5. 验证 + 审查
|
|
82
|
+
/curdx-flow:verify
|
|
83
|
+
/curdx-flow:review
|
|
84
|
+
|
|
85
|
+
# 完成。git push.
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
更多场景(棕地 / Epic / Fast / UI 重)见 [`docs/workflows.md`](./docs/workflows.md)。
|
|
89
|
+
|
|
90
|
+
## 五根支柱
|
|
91
|
+
|
|
92
|
+
1. **Mind(L1 基线)** — Karpathy 4 原则 + 必用工具规则 + 三条红线
|
|
93
|
+
2. **Spec(规格)** — 研究 → 需求 → 设计 → 任务(可伸缩,4 文件 lite 到 12 文件 enterprise)
|
|
94
|
+
3. **Agents(代理)** — 15 职能 + 9 人格(Mary / John / Winston / ...)
|
|
95
|
+
4. **Flow(流程)** — 4 种执行策略,自动路由
|
|
96
|
+
5. **Memory(记忆)** — claude-mem(隐式)+ `.flow/STATE.md`(显式决策 D-NN)
|
|
97
|
+
|
|
98
|
+
设计哲学详见 [`docs/ethos.md`](./docs/ethos.md)。
|
|
99
|
+
|
|
100
|
+
## 文档
|
|
101
|
+
|
|
102
|
+
| 文档 | 何时读 |
|
|
103
|
+
|-----|------|
|
|
104
|
+
| [`docs/getting-started.md`](./docs/getting-started.md) | 首次使用,5 分钟上手 |
|
|
105
|
+
| [`docs/command-reference.md`](./docs/command-reference.md) | 31 个命令完整参考 |
|
|
106
|
+
| [`docs/agent-reference.md`](./docs/agent-reference.md) | 24 个代理 + 人格 |
|
|
107
|
+
| [`docs/workflows.md`](./docs/workflows.md) | 5 种典型场景(greenfield/brownfield/epic/fast/UI) |
|
|
108
|
+
| [`docs/architecture.md`](./docs/architecture.md) | 内部设计(给扩展者) |
|
|
109
|
+
| [`docs/ethos.md`](./docs/ethos.md) | 设计决策的理由 |
|
|
110
|
+
| [`docs/troubleshoot.md`](./docs/troubleshoot.md) | 故障排查 |
|
|
111
|
+
|
|
112
|
+
## 当前不做的(故意)
|
|
113
|
+
|
|
114
|
+
**v1.0 故意跳过**:
|
|
115
|
+
- **Phase 6**(ship / land / canary / retro) — 私有仓库场景 ROI 低。未来社区反馈需要再补。
|
|
116
|
+
- **集成检查代理** — Epic 跨子规格验证。暂时手动。
|
|
117
|
+
- **Checkpoint save/restore** — 当前 `.flow/STATE.md` 覆盖多数需求。
|
|
118
|
+
- **多运行时支持** — 仅 Claude Code。其他工具的插件 API 成熟后再考虑。
|
|
119
|
+
|
|
120
|
+
完整版本历史见 [`CHANGELOG.md`](./CHANGELOG.md)。
|
|
121
|
+
|
|
122
|
+
## 致谢
|
|
123
|
+
|
|
124
|
+
CurDX-Flow 是蒸馏,不是原创。深深致谢:
|
|
125
|
+
|
|
126
|
+
- [**andrej-karpathy-skills**](https://github.com/forrestchang/andrej-karpathy-skills) — 4 原则
|
|
127
|
+
- [**smart-ralph**](https://github.com/Nibzard/smart-ralph) — 规格引擎 + stop-hook 循环
|
|
128
|
+
- [**superpowers**](https://github.com/obra/superpowers) — Subagent 纪律 + TDD + 两阶段审查
|
|
129
|
+
- [**BMAD-METHOD**](https://github.com/bmad-code-org/BMAD-METHOD) — 人格 + Party Mode + 对抗审查
|
|
130
|
+
- [**get-shit-done**](https://github.com/ryangentry/get-shit-done) — 波形执行 + 决策锁定 + 多源审计
|
|
131
|
+
- [**gstack**](https://github.com/garrytan/gstack)(Garry Tan) — 规划审查 + DX 哲学
|
|
132
|
+
- [**pua**](https://github.com/tanweai/pua) — 持续性 + 三条红线
|
|
133
|
+
- [**claude-mem**](https://github.com/thedotmack/claude-mem) — 自动跨会话记忆
|
|
134
|
+
- [**frontend-design skill**](https://claude.ai/skills/frontend-design) — distinctive UI(Anthropic 官方)
|
|
135
|
+
- **context7**(Upstash)+ **sequential-thinking**(Anthropic)+ **chrome-devtools-mcp**(Chrome 团队)
|
|
136
|
+
|
|
137
|
+
## 许可
|
|
138
|
+
|
|
139
|
+
MIT。见 [`LICENSE`](./LICENSE)。
|
|
140
|
+
|
|
141
|
+
## 贡献
|
|
142
|
+
|
|
143
|
+
- Issues: https://github.com/wdx/curdx-flow/issues
|
|
144
|
+
- 欢迎 PR,但请先用 `/curdx-flow:spec` 自己走一遍(吃自己的狗粮)
|
|
145
|
+
- 社区准则:友善 + 具体 + 不对着 LLM 发火
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
_CurDX = AI 编程时代的 "Current Developer eXperience"。_
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* curdx-flow CLI entry
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* npx github:curdx/curdx-flow <command> [args]
|
|
7
|
+
* (or after npm publish: npx @curdx/flow <command> [args])
|
|
8
|
+
*
|
|
9
|
+
* Commands:
|
|
10
|
+
* install Install curdx-flow plugin + optional recommended plugins
|
|
11
|
+
* doctor Check health (claude CLI, plugin, MCPs, recommended plugins)
|
|
12
|
+
* init Initialize .flow/ in current project (external version)
|
|
13
|
+
* upgrade Update curdx-flow + recommended plugins to latest
|
|
14
|
+
* help Show this help
|
|
15
|
+
* --version / -v
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { install } from "../cli/install.js";
|
|
19
|
+
import { doctor } from "../cli/doctor.js";
|
|
20
|
+
import { init } from "../cli/init.js";
|
|
21
|
+
import { upgrade } from "../cli/upgrade.js";
|
|
22
|
+
import { uninstall } from "../cli/uninstall.js";
|
|
23
|
+
import { VERSION, color } from "../cli/utils.js";
|
|
24
|
+
|
|
25
|
+
const args = process.argv.slice(2);
|
|
26
|
+
const cmd = args[0];
|
|
27
|
+
const rest = args.slice(1);
|
|
28
|
+
|
|
29
|
+
function printHelp() {
|
|
30
|
+
console.log(`
|
|
31
|
+
${color.bold("curdx-flow")} ${color.dim(`v${VERSION}`)}
|
|
32
|
+
CurDX-Flow installer & helper for Claude Code
|
|
33
|
+
|
|
34
|
+
${color.bold("USAGE")}
|
|
35
|
+
curdx-flow <command> [options]
|
|
36
|
+
|
|
37
|
+
${color.bold("COMMANDS")}
|
|
38
|
+
${color.cyan("install")} Install curdx-flow plugin + optional recommended plugins
|
|
39
|
+
--all Install all recommended (skip prompt)
|
|
40
|
+
--no-deps Only install curdx-flow, skip recommendations
|
|
41
|
+
|
|
42
|
+
${color.cyan("doctor")} Check health (claude CLI, plugin, MCPs, recommended)
|
|
43
|
+
|
|
44
|
+
${color.cyan("init")} Initialize .flow/ in current project (no Claude Code needed)
|
|
45
|
+
[path] Target directory (default: cwd)
|
|
46
|
+
--force Overwrite existing .flow/
|
|
47
|
+
|
|
48
|
+
${color.cyan("upgrade")} Update curdx-flow and recommended plugins to latest
|
|
49
|
+
|
|
50
|
+
${color.cyan("uninstall")} Remove curdx-flow plugin (and optionally recommended / artifacts)
|
|
51
|
+
-y, --yes Skip confirmation, keep recommended + .flow/
|
|
52
|
+
--keep-recommended Don't ask about pua/claude-mem/frontend-design
|
|
53
|
+
--purge Also remove ~/.local/bin/bun, ~/.local/bin/uv symlinks
|
|
54
|
+
|
|
55
|
+
${color.cyan("help")} Show this help (same as --help / -h)
|
|
56
|
+
|
|
57
|
+
${color.bold("OPTIONS")}
|
|
58
|
+
-v, --version Print version
|
|
59
|
+
-h, --help Show help
|
|
60
|
+
|
|
61
|
+
${color.bold("EXAMPLES")}
|
|
62
|
+
${color.dim("# First-time install with recommended plugins")}
|
|
63
|
+
npx github:curdx/curdx-flow install --all
|
|
64
|
+
|
|
65
|
+
${color.dim("# Check what's installed")}
|
|
66
|
+
npx github:curdx/curdx-flow doctor
|
|
67
|
+
|
|
68
|
+
${color.dim("# Initialize your project")}
|
|
69
|
+
cd ~/my-project && npx github:curdx/curdx-flow init
|
|
70
|
+
|
|
71
|
+
${color.dim("# Update everything")}
|
|
72
|
+
npx github:curdx/curdx-flow upgrade
|
|
73
|
+
|
|
74
|
+
${color.bold("LEARN MORE")}
|
|
75
|
+
https://github.com/curdx/curdx-flow
|
|
76
|
+
`);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async function main() {
|
|
80
|
+
// Version flags
|
|
81
|
+
if (cmd === "--version" || cmd === "-v") {
|
|
82
|
+
console.log(VERSION);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Help flags
|
|
87
|
+
if (!cmd || cmd === "help" || cmd === "--help" || cmd === "-h") {
|
|
88
|
+
printHelp();
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Route
|
|
93
|
+
try {
|
|
94
|
+
switch (cmd) {
|
|
95
|
+
case "install":
|
|
96
|
+
await install(rest);
|
|
97
|
+
break;
|
|
98
|
+
case "doctor":
|
|
99
|
+
await doctor(rest);
|
|
100
|
+
break;
|
|
101
|
+
case "init":
|
|
102
|
+
await init(rest);
|
|
103
|
+
break;
|
|
104
|
+
case "upgrade":
|
|
105
|
+
await upgrade(rest);
|
|
106
|
+
break;
|
|
107
|
+
case "uninstall":
|
|
108
|
+
case "remove":
|
|
109
|
+
await uninstall(rest);
|
|
110
|
+
break;
|
|
111
|
+
default:
|
|
112
|
+
console.error(color.red(`Unknown command: ${cmd}`));
|
|
113
|
+
console.error(`Run ${color.cyan("curdx-flow help")} for usage.`);
|
|
114
|
+
process.exit(1);
|
|
115
|
+
}
|
|
116
|
+
} catch (err) {
|
|
117
|
+
console.error(color.red(`\n✗ ${err.message || err}`));
|
|
118
|
+
if (process.env.CURDX_DEBUG) {
|
|
119
|
+
console.error(err.stack || "");
|
|
120
|
+
}
|
|
121
|
+
process.exit(1);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
main();
|
package/cli/README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# curdx-flow CLI
|
|
2
|
+
|
|
3
|
+
One-shot installer + external diagnostics + external init. Zero npm deps, pure Node.js.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Interactive install (pick recommended plugins)
|
|
9
|
+
npx github:curdx/curdx-flow install
|
|
10
|
+
|
|
11
|
+
# Or install everything automatically
|
|
12
|
+
npx github:curdx/curdx-flow install --all
|
|
13
|
+
|
|
14
|
+
# Health check
|
|
15
|
+
npx github:curdx/curdx-flow doctor
|
|
16
|
+
|
|
17
|
+
# Initialize a project (creates .flow/ in cwd)
|
|
18
|
+
cd ~/your-project
|
|
19
|
+
npx github:curdx/curdx-flow init
|
|
20
|
+
|
|
21
|
+
# Update all plugins
|
|
22
|
+
npx github:curdx/curdx-flow upgrade
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Commands
|
|
26
|
+
|
|
27
|
+
### `install [--all] [--no-deps]`
|
|
28
|
+
|
|
29
|
+
Steps:
|
|
30
|
+
1. Verify the `claude` CLI is installed
|
|
31
|
+
2. `claude plugin marketplace add curdx/curdx-flow`
|
|
32
|
+
3. `claude plugin install curdx-flow@curdx-flow-marketplace` (auto-installs 3 MCPs)
|
|
33
|
+
4. Interactively (or automatically) install recommended plugins: **pua**, **claude-mem**, **frontend-design**
|
|
34
|
+
|
|
35
|
+
| Flag | Purpose |
|
|
36
|
+
|------|---------|
|
|
37
|
+
| `--all` | Install all recommended plugins, no prompt |
|
|
38
|
+
| `--no-deps` | Install only curdx-flow itself |
|
|
39
|
+
|
|
40
|
+
### `doctor [--verbose]`
|
|
41
|
+
|
|
42
|
+
External diagnostics: claude CLI / curdx-flow / 3 MCPs / 3 recommended plugins / current directory `.flow/` state.
|
|
43
|
+
|
|
44
|
+
### `init [path] [--force]`
|
|
45
|
+
|
|
46
|
+
In `path` (default cwd) creates `.flow/` directory: PROJECT.md / CONTEXT.md / STATE.md / ROADMAP.md / config.json + updates `.gitignore`.
|
|
47
|
+
|
|
48
|
+
If the curdx-flow plugin is installed, reads templates from the plugin cache; otherwise uses embedded fallback templates.
|
|
49
|
+
|
|
50
|
+
### `upgrade`
|
|
51
|
+
|
|
52
|
+
`claude plugin marketplace update` + `claude plugin update` for every installed curdx-flow-related plugin.
|
|
53
|
+
|
|
54
|
+
### `uninstall [-y] [--keep-recommended] [--purge]`
|
|
55
|
+
|
|
56
|
+
Inverse of `install`. By default removes only the curdx-flow plugin. With `--purge`, also removes the `~/.local/bin/bun` and `~/.local/bin/uv` symlinks created by install.
|
|
57
|
+
|
|
58
|
+
## Why a CLI?
|
|
59
|
+
|
|
60
|
+
The **core workflow** still lives inside Claude Code (`/curdx-flow:*` commands). The CLI provides:
|
|
61
|
+
|
|
62
|
+
- **One-line install**: Docker/CI friendly (`RUN npx github:curdx/curdx-flow install --all`)
|
|
63
|
+
- **External diagnostics**: check health without entering Claude Code
|
|
64
|
+
- **Batch deployment**: write a script for your team — `for host in ...; do ssh $host npx github:curdx/curdx-flow install; done`
|
|
65
|
+
|
|
66
|
+
## Zero-dependency design
|
|
67
|
+
|
|
68
|
+
- Pure ES Modules (Node 18+)
|
|
69
|
+
- Only Node built-ins (`child_process`, `fs/promises`, `readline`)
|
|
70
|
+
- No `chalk` / `commander` / `inquirer` / `execa`
|
|
71
|
+
- Fast `npx` (no `node_modules` to download)
|
|
72
|
+
|
|
73
|
+
## Local development
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# clone
|
|
77
|
+
git clone https://github.com/curdx/curdx-flow
|
|
78
|
+
cd curdx-flow
|
|
79
|
+
|
|
80
|
+
# run directly
|
|
81
|
+
node bin/curdx-flow.js --help
|
|
82
|
+
node bin/curdx-flow.js doctor
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## License
|
|
86
|
+
|
|
87
|
+
MIT
|