ai-native-core 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -106,9 +106,14 @@ paradigm_detection = true
|
|
|
106
106
|
# SDD 门禁(Spec-Driven Development)
|
|
107
107
|
# =============================================================================
|
|
108
108
|
[sdd]
|
|
109
|
+
# 完整流程:explore(可选)→ propose → confirm → apply
|
|
109
110
|
# 是否强制 spec-before-code
|
|
110
111
|
enforced = true
|
|
111
112
|
|
|
113
|
+
# 复杂需求是否推荐先 explore(探索需求、澄清边界)
|
|
114
|
+
# 设为 true 时,AI 会在 propose 前主动建议 explore
|
|
115
|
+
recommend_explore = true
|
|
116
|
+
|
|
112
117
|
# 是否要求 design.md 包含 ASCII wireframe
|
|
113
118
|
require_ascii_wireframe = true
|
|
114
119
|
|
package/package.json
CHANGED
package/src/commands/accept.js
CHANGED
|
@@ -32,6 +32,21 @@ function run(args) {
|
|
|
32
32
|
return { pass: fs.existsSync(p), detail: fs.existsSync(p) ? 'initialized' : 'NOT INITIALIZED' };
|
|
33
33
|
}, results);
|
|
34
34
|
|
|
35
|
+
// Phase 1.5 — SDD check
|
|
36
|
+
const sddTool = config.sdd?.tool || config.ai_tools?.sdd_tool;
|
|
37
|
+
if (sddTool && sddTool !== 'none') {
|
|
38
|
+
console.log('Phase 1.5 — SDD 门禁');
|
|
39
|
+
check('sdd-tool-configured', () => {
|
|
40
|
+
const dir = path.join(root, 'openspec', 'changes');
|
|
41
|
+
const ok = fs.existsSync(dir) && fs.readdirSync(dir).length > 0;
|
|
42
|
+
return { pass: ok || sddTool !== 'openspec', detail: sddTool + (ok ? ' ✓' : ' (spec 目录为空)') };
|
|
43
|
+
}, results);
|
|
44
|
+
check('sdd-gate', () => {
|
|
45
|
+
const enforced = config.sdd?.enforced !== false;
|
|
46
|
+
return { pass: enforced, detail: enforced ? 'enforced' : '⚠ disabled' };
|
|
47
|
+
}, results);
|
|
48
|
+
}
|
|
49
|
+
|
|
35
50
|
// Phase 2
|
|
36
51
|
console.log('Phase 2 — 代码质量');
|
|
37
52
|
check('lint', () => tryExec('pnpm lint || npm run lint || true', root), results);
|
package/src/commands/init.js
CHANGED
|
@@ -97,6 +97,8 @@ function doInit(stacks, isForce, answers = {}) {
|
|
|
97
97
|
};
|
|
98
98
|
|
|
99
99
|
copyFile('config/ai-native.config.toml', '.ai-native/config.toml', c => {
|
|
100
|
+
c = c.replace(/type = "frontend"/, `type = "${answers.type || 'frontend'}"`);
|
|
101
|
+
if (answers.type) c = c.replace(/name = "my-project"/, `name = "${path.basename(root)}"`);
|
|
100
102
|
c = c.replace(/adapter = "react-spa"/, stacks.length > 1
|
|
101
103
|
? `adapter = [${stacks.map(s => `"${s}"`).join(', ')}]`
|
|
102
104
|
: `adapter = "${stacks[0]}"`);
|
|
@@ -104,7 +106,7 @@ function doInit(stacks, isForce, answers = {}) {
|
|
|
104
106
|
if (answers.css) c = c.replace(/css = "tailwind-v4"/, `css = "${answers.css}"`);
|
|
105
107
|
if (answers.ui) c = c.replace(/ui_library = "shadcn"/, `ui_library = "${answers.ui}"`);
|
|
106
108
|
if (answers.test) c = c.replace(/test_framework = "vitest"/, `test_framework = "${answers.test}"`);
|
|
107
|
-
if (answers.ts) c = c.replace(/typescript = true/, `typescript = ${answers.ts === 'yes'}`);
|
|
109
|
+
if (answers.ts !== undefined) c = c.replace(/typescript = true/, `typescript = ${answers.ts === 'yes'}`);
|
|
108
110
|
return c;
|
|
109
111
|
});
|
|
110
112
|
|