skill-flow 1.0.0

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.
Files changed (87) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +108 -0
  3. package/README.zh.md +108 -0
  4. package/dist/adapters/channel-adapters.d.ts +8 -0
  5. package/dist/adapters/channel-adapters.js +56 -0
  6. package/dist/adapters/channel-adapters.js.map +1 -0
  7. package/dist/cli.d.ts +2 -0
  8. package/dist/cli.js +118 -0
  9. package/dist/cli.js.map +1 -0
  10. package/dist/domain/types.d.ts +133 -0
  11. package/dist/domain/types.js +2 -0
  12. package/dist/domain/types.js.map +1 -0
  13. package/dist/services/deployment-applier.d.ts +6 -0
  14. package/dist/services/deployment-applier.js +54 -0
  15. package/dist/services/deployment-applier.js.map +1 -0
  16. package/dist/services/deployment-planner.d.ts +11 -0
  17. package/dist/services/deployment-planner.js +179 -0
  18. package/dist/services/deployment-planner.js.map +1 -0
  19. package/dist/services/doctor-service.d.ts +5 -0
  20. package/dist/services/doctor-service.js +129 -0
  21. package/dist/services/doctor-service.js.map +1 -0
  22. package/dist/services/inventory-service.d.ts +14 -0
  23. package/dist/services/inventory-service.js +186 -0
  24. package/dist/services/inventory-service.js.map +1 -0
  25. package/dist/services/skill-flow.d.ts +60 -0
  26. package/dist/services/skill-flow.js +260 -0
  27. package/dist/services/skill-flow.js.map +1 -0
  28. package/dist/services/source-service.d.ts +35 -0
  29. package/dist/services/source-service.js +270 -0
  30. package/dist/services/source-service.js.map +1 -0
  31. package/dist/services/workflow-service.d.ts +5 -0
  32. package/dist/services/workflow-service.js +32 -0
  33. package/dist/services/workflow-service.js.map +1 -0
  34. package/dist/state/store.d.ts +14 -0
  35. package/dist/state/store.js +59 -0
  36. package/dist/state/store.js.map +1 -0
  37. package/dist/tests/skill-flow.test.d.ts +1 -0
  38. package/dist/tests/skill-flow.test.js +926 -0
  39. package/dist/tests/skill-flow.test.js.map +1 -0
  40. package/dist/tui/config-app.d.ts +47 -0
  41. package/dist/tui/config-app.js +732 -0
  42. package/dist/tui/config-app.js.map +1 -0
  43. package/dist/tui/selection-state.d.ts +8 -0
  44. package/dist/tui/selection-state.js +32 -0
  45. package/dist/tui/selection-state.js.map +1 -0
  46. package/dist/utils/constants.d.ts +19 -0
  47. package/dist/utils/constants.js +164 -0
  48. package/dist/utils/constants.js.map +1 -0
  49. package/dist/utils/format.d.ts +6 -0
  50. package/dist/utils/format.js +45 -0
  51. package/dist/utils/format.js.map +1 -0
  52. package/dist/utils/fs.d.ts +10 -0
  53. package/dist/utils/fs.js +89 -0
  54. package/dist/utils/fs.js.map +1 -0
  55. package/dist/utils/git.d.ts +3 -0
  56. package/dist/utils/git.js +12 -0
  57. package/dist/utils/git.js.map +1 -0
  58. package/dist/utils/result.d.ts +4 -0
  59. package/dist/utils/result.js +15 -0
  60. package/dist/utils/result.js.map +1 -0
  61. package/dist/utils/source-id.d.ts +2 -0
  62. package/dist/utils/source-id.js +16 -0
  63. package/dist/utils/source-id.js.map +1 -0
  64. package/img/img-1.jpg +0 -0
  65. package/package.json +39 -0
  66. package/src/adapters/channel-adapters.ts +75 -0
  67. package/src/cli.tsx +147 -0
  68. package/src/domain/types.ts +175 -0
  69. package/src/services/deployment-applier.ts +81 -0
  70. package/src/services/deployment-planner.ts +259 -0
  71. package/src/services/doctor-service.ts +156 -0
  72. package/src/services/inventory-service.ts +251 -0
  73. package/src/services/skill-flow.ts +381 -0
  74. package/src/services/source-service.ts +427 -0
  75. package/src/services/workflow-service.ts +56 -0
  76. package/src/state/store.ts +68 -0
  77. package/src/tests/skill-flow.test.ts +1184 -0
  78. package/src/tui/config-app.tsx +1094 -0
  79. package/src/tui/selection-state.ts +45 -0
  80. package/src/utils/constants.ts +201 -0
  81. package/src/utils/format.ts +59 -0
  82. package/src/utils/fs.ts +102 -0
  83. package/src/utils/git.ts +16 -0
  84. package/src/utils/result.ts +23 -0
  85. package/src/utils/source-id.ts +19 -0
  86. package/tsconfig.json +22 -0
  87. package/vitest.config.ts +8 -0
