sdd-flow-kit 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/postinstall.js +46 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
|
|
16
16
|
1. 进入你要开发的项目目录
|
|
17
17
|
2. 安装:`npm i -D sdd-flow-kit`
|
|
18
|
+
- 安装后会自动执行一次初始化(postinstall)
|
|
19
|
+
- 交互终端下会提示选择项目类型(OMS / ADI / 欢盟 / AD Tools,默认 OMS)
|
|
20
|
+
- 非交互环境自动使用默认值(agent=claude-code, project=OMS)
|
|
18
21
|
3. 安装流程(安装即用,默认 `claude-code`):`npx sdd-flow-kit install`
|
|
19
22
|
- 会自动安装对应 AI 环境并写入项目级触发 Skill(仅在“开发 <产品> <版本> 需求/版本/PRD”场景触发)
|
|
20
23
|
- 会在项目根目录生成 `docs/<项目>-doc-skill/`(用于 PRD 下载脚本与说明),可通过 `--project` 选择:`OMS` / `ADI` / `欢盟` / `AD Tools`(默认 `OMS`)
|
|
@@ -22,6 +25,8 @@
|
|
|
22
25
|
5. (可选)环境健检:`npx sdd-flow-kit doctor --agent claude-code`
|
|
23
26
|
6. 完成后,直接在 Cursor / Claude Code / Codex / OpenClaw 中用自然语言发起需求,例如:`开发 ADI 2.3.2 需求`
|
|
24
27
|
|
|
28
|
+
> 可通过环境变量覆盖安装时默认项目类型:`SDD_FLOW_KIT_PROJECT=ADI npm i -D sdd-flow-kit`
|
|
29
|
+
|
|
25
30
|
#### 使用说明
|
|
26
31
|
|
|
27
32
|
1. `install`(等价 `setup`):提示选择开发环境(cursor/claude-code/codex/openclaw,默认 claude-code)与开发分支(无则自动创建),并检测/安装 openspec+superpower 基础环境,同时写入项目级 Skill
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
7
|
+
const node_process_1 = __importDefault(require("node:process"));
|
|
8
|
+
const setupProject_1 = require("./steps/setupProject");
|
|
9
|
+
const ALLOWED_PROJECTS = ["OMS", "ADI", "欢盟", "AD Tools"];
|
|
10
|
+
function resolveProjectKindFromEnv() {
|
|
11
|
+
const raw = (node_process_1.default.env.SDD_FLOW_KIT_PROJECT ?? "").trim();
|
|
12
|
+
if (ALLOWED_PROJECTS.includes(raw)) {
|
|
13
|
+
return raw;
|
|
14
|
+
}
|
|
15
|
+
return "OMS";
|
|
16
|
+
}
|
|
17
|
+
async function main() {
|
|
18
|
+
// npm/pnpm 安装依赖时,INIT_CWD 指向用户项目根目录。
|
|
19
|
+
const initCwd = node_process_1.default.env.INIT_CWD ? node_path_1.default.resolve(node_process_1.default.env.INIT_CWD) : null;
|
|
20
|
+
const pkgDir = node_path_1.default.resolve(__dirname, "..");
|
|
21
|
+
const projectRoot = initCwd ?? node_process_1.default.cwd();
|
|
22
|
+
// 避免在本包自身仓库开发安装依赖时重复触发自动初始化。
|
|
23
|
+
if (projectRoot === pkgDir)
|
|
24
|
+
return;
|
|
25
|
+
const isInteractive = Boolean(node_process_1.default.stdin.isTTY && node_process_1.default.stdout.isTTY);
|
|
26
|
+
const projectKind = resolveProjectKindFromEnv();
|
|
27
|
+
// eslint-disable-next-line no-console
|
|
28
|
+
console.log(`[sdd-flow-kit] postinstall bootstrap at: ${projectRoot}`);
|
|
29
|
+
// eslint-disable-next-line no-console
|
|
30
|
+
console.log(`[sdd-flow-kit] interactive=${isInteractive}, defaultProject=${projectKind}`);
|
|
31
|
+
await (0, setupProject_1.setupProject)({
|
|
32
|
+
projectRoot,
|
|
33
|
+
agent: "claude-code",
|
|
34
|
+
// 交互安装允许用户在 setupProject 内选择 agent/project/branch
|
|
35
|
+
yes: !isInteractive,
|
|
36
|
+
dryRun: false,
|
|
37
|
+
projectKind,
|
|
38
|
+
});
|
|
39
|
+
// eslint-disable-next-line no-console
|
|
40
|
+
console.log("[sdd-flow-kit] setup completed");
|
|
41
|
+
}
|
|
42
|
+
main().catch((err) => {
|
|
43
|
+
// 不阻断依赖安装,仅告警
|
|
44
|
+
// eslint-disable-next-line no-console
|
|
45
|
+
console.warn("[sdd-flow-kit] postinstall setup skipped:", err instanceof Error ? err.message : err);
|
|
46
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sdd-flow-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Cross-agent SDD automated development workflow kit (ADI/ADI-like).",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "tsc -p tsconfig.json",
|
|
19
19
|
"start": "node dist/cli.js",
|
|
20
|
-
"prepublishOnly": "npm run build"
|
|
20
|
+
"prepublishOnly": "npm run build",
|
|
21
|
+
"postinstall": "node dist/postinstall.js"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"@types/node": "^20.14.10",
|