@bicorne/task-flow 0.1.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 (118) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +252 -0
  3. package/SKILL.md +250 -0
  4. package/assets/.harnessrc +10 -0
  5. package/assets/PHASE-task.json.example +50 -0
  6. package/assets/design.md +69 -0
  7. package/assets/hooks.json +15 -0
  8. package/assets/product-requirement.md +82 -0
  9. package/assets/schema.json +127 -0
  10. package/assets/tasks.md +26 -0
  11. package/dist/commands/analyze.d.ts +32 -0
  12. package/dist/commands/analyze.js +338 -0
  13. package/dist/commands/archive.d.ts +11 -0
  14. package/dist/commands/archive.js +53 -0
  15. package/dist/commands/design.d.ts +38 -0
  16. package/dist/commands/design.js +492 -0
  17. package/dist/commands/extract.d.ts +31 -0
  18. package/dist/commands/extract.js +477 -0
  19. package/dist/commands/init.d.ts +24 -0
  20. package/dist/commands/init.js +165 -0
  21. package/dist/commands/merge/index.d.ts +17 -0
  22. package/dist/commands/merge/index.js +322 -0
  23. package/dist/commands/merge/merger.d.ts +18 -0
  24. package/dist/commands/merge/merger.js +151 -0
  25. package/dist/commands/merge/types.d.ts +67 -0
  26. package/dist/commands/merge/types.js +6 -0
  27. package/dist/commands/merge/validators.d.ts +14 -0
  28. package/dist/commands/merge/validators.js +147 -0
  29. package/dist/commands/merge.d.ts +7 -0
  30. package/dist/commands/merge.js +15 -0
  31. package/dist/commands/start.d.ts +32 -0
  32. package/dist/commands/start.js +265 -0
  33. package/dist/commands/status.d.ts +15 -0
  34. package/dist/commands/status.js +143 -0
  35. package/dist/commands/sync.d.ts +11 -0
  36. package/dist/commands/sync.js +58 -0
  37. package/dist/commands/tasks-gen/doc-parser.d.ts +7 -0
  38. package/dist/commands/tasks-gen/doc-parser.js +259 -0
  39. package/dist/commands/tasks-gen/generators.d.ts +33 -0
  40. package/dist/commands/tasks-gen/generators.js +141 -0
  41. package/dist/commands/tasks-gen/index.d.ts +30 -0
  42. package/dist/commands/tasks-gen/index.js +345 -0
  43. package/dist/commands/tasks-gen/parsers.d.ts +29 -0
  44. package/dist/commands/tasks-gen/parsers.js +272 -0
  45. package/dist/commands/tasks-gen/templates.d.ts +8 -0
  46. package/dist/commands/tasks-gen/templates.js +37 -0
  47. package/dist/commands/tasks-gen/types.d.ts +71 -0
  48. package/dist/commands/tasks-gen/types.js +17 -0
  49. package/dist/commands/tasks-gen/validators.d.ts +14 -0
  50. package/dist/commands/tasks-gen/validators.js +54 -0
  51. package/dist/commands/tasks.d.ts +9 -0
  52. package/dist/commands/tasks.js +22 -0
  53. package/dist/commands/worktree.d.ts +28 -0
  54. package/dist/commands/worktree.js +275 -0
  55. package/dist/hooks/check-prd-exists.d.ts +20 -0
  56. package/dist/hooks/check-prd-exists.js +61 -0
  57. package/dist/hooks/check-worktree-conflict.d.ts +34 -0
  58. package/dist/hooks/check-worktree-conflict.js +107 -0
  59. package/dist/hooks/hook-runner/executor.d.ts +18 -0
  60. package/dist/hooks/hook-runner/executor.js +143 -0
  61. package/dist/hooks/hook-runner/index.d.ts +64 -0
  62. package/dist/hooks/hook-runner/index.js +220 -0
  63. package/dist/hooks/hook-runner/loader.d.ts +23 -0
  64. package/dist/hooks/hook-runner/loader.js +126 -0
  65. package/dist/hooks/hook-runner/types.d.ts +59 -0
  66. package/dist/hooks/hook-runner/types.js +6 -0
  67. package/dist/hooks/hook-runner.d.ts +9 -0
  68. package/dist/hooks/hook-runner.js +30 -0
  69. package/dist/hooks/phase-complete-detector.d.ts +35 -0
  70. package/dist/hooks/phase-complete-detector.js +203 -0
  71. package/dist/hooks/phase-gate-validator.d.ts +76 -0
  72. package/dist/hooks/phase-gate-validator.js +407 -0
  73. package/dist/hooks/save-checkpoint.d.ts +43 -0
  74. package/dist/hooks/save-checkpoint.js +144 -0
  75. package/dist/hooks/start-mcp-servers.d.ts +50 -0
  76. package/dist/hooks/start-mcp-servers.js +75 -0
  77. package/dist/hooks/stop-mcp-servers.d.ts +40 -0
  78. package/dist/hooks/stop-mcp-servers.js +58 -0
  79. package/dist/index.d.ts +29 -0
  80. package/dist/index.js +238 -0
  81. package/dist/lib/archive.d.ts +31 -0
  82. package/dist/lib/archive.js +226 -0
  83. package/dist/lib/config.d.ts +93 -0
  84. package/dist/lib/config.js +251 -0
  85. package/dist/lib/constants.d.ts +222 -0
  86. package/dist/lib/constants.js +247 -0
  87. package/dist/lib/interactive.d.ts +31 -0
  88. package/dist/lib/interactive.js +166 -0
  89. package/dist/lib/mcp-client.d.ts +156 -0
  90. package/dist/lib/mcp-client.js +370 -0
  91. package/dist/lib/state.d.ts +119 -0
  92. package/dist/lib/state.js +293 -0
  93. package/dist/slash/executor.d.ts +22 -0
  94. package/dist/slash/executor.js +259 -0
  95. package/dist/slash/index.d.ts +11 -0
  96. package/dist/slash/index.js +45 -0
  97. package/dist/slash/parser.d.ts +24 -0
  98. package/dist/slash/parser.js +101 -0
  99. package/dist/slash/registry.d.ts +22 -0
  100. package/dist/slash/registry.js +155 -0
  101. package/dist/spec/openspec-to-task/builders.d.ts +107 -0
  102. package/dist/spec/openspec-to-task/builders.js +138 -0
  103. package/dist/spec/openspec-to-task/index.d.ts +20 -0
  104. package/dist/spec/openspec-to-task/index.js +182 -0
  105. package/dist/spec/openspec-to-task/parsers.d.ts +65 -0
  106. package/dist/spec/openspec-to-task/parsers.js +232 -0
  107. package/dist/spec/openspec-to-task/types.d.ts +49 -0
  108. package/dist/spec/openspec-to-task/types.js +6 -0
  109. package/dist/spec/sync-openspec-to-task.d.ts +7 -0
  110. package/dist/spec/sync-openspec-to-task.js +21 -0
  111. package/dist/spec/sync-task-to-openspec.d.ts +27 -0
  112. package/dist/spec/sync-task-to-openspec.js +288 -0
  113. package/dist/types/ai-context.d.ts +108 -0
  114. package/dist/types/ai-context.js +9 -0
  115. package/package.json +66 -0
  116. package/references/AI-CONVERSATION-TUTORIAL.md +270 -0
  117. package/references/CLI-TUTORIAL.md +447 -0
  118. package/references/GIT-WORKTREE-SOP.md +109 -0
