cli-blueprint 1.0.0 → 1.0.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/README.md +21 -150
- package/cli.mjs +226 -0
- package/package.json +11 -14
- package/skill/skill.json +7 -0
- package/LICENSE +0 -201
- package/install.mjs +0 -442
- package/skills/blueprint/install-meta.json +0 -7
- package/skills/blueprint/skill.json +0 -10
- package/skills/calctool/SKILL.md +0 -173
- package/skills/calctool/install-meta.json +0 -7
- package/skills/calctool/platform-template/README.md +0 -74
- package/skills/calctool/platform-template/index.html +0 -12
- package/skills/calctool/platform-template/package.json +0 -26
- package/skills/calctool/platform-template/src/App.tsx +0 -233
- package/skills/calctool/platform-template/src/authz.ts +0 -103
- package/skills/calctool/platform-template/src/engine/evaluate.ts +0 -114
- package/skills/calctool/platform-template/src/engine-definition.json +0 -195
- package/skills/calctool/platform-template/src/main.tsx +0 -13
- package/skills/calctool/platform-template/src/pipeline.ts +0 -80
- package/skills/calctool/platform-template/src/store.ts +0 -53
- package/skills/calctool/platform-template/tsconfig.json +0 -15
- package/skills/calctool/platform-template/vite.config.ts +0 -7
- package/skills/calctool/references/declarative-pages.md +0 -69
- package/skills/calctool/references/engine-meta-model.md +0 -123
- package/skills/calctool/references/finance-example.md +0 -132
- package/skills/calctool/references/formula-dsl.md +0 -92
- package/skills/calctool/references/import-ocr.md +0 -72
- package/skills/calctool/skill.json +0 -10
- package/skills/calctool/templates/ecommerce-ops/README.md +0 -27
- package/skills/calctool/templates/ecommerce-ops/domain-reference.yaml +0 -172
- package/skills/swarm/SKILL.md +0 -120
- package/skills/swarm/install-meta.json +0 -7
- package/skills/swarm/references/ops-heartbeat.md +0 -45
- package/skills/swarm/references/org-chart.md +0 -50
- package/skills/swarm/references/security-guard.md +0 -56
- package/skills/swarm/references/task-lifecycle.md +0 -53
- package/skills/swarm/references/traffic-light.md +0 -52
- package/skills/swarm/skill.json +0 -10
- package/skills/swarm/swarm-runtime.mjs +0 -600
- package/sources.json +0 -25
- /package/{skills/blueprint → skill}/SKILL.md +0 -0
package/README.md
CHANGED
|
@@ -1,166 +1,37 @@
|
|
|
1
|
-
#
|
|
1
|
+
# clitax-wvz6zmRWmX
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Install and run the Blueprint skill from [CLI.Tax](https://cli.tax/blueprint).
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npx
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
默认包含:
|
|
10
|
-
- `blueprint`(CLI.Tax 工程规划 skill,`https://cli.tax/wvz6zmRWmX`)
|
|
11
|
-
- `calctool`(万能计算工具生成器,`https://cli.tax/KKyA6xljUX`)
|
|
12
|
-
|
|
13
|
-
## 这是什么机制?
|
|
14
|
-
|
|
15
|
-
clitaxio 的本质只是从 `https://cli.tax/api/public/skills/{code}` 下载两个文件
|
|
16
|
-
(`SKILL.md` + `skill.json`)并写入 IDE 的 skills 目录。本包把这个过程**固化成一个可版本化、
|
|
17
|
-
可分发、可扩展的本地插件包**,并打通了 cli.tax 生态:
|
|
18
|
-
|
|
19
|
-
- **自动拉取**:`sources.json` 里配置 cli.tax skill 源(如 `wvz6zmRWmX`),
|
|
20
|
-
`node install.mjs pull` 或 install 时自动从 cli.tax 拉取最新内容到 `skills/`(可提交进 git)
|
|
21
|
-
- **自动匹配分发**:每个 skill 是一个目录:`skills/<name>/SKILL.md`;安装器自动检测本机
|
|
22
|
-
真实安装的 IDE,把 skill 分发到各 IDE 自己的用户级根(如 Codex 扫 `~/.codex/skills`、
|
|
23
|
-
DSH 扫 `~/.dsh/skills`),各一份、互不干扰
|
|
24
|
-
- 共享兼容根 `~/.agents/skills` 默认跳过——它会被多个工具扫描,是"同一 skill 重复出现"的根源
|
|
25
|
-
|
|
26
|
-
**与 clitaxio 的区别**:clitaxio 只把 skill 装到**一个** IDE 目录;本包是"拉取 + 多 IDE 自动分发",
|
|
27
|
-
装一次,本机所有已装 IDE 都能用。
|
|
28
|
-
|
|
29
|
-
## 安装 / 更新 / 卸载
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
# 本地运行(无需发布)
|
|
33
|
-
node install.mjs pull # 从 cli.tax(sources.json)拉取最新 skill 到 skills/,可 git 提交
|
|
34
|
-
node install.mjs install # 自动匹配:skills/ 为空时自动先 pull,再分发到本机已装 IDE
|
|
35
|
-
node install.mjs install --all # 装到所有已知 IDE(不管是否安装)
|
|
36
|
-
node install.mjs install --ide codex --ide dsh # 只装指定 IDE(可重复)
|
|
37
|
-
node install.mjs install --skip cursor # 自动匹配但跳过指定 IDE(可重复)
|
|
38
|
-
node install.mjs install --pull # 强制重新从 cli.tax 拉取后再安装
|
|
39
|
-
node install.mjs install --project # 额外装到当前项目的项目级根
|
|
40
|
-
node install.mjs install --agents # 额外装到共享 ~/.agents/skills(警告:可能被多工具重复发现)
|
|
41
|
-
node install.mjs install --target /abs/path # 只装到自定义目录
|
|
42
|
-
node install.mjs update # 幂等覆盖,等同 install
|
|
43
|
-
node install.mjs list # 列出包内 skills
|
|
44
|
-
node install.mjs ides # 查看已知 IDE 及本机检测结果(✓ = 本机已装)
|
|
45
|
-
node install.mjs uninstall # 从相同目标卸载本包安装的 skills
|
|
6
|
+
npx clitaxio@latest install wvz6zmRWmX
|
|
46
7
|
```
|
|
47
8
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
## 支持的 IDE(全世界已知安装位置,官方文档核实)
|
|
53
|
-
|
|
54
|
-
| IDE | 用户级根 | 项目级根 | 说明 |
|
|
55
|
-
|---|---|---|---|
|
|
56
|
-
| Codex CLI | `~/.codex/skills` | `.codex/skills` | 新官方约定 `~/.agents/skills`;此处用专属根避免共享冲突 |
|
|
57
|
-
| DSH | `~/.dsh/skills` | `.dsh/skills` | skill-filesystem 自动扫描 |
|
|
58
|
-
| Claude Code | `~/.claude/skills` | `.claude/skills` | 父目录向上扫描至 repo root |
|
|
59
|
-
| Gemini CLI | `~/.gemini/skills` | `.gemini/skills` | 别名 `.agents/skills` 优先级更高 |
|
|
60
|
-
| Google Antigravity | `~/.gemini/antigravity/skills` | `.agents/skills`(随 --agents) | workspace 级固定用 agents 标准 |
|
|
61
|
-
| Cursor | `~/.cursor/skills` | `.cursor/skills` | 兼容加载 .claude/.codex/.agents/skills |
|
|
62
|
-
| Cline | `~/.cline/skills` | `.cline/skills` | 全局优先于项目 |
|
|
63
|
-
| Roo Code | `~/.roo/skills` | `.roo/skills` | 项目覆盖全局 |
|
|
64
|
-
| Kilo Code | `~/.kilo/skills` | `.kilo/skills` | kilo.jsonc 可配 |
|
|
65
|
-
| Windsurf | `~/.codeium/windsurf/skills` | `.windsurf/skills` | Cascade Skills |
|
|
66
|
-
| VS Code / Copilot | `~/.copilot/skills` | `.github/skills` | 另兼容 .claude/skills |
|
|
67
|
-
| Trae | `~/.trae-cn/skills`(国内版) | `.trae/skills` | 国际版用户级未确认 |
|
|
68
|
-
| Qwen Code | `~/.qwen/skills` | `.qwen/skills` | 模型自动调用 |
|
|
69
|
-
| OpenCode | `~/.config/opencode/skills` | `.opencode/skills` | 兼容 .claude/.agents |
|
|
70
|
-
| Zed | `~/.agents/skills`(仅 --agents) | `.agents/skills`(仅 --agents) | 官方即用 agents 标准根 |
|
|
71
|
-
| Amazon Q | 无 skills 机制 | 无 skills 机制 | 官方确认不支持 SKILL.md |
|
|
72
|
-
|
|
73
|
-
> 跨工具互操作标准根 `~/.agents/skills`(agentskills.io):Codex 新约定、Gemini、Zed、
|
|
74
|
-
> OpenCode、Cursor、Antigravity、Kilo 等都支持,但会被**多个工具同时扫描**——同一 skill
|
|
75
|
-
> 装进去会在各工具中重复出现。本安装器默认跳过它(`--agents` 显式开启并警告)。
|
|
76
|
-
>
|
|
77
|
-
> 新增 IDE:在 `install.mjs` 的 `IDES` 数组加一行即可,其余逻辑自动生效。
|
|
78
|
-
|
|
79
|
-
## 分发给别人
|
|
9
|
+
Installs the Blueprint skill into the current IDE skills directory
|
|
10
|
+
(`$CODEX_HOME/skills/blueprint`, falling back to `.codex/skills/blueprint`),
|
|
11
|
+
so the IDE agent can discover the protocol and compile goals into
|
|
12
|
+
implementation-ready engineering blueprints.
|
|
80
13
|
|
|
81
|
-
### 方式 A:npm 一条命令(推荐,最简单)
|
|
82
|
-
已发布到 npm(`cli-blueprint` / `cli-calctool` / `cli-swarm`),使用者只需:
|
|
83
14
|
```bash
|
|
84
|
-
npx
|
|
85
|
-
npx cli-calctool@latest install # 同样内容(calctool 命名入口)
|
|
86
|
-
npx cli-swarm@latest install # 同样内容(swarm 命名入口)
|
|
15
|
+
npx clitaxio@latest run wvz6zmRWmX
|
|
87
16
|
```
|
|
88
|
-
自动完成:从 cli.tax 拉取 blueprint + calctool + swarm → 检测本机已装 IDE → 分发到每个 IDE。
|
|
89
|
-
更新:同一命令(`@latest` 自动拉新版),且每次 install 会对比 cli.tax 最新版本并提示 ⤴。
|
|
90
|
-
|
|
91
|
-
### 方式 B:Git 仓库
|
|
92
|
-
```bash
|
|
93
|
-
git clone https://github.com/88208555/Blueprint-clitax.git
|
|
94
|
-
cd Blueprint-clitax
|
|
95
|
-
node install.mjs install
|
|
96
|
-
```
|
|
97
|
-
更新:`git pull && node install.mjs update`(install/update 会对比已装版本与 cli.tax 最新版本并提示)。
|
|
98
|
-
|
|
99
|
-
### 更新感知(自动升级 + check)
|
|
100
17
|
|
|
101
|
-
|
|
102
|
-
|
|
18
|
+
Runs the skill handshake in the terminal: it prints the capability address,
|
|
19
|
+
method, and example request so the IDE agent can read the installed SKILL.md
|
|
20
|
+
and take the intake questions before calling.
|
|
103
21
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
node install.mjs install # 源码方式同理
|
|
107
|
-
```
|
|
108
|
-
升级时输出 `⤴ 已更新 <skill> 旧版本 → 新版本`。
|
|
22
|
+
The live endpoint is `https://cli.tax/wvz6zmRWmX` and speaks
|
|
23
|
+
`blueprint.skill.request/1.0`.
|
|
109
24
|
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
npx cli-blueprint@latest install --silent # 静默升级,无任何提示
|
|
113
|
-
node install.mjs install --yes # 源码方式静默升级
|
|
114
|
-
```
|
|
25
|
+
## Distribution
|
|
115
26
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
node install.mjs check # 遍历本机已装 IDE,对比 cli.tax 最新版本
|
|
119
|
-
npx cli-blueprint@latest check # 单包检查(calctool / swarm 同理)
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
安装器写入 `install-meta.json`(来源/版本/时间)到每个 skill 目录;SKILL.md 注入版本横幅,
|
|
123
|
-
IDE 每次读取即可见当前版本与更新命令。
|
|
27
|
+
No npm account is required. The installer tarball is hosted on the platform
|
|
28
|
+
itself and mirrored to the object storage download folder `cli-downloads/`:
|
|
124
29
|
|
|
125
|
-
### 方式 C:直接用 clitaxio(只装单个 IDE,作为对照)
|
|
126
30
|
```bash
|
|
127
|
-
|
|
128
|
-
```
|
|
129
|
-
> ⚠️ 注意:clitaxio **只把 skill 装到默认的 Codex 目录**(单一 IDE),不会自动检测/分发到
|
|
130
|
-
> 其他 IDE,也不处理 `~/.agents/skills` 共享根重复问题。需要多 IDE 分发请用方式 A/B。
|
|
131
|
-
|
|
132
|
-
## 目录结构
|
|
133
|
-
|
|
134
|
-
```
|
|
135
|
-
cli-blueprint/
|
|
136
|
-
├── install.mjs # 安装器(Node ≥18,零依赖):pull / install / uninstall / list / ides
|
|
137
|
-
├── sources.json # ★ cli.tax skill 源清单(code → 自动拉取),扩展就加一行
|
|
138
|
-
├── package.json # npm 包元数据(cli-blueprint)
|
|
139
|
-
├── README.md
|
|
140
|
-
└── skills/ # skill 内容(pull 生成,可提交 git 离线兜底)
|
|
141
|
-
└── blueprint/
|
|
142
|
-
├── SKILL.md
|
|
143
|
-
└── skill.json
|
|
31
|
+
pnpm pack:blueprint
|
|
144
32
|
```
|
|
145
33
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
{ "cliTax": [
|
|
151
|
-
{ "code": "wvz6zmRWmX", "slug": "blueprint", "endpoint": "https://cli.tax/api/public/skills/{code}" },
|
|
152
|
-
{ "code": "你的新code", "slug": "新skill名", "endpoint": "https://cli.tax/api/public/skills/{code}" }
|
|
153
|
-
] }
|
|
154
|
-
```
|
|
155
|
-
然后 `node install.mjs pull` → 自动下载到 skills/。
|
|
156
|
-
|
|
157
|
-
**方式 B:本地手工写**——直接建 `skills/my-new-skill/SKILL.md`(frontmatter: `name` kebab-case + `description`)。
|
|
158
|
-
|
|
159
|
-
两种方式后都只需 `node install.mjs update` 同步到本机所有已装 IDE。
|
|
160
|
-
|
|
161
|
-
## 常见问题
|
|
162
|
-
|
|
163
|
-
- **装完当前会话没立刻出现?** skill 目录在会话初始化时注入,新会话即可发现;文件系统 watcher 也会自动感知变更。
|
|
164
|
-
- **Codex 里出现了 2 个同一个 skill?** 常见原因是同时存在 `~/.codex/skills/<name>` 和 `~/.agents/skills/<name>`(或 config.toml 注册条目)。本安装器默认不会装到 `~/.agents/skills`,避免此问题;如已发生,删除 `~/.agents/skills/<name>` 并清理 config.toml 中的 `[[skills.config]]` 条目即可。
|
|
165
|
-
- **想改 skill 内容?** 直接改 `skills/<name>/SKILL.md` 再 `update`,幂等覆盖。
|
|
166
|
-
- **命名要求?** 目录名即 skill 名,必须 kebab-case(如 `my-new-skill`)。
|
|
34
|
+
`scripts/pack-blueprint-cli.mjs` packs this directory into
|
|
35
|
+
`apps/web/public/cli-downloads/clitax-wvz6zmRWmX.tgz`; the production deploy
|
|
36
|
+
uploads every file in that folder to the object storage bucket under the
|
|
37
|
+
dedicated `cli-downloads/` key prefix.
|
package/cli.mjs
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { copyFile, mkdir, writeFile } from 'node:fs/promises'
|
|
3
|
+
import { createInterface } from 'node:readline/promises'
|
|
4
|
+
import { stdin, stdout } from 'node:process'
|
|
5
|
+
import { dirname, join, resolve } from 'node:path'
|
|
6
|
+
import { fileURLToPath } from 'node:url'
|
|
7
|
+
import { existsSync, readFileSync } from 'node:fs'
|
|
8
|
+
|
|
9
|
+
const ENDPOINT = 'https://cli.tax/wvz6zmRWmX'
|
|
10
|
+
const SCHEMA_VERSION = 'blueprint.skill.request/1.0'
|
|
11
|
+
const PACKAGE_SKILL_DIR = join(dirname(fileURLToPath(import.meta.url)), 'skill')
|
|
12
|
+
const INSTALL_META = 'install-meta.json'
|
|
13
|
+
const LATEST_ENDPOINT = 'https://cli.tax/api/public/skills/wvz6zmRWmX'
|
|
14
|
+
|
|
15
|
+
const INTAKE_QUESTIONS = [
|
|
16
|
+
{
|
|
17
|
+
id: 'goal',
|
|
18
|
+
prompt: 'Describe the product or site goal in one paragraph: what must the user be able to do, and what must never happen.',
|
|
19
|
+
required: true,
|
|
20
|
+
example: 'A bubble-gum minigame that works offline for 60 seconds.',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'scope',
|
|
24
|
+
prompt: "List the pages, regions, and actors that must be covered, or say 'the whole site'.",
|
|
25
|
+
required: false,
|
|
26
|
+
example: 'One game page plus a results summary.',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'constraints',
|
|
30
|
+
prompt: 'State hard constraints: platforms, input methods, languages, offline or online, storage, and anything that is forbidden.',
|
|
31
|
+
required: false,
|
|
32
|
+
example: 'No account, no ads, no payments; keyboard and touch only.',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: 'acceptance',
|
|
36
|
+
prompt: 'List the acceptance checks that prove the result works, including failure and boundary paths.',
|
|
37
|
+
required: true,
|
|
38
|
+
example: 'Timer, scoring, and results always match the active state; a lower score never overwrites the high score.',
|
|
39
|
+
},
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
function usage() {
|
|
43
|
+
return [
|
|
44
|
+
'clitax-wvz6zmRWmX — install and run the Blueprint skill from CLI.Tax',
|
|
45
|
+
'',
|
|
46
|
+
'Usage:',
|
|
47
|
+
' npx <package-url> install [directory]',
|
|
48
|
+
' Install the Blueprint skill for the current IDE (Codex skills directory by default).',
|
|
49
|
+
' If an older version is already installed, it reports and upgrades it.',
|
|
50
|
+
' npx <package-url> check [directory]',
|
|
51
|
+
' Check whether the installed skill has a newer version on cli.tax.',
|
|
52
|
+
' npx <package-url> run',
|
|
53
|
+
' Run the skill handshake: discover capabilities, answer the intake questions,',
|
|
54
|
+
' and save BLUEPRINT-REQUIREMENTS.json for the IDE agent.',
|
|
55
|
+
'',
|
|
56
|
+
`Endpoint: ${ENDPOINT}`,
|
|
57
|
+
].join('\n')
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** 读取已安装目录的版本元数据 */
|
|
61
|
+
function readMeta(dir) {
|
|
62
|
+
const p = join(dir, INSTALL_META)
|
|
63
|
+
if (!existsSync(p)) return null
|
|
64
|
+
try { return JSON.parse(readFileSync(p, 'utf8')) } catch { return null }
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** 查询 cli.tax 最新版本(GET /api/public/skills/{code}) */
|
|
68
|
+
async function fetchLatestVersion() {
|
|
69
|
+
try {
|
|
70
|
+
const resp = await fetch(LATEST_ENDPOINT)
|
|
71
|
+
if (!resp.ok) return null
|
|
72
|
+
const data = await resp.json()
|
|
73
|
+
return { version: data.version ?? '', displayName: data.displayName ?? 'blueprint' }
|
|
74
|
+
} catch {
|
|
75
|
+
return null
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async function postRequest(operation, requestId) {
|
|
80
|
+
const response = await fetch(ENDPOINT, {
|
|
81
|
+
method: 'POST',
|
|
82
|
+
headers: { 'Content-Type': 'application/json' },
|
|
83
|
+
body: JSON.stringify({
|
|
84
|
+
input: {
|
|
85
|
+
schemaVersion: SCHEMA_VERSION,
|
|
86
|
+
requestId,
|
|
87
|
+
operation,
|
|
88
|
+
input: {},
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
})
|
|
92
|
+
let payload
|
|
93
|
+
try {
|
|
94
|
+
payload = await response.json()
|
|
95
|
+
} catch {
|
|
96
|
+
throw new Error(`Blueprint ${operation} failed: the runtime host returned a non-JSON response (HTTP ${response.status}). Check that the CLI runtime is deployed on ${ENDPOINT}.`)
|
|
97
|
+
}
|
|
98
|
+
if (!response.ok || payload?.ok !== true) {
|
|
99
|
+
const message = payload?.error?.message ?? payload?.error ?? `HTTP ${response.status}`
|
|
100
|
+
throw new Error(`Blueprint ${operation} failed: ${message}`)
|
|
101
|
+
}
|
|
102
|
+
return payload
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function installTarget(explicit) {
|
|
106
|
+
if (explicit) return resolve(explicit)
|
|
107
|
+
const codexHome = process.env.CODEX_HOME?.trim()
|
|
108
|
+
if (codexHome) return join(codexHome, 'skills', 'blueprint')
|
|
109
|
+
const projectCodex = join(process.cwd(), '.codex', 'skills', 'blueprint')
|
|
110
|
+
return projectCodex
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
async function install(explicit) {
|
|
114
|
+
const target = installTarget(explicit)
|
|
115
|
+
await mkdir(target, { recursive: true })
|
|
116
|
+
const previous = readMeta(target)
|
|
117
|
+
await copyFile(join(PACKAGE_SKILL_DIR, 'SKILL.md'), join(target, 'SKILL.md'))
|
|
118
|
+
await copyFile(join(PACKAGE_SKILL_DIR, 'skill.json'), join(target, 'skill.json'))
|
|
119
|
+
const localVersion = process.env.npm_package_version ?? ''
|
|
120
|
+
const latest = await fetchLatestVersion()
|
|
121
|
+
await writeFile(join(target, INSTALL_META), `${JSON.stringify({
|
|
122
|
+
source: 'wvz6zmRWmX',
|
|
123
|
+
slug: 'blueprint',
|
|
124
|
+
version: latest?.version ?? '',
|
|
125
|
+
packageVersion: localVersion,
|
|
126
|
+
endpoint: ENDPOINT,
|
|
127
|
+
installedAt: new Date().toISOString(),
|
|
128
|
+
}, null, 2)}\n`)
|
|
129
|
+
if (previous?.version && latest?.version && previous.version !== latest.version) {
|
|
130
|
+
console.log(`Blueprint skill updated: ${target}`)
|
|
131
|
+
console.log(` ⤴ ${previous.version} → ${latest.version}`)
|
|
132
|
+
} else {
|
|
133
|
+
console.log(`Blueprint skill installed: ${target}${latest?.version ? ` (${latest.version})` : ''}`)
|
|
134
|
+
}
|
|
135
|
+
if (latest?.version) {
|
|
136
|
+
console.log(`Latest version on cli.tax: ${latest.version}`)
|
|
137
|
+
}
|
|
138
|
+
console.log('Next: return to your IDE conversation and state the goal.')
|
|
139
|
+
console.log('The IDE agent reads the installed SKILL.md, asks you the intake questions,')
|
|
140
|
+
console.log('and then calls the Blueprint protocol to build and validate the blueprint.')
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async function check(explicit) {
|
|
144
|
+
const target = installTarget(explicit)
|
|
145
|
+
const local = readMeta(target)
|
|
146
|
+
const latest = await fetchLatestVersion()
|
|
147
|
+
if (!latest) {
|
|
148
|
+
console.log('blueprint: cannot reach cli.tax to check updates.')
|
|
149
|
+
process.exitCode = 1
|
|
150
|
+
return
|
|
151
|
+
}
|
|
152
|
+
if (!local?.version) {
|
|
153
|
+
console.log(`blueprint: no version record in ${target} (installed before update tracking).`)
|
|
154
|
+
console.log(`Latest on cli.tax: ${latest.version}. Run install to record and refresh.`)
|
|
155
|
+
process.exitCode = 1
|
|
156
|
+
return
|
|
157
|
+
}
|
|
158
|
+
if (local.version === latest.version) {
|
|
159
|
+
console.log(`blueprint is up to date (${latest.version}) at ${target}`)
|
|
160
|
+
} else {
|
|
161
|
+
console.log(`blueprint update available: ${local.version} → ${latest.version} at ${target}`)
|
|
162
|
+
console.log('Run: npx cli-blueprint@latest install')
|
|
163
|
+
process.exitCode = 1
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
async function askOne(question, readline) {
|
|
168
|
+
const requiredMark = question.required ? ' (required)' : ''
|
|
169
|
+
console.log(`\n${question.prompt}${requiredMark}`)
|
|
170
|
+
console.log(`Example: ${question.example}`)
|
|
171
|
+
for (;;) {
|
|
172
|
+
const answer = (await readline.question('> ')).trim()
|
|
173
|
+
if (answer || !question.required) return answer || ''
|
|
174
|
+
console.log('This question is required. Please answer before continuing.')
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
async function run() {
|
|
179
|
+
const capabilities = await postRequest('capabilities', 'cli-1')
|
|
180
|
+
const skill = capabilities.output?.skill ?? {}
|
|
181
|
+
const nextStep = capabilities.output?.nextStep ?? {}
|
|
182
|
+
console.log(`Blueprint ${skill.version ?? ''} — ${skill.description ?? 'installable engineering blueprints'}`)
|
|
183
|
+
if (nextStep.instruction) console.log(nextStep.instruction)
|
|
184
|
+
|
|
185
|
+
const readline = createInterface({ input: stdin, output: stdout })
|
|
186
|
+
const answers = []
|
|
187
|
+
try {
|
|
188
|
+
for (const question of INTAKE_QUESTIONS) {
|
|
189
|
+
answers.push({ id: question.id, prompt: question.prompt, answer: await askOne(question, readline) })
|
|
190
|
+
}
|
|
191
|
+
} finally {
|
|
192
|
+
readline.close()
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const requirements = {
|
|
196
|
+
schemaVersion: SCHEMA_VERSION,
|
|
197
|
+
endpoint: ENDPOINT,
|
|
198
|
+
createdAt: new Date().toISOString(),
|
|
199
|
+
answers,
|
|
200
|
+
}
|
|
201
|
+
const target = join(process.cwd(), 'BLUEPRINT-REQUIREMENTS.json')
|
|
202
|
+
await writeFile(target, `${JSON.stringify(requirements, null, 2)}\n`)
|
|
203
|
+
console.log(`\nRequirements saved: ${target}`)
|
|
204
|
+
console.log('Next: continue in your IDE agent with this file.')
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const command = process.argv[2] ?? 'help'
|
|
208
|
+
const argument = process.argv[3] ?? ''
|
|
209
|
+
try {
|
|
210
|
+
if (command === 'install') {
|
|
211
|
+
await install(argument)
|
|
212
|
+
} else if (command === 'check') {
|
|
213
|
+
await check(argument)
|
|
214
|
+
} else if (command === 'run') {
|
|
215
|
+
await run()
|
|
216
|
+
} else if (command === '--help' || command === '-h' || command === 'help') {
|
|
217
|
+
console.log(usage())
|
|
218
|
+
} else {
|
|
219
|
+
console.error(`Unknown command: ${command}\n`)
|
|
220
|
+
console.log(usage())
|
|
221
|
+
process.exitCode = 1
|
|
222
|
+
}
|
|
223
|
+
} catch (error) {
|
|
224
|
+
console.error(error instanceof Error ? error.message : error)
|
|
225
|
+
process.exitCode = 1
|
|
226
|
+
}
|
package/package.json
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cli-blueprint",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Blueprint
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Blueprint skill installer for CLI.Tax: compile one goal into an executable, verifiable engineering blueprint.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"cli-blueprint": "
|
|
7
|
+
"cli-blueprint": "./cli.mjs"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
10
|
+
"cli.mjs",
|
|
11
|
+
"skill",
|
|
12
|
+
"README.md"
|
|
13
13
|
],
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=18"
|
|
16
16
|
},
|
|
17
|
-
"license": "
|
|
17
|
+
"license": "UNLICENSED",
|
|
18
18
|
"keywords": [
|
|
19
|
-
"blueprint",
|
|
20
|
-
"skill",
|
|
21
19
|
"cli.tax",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"agent"
|
|
25
|
-
"installer"
|
|
20
|
+
"skill",
|
|
21
|
+
"installer",
|
|
22
|
+
"agent"
|
|
26
23
|
]
|
|
27
|
-
}
|
|
24
|
+
}
|
package/skill/skill.json
ADDED
package/LICENSE
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
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 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 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 those 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
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright [yyyy] [name of copyright owner]
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|