sillyspec 3.8.4 → 3.8.6
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 +0 -6
- package/docs/.vitepress/config.mts +45 -0
- package/docs/.vitepress/dist/404.html +25 -0
- package/docs/.vitepress/dist/assets/app.YytxICdd.js +1 -0
- package/docs/.vitepress/dist/assets/chunks/framework.Czhw_PXq.js +19 -0
- package/docs/.vitepress/dist/assets/chunks/theme.DusTRZQk.js +1 -0
- package/docs/.vitepress/dist/assets/index.md.C3VCvtQA.js +1 -0
- package/docs/.vitepress/dist/assets/index.md.C3VCvtQA.lean.js +1 -0
- package/docs/.vitepress/dist/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
- package/docs/.vitepress/dist/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
- package/docs/.vitepress/dist/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
- package/docs/.vitepress/dist/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
- package/docs/.vitepress/dist/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
- package/docs/.vitepress/dist/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
- package/docs/.vitepress/dist/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
- package/docs/.vitepress/dist/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
- package/docs/.vitepress/dist/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
- package/docs/.vitepress/dist/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
- package/docs/.vitepress/dist/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
- package/docs/.vitepress/dist/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
- package/docs/.vitepress/dist/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
- package/docs/.vitepress/dist/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
- package/docs/.vitepress/dist/assets/sillyspec_commands.md.CXFFsj08.js +15 -0
- package/docs/.vitepress/dist/assets/sillyspec_commands.md.CXFFsj08.lean.js +1 -0
- package/docs/.vitepress/dist/assets/sillyspec_dashboard.md.BuPXHqjX.js +4 -0
- package/docs/.vitepress/dist/assets/sillyspec_dashboard.md.BuPXHqjX.lean.js +1 -0
- package/docs/.vitepress/dist/assets/sillyspec_file-io.md.Cz3x7llx.js +1 -0
- package/docs/.vitepress/dist/assets/sillyspec_file-io.md.Cz3x7llx.lean.js +1 -0
- package/docs/.vitepress/dist/assets/sillyspec_getting-started.md.ClcvV8k3.js +4 -0
- package/docs/.vitepress/dist/assets/sillyspec_getting-started.md.ClcvV8k3.lean.js +1 -0
- package/docs/.vitepress/dist/assets/sillyspec_install.md.CKuR2tiT.js +5 -0
- package/docs/.vitepress/dist/assets/sillyspec_install.md.CKuR2tiT.lean.js +1 -0
- package/docs/.vitepress/dist/assets/sillyspec_lifecycle.md.DY293cR1.js +28 -0
- package/docs/.vitepress/dist/assets/sillyspec_lifecycle.md.DY293cR1.lean.js +1 -0
- package/docs/.vitepress/dist/assets/sillyspec_structure.md.sVYS4zPs.js +30 -0
- package/docs/.vitepress/dist/assets/sillyspec_structure.md.sVYS4zPs.lean.js +1 -0
- package/docs/.vitepress/dist/assets/style.DFTx90Kk.css +1 -0
- package/docs/.vitepress/dist/hashmap.json +1 -0
- package/docs/.vitepress/dist/index.html +28 -0
- package/docs/.vitepress/dist/sillyspec/commands.html +42 -0
- package/docs/.vitepress/dist/sillyspec/dashboard.html +31 -0
- package/docs/.vitepress/dist/sillyspec/file-io.html +28 -0
- package/docs/.vitepress/dist/sillyspec/getting-started.html +31 -0
- package/docs/.vitepress/dist/sillyspec/install.html +32 -0
- package/docs/.vitepress/dist/sillyspec/lifecycle.html +55 -0
- package/docs/.vitepress/dist/sillyspec/structure.html +57 -0
- package/docs/.vitepress/dist/vp-icons.css +1 -0
- package/docs/index.md +34 -0
- package/docs/sillyspec/commands.md +218 -0
- package/docs/sillyspec/dashboard.md +51 -0
- package/docs/sillyspec/file-io.md +34 -0
- package/docs/sillyspec/getting-started.md +61 -0
- package/docs/sillyspec/install.md +51 -0
- package/docs/sillyspec/lifecycle.md +146 -0
- package/docs/sillyspec/structure.md +62 -0
- package/package.json +11 -9
- package/packages/dashboard/dist/assets/index-Bh-GPjKY.css +1 -0
- package/packages/dashboard/dist/assets/index-CrCn5Gg6.js +17 -0
- package/packages/dashboard/dist/index.html +2 -2
- package/packages/dashboard/package-lock.json +0 -220
- package/packages/dashboard/package.json +5 -8
- package/packages/dashboard/server/index.js +106 -255
- package/packages/dashboard/server/parser.js +29 -333
- package/packages/dashboard/server/watcher.js +131 -203
- package/packages/dashboard/src/App.vue +10 -181
- package/packages/dashboard/src/components/ActionBar.vue +42 -26
- package/packages/dashboard/src/components/CommandPalette.vue +65 -40
- package/packages/dashboard/src/components/DetailPanel.vue +53 -68
- package/packages/dashboard/src/components/LogStream.vue +33 -13
- package/packages/dashboard/src/components/PipelineStage.vue +8 -8
- package/packages/dashboard/src/components/PipelineView.vue +45 -80
- package/packages/dashboard/src/components/ProjectList.vue +45 -103
- package/packages/dashboard/src/components/StageBadge.vue +13 -13
- package/packages/dashboard/src/components/StepCard.vue +15 -15
- package/packages/dashboard/src/composables/useDashboard.js +6 -20
- package/packages/dashboard/src/composables/useKeyboard.js +4 -6
- package/packages/dashboard/src/main.js +1 -4
- package/packages/dashboard/src/style.css +17 -17
- package/src/index.js +12 -123
- package/src/init.js +227 -86
- package/src/setup.js +9 -1
- package/templates/archive.md +121 -0
- package/templates/brainstorm.md +240 -0
- package/{.claude/skills/sillyspec-commit/SKILL.md → templates/commit.md} +47 -29
- package/templates/continue.md +32 -0
- package/templates/execute.md +314 -0
- package/templates/explore.md +60 -0
- package/templates/export.md +21 -0
- package/templates/init.md +61 -0
- package/templates/plan.md +157 -0
- package/templates/quick.md +135 -0
- package/templates/scan-quick.md +49 -0
- package/templates/scan.md +172 -0
- package/templates/skills/playwright-e2e/SKILL.md +340 -0
- package/templates/status.md +75 -0
- package/templates/verify.md +253 -0
- package/templates/workspace-sync.md +99 -0
- package/templates/workspace.md +70 -0
- package/.claude/skills/sillyspec-archive/SKILL.md +0 -17
- package/.claude/skills/sillyspec-auto/SKILL.md +0 -77
- package/.claude/skills/sillyspec-brainstorm/SKILL.md +0 -17
- package/.claude/skills/sillyspec-continue/SKILL.md +0 -44
- package/.claude/skills/sillyspec-doctor/SKILL.md +0 -22
- package/.claude/skills/sillyspec-execute/SKILL.md +0 -17
- package/.claude/skills/sillyspec-explore/SKILL.md +0 -96
- package/.claude/skills/sillyspec-export/SKILL.md +0 -53
- package/.claude/skills/sillyspec-init/SKILL.md +0 -170
- package/.claude/skills/sillyspec-plan/SKILL.md +0 -52
- package/.claude/skills/sillyspec-propose/SKILL.md +0 -17
- package/.claude/skills/sillyspec-quick/SKILL.md +0 -17
- package/.claude/skills/sillyspec-resume/SKILL.md +0 -111
- package/.claude/skills/sillyspec-scan/SKILL.md +0 -17
- package/.claude/skills/sillyspec-state/SKILL.md +0 -54
- package/.claude/skills/sillyspec-status/SKILL.md +0 -17
- package/.claude/skills/sillyspec-verify/SKILL.md +0 -17
- package/.claude/skills/sillyspec-workspace/SKILL.md +0 -149
- package/.sillyspec/changes/archive/2026-04-08-derive-state/design.md +0 -97
- package/.sillyspec/changes/archive/2026-04-08-derive-state/plan.md +0 -51
- package/.sillyspec/changes/archive/2026-04-08-derive-state/proposal.md +0 -29
- package/.sillyspec/changes/archive/2026-04-08-derive-state/requirements.md +0 -34
- package/.sillyspec/changes/archive/2026-04-08-derive-state/tasks.md +0 -13
- package/.sillyspec/changes/archive/2026-04-08-derive-state/verify-result.md +0 -43
- package/.sillyspec/changes/auto-mode/design.md +0 -50
- package/.sillyspec/changes/auto-mode/proposal.md +0 -19
- package/.sillyspec/changes/auto-mode/requirements.md +0 -21
- package/.sillyspec/changes/auto-mode/tasks.md +0 -7
- package/.sillyspec/changes/brainstorm-archive/2026-04-05-unified-docs-design.md +0 -199
- package/.sillyspec/changes/dashboard/design.md.braindraft +0 -206
- package/.sillyspec/changes/run-command-design/design.md +0 -1230
- package/.sillyspec/changes/unified-docs-design/design.md +0 -199
- package/.sillyspec/docs/sillyspec/scan/.gitkeep +0 -0
- package/.sillyspec/knowledge/INDEX.md +0 -8
- package/.sillyspec/knowledge/uncategorized.md +0 -3
- package/.sillyspec/projects/sillyspec.yaml +0 -3
- package/packages/dashboard/dist/assets/index-D1EVTLmc.js +0 -7446
- package/packages/dashboard/dist/assets/index-DGe8CqeP.css +0 -1
- package/packages/dashboard/public/logo.jpg +0 -0
- package/packages/dashboard/src/components/DocPreview.vue +0 -160
- package/packages/dashboard/src/components/DocTree.vue +0 -58
- package/packages/dashboard/src/components/ProjectOverview.vue +0 -178
- package/packages/dashboard/src/components/detail/DocsDetail.vue +0 -48
- package/packages/dashboard/src/components/detail/GitDetail.vue +0 -61
- package/packages/dashboard/src/components/detail/TechDetail.vue +0 -43
- package/src/derive.js +0 -147
- package/src/migrate.js +0 -117
- package/src/progress.js +0 -495
- package/src/run.js +0 -640
- package/src/stages/archive.js +0 -54
- package/src/stages/brainstorm.js +0 -239
- package/src/stages/doctor.js +0 -312
- package/src/stages/execute.js +0 -258
- package/src/stages/index.js +0 -35
- package/src/stages/plan.js +0 -259
- package/src/stages/propose.js +0 -115
- package/src/stages/quick.js +0 -64
- package/src/stages/scan.js +0 -141
- package/src/stages/status.js +0 -65
- package/src/stages/verify.js +0 -135
- /package/.sillyspec/{changes/brainstorm-archive → specs}/2026-04-05-dashboard-design.md +0 -0
- /package/{packages/dashboard → docs/.vitepress}/dist/favicon.jpg +0 -0
- /package/{logo.jpg → docs/.vitepress/dist/logo.jpg} +0 -0
- /package/{packages/dashboard → docs}/public/favicon.jpg +0 -0
- /package/{packages/dashboard/dist → docs/public}/logo.jpg +0 -0
package/src/derive.js
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { readdirSync, existsSync } from 'fs';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 从 artifacts 文件系统反推状态,与 progress.json 交叉校验。
|
|
6
|
-
* 纯函数,零外部副作用(fix 模式除外)。
|
|
7
|
-
*
|
|
8
|
-
* @param {string} cwd - 项目根目录
|
|
9
|
-
* @param {object} options
|
|
10
|
-
* @param {'light'|'full'} options.mode - 轻量(当前步骤)或全量扫描
|
|
11
|
-
* @param {boolean} options.fix - 是否自动修复明显不一致
|
|
12
|
-
* @param {object} options.pm - ProgressManager 实例(fix 模式需要)
|
|
13
|
-
* @param {object} options.progress - 已加载的 progress 数据
|
|
14
|
-
* @returns {{ issues: Array<{type:string, severity:string, stage:string, step:number, message:string, suggestion:string}>, fixed: number }}
|
|
15
|
-
*/
|
|
16
|
-
export function deriveState(cwd, options = {}) {
|
|
17
|
-
const { mode = 'light', fix = false, pm = null, progress = null } = options;
|
|
18
|
-
|
|
19
|
-
const issues = [];
|
|
20
|
-
let fixed = 0;
|
|
21
|
-
|
|
22
|
-
const artifactsDir = join(cwd, '.sillyspec', '.runtime', 'artifacts');
|
|
23
|
-
if (!existsSync(artifactsDir)) {
|
|
24
|
-
return { issues: [{ type: 'no-artifacts', severity: 'info', stage: '-', step: 0, message: 'artifacts 目录不存在', suggestion: '正常,项目刚开始' }], fixed: 0 };
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// 扫描 artifacts 文件,解析 stage/step 信息
|
|
28
|
-
const artifactMap = {}; // { "stage:stepN": [filenames] }
|
|
29
|
-
const stageStepSet = new Set(); // "stage:stepN"
|
|
30
|
-
|
|
31
|
-
let files;
|
|
32
|
-
try {
|
|
33
|
-
files = readdirSync(artifactsDir).filter(f => f.endsWith('.txt'));
|
|
34
|
-
} catch {
|
|
35
|
-
return { issues: [], fixed: 0 };
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
for (const file of files) {
|
|
39
|
-
// 格式: {stage}-step{N}-{timestamp}.txt
|
|
40
|
-
const match = file.match(/^(.+)-step(\d+)-\d+\.txt$/);
|
|
41
|
-
if (match) {
|
|
42
|
-
const [, stage, stepStr] = match;
|
|
43
|
-
const key = `${stage}:${stepStr}`;
|
|
44
|
-
if (!artifactMap[key]) artifactMap[key] = [];
|
|
45
|
-
artifactMap[key].push(file);
|
|
46
|
-
stageStepSet.add(key);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// 需要检查的阶段
|
|
51
|
-
let stagesToCheck = [];
|
|
52
|
-
if (progress) {
|
|
53
|
-
if (mode === 'light') {
|
|
54
|
-
// 轻量:只检查 currentStage
|
|
55
|
-
const currentStage = progress.currentStage || '';
|
|
56
|
-
if (currentStage) stagesToCheck.push(currentStage);
|
|
57
|
-
} else {
|
|
58
|
-
// 全量:检查所有阶段
|
|
59
|
-
stagesToCheck = Object.keys(progress.stages || {});
|
|
60
|
-
}
|
|
61
|
-
} else {
|
|
62
|
-
// 没有 progress 数据,从 artifacts 推断所有阶段
|
|
63
|
-
for (const key of stageStepSet) {
|
|
64
|
-
const stage = key.split(':')[0];
|
|
65
|
-
if (!stagesToCheck.includes(stage)) stagesToCheck.push(stage);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
for (const stage of stagesToCheck) {
|
|
70
|
-
const stageData = progress?.stages?.[stage];
|
|
71
|
-
const steps = stageData?.steps || [];
|
|
72
|
-
|
|
73
|
-
// 收集 artifacts 中该阶段的步骤编号
|
|
74
|
-
const artifactSteps = new Set();
|
|
75
|
-
for (const key of stageStepSet) {
|
|
76
|
-
const [s, n] = key.split(':');
|
|
77
|
-
if (s === stage) artifactSteps.add(parseInt(n));
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// 检查1:artifacts 有但 progress 未标记完成
|
|
81
|
-
for (const stepNum of artifactSteps) {
|
|
82
|
-
const stepIdx = stepNum - 1;
|
|
83
|
-
if (stepIdx < steps.length) {
|
|
84
|
-
const step = steps[stepIdx];
|
|
85
|
-
if (step.status !== 'done') {
|
|
86
|
-
issues.push({
|
|
87
|
-
type: 'missing-progress',
|
|
88
|
-
severity: 'issue',
|
|
89
|
-
stage,
|
|
90
|
-
step: stepNum,
|
|
91
|
-
message: `artifacts 有 ${stage}-step${stepNum} 文件但 progress 未标记完成`,
|
|
92
|
-
suggestion: '标记该步骤为 done'
|
|
93
|
-
});
|
|
94
|
-
if (fix && pm && progress) {
|
|
95
|
-
step.status = 'done';
|
|
96
|
-
pm._write(cwd, progress);
|
|
97
|
-
fixed++;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// 检查2:progress 有但 artifacts 无文件(warning,不修复)
|
|
104
|
-
for (let i = 0; i < steps.length; i++) {
|
|
105
|
-
const step = steps[i];
|
|
106
|
-
if (step.status === 'done' && !artifactSteps.has(i + 1)) {
|
|
107
|
-
issues.push({
|
|
108
|
-
type: 'missing-artifact',
|
|
109
|
-
severity: 'warning',
|
|
110
|
-
stage,
|
|
111
|
-
step: i + 1,
|
|
112
|
-
message: `${stage} step ${i + 1} 标记完成但 artifacts 无对应文件`,
|
|
113
|
-
suggestion: '可能被手动清理,忽略即可'
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// 检查3:artifacts 有 step5 但 progress 只到 step3(中间漏记)
|
|
119
|
-
if (artifactSteps.size > 0) {
|
|
120
|
-
const maxArtifactStep = Math.max(...artifactSteps);
|
|
121
|
-
const maxProgressDoneStep = steps.reduce((max, s, i) => s.status === 'done' ? Math.max(max, i + 1) : max, 0);
|
|
122
|
-
|
|
123
|
-
if (maxArtifactStep > maxProgressDoneStep && maxProgressDoneStep > 0) {
|
|
124
|
-
// 检查中间是否有漏记的
|
|
125
|
-
for (let i = maxProgressDoneStep + 1; i <= maxArtifactStep; i++) {
|
|
126
|
-
if (artifactSteps.has(i) && i - 1 < steps.length && steps[i - 1].status !== 'done') {
|
|
127
|
-
// 已在检查1处理,跳过
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// progress 步骤数少于 artifacts 最大步骤号
|
|
133
|
-
if (maxArtifactStep > steps.length) {
|
|
134
|
-
issues.push({
|
|
135
|
-
type: 'missing-steps',
|
|
136
|
-
severity: 'issue',
|
|
137
|
-
stage,
|
|
138
|
-
step: steps.length + 1,
|
|
139
|
-
message: `artifacts 有 step${maxArtifactStep} 但 progress 只有 ${steps.length} 个步骤`,
|
|
140
|
-
suggestion: 'progress 数据可能不完整'
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
return { issues, fixed };
|
|
147
|
-
}
|
package/src/migrate.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { existsSync, readdirSync, readFileSync, writeFileSync, mkdirSync, renameSync, copyFileSync } from 'fs';
|
|
2
|
-
import { join, resolve } from 'path';
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Migrate old .sillyspec/ structure to unified docs/<project>/ structure
|
|
7
|
-
* @param {string} projectDir - Path to the project directory
|
|
8
|
-
*/
|
|
9
|
-
export function migrateDocs(projectDir) {
|
|
10
|
-
const sillyspecDir = join(projectDir, '.sillyspec');
|
|
11
|
-
if (!existsSync(sillyspecDir)) {
|
|
12
|
-
console.error('❌ .sillyspec/ 目录不存在');
|
|
13
|
-
process.exit(1);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Determine project name from projects/*.yaml or directory name
|
|
17
|
-
let projectName = projectDir.split('/').pop();
|
|
18
|
-
const projectsDir = join(sillyspecDir, 'projects');
|
|
19
|
-
if (existsSync(projectsDir)) {
|
|
20
|
-
const yamlFiles = readdirSync(projectsDir).filter(f => f.endsWith('.yaml'));
|
|
21
|
-
if (yamlFiles.length > 0) {
|
|
22
|
-
projectName = yamlFiles[0].replace('.yaml', '');
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
console.log(chalk.cyan(`📦 迁移项目: ${projectName}`));
|
|
27
|
-
console.log('');
|
|
28
|
-
|
|
29
|
-
const docsBase = join(sillyspecDir, 'docs', projectName);
|
|
30
|
-
let migrated = 0;
|
|
31
|
-
|
|
32
|
-
// 1. codebase/ → docs/<project>/scan/
|
|
33
|
-
const codebaseDir = join(sillyspecDir, 'codebase');
|
|
34
|
-
if (existsSync(codebaseDir)) {
|
|
35
|
-
const targetDir = join(docsBase, 'scan');
|
|
36
|
-
mkdirSync(targetDir, { recursive: true });
|
|
37
|
-
const files = readdirSync(codebaseDir).filter(f => f.endsWith('.md'));
|
|
38
|
-
for (const file of files) {
|
|
39
|
-
const src = join(codebaseDir, file);
|
|
40
|
-
const dest = join(targetDir, file);
|
|
41
|
-
if (!existsSync(dest)) {
|
|
42
|
-
copyFileSync(src, dest);
|
|
43
|
-
console.log(chalk.green(' ✅') + ` scan/${file}`);
|
|
44
|
-
migrated++;
|
|
45
|
-
} else {
|
|
46
|
-
console.log(chalk.yellow(' ⏭️') + ` scan/${file} (已存在)`);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// 2. specs/ is deprecated — designs live in changes/<变更名>/design.md
|
|
52
|
-
|
|
53
|
-
// 3. changes/archive/ → docs/<project>/archive/
|
|
54
|
-
const archiveDir = join(sillyspecDir, 'changes', 'archive');
|
|
55
|
-
if (existsSync(archiveDir)) {
|
|
56
|
-
const targetDir = join(docsBase, 'archive');
|
|
57
|
-
mkdirSync(targetDir, { recursive: true });
|
|
58
|
-
const entries = readdirSync(archiveDir);
|
|
59
|
-
for (const entry of entries) {
|
|
60
|
-
const src = join(archiveDir, entry);
|
|
61
|
-
const dest = join(targetDir, entry);
|
|
62
|
-
if (!existsSync(dest)) {
|
|
63
|
-
copyFileSync(src, dest);
|
|
64
|
-
console.log(chalk.green(' ✅') + ` archive/${entry}`);
|
|
65
|
-
migrated++;
|
|
66
|
-
} else {
|
|
67
|
-
console.log(chalk.yellow(' ⏭️') + ` archive/${entry} (已存在)`);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// 4. knowledge/ → docs/<project>/archive/ (append knowledge files)
|
|
73
|
-
const knowledgeDir = join(sillyspecDir, 'knowledge');
|
|
74
|
-
if (existsSync(knowledgeDir)) {
|
|
75
|
-
const targetDir = join(docsBase, 'archive');
|
|
76
|
-
mkdirSync(targetDir, { recursive: true });
|
|
77
|
-
const files = readdirSync(knowledgeDir).filter(f => f.endsWith('.md'));
|
|
78
|
-
for (const file of files) {
|
|
79
|
-
const src = join(knowledgeDir, file);
|
|
80
|
-
const dest = join(targetDir, `knowledge-${file}`);
|
|
81
|
-
if (!existsSync(dest)) {
|
|
82
|
-
copyFileSync(src, dest);
|
|
83
|
-
console.log(chalk.green(' ✅') + ` archive/knowledge-${file}`);
|
|
84
|
-
migrated++;
|
|
85
|
-
} else {
|
|
86
|
-
console.log(chalk.yellow(' ⏭️') + ` archive/knowledge-${file} (已存在)`);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// 5. quicklog/ → docs/<project>/quicklog/
|
|
92
|
-
const quicklogDir = join(sillyspecDir, 'quicklog');
|
|
93
|
-
if (existsSync(quicklogDir)) {
|
|
94
|
-
const targetDir = join(docsBase, 'quicklog');
|
|
95
|
-
mkdirSync(targetDir, { recursive: true });
|
|
96
|
-
const files = readdirSync(quicklogDir).filter(f => f.endsWith('.md'));
|
|
97
|
-
for (const file of files) {
|
|
98
|
-
const src = join(quicklogDir, file);
|
|
99
|
-
const dest = join(targetDir, file);
|
|
100
|
-
if (!existsSync(dest)) {
|
|
101
|
-
copyFileSync(src, dest);
|
|
102
|
-
console.log(chalk.green(' ✅') + ` quicklog/${file}`);
|
|
103
|
-
migrated++;
|
|
104
|
-
} else {
|
|
105
|
-
console.log(chalk.yellow(' ⏭️') + ` quicklog/${file} (已存在)`);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
console.log('');
|
|
111
|
-
if (migrated > 0) {
|
|
112
|
-
console.log(chalk.green(` ✅ 迁移完成,共迁移 ${migrated} 个文件`));
|
|
113
|
-
console.log(chalk.dim(' 旧文件保留在原位,确认无误后可手动删除'));
|
|
114
|
-
} else {
|
|
115
|
-
console.log(chalk.yellow(' 没有需要迁移的文件'));
|
|
116
|
-
}
|
|
117
|
-
}
|