@@ -0,0 +1,288 @@
1
+ "use strict";
2
+ /**
3
+ * sync-task-to-openspec.ts
4
+ * Sync task execution status back to Spec
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || (function () {
23
+ var ownKeys = function(o) {
24
+ ownKeys = Object.getOwnPropertyNames || function (o) {
25
+ var ar = [];
26
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
+ return ar;
28
+ };
29
+ return ownKeys(o);
30
+ };
31
+ return function (mod) {
32
+ if (mod && mod.__esModule) return mod;
33
+ var result = {};
34
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
+ __setModuleDefault(result, mod);
36
+ return result;
37
+ };
38
+ })();
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ exports.syncTaskToSpec = syncTaskToSpec;
41
+ exports.main = main;
42
+ const fs = __importStar(require("fs"));
43
+ const path = __importStar(require("path"));
44
+ const config_1 = require("../lib/config");
45
+ const state_1 = require("../lib/state");
46
+ /**
47
+ * Validate that a resolved path is within the project root (prevent path traversal)
48
+ * @param resolvedPath - The resolved absolute path
49
+ * @param projectRoot - The project root directory
50
+ * @returns True if path is within project root
51
+ */
52
+ function isPathWithinProject(resolvedPath, projectRoot) {
53
+ const relativePath = path.relative(projectRoot, resolvedPath);
54
+ return !relativePath.startsWith('..') && !path.isAbsolute(relativePath);
55
+ }
56
+ function parseArgs(argv) {
57
+ const args = {};
58
+ for (let i = 2; i < argv.length; i += 1) {
59
+ const token = argv[i] || '';
60
+ if (!token.startsWith('--')) {
61
+ continue;
62
+ }
63
+ const key = token.slice(2);
64
+ const next = argv[i + 1] || '';
65
+ if (!next || next.startsWith('--')) {
66
+ args[key] = true;
67
+ continue;
68
+ }
69
+ args[key] = next;
70
+ i += 1;
71
+ }
72
+ return args;
73
+ }
74
+ function ensurePosix(p) {
75
+ return String(p || '').replace(/\\/g, '/');
76
+ }
77
+ function readJsonIfExists(filePath) {
78
+ if (!filePath || !fs.existsSync(filePath)) {
79
+ return null;
80
+ }
81
+ try {
82
+ return JSON.parse(fs.readFileSync(filePath, 'utf8'));
83
+ }
84
+ catch {
85
+ return null;
86
+ }
87
+ }
88
+ function readTextIfExists(filePath) {
89
+ if (!filePath || !fs.existsSync(filePath)) {
90
+ return '';
91
+ }
92
+ return fs.readFileSync(filePath, 'utf8');
93
+ }
94
+ function getTaskFilePath(config, taskId) {
95
+ return path.resolve(config.tasksDirAbs, `${taskId}.json`);
96
+ }
97
+ function readTaskJson(config, taskId) {
98
+ const taskPath = getTaskFilePath(config, taskId);
99
+ if (!fs.existsSync(taskPath)) {
100
+ return null;
101
+ }
102
+ return readJsonIfExists(taskPath);
103
+ }
104
+ function normalizeSnapshotValidations(snapshot) {
105
+ const results = Array.isArray(snapshot?.validationResults) ? snapshot.validationResults : [];
106
+ return results.map((item) => ({
107
+ name: item?.name || '',
108
+ status: item?.status || 'unknown',
109
+ detail: item?.detail || null,
110
+ }));
111
+ }
112
+ function toExecutionStatus(state) {
113
+ if (state?.status === 'completed') {
114
+ return 'completed';
115
+ }
116
+ if (state?.lastGateBlockedReason) {
117
+ return 'blocked';
118
+ }
119
+ return state?.status || 'running';
120
+ }
121
+ function resolveReviewPath(config, taskJson) {
122
+ const report = taskJson?.metadata?.outputs?.report;
123
+ if (!report) {
124
+ return null;
125
+ }
126
+ return path.resolve(config.projectRoot, report);
127
+ }
128
+ function resolveSnapshotPath(config, state, taskJson) {
129
+ if (state?.currentSnapshot) {
130
+ return path.resolve(config.projectRoot, state.currentSnapshot);
131
+ }
132
+ const snapshot = taskJson?.metadata?.outputs?.snapshot;
133
+ if (!snapshot) {
134
+ return null;
135
+ }
136
+ return path.resolve(config.projectRoot, snapshot);
137
+ }
138
+ function parseReviewConclusion(content) {
139
+ const patterns = [
140
+ { regex: /^\s*(?:结论 |Conclusion)\s*:\s*PASS\b/m, result: 'PASS' },
141
+ { regex: /^\s*(?:结论 |Conclusion)\s*:\s*NEEDS_WORK\b/m, result: 'NEEDS_WORK' },
142
+ { regex: /^\s*(?:结论 |Conclusion)\s*:\s*FAIL\b/m, result: 'FAIL' },
143
+ { regex: /^##\s*结论\s*:\s*PASS\b/m, result: 'PASS' },
144
+ { regex: /^##\s*结论\s*:\s*NEEDS_WORK\b/m, result: 'NEEDS_WORK' },
145
+ { regex: /^##\s*结论\s*:\s*FAIL\b/m, result: 'FAIL' },
146
+ { regex: /^#\s*PASS\b/m, result: 'PASS' },
147
+ { regex: /^#\s*NEEDS_WORK\b/m, result: 'NEEDS_WORK' },
148
+ { regex: /^#\s*FAIL\b/m, result: 'FAIL' },
149
+ { regex: /\*\*结论\*\*\s*:\s*PASS\b/, result: 'PASS' },
150
+ { regex: /\*\*结论\*\*\s*:\s*NEEDS_WORK\b/, result: 'NEEDS_WORK' },
151
+ { regex: /\*\*结论\*\*\s*:\s*FAIL\b/, result: 'FAIL' },
152
+ { regex: /\*\*PASS\*\*/, result: 'PASS' },
153
+ { regex: /\*\*NEEDS_WORK\*\*/, result: 'NEEDS_WORK' },
154
+ { regex: /\*\*FAIL\*\*/, result: 'FAIL' },
155
+ ];
156
+ for (const { regex, result } of patterns) {
157
+ const match = content.match(regex);
158
+ if (match) {
159
+ return result;
160
+ }
161
+ }
162
+ return null;
163
+ }
164
+ function buildExecutionDocument(params) {
165
+ const { config, taskJson, state, taskId, spec } = params;
166
+ const snapshotPath = resolveSnapshotPath(config, state, taskJson);
167
+ const reportPath = resolveReviewPath(config, taskJson);
168
+ const snapshot = readJsonIfExists(snapshotPath);
169
+ const reportContent = readTextIfExists(reportPath);
170
+ const report = reportContent ? { conclusion: parseReviewConclusion(reportContent), validationMap: {} } : { conclusion: null, validationMap: {} };
171
+ const archivePath = path.resolve(config.archiveDirAbs, `${taskId}.json`);
172
+ const archive = readJsonIfExists(archivePath);
173
+ return {
174
+ change: spec.change,
175
+ taskId,
176
+ status: toExecutionStatus(state),
177
+ currentPhase: state?.currentPhase || null,
178
+ phaseCompleted: state?.phaseCompleted || null,
179
+ reviewConclusion: state?.reviewConclusion || report.conclusion || null,
180
+ currentSnapshot: state?.currentSnapshot || (snapshotPath ? ensurePosix(path.relative(config.projectRoot, snapshotPath)) : null),
181
+ updatedAt: state?.updatedAt || new Date().toISOString(),
182
+ startedAt: state?.startedAt || null,
183
+ archive: {
184
+ path: fs.existsSync(archivePath) ? ensurePosix(path.relative(config.projectRoot, archivePath)) : null,
185
+ eventCount: Array.isArray(archive?.events) ? archive.events.length : 0,
186
+ lastEvent: Array.isArray(archive?.events) && archive.events.length > 0 ? archive.events[archive.events.length - 1] : null,
187
+ },
188
+ lastGate: {
189
+ blockedAt: state?.lastGateBlockedAt || null,
190
+ reason: state?.lastGateBlockedReason || null,
191
+ phase: state?.lastGateBlockedPhase || null,
192
+ missingValidations: Array.isArray(state?.lastMissingValidations) ? state.lastMissingValidations : [],
193
+ },
194
+ taskPhases: {
195
+ planning: taskJson?.status || 'pending',
196
+ implementation: taskJson?.status || 'pending',
197
+ review: taskJson?.status || 'pending',
198
+ },
199
+ artifacts: {
200
+ task: ensurePosix(path.relative(config.projectRoot, getTaskFilePath(config, taskId))),
201
+ proposal: spec.proposal || null,
202
+ design: spec.design || null,
203
+ tasks: spec.tasks || null,
204
+ snapshot: snapshotPath ? ensurePosix(path.relative(config.projectRoot, snapshotPath)) : null,
205
+ review: reportPath ? ensurePosix(path.relative(config.projectRoot, reportPath)) : null,
206
+ },
207
+ planning: {
208
+ embedded: true,
209
+ summary: taskJson?.implementation?.notes || '',
210
+ },
211
+ validations: {
212
+ implementation: normalizeSnapshotValidations(snapshot),
213
+ review: Object.entries(report.validationMap || {}).map(([name, status]) => ({ name, status })),
214
+ },
215
+ mergeStrategy: taskJson?.metadata?.mergeStrategy || { type: 'squash', deleteBranch: true, deleteWorktree: true },
216
+ };
217
+ }
218
+ function getMetadataSpec(taskJson) {
219
+ if (!taskJson?.metadata?.change) {
220
+ return null;
221
+ }
222
+ return {
223
+ change: taskJson.metadata.change,
224
+ proposal: taskJson.docs_to_read?.[0] || null,
225
+ design: taskJson.docs_to_read?.[1] || null,
226
+ tasks: taskJson.docs_to_read?.[2] || null,
227
+ manifest: taskJson.metadata.manifest || null,
228
+ execution: taskJson.metadata.execution || null,
229
+ version: 'v1',
230
+ };
231
+ }
232
+ /**
233
+ * Sync task to Spec
234
+ */
235
+ function syncTaskToSpec(options = {}) {
236
+ const config = (0, config_1.loadConfig)({ cwd: options.cwd });
237
+ const state = (0, state_1.loadState)(config);
238
+ const taskId = options.taskId || state.currentTask;
239
+ if (!taskId) {
240
+ return { skipped: true, reason: 'missing-task-id' };
241
+ }
242
+ const taskJson = readTaskJson(config, taskId);
243
+ if (!taskJson) {
244
+ return { skipped: true, reason: 'missing-task-file' };
245
+ }
246
+ const spec = getMetadataSpec(taskJson);
247
+ if (!spec?.change) {
248
+ return { skipped: true, reason: 'missing-spec-metadata' };
249
+ }
250
+ const executionTarget = spec.execution || ensurePosix(`spec/changes/${spec.change}/execution.json`);
251
+ const executionPath = path.resolve(config.projectRoot, executionTarget);
252
+ // Security: Validate execution path is within project root
253
+ if (!isPathWithinProject(executionPath, config.projectRoot)) {
254
+ console.error(`[SPEC-SYNC] Execution path escapes project root: ${executionTarget}`);
255
+ return { skipped: true, reason: 'invalid-execution-path' };
256
+ }
257
+ const executionDoc = buildExecutionDocument({ config, taskJson, state, taskId, spec });
258
+ fs.mkdirSync(path.dirname(executionPath), { recursive: true });
259
+ fs.writeFileSync(executionPath, JSON.stringify(executionDoc, null, 2), 'utf8');
260
+ return {
261
+ skipped: false,
262
+ taskId,
263
+ change: spec.change,
264
+ executionPath: ensurePosix(path.relative(config.projectRoot, executionPath)),
265
+ };
266
+ }
267
+ /**
268
+ * Main entry point
269
+ */
270
+ function main() {
271
+ const args = parseArgs(process.argv);
272
+ const result = syncTaskToSpec({
273
+ cwd: args.cwd,
274
+ taskId: args['task-id'],
275
+ });
276
+ if (result.skipped) {
277
+ console.log(`[SPEC-SYNC] skipped: ${result.reason}`);
278
+ process.exit(0);
279
+ }
280
+ console.log(`[SPEC-SYNC] updated: ${result.executionPath}`);
281
+ process.exit(0);
282
+ }
283
+ if (require.main === module) {
284
+ main();
285
+ }
286
+ exports.default = {
287
+ syncTaskToSpec,
288
+ };
@@ -0,0 +1,108 @@
1
+ /**
2
+ * types/ai-context.ts
3
+ * AI 项目上下文协议定义
4
+ *
5
+ * AI 在调用 extract/design/tasks 命令前,先分析宿主项目并生成此结构,
6
+ * 通过 --context-file 参数传入。CLI 命令会将其注入到生成的文档中。
7
+ */
8
+ /**
9
+ * 项目基本信息
10
+ */
11
+ export interface ProjectInfo {
12
+ /** 项目名称 */
13
+ name: string;
14
+ /** 项目描述(从 package.json description 或 README 提取) */
15
+ description?: string;
16
+ /** 项目类型 */
17
+ type?: 'library' | 'application' | 'service' | 'cli' | 'monorepo';
18
+ /** 技术栈 */
19
+ techStack?: TechStack;
20
+ /** 目录结构摘要 */
21
+ structure?: DirectorySummary[];
22
+ /** 关键文件列表 */
23
+ keyFiles?: string[];
24
+ /** 依赖信息 */
25
+ dependencies?: DependencyInfo;
26
+ }
27
+ /**
28
+ * 技术栈信息
29
+ */
30
+ export interface TechStack {
31
+ /** 编程语言及版本 */
32
+ language?: string;
33
+ /** 运行时 */
34
+ runtime?: string;
35
+ /** 框架 */
36
+ framework?: string;
37
+ /** 构建工具 */
38
+ buildTool?: string;
39
+ /** 测试框架 */
40
+ testFramework?: string;
41
+ /** 代码规范工具 */
42
+ lintTool?: string;
43
+ /** 包管理器 */
44
+ packageManager?: string;
45
+ /** 其他关键技术 */
46
+ others?: string[];
47
+ }
48
+ /**
49
+ * 目录摘要
50
+ */
51
+ export interface DirectorySummary {
52
+ /** 目录路径 */
53
+ path: string;
54
+ /** 目录用途描述 */
55
+ purpose: string;
56
+ /** 文件数量(可选) */
57
+ fileCount?: number;
58
+ }
59
+ /**
60
+ * 依赖信息
61
+ */
62
+ export interface DependencyInfo {
63
+ /** 核心依赖 */
64
+ core?: string[];
65
+ /** 开发依赖 */
66
+ dev?: string[];
67
+ /** 缺失的关键依赖(AI 建议添加的) */
68
+ suggested?: string[];
69
+ }
70
+ /**
71
+ * AI 项目上下文(完整结构)
72
+ */
73
+ export interface AiContext {
74
+ /** 协议版本 */
75
+ version: '1.0';
76
+ /** 项目基本信息 */
77
+ project: ProjectInfo;
78
+ /** AI 对项目的理解和分析 */
79
+ analysis?: {
80
+ /** 项目架构总结 */
81
+ architectureSummary?: string;
82
+ /** 核心模块识别 */
83
+ coreModules?: Array<{
84
+ name: string;
85
+ path: string;
86
+ description: string;
87
+ }>;
88
+ /** 识别的设计模式 */
89
+ designPatterns?: string[];
90
+ /** 潜在技术风险 */
91
+ risks?: string[];
92
+ /** 改进建议 */
93
+ suggestions?: string[];
94
+ };
95
+ /** 任务特定信息 */
96
+ task?: {
97
+ /** 任务类型 */
98
+ type?: 'feat' | 'fix' | 'refactor' | 'test' | 'docs' | 'chore';
99
+ /** 任务优先级 */
100
+ priority?: 'high' | 'medium' | 'low';
101
+ /** 任务涉及的文件范围 */
102
+ affectedFiles?: string[];
103
+ /** 任务约束条件 */
104
+ constraints?: string[];
105
+ /** 特殊要求 */
106
+ requirements?: string[];
107
+ };
108
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * types/ai-context.ts
4
+ * AI 项目上下文协议定义
5
+ *
6
+ * AI 在调用 extract/design/tasks 命令前,先分析宿主项目并生成此结构,
7
+ * 通过 --context-file 参数传入。CLI 命令会将其注入到生成的文档中。
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@bicorne/task-flow",
3
+ "version": "0.1.0",
4
+ "description": "Git worktree-based parallel task execution system for zero-conflict multi-task development",
5
+ "license": "MIT",
6
+ "type": "commonjs",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "bin": {
10
+ "task-flow": "./dist/index.js"
11
+ },
12
+ "engines": {
13
+ "node": ">=24.14.0"
14
+ },
15
+ "engineStrict": true,
16
+ "keywords": [
17
+ "harness",
18
+ "task-flow",
19
+ "git-worktree",
20
+ "parallel-development",
21
+ "task-management",
22
+ "developer-tools"
23
+ ],
24
+ "author": "Sam Xu",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/didengren/harness-task-flow.git"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/didengren/harness-task-flow/issues"
31
+ },
32
+ "homepage": "https://github.com/didengren/harness-task-flow#readme",
33
+ "files": [
34
+ "dist/",
35
+ "assets/",
36
+ "references/",
37
+ "SKILL.md",
38
+ "README.md",
39
+ "LICENSE"
40
+ ],
41
+ "devDependencies": {
42
+ "@changesets/cli": "^2.27.0",
43
+ "@eslint/js": "^9.0.0",
44
+ "@types/node": "^24.12.0",
45
+ "@typescript-eslint/eslint-plugin": "8.58.0",
46
+ "@typescript-eslint/parser": "8.58.0",
47
+ "eslint": "^9.0.0",
48
+ "globals": "^15.0.0",
49
+ "typescript": "^5.9.3",
50
+ "typescript-eslint": "^8.58.0"
51
+ },
52
+ "publishConfig": {
53
+ "access": "public"
54
+ },
55
+ "scripts": {
56
+ "test": "node --test tests/**/*.test.js",
57
+ "lint": "eslint src/",
58
+ "build": "tsc --project tsconfig.build.json",
59
+ "build:dev": "tsc",
60
+ "build:watch": "tsc --watch",
61
+ "typecheck": "tsc --noEmit",
62
+ "changeset": "changeset",
63
+ "version": "changeset version",
64
+ "release": "pnpm build && changeset publish"
65
+ }
66
+ }