package/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by the Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding any notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf of
171
+ any other Contributor, and only if You agree to indemnify, defend,
172
+ and hold each Contributor harmless for any liability incurred by, or
173
+ claims asserted against, such Contributor by reason of your accepting
174
+ any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 VintLin
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,108 @@
1
+ # Skill Flow
2
+
3
+ > **Workflow-first management for AI agent skills.**
4
+ > Grouped workflows · Multi-target projection · Explicit state · Drift diagnosis
5
+
6
+ ![img](img/img-1.jpg)
7
+
8
+ [中文文档](./README.zh.md)
9
+
10
+ [![Node.js Version](https://img.shields.io/node/v/skill-flow?style=flat-square)](https://nodejs.org)
11
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square)](./LICENSE)
12
+
13
+ As your AI agent skills grow, management becomes chaotic: one Git source contains multiple related skills, projections scatter across different agents, updates and troubleshooting become difficult.
14
+
15
+ `skill-flow` reorganizes skill management around workflows: add skill groups from Git sources, select projection targets, update uniformly, diagnose drift. Keep skill management clear, controlled, and efficient.
16
+
17
+ ## Key Features
18
+
19
+ **Workflow-Based Grouping**
20
+ One Git source = one workflow group. Related skills stay together, updates and maintenance happen at the workflow level.
21
+
22
+ **Multi-Target Projection**
23
+ Configure once, project to multiple agents (Claude Code, Cursor, Windsurf, and 13+ targets).
24
+
25
+ **Interactive Terminal UI**
26
+ Intuitive TUI: view groups → select skills → choose targets → save configuration.
27
+
28
+ **Explicit State Tracking**
29
+ `manifest.json` records your intent, `lock.json` records actual deployment state. Clear and queryable.
30
+
31
+ **Health Diagnosis**
32
+ `doctor` command detects broken links, drift, and conflicts with precision.
33
+
34
+ ## Installation
35
+
36
+ Requires Node.js >= 20, currently optimized for macOS.
37
+
38
+ ```bash
39
+ git clone https://github.com/VintLin/skill-manager.git
40
+ cd skill-manager
41
+ npm install
42
+ npm run build
43
+ npm link # Optional: global install
44
+ ```
45
+
46
+ ## Quick Start
47
+
48
+ ```bash
49
+ # Add a skill source
50
+ skill-flow add /path/to/skills-repo
51
+
52
+ # View workflow groups
53
+ skill-flow list
54
+
55
+ # Interactive configuration (select skills and targets)
56
+ skill-flow config
57
+
58
+ # Update all sources
59
+ skill-flow update --all
60
+
61
+ # Health check
62
+ skill-flow doctor
63
+
64
+ # Remove a workflow group
65
+ skill-flow uninstall my-source-id
66
+ ```
67
+
68
+ ## Command Reference
69
+
70
+ | Command | Description |
71
+ |---|---|
72
+ | `add <source>` | Add Git source (supports local path, `owner/repo`, https/ssh URL) |
73
+ | `list` | Show workflow groups |
74
+ | `config` | Open interactive configuration UI |
75
+ | `update [sourceId] --all` | Update sources and re-project |
76
+ | `doctor` | Diagnose projection health |
77
+ | `uninstall <sourceIds...>` | Remove workflow groups and projections |
78
+
79
+ ## How It Works
80
+
81
+ **State Management**
82
+ - `~/.skillflow/manifest.json` - Your configuration intent
83
+ - `~/.skillflow/lock.json` - Actual deployment state
84
+ - `~/.skillflow/source/git/<source-id>/` - Git source cache
85
+
86
+ **Projection Strategy**
87
+ Symlinks preferred, file copies when necessary. Target directories are projections only; true state managed by lock.json.
88
+
89
+ ## Supported Agents
90
+
91
+ Claude Code · Codex · Cursor · GitHub Copilot · Gemini CLI · OpenCode · OpenClaw · Pi · Windsurf · Roo Code · Cline · Amp · Kiro
92
+
93
+ Customize target paths via environment variables (e.g., `SKILL_FLOW_TARGET_CLAUDE_CODE`).
94
+
95
+ ## Development
96
+
97
+ ```bash
98
+ npm install
99
+ npm run dev # Development mode
100
+ npm run build # Build
101
+ npm test # Run tests
102
+ ```
103
+
104
+ Tech stack: TypeScript + Vitest + Ink TUI
105
+
106
+ ## License
107
+
108
+ Apache License 2.0. See [LICENSE](./LICENSE).
package/README.zh.md ADDED
@@ -0,0 +1,108 @@
1
+ # Skill Flow
2
+
3
+ > **让 AI 技能管理回归工作流本质。**
4
+ > 工作流分组 · 多目标投影 · 显式状态 · 漂移诊断
5
+
6
+ ![img](img/img-1.jpg)
7
+
8
+ [English](./README.md)
9
+
10
+ [![Node.js Version](https://img.shields.io/node/v/skill-flow?style=flat-square)](https://nodejs.org)
11
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square)](./LICENSE)
12
+
13
+ 当你的 AI agent 技能越装越多,管理就会变得混乱:一个 Git 源包含多个相关技能,投影到不同 agent 后结构被打散,更新和排障变得困难。
14
+
15
+ `skill-flow` 用工作流视角重新组织技能管理:从 Git 源添加技能组,选择投影目标,统一更新,诊断漂移。让技能管理清晰、可控、高效。
16
+
17
+ ## 核心特性
18
+
19
+ **工作流分组管理**
20
+ 一个 Git 源 = 一个工作流组。相关技能保持在一起,更新和维护以工作流为单位进行。
21
+
22
+ **多目标投影**
23
+ 一次配置,投影到多个 agent(Claude Code、Cursor、Windsurf 等 13+ 目标)。
24
+
25
+ **交互式终端 UI**
26
+ 直观的 TUI 界面:查看分组 → 选择技能 → 选择目标 → 保存配置。
27
+
28
+ **显式状态追踪**
29
+ `manifest.json` 记录你的意图,`lock.json` 记录实际部署状态。状态清晰可查。
30
+
31
+ **健康诊断**
32
+ `doctor` 命令检测断链、漂移、冲突,精准定位问题。
33
+
34
+ ## 安装
35
+
36
+ 需要 Node.js >= 20,当前版本针对 macOS 优化。
37
+
38
+ ```bash
39
+ git clone https://github.com/VintLin/skill-manager.git
40
+ cd skill-manager
41
+ npm install
42
+ npm run build
43
+ npm link # 可选:全局安装
44
+ ```
45
+
46
+ ## 快速开始
47
+
48
+ ```bash
49
+ # 添加技能源
50
+ skill-flow add /path/to/skills-repo
51
+
52
+ # 查看工作流分组
53
+ skill-flow list
54
+
55
+ # 交互式配置(选择技能和目标)
56
+ skill-flow config
57
+
58
+ # 更新所有源
59
+ skill-flow update --all
60
+
61
+ # 健康检查
62
+ skill-flow doctor
63
+
64
+ # 移除工作流组
65
+ skill-flow uninstall my-source-id
66
+ ```
67
+
68
+ ## 命令参考
69
+
70
+ | 命令 | 说明 |
71
+ |---|---|
72
+ | `add <source>` | 添加 Git 源(支持本地路径、`owner/repo`、https/ssh URL) |
73
+ | `list` | 显示工作流分组 |
74
+ | `config` | 打开交互式配置界面 |
75
+ | `update [sourceId] --all` | 更新源并重新投影 |
76
+ | `doctor` | 诊断投影健康状态 |
77
+ | `uninstall <sourceIds...>` | 移除工作流组及其投影 |
78
+
79
+ ## 工作原理
80
+
81
+ **状态管理**
82
+ - `~/.skillflow/manifest.json` - 你的配置意图
83
+ - `~/.skillflow/lock.json` - 实际部署状态
84
+ - `~/.skillflow/source/git/<source-id>/` - Git 源缓存
85
+
86
+ **投影策略**
87
+ 优先使用符号链接,必要时使用文件复制。目标目录仅作为投影,真实状态由 lock.json 管理。
88
+
89
+ ## 支持的 Agent
90
+
91
+ Claude Code · Codex · Cursor · GitHub Copilot · Gemini CLI · OpenCode · OpenClaw · Pi · Windsurf · Roo Code · Cline · Amp · Kiro
92
+
93
+ 可通过环境变量自定义目标路径(如 `SKILL_FLOW_TARGET_CLAUDE_CODE`)。
94
+
95
+ ## 开发
96
+
97
+ ```bash
98
+ npm install
99
+ npm run dev # 开发模式
100
+ npm run build # 构建
101
+ npm test # 运行测试
102
+ ```
103
+
104
+ 技术栈:TypeScript + Vitest + Ink TUI
105
+
106
+ ## 许可证
107
+
108
+ Apache License 2.0。见 [LICENSE](./LICENSE)。
@@ -0,0 +1,8 @@
1
+ import type { ChannelDetection, DeploymentStrategy, DeploymentTargetName } from "../domain/types.js";
2
+ export interface ChannelAdapter {
3
+ readonly target: DeploymentTargetName;
4
+ readonly strategy: DeploymentStrategy;
5
+ detect(): Promise<ChannelDetection>;
6
+ resolveTargetPath(rootPath: string, linkName: string): string;
7
+ }
8
+ export declare function createChannelAdapters(): ChannelAdapter[];
@@ -0,0 +1,56 @@
1
+ import path from "node:path";
2
+ import { TARGET_DEFINITIONS, } from "../utils/constants.js";
3
+ import { pathExists } from "../utils/fs.js";
4
+ class DefaultChannelAdapter {
5
+ target;
6
+ strategy;
7
+ constructor(target) {
8
+ this.target = target;
9
+ this.strategy = TARGET_DEFINITIONS[target].strategy;
10
+ }
11
+ async detect() {
12
+ const definition = TARGET_DEFINITIONS[this.target];
13
+ const envVar = definition.envVar;
14
+ const override = process.env[envVar];
15
+ const candidates = override ? [override] : definition.writeRootCandidates;
16
+ for (const candidate of candidates) {
17
+ const rootPath = path.resolve(candidate);
18
+ if (await pathExists(rootPath)) {
19
+ return {
20
+ target: this.target,
21
+ strategy: this.strategy,
22
+ available: true,
23
+ rootPath,
24
+ };
25
+ }
26
+ }
27
+ return {
28
+ target: this.target,
29
+ strategy: this.strategy,
30
+ available: false,
31
+ rootPath: path.resolve(candidates[0] ?? "."),
32
+ reason: `Target directory not found. Set ${envVar} or create the agent directory first.`,
33
+ };
34
+ }
35
+ resolveTargetPath(rootPath, linkName) {
36
+ return path.join(rootPath, linkName);
37
+ }
38
+ }
39
+ export function createChannelAdapters() {
40
+ return [
41
+ new DefaultChannelAdapter("claude-code"),
42
+ new DefaultChannelAdapter("codex"),
43
+ new DefaultChannelAdapter("cursor"),
44
+ new DefaultChannelAdapter("github-copilot"),
45
+ new DefaultChannelAdapter("gemini-cli"),
46
+ new DefaultChannelAdapter("opencode"),
47
+ new DefaultChannelAdapter("openclaw"),
48
+ new DefaultChannelAdapter("pi"),
49
+ new DefaultChannelAdapter("windsurf"),
50
+ new DefaultChannelAdapter("roo-code"),
51
+ new DefaultChannelAdapter("cline"),
52
+ new DefaultChannelAdapter("amp"),
53
+ new DefaultChannelAdapter("kiro"),
54
+ ];
55
+ }
56
+ //# sourceMappingURL=channel-adapters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel-adapters.js","sourceRoot":"","sources":["../../src/adapters/channel-adapters.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAO7B,OAAO,EACL,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAS5C,MAAM,qBAAqB;IAGJ;IAFZ,QAAQ,CAAqB;IAEtC,YAAqB,MAA4B;QAA5B,WAAM,GAAN,MAAM,CAAsB;QAC/C,IAAI,CAAC,QAAQ,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,MAAM;QACV,MAAM,UAAU,GAAG,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QACjC,MAAM,QAAQ,GAAG,OAAO,CAAC,G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,CAAC,UAAU,CAAC;QACrC,IAAI,qBAAqB,CAAC,UAAU,CAAC;QACrC,IAAI,qBAAqB,CAAC,OAAO,CAAC;QAClC,IAAI,qBAAqB,CAAC,KAAK,CAAC;QAChC,IAAI,qBAAqB,CAAC,MAAM,CAAC;KAClC,CAAC;AACJ,CAAC"}
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,118 @@
1
+ #!/usr/bin/env node
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Command } from "commander";
4
+ import { render } from "ink";
5
+ import { SkillFlowApp } from "./services/skill-flow.js";
6
+ import { ConfigApp } from "./tui/config-app.js";
7
+ import { formatDoctorIssue, formatWorkflowList } from "./utils/format.js";
8
+ const program = new Command();
9
+ const app = new SkillFlowApp();
10
+ program
11
+ .name("skill-flow")
12
+ .description("Workflow-first skill projection manager")
13
+ .version("1.0.0");
14
+ program
15
+ .command("add")
16
+ .argument("<source>", "Git source locator")
17
+ .action(async (source) => {
18
+ const result = await app.addSource(source);
19
+ if (!result.ok) {
20
+ printErrors(result.errors);
21
+ process.exitCode = 1;
22
+ return;
23
+ }
24
+ console.log(`Added ${result.data.manifest.id} with ${result.data.leafCount} valid skills.`);
25
+ printWarnings(result.warnings.map((warning) => warning.message));
26
+ });
27
+ program.command("list").action(async () => {
28
+ const result = await app.listWorkflows();
29
+ if (!result.ok) {
30
+ printErrors(result.errors);
31
+ process.exitCode = 1;
32
+ return;
33
+ }
34
+ console.log(formatWorkflowList(result.data.summaries));
35
+ });
36
+ program.command("config").action(async () => {
37
+ const result = await app.getConfigData();
38
+ if (!result.ok) {
39
+ printErrors(result.errors);
40
+ process.exitCode = 1;
41
+ return;
42
+ }
43
+ const initialDrafts = Object.fromEntries(result.data.summaries.map((summary) => {
44
+ const targets = summary.bindings.targets;
45
+ const enabledTargets = Object.entries(targets)
46
+ .filter(([, value]) => value?.enabled)
47
+ .map(([target]) => target);
48
+ const selectedLeafIds = [...new Set(enabledTargets.flatMap((target) => targets[target]?.leafIds ?? []))];
49
+ return [
50
+ summary.source.id,
51
+ {
52
+ enabledTargets,
53
+ selectedLeafIds,
54
+ },
55
+ ];
56
+ }));
57
+ const availableTargets = await app.getAvailableTargets();
58
+ const instance = render(_jsx(ConfigApp, { app: app, availableTargets: availableTargets, summaries: result.data.summaries, initialDrafts: initialDrafts }));
59
+ await instance.waitUntilExit();
60
+ });
61
+ program
62
+ .command("update")
63
+ .argument("[sourceId]", "Optional workflow group id")
64
+ .option("--all", "Update all registered workflow groups")
65
+ .action(async (sourceId, options) => {
66
+ const ids = options.all || !sourceId ? undefined : [sourceId];
67
+ const result = await app.updateSources(ids);
68
+ if (!result.ok) {
69
+ printErrors(result.errors);
70
+ process.exitCode = 1;
71
+ return;
72
+ }
73
+ for (const item of result.data.updated) {
74
+ console.log(`${item.sourceId} changed:${item.changed} +${item.addedLeafIds.length} -${item.removedLeafIds.length} invalidated:${item.invalidatedLeafIds.length}`);
75
+ }
76
+ printWarnings(result.warnings.map((warning) => warning.message));
77
+ });
78
+ program.command("doctor").action(async () => {
79
+ const result = await app.doctor();
80
+ if (!result.ok) {
81
+ printErrors(result.errors);
82
+ process.exitCode = 1;
83
+ return;
84
+ }
85
+ console.log(result.data.status);
86
+ if (result.data.issues.length === 0) {
87
+ console.log("No issues detected.");
88
+ return;
89
+ }
90
+ for (const issue of result.data.issues) {
91
+ console.log(formatDoctorIssue(issue));
92
+ }
93
+ });
94
+ program
95
+ .command("uninstall")
96
+ .argument("<sourceIds...>", "Workflow group ids to remove")
97
+ .action(async (sourceIds) => {
98
+ const result = await app.uninstall(sourceIds);
99
+ if (!result.ok) {
100
+ printErrors(result.errors);
101
+ process.exitCode = 1;
102
+ return;
103
+ }
104
+ console.log(`Removed: ${result.data.removed.join(", ")}`);
105
+ printWarnings(result.data.warnings);
106
+ });
107
+ await program.parseAsync(process.argv);
108
+ function printErrors(errors) {
109
+ for (const error of errors) {
110
+ console.error(error.message);
111
+ }
112
+ }
113
+ function printWarnings(messages) {
114
+ for (const message of messages) {
115
+ console.warn(`warning: ${message}`);
116
+ }
117
+ }
118
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.tsx"],"names":[],"mappings":";;AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAuB,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE/F,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAC9B,MAAM,GAAG,GAAG,IAAI,YAAY,EAAE,CAAC;AAE/B,OAAO;KACJ,IAAI,CAAC,YAAY,CAAC;KAClB,WAAW,CAAC,yCAAyC,CAAC;KACtD,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,KAAK,CAAC;KACd,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAAC;KAC1C,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;IAC/B,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC3B,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IACD,OAAO,CAAC,GAAG,CACT,SAAS,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,SAAS,gBAAgB,CAC/E,CAAC;IACF,aAAa,CAAC,MAAM,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