openplanr 0.9.0 → 1.0.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.
- package/README.md +142 -58
- package/dist/agents/index.d.ts +1 -5
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +1 -4
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/task-parser.d.ts +4 -1
- package/dist/agents/task-parser.d.ts.map +1 -1
- package/dist/agents/task-parser.js +6 -3
- package/dist/agents/task-parser.js.map +1 -1
- package/dist/agents/utils.d.ts +0 -4
- package/dist/agents/utils.d.ts.map +1 -1
- package/dist/agents/utils.js +3 -24
- package/dist/agents/utils.js.map +1 -1
- package/dist/ai/codebase/context-builder.d.ts +22 -3
- package/dist/ai/codebase/context-builder.d.ts.map +1 -1
- package/dist/ai/codebase/context-builder.js +202 -14
- package/dist/ai/codebase/context-builder.js.map +1 -1
- package/dist/ai/codebase/file-reader.d.ts.map +1 -1
- package/dist/ai/codebase/file-reader.js +7 -3
- package/dist/ai/codebase/file-reader.js.map +1 -1
- package/dist/ai/codebase/index.d.ts +3 -1
- package/dist/ai/codebase/index.d.ts.map +1 -1
- package/dist/ai/codebase/index.js +3 -1
- package/dist/ai/codebase/index.js.map +1 -1
- package/dist/ai/codebase/pattern-rules.d.ts +28 -0
- package/dist/ai/codebase/pattern-rules.d.ts.map +1 -0
- package/dist/ai/codebase/pattern-rules.js +186 -0
- package/dist/ai/codebase/pattern-rules.js.map +1 -0
- package/dist/ai/codebase/rules-reader.d.ts +14 -0
- package/dist/ai/codebase/rules-reader.d.ts.map +1 -0
- package/dist/ai/codebase/rules-reader.js +25 -0
- package/dist/ai/codebase/rules-reader.js.map +1 -0
- package/dist/ai/codebase/stack-detector.d.ts.map +1 -1
- package/dist/ai/codebase/stack-detector.js +4 -1
- package/dist/ai/codebase/stack-detector.js.map +1 -1
- package/dist/ai/codebase/tree-generator.d.ts.map +1 -1
- package/dist/ai/codebase/tree-generator.js +5 -2
- package/dist/ai/codebase/tree-generator.js.map +1 -1
- package/dist/ai/errors.js +1 -1
- package/dist/ai/errors.js.map +1 -1
- package/dist/ai/prompts/prompt-builder.d.ts +12 -0
- package/dist/ai/prompts/prompt-builder.d.ts.map +1 -1
- package/dist/ai/prompts/prompt-builder.js +38 -3
- package/dist/ai/prompts/prompt-builder.js.map +1 -1
- package/dist/ai/prompts/system-prompts.d.ts +4 -2
- package/dist/ai/prompts/system-prompts.d.ts.map +1 -1
- package/dist/ai/prompts/system-prompts.js +72 -12
- package/dist/ai/prompts/system-prompts.js.map +1 -1
- package/dist/ai/schemas/ai-response-schemas.d.ts +48 -2
- package/dist/ai/schemas/ai-response-schemas.d.ts.map +1 -1
- package/dist/ai/schemas/ai-response-schemas.js +19 -0
- package/dist/ai/schemas/ai-response-schemas.js.map +1 -1
- package/dist/ai/types.d.ts +3 -1
- package/dist/ai/types.d.ts.map +1 -1
- package/dist/ai/types.js +2 -0
- package/dist/ai/types.js.map +1 -1
- package/dist/ai/validation/dependency-chains.d.ts +21 -0
- package/dist/ai/validation/dependency-chains.d.ts.map +1 -0
- package/dist/ai/validation/dependency-chains.js +114 -0
- package/dist/ai/validation/dependency-chains.js.map +1 -0
- package/dist/ai/validation/index.d.ts +3 -0
- package/dist/ai/validation/index.d.ts.map +1 -0
- package/dist/ai/validation/index.js +3 -0
- package/dist/ai/validation/index.js.map +1 -0
- package/dist/ai/validation/task-validator.d.ts +37 -0
- package/dist/ai/validation/task-validator.d.ts.map +1 -0
- package/dist/ai/validation/task-validator.js +89 -0
- package/dist/ai/validation/task-validator.js.map +1 -0
- package/dist/cli/commands/backlog.d.ts +10 -0
- package/dist/cli/commands/backlog.d.ts.map +1 -0
- package/dist/cli/commands/backlog.js +292 -0
- package/dist/cli/commands/backlog.js.map +1 -0
- package/dist/cli/commands/checklist.js +4 -4
- package/dist/cli/commands/checklist.js.map +1 -1
- package/dist/cli/commands/config.js +13 -13
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/epic.d.ts.map +1 -1
- package/dist/cli/commands/epic.js +29 -23
- package/dist/cli/commands/epic.js.map +1 -1
- package/dist/cli/commands/estimate.d.ts.map +1 -1
- package/dist/cli/commands/estimate.js +40 -39
- package/dist/cli/commands/estimate.js.map +1 -1
- package/dist/cli/commands/export.js +6 -4
- package/dist/cli/commands/export.js.map +1 -1
- package/dist/cli/commands/feature.js +9 -9
- package/dist/cli/commands/feature.js.map +1 -1
- package/dist/cli/commands/github.d.ts.map +1 -1
- package/dist/cli/commands/github.js +30 -27
- package/dist/cli/commands/github.js.map +1 -1
- package/dist/cli/commands/plan.d.ts.map +1 -1
- package/dist/cli/commands/plan.js +27 -42
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/quick.d.ts.map +1 -1
- package/dist/cli/commands/quick.js +37 -107
- package/dist/cli/commands/quick.js.map +1 -1
- package/dist/cli/commands/refine.js +21 -21
- package/dist/cli/commands/refine.js.map +1 -1
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/search.js +18 -7
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/sprint.d.ts +9 -0
- package/dist/cli/commands/sprint.d.ts.map +1 -0
- package/dist/cli/commands/sprint.js +519 -0
- package/dist/cli/commands/sprint.js.map +1 -0
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +77 -32
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/story.js +15 -15
- package/dist/cli/commands/story.js.map +1 -1
- package/dist/cli/commands/sync.js +11 -7
- package/dist/cli/commands/sync.js.map +1 -1
- package/dist/cli/commands/task.d.ts +0 -2
- package/dist/cli/commands/task.d.ts.map +1 -1
- package/dist/cli/commands/task.js +14 -169
- package/dist/cli/commands/task.js.map +1 -1
- package/dist/cli/commands/template.d.ts +10 -0
- package/dist/cli/commands/template.d.ts.map +1 -0
- package/dist/cli/commands/template.js +269 -0
- package/dist/cli/commands/template.js.map +1 -0
- package/dist/cli/helpers/task-creation.d.ts +89 -0
- package/dist/cli/helpers/task-creation.d.ts.map +1 -0
- package/dist/cli/helpers/task-creation.js +140 -0
- package/dist/cli/helpers/task-creation.js.map +1 -0
- package/dist/cli/index.js +25 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/models/schema.d.ts +2 -0
- package/dist/models/schema.d.ts.map +1 -1
- package/dist/models/schema.js +2 -0
- package/dist/models/schema.js.map +1 -1
- package/dist/models/types.d.ts +32 -1
- package/dist/models/types.d.ts.map +1 -1
- package/dist/services/artifact-gathering.d.ts +2 -0
- package/dist/services/artifact-gathering.d.ts.map +1 -1
- package/dist/services/artifact-gathering.js +26 -7
- package/dist/services/artifact-gathering.js.map +1 -1
- package/dist/services/artifact-service.d.ts +5 -5
- package/dist/services/artifact-service.d.ts.map +1 -1
- package/dist/services/artifact-service.js +4 -0
- package/dist/services/artifact-service.js.map +1 -1
- package/dist/services/config-service.d.ts.map +1 -1
- package/dist/services/config-service.js +2 -0
- package/dist/services/config-service.js.map +1 -1
- package/dist/services/credential-backends.d.ts.map +1 -1
- package/dist/services/credential-backends.js +15 -7
- package/dist/services/credential-backends.js.map +1 -1
- package/dist/services/credentials-service.d.ts.map +1 -1
- package/dist/services/credentials-service.js +6 -3
- package/dist/services/credentials-service.js.map +1 -1
- package/dist/services/github-service.d.ts +2 -2
- package/dist/services/github-service.d.ts.map +1 -1
- package/dist/services/github-service.js +9 -4
- package/dist/services/github-service.js.map +1 -1
- package/dist/services/template-service.d.ts +2 -1
- package/dist/services/template-service.d.ts.map +1 -1
- package/dist/services/template-service.js +2 -1
- package/dist/services/template-service.js.map +1 -1
- package/dist/templates/backlog/backlog-item.md.hbs +40 -0
- package/dist/templates/checklists/agile-checklist.md.hbs +1 -1
- package/dist/templates/quick/quick-task.md.hbs +1 -1
- package/dist/templates/rules/claude/CLAUDE.md.hbs +78 -35
- package/dist/templates/rules/codex/AGENTS.md.hbs +73 -17
- package/dist/templates/rules/cursor/2101-implement-task-list.mdc.hbs +66 -14
- package/dist/templates/sprints/sprint.md.hbs +42 -0
- package/dist/templates/task-templates/api-integration.json +45 -0
- package/dist/templates/task-templates/auth-flow.json +48 -0
- package/dist/templates/task-templates/database-migration.json +44 -0
- package/dist/templates/task-templates/react-component.json +45 -0
- package/dist/templates/task-templates/rest-endpoint.json +53 -0
- package/dist/templates/tasks/task-list.md.hbs +1 -1
- package/dist/utils/constants.d.ts +4 -0
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +4 -0
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/logger.d.ts +31 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +92 -9
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/markdown.d.ts +3 -2
- package/dist/utils/markdown.d.ts.map +1 -1
- package/dist/utils/markdown.js +3 -1
- package/dist/utils/markdown.js.map +1 -1
- package/dist/utils/slugify.d.ts +8 -1
- package/dist/utils/slugify.d.ts.map +1 -1
- package/dist/utils/slugify.js +18 -2
- package/dist/utils/slugify.js.map +1 -1
- package/package.json +14 -3
- package/dist/agents/agent-factory.d.ts +0 -7
- package/dist/agents/agent-factory.d.ts.map +0 -1
- package/dist/agents/agent-factory.js +0 -22
- package/dist/agents/agent-factory.js.map +0 -1
- package/dist/agents/claude-agent.d.ts +0 -18
- package/dist/agents/claude-agent.d.ts.map +0 -1
- package/dist/agents/claude-agent.js +0 -183
- package/dist/agents/claude-agent.js.map +0 -1
- package/dist/agents/codex-agent.d.ts +0 -17
- package/dist/agents/codex-agent.d.ts.map +0 -1
- package/dist/agents/codex-agent.js +0 -124
- package/dist/agents/codex-agent.js.map +0 -1
- package/dist/agents/cursor-agent.d.ts +0 -14
- package/dist/agents/cursor-agent.d.ts.map +0 -1
- package/dist/agents/cursor-agent.js +0 -49
- package/dist/agents/cursor-agent.js.map +0 -1
- package/dist/agents/implementation-bridge.d.ts +0 -30
- package/dist/agents/implementation-bridge.d.ts.map +0 -1
- package/dist/agents/implementation-bridge.js +0 -256
- package/dist/agents/implementation-bridge.js.map +0 -1
- package/dist/agents/progress.d.ts +0 -62
- package/dist/agents/progress.d.ts.map +0 -1
- package/dist/agents/progress.js +0 -155
- package/dist/agents/progress.js.map +0 -1
- package/dist/agents/prompt-composer.d.ts +0 -30
- package/dist/agents/prompt-composer.d.ts.map +0 -1
- package/dist/agents/prompt-composer.js +0 -81
- package/dist/agents/prompt-composer.js.map +0 -1
- package/dist/agents/types.d.ts +0 -25
- package/dist/agents/types.d.ts.map +0 -1
- package/dist/agents/types.js +0 -8
- package/dist/agents/types.js.map +0 -1
- package/dist/utils/error-context.d.ts +0 -23
- package/dist/utils/error-context.d.ts.map +0 -1
- package/dist/utils/error-context.js +0 -94
- package/dist/utils/error-context.js.map +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads project-specific rules from `.planr/rules.md`.
|
|
3
|
+
*
|
|
4
|
+
* These rules are injected directly into AI prompts so project
|
|
5
|
+
* owners can control how the AI generates tasks, names files,
|
|
6
|
+
* and follows architectural conventions — without modifying code.
|
|
7
|
+
*/
|
|
8
|
+
import { readProjectFile } from './file-reader.js';
|
|
9
|
+
/** Maximum characters to read from the rules file. */
|
|
10
|
+
const MAX_RULES_CHARS = 8_000;
|
|
11
|
+
/**
|
|
12
|
+
* Read `.planr/rules.md` from the project directory.
|
|
13
|
+
*
|
|
14
|
+
* @returns The trimmed rules content, or `null` if the file doesn't exist or is empty.
|
|
15
|
+
*/
|
|
16
|
+
export async function readProjectRules(projectDir) {
|
|
17
|
+
const content = await readProjectFile(projectDir, '.planr/rules.md');
|
|
18
|
+
if (content === null)
|
|
19
|
+
return null;
|
|
20
|
+
const trimmed = content.trim();
|
|
21
|
+
if (!trimmed)
|
|
22
|
+
return null;
|
|
23
|
+
return trimmed.slice(0, MAX_RULES_CHARS);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=rules-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules-reader.js","sourceRoot":"","sources":["../../../src/ai/codebase/rules-reader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,sDAAsD;AACtD,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,UAAkB;IACvD,MAAM,OAAO,GAAG,MAAM,eAAe,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;IACrE,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAClC,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC/B,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-detector.d.ts","sourceRoot":"","sources":["../../../src/ai/codebase/stack-detector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"stack-detector.d.ts","sourceRoot":"","sources":["../../../src/ai/codebase/stack-detector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAqID,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAanF;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CASxD"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import path from 'node:path';
|
|
9
9
|
import { fileExists, readFile } from '../../utils/fs.js';
|
|
10
|
+
import { logger } from '../../utils/logger.js';
|
|
10
11
|
const DETECTORS = [
|
|
11
12
|
{
|
|
12
13
|
file: 'package.json',
|
|
@@ -149,7 +150,9 @@ export async function detectTechStack(projectDir) {
|
|
|
149
150
|
const content = await readFile(filePath);
|
|
150
151
|
return await detector.detect(content, projectDir);
|
|
151
152
|
}
|
|
152
|
-
catch {
|
|
153
|
+
catch (err) {
|
|
154
|
+
logger.debug('Tech stack detection failed for detector', err);
|
|
155
|
+
}
|
|
153
156
|
}
|
|
154
157
|
}
|
|
155
158
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-detector.js","sourceRoot":"","sources":["../../../src/ai/codebase/stack-detector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"stack-detector.js","sourceRoot":"","sources":["../../../src/ai/codebase/stack-detector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAe/C,MAAM,SAAS,GAAoB;IACjC;QACE,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YACxB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAChC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;YACjD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GAA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IAAI,CAAC,aAAa,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC1C,IAAI,KAAK,CAAC,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,cAAc,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;IACjE,IAAI,KAAK,CAAC,cAAc;QAAE,KAAK,CAAC,IAAI,CAAC,oBAAoB,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC;IACjF,IAAI,KAAK,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,qBAAqB,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-generator.d.ts","sourceRoot":"","sources":["../../../src/ai/codebase/tree-generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"tree-generator.d.ts","sourceRoot":"","sources":["../../../src/ai/codebase/tree-generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgCH,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,MAAM,EAClB,QAAQ,GAAE,MAAU,GACnB,OAAO,CAAC,MAAM,CAAC,CAOjB"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { readdir, stat } from 'node:fs/promises';
|
|
8
8
|
import path from 'node:path';
|
|
9
|
+
import { logger } from '../../utils/logger.js';
|
|
9
10
|
const IGNORED_DIRS = new Set([
|
|
10
11
|
'node_modules',
|
|
11
12
|
'.git',
|
|
@@ -44,7 +45,8 @@ async function walkDir(dirPath, prefix, maxDepth, currentDepth, lines) {
|
|
|
44
45
|
try {
|
|
45
46
|
entries = await readdir(dirPath);
|
|
46
47
|
}
|
|
47
|
-
catch {
|
|
48
|
+
catch (err) {
|
|
49
|
+
logger.debug('Failed to read directory for tree generation', err);
|
|
48
50
|
return;
|
|
49
51
|
}
|
|
50
52
|
// Filter and sort: directories first, then files
|
|
@@ -60,7 +62,8 @@ async function walkDir(dirPath, prefix, maxDepth, currentDepth, lines) {
|
|
|
60
62
|
else
|
|
61
63
|
files.push(entry);
|
|
62
64
|
}
|
|
63
|
-
catch {
|
|
65
|
+
catch (err) {
|
|
66
|
+
logger.debug('Failed to stat entry during tree generation', err);
|
|
64
67
|
// Skip inaccessible entries
|
|
65
68
|
}
|
|
66
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-generator.js","sourceRoot":"","sources":["../../../src/ai/codebase/tree-generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"tree-generator.js","sourceRoot":"","sources":["../../../src/ai/codebase/tree-generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,cAAc;IACd,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,OAAO;IACP,OAAO;IACP,aAAa;IACb,aAAa;IACb,eAAe;IACf,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,MAAM;IACN,MAAM;IACN,UAAU;IACV,aAAa;IACb,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,SAAS;CACV,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC;A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,EAChB,KAAK,CACN,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/ai/errors.js
CHANGED
|
@@ -42,7 +42,7 @@ export class AIError extends Error {
|
|
|
42
42
|
export function wrapProviderError(err, provider) {
|
|
43
43
|
if (err instanceof AIError)
|
|
44
44
|
return err;
|
|
45
|
-
const error = err;
|
|
45
|
+
const error = err; // Unknown error shape requires index access
|
|
46
46
|
const status = error?.status;
|
|
47
47
|
const code = error?.code;
|
|
48
48
|
const message = error?.message || String(err);
|
package/dist/ai/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/ai/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,MAAM,OAAO,OAAQ,SAAQ,KAAK;IAGd;IACA;IACA;IACA;IALlB,YACE,OAAe,EACC,IAAiB,EACjB,YAAqB,KAAK,EAC1B,YAAqB,EACrB,KAAe;QAE/B,KAAK,CAAC,OAAO,CAAC,CAAC;QALC,SAAI,GAAJ,IAAI,CAAa;QACjB,cAAS,GAAT,SAAS,CAAiB;QAC1B,iBAAY,GAAZ,YAAY,CAAS;QACrB,UAAK,GAAL,KAAK,CAAU;QAG/B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;IACxB,CAAC;IAED,0DAA0D;IAC1D,IAAI,WAAW;QACb,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YAClB,KAAK,MAAM;gBACT,OAAO,mEAAmE,CAAC;YAC7E,KAAK,YAAY;gBACf,OAAO,mDAAmD,CAAC;YAC7D,KAAK,YAAY;gBACf,OAAO,+DAA+D,CAAC;YACzE,KAAK,YAAY;gBACf,OAAO,4EAA4E,CAAC;YACtF,KAAK,kBAAkB;gBACrB,OAAO,kEAAkE,CAAC;YAC5E;gBACE,OAAO,IAAI,CAAC,OAAO,CAAC;QACxB,CAAC;IACH,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAA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|
|
@@ -40,6 +40,18 @@ export interface TasksPromptInput {
|
|
|
40
40
|
export declare function buildTasksPrompt(ctx: TasksPromptInput): AIMessage[];
|
|
41
41
|
export declare function buildQuickTasksPrompt(description: string, codebaseContext?: string): AIMessage[];
|
|
42
42
|
export declare function buildEstimatePrompt(artifactContent: string, artifactType: string, codebaseContext?: string): AIMessage[];
|
|
43
|
+
export declare function buildBacklogPrioritizePrompt(items: Array<{
|
|
44
|
+
id: string;
|
|
45
|
+
title: string;
|
|
46
|
+
priority: string;
|
|
47
|
+
tags: string[];
|
|
48
|
+
description: string;
|
|
49
|
+
}>, codebaseContext?: string): AIMessage[];
|
|
50
|
+
export declare function buildSprintAutoSelectPrompt(availableTasks: Array<{
|
|
51
|
+
id: string;
|
|
52
|
+
title: string;
|
|
53
|
+
points?: number;
|
|
54
|
+
}>, velocity: number, codebaseContext?: string): AIMessage[];
|
|
43
55
|
export declare function buildRefinePrompt(artifactContent: string, artifactType: string, parentContext?: {
|
|
44
56
|
type: string;
|
|
45
57
|
content: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/ai/prompts/prompt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/ai/prompts/prompt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAgB7C,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,GAAE,MAAM,EAAO,GAAG,SAAS,EAAE,CAkBxF;AAED,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,gBAAgB,GAAE,MAAM,EAAO,EAC/B,YAAY,CAAC,EAAE,MAAM,GACpB,SAAS,EA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AAM,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC,EACF,eAAe,CAAC,EAAE,MAAM,GACvB,SAAS,EAAE,CAkBb;AAED,wBAAgB,2BAA2B,CACzC,cAAc,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EACrE,QAAQ,EAAE,MAAM,EAChB,eAAe,CAAC,EAAE,MAAM,GACvB,SAAS,EAAE,CAeb;AAED,wBAAgB,iBAAiB,CAC/B,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,aAAa,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAChD,SAAS,EAAE,CAYb"}
|
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
* Existing sibling titles are injected to prevent the AI from
|
|
9
9
|
* generating duplicate artifacts.
|
|
10
10
|
*/
|
|
11
|
-
import { EPIC_SYSTEM_PROMPT, ESTIMATE_SYSTEM_PROMPT, FEATURES_SYSTEM_PROMPT, QUICK_TASKS_SYSTEM_PROMPT, REFINE_SYSTEM_PROMPT, STORIES_SYSTEM_PROMPT, TASKS_SYSTEM_PROMPT, } from './system-prompts.js';
|
|
11
|
+
import { BACKLOG_PRIORITIZE_SYSTEM_PROMPT, EPIC_SYSTEM_PROMPT, ESTIMATE_SYSTEM_PROMPT, FEATURES_SYSTEM_PROMPT, QUICK_TASKS_SYSTEM_PROMPT, REFINE_SYSTEM_PROMPT, SPRINT_AUTO_SELECT_SYSTEM_PROMPT, STORIES_SYSTEM_PROMPT, TASKS_SYSTEM_PROMPT, } from './system-prompts.js';
|
|
12
|
+
/** Input exceeding this many lines is treated as a detailed document (PRD, spec, etc.). */
|
|
13
|
+
const DETAILED_INPUT_LINE_THRESHOLD = 5;
|
|
12
14
|
export function buildEpicPrompt(brief, existingEpics = []) {
|
|
13
|
-
const isDetailed = brief.split('\n').length >
|
|
15
|
+
const isDetailed = brief.split('\n').length > DETAILED_INPUT_LINE_THRESHOLD;
|
|
14
16
|
let userContent;
|
|
15
17
|
if (isDetailed) {
|
|
16
18
|
userContent = `Create an epic from this detailed requirements document. Extract ALL key requirements, features, and success criteria from the full document:\n\n${brief}`;
|
|
@@ -94,7 +96,14 @@ export function buildTasksPrompt(ctx) {
|
|
|
94
96
|
];
|
|
95
97
|
}
|
|
96
98
|
export function buildQuickTasksPrompt(description, codebaseContext) {
|
|
97
|
-
|
|
99
|
+
const isDetailed = description.split('\n').length > DETAILED_INPUT_LINE_THRESHOLD;
|
|
100
|
+
let userContent;
|
|
101
|
+
if (isDetailed) {
|
|
102
|
+
userContent = `Generate an implementation task list from this detailed requirements document. Extract ALL commands, data models, constraints, and features into concrete implementation tasks:\n\n${description}`;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
userContent = `Generate an implementation task list for the following:\n\n"${description}"`;
|
|
106
|
+
}
|
|
98
107
|
if (codebaseContext) {
|
|
99
108
|
userContent += `\n\n--- Codebase Context ---\n${codebaseContext}`;
|
|
100
109
|
}
|
|
@@ -113,6 +122,32 @@ export function buildEstimatePrompt(artifactContent, artifactType, codebaseConte
|
|
|
113
122
|
{ role: 'user', content: userContent },
|
|
114
123
|
];
|
|
115
124
|
}
|
|
125
|
+
export function buildBacklogPrioritizePrompt(items, codebaseContext) {
|
|
126
|
+
const itemsList = items
|
|
127
|
+
.map((item) => `- ${item.id}: "${item.title}" (current: ${item.priority}, tags: ${item.tags.join(', ') || 'none'})`)
|
|
128
|
+
.join('\n');
|
|
129
|
+
let userContent = `Prioritize these open backlog items by business impact and effort:\n\n${itemsList}`;
|
|
130
|
+
if (codebaseContext) {
|
|
131
|
+
userContent += `\n\n--- Codebase Context ---\n${codebaseContext}`;
|
|
132
|
+
}
|
|
133
|
+
return [
|
|
134
|
+
{ role: 'system', content: BACKLOG_PRIORITIZE_SYSTEM_PROMPT },
|
|
135
|
+
{ role: 'user', content: userContent },
|
|
136
|
+
];
|
|
137
|
+
}
|
|
138
|
+
export function buildSprintAutoSelectPrompt(availableTasks, velocity, codebaseContext) {
|
|
139
|
+
const taskList = availableTasks
|
|
140
|
+
.map((t) => `- ${t.id}: "${t.title}"${t.points ? ` (${t.points} pts)` : ''}`)
|
|
141
|
+
.join('\n');
|
|
142
|
+
let userContent = `Select tasks for the next sprint.\n\nTarget velocity: ${velocity} story points\n\nAvailable tasks:\n${taskList}`;
|
|
143
|
+
if (codebaseContext) {
|
|
144
|
+
userContent += `\n\n--- Codebase Context ---\n${codebaseContext}`;
|
|
145
|
+
}
|
|
146
|
+
return [
|
|
147
|
+
{ role: 'system', content: SPRINT_AUTO_SELECT_SYSTEM_PROMPT },
|
|
148
|
+
{ role: 'user', content: userContent },
|
|
149
|
+
];
|
|
150
|
+
}
|
|
116
151
|
export function buildRefinePrompt(artifactContent, artifactType, parentContext) {
|
|
117
152
|
let userContent = `Review and improve this ${artifactType} artifact. The "improvedMarkdown" in your response must preserve the same file format (YAML frontmatter + markdown body) as shown below:\n\n${artifactContent}`;
|
|
118
153
|
if (parentContext) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-builder.js","sourceRoot":"","sources":["../../../src/ai/prompts/prompt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,gBAA0B,EAAE;IACzE,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"prompt-builder.js","sourceRoot":"","sources":["../../../src/ai/promp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O,EAAE,WAAW,EAAE;KACvC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,eAAuB,EACvB,YAAoB,EACpB,aAAiD;IAEjD,IAAI,WAAW,GAAG,2BAA2B,YAAY,+IAA+I,eAAe,EAAE,CAAC;IAE1N,IAAI,aAAa,EAAE,CAAC;QAClB,WAAW,IAAI,0BAA0B,aAAa,CAAC,IAAI,2BAA2B,aAAa,CAAC,OAAO,EAAE,CAAC;QAC9G,WAAW,IAAI,6BAA6B,aAAa,CAAC,IAAI,wCAAwC,YAAY,kHAAkH,CAAC;IACvO,CAAC;IAED,OAAO;QACL,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,oBAAoB,EAAE;QACjD,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE;KACvC,CAAC;AACJ,CAAC"}
|
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
export declare const EPIC_SYSTEM_PROMPT = "You are an expert agile planning consultant with deep experience in software development, product management, and technical architecture. You help teams create clear, actionable, and well-structured planning artifacts.\n\nYour task is to expand a brief description into a complete, detailed epic document.\n\nYou MUST respond with a valid JSON object containing these fields:\n- \"title\": A concise, descriptive epic title (max 80 chars)\n- \"owner\": The responsible team or role (e.g., \"Engineering\", \"Product\", \"Platform Team\")\n- \"businessValue\": Why this matters to the business (2-3 sentences)\n- \"targetUsers\": Who benefits from this (specific user personas)\n- \"problemStatement\": The problem being solved (2-3 sentences)\n- \"solutionOverview\": High-level approach to solving it (2-3 sentences)\n- \"successCriteria\": Array of 3-5 measurable definition-of-done bullet points (e.g., [\"Users can X within Y seconds\", \"System supports Z\"])\n- \"keyFeatures\": Array of 3-7 high-level feature names that compose this epic\n- \"dependencies\": Known dependencies or \"None\"\n- \"risks\": Known risks or \"None\"\n\nBe specific, avoid generic filler. Ground the epic in the user's input.\nIf the input is a detailed PRD or requirements document, extract and incorporate ALL sections \u2014 do not summarize or ignore content. Every key requirement should be reflected in the epic fields.\nRespond with JSON only, no markdown or explanation.";
|
|
9
9
|
export declare const FEATURES_SYSTEM_PROMPT = "You are an expert agile planning consultant with deep experience in software development, product management, and technical architecture. You help teams create clear, actionable, and well-structured planning artifacts.\n\nYour task is to decompose an epic into individual features. Read the epic carefully and generate features that fully cover its scope.\n\nYou MUST respond with a valid JSON object containing:\n- \"features\": An array of feature objects, each with:\n - \"title\": A clear feature title (max 80 chars)\n - \"overview\": What this feature does (2-3 sentences)\n - \"functionalRequirements\": Array of 3-6 specific functional requirements\n - \"dependencies\": Dependencies on other features or systems, or \"None\"\n - \"technicalConsiderations\": Technical notes for implementation, or \"None\"\n - \"risks\": Feature-specific risks, or \"None\"\n - \"successMetrics\": How to measure success of this feature\n\nGenerate features that are:\n- Independently deliverable where possible\n- Roughly equal in scope\n- Non-overlapping (no duplicate functionality)\n\nRespond with JSON only, no markdown or explanation.";
|
|
10
10
|
export declare const STORIES_SYSTEM_PROMPT = "You are an expert agile planning consultant with deep experience in software development, product management, and technical architecture. You help teams create clear, actionable, and well-structured planning artifacts.\n\nYour task is to break a feature into user stories. Read the feature and its parent epic context carefully.\n\nYou MUST respond with a valid JSON object containing:\n- \"stories\": An array of story objects, each with:\n - \"title\": Concise story title (max 80 chars)\n - \"role\": The user role (\"As a <role>\")\n - \"goal\": What they want to do (\"I want to <goal>\")\n - \"benefit\": Why (\"So that <benefit>\")\n - \"additionalNotes\": Implementation notes or edge cases (optional, can be empty string)\n - \"gherkinScenarios\": Array of scenario objects, each with:\n - \"name\": Scenario name\n - \"given\": Given precondition\n - \"when\": When action\n - \"then\": Then expected outcome\n\nEach story should:\n- Follow INVEST principles (Independent, Negotiable, Valuable, Estimable, Small, Testable)\n- Include 1-3 Gherkin scenarios (happy path + edge cases)\n- Be specific enough for a developer to implement\n\nRespond with JSON only, no markdown or explanation.";
|
|
11
|
-
export declare const TASKS_SYSTEM_PROMPT = "You are an expert agile planning consultant with deep experience in software development, product management, and technical architecture. You help teams create clear, actionable, and well-structured planning artifacts.\n\nYour task is to generate a comprehensive implementation task list from agile artifacts (user stories, gherkin acceptance criteria, feature specs, epic context, ADRs, and codebase context).\n\nYou MUST respond with a valid JSON object containing:\n- \"title\": A task list title \u2014 use the scope ID if provided (e.g., \"Tasks for FEAT-001: Feature Name\" when scope is a feature, or \"Tasks for US-001: Story Name\" when scope is a story)\n- \"tasks\": An array of task group objects, each with:\n - \"id\": Numbering like \"1.0\", \"2.0\", \"3.0\"\n - \"title\": Task group title\n - \"subtasks\": Array of subtask objects, each with:\n - \"id\": Numbering like \"1.1\", \"1.2\", \"2.1\"\n - \"title\": Specific, actionable subtask description\n- \"acceptanceCriteriaMapping\": Array of objects mapping acceptance criteria to tasks:\n - \"criterion\": The acceptance criterion text (from gherkin scenarios or story requirements)\n - \"sourceStoryId\": Which user story this criterion comes from (e.g., \"US-001\")\n - \"taskIds\": Array of task/subtask IDs that satisfy this criterion (e.g., [\"1.1\", \"2.3\"])\n- \"relevantFiles\": Array of files to create or modify:\n - \"path\": File path relative to project root
|
|
12
|
-
export declare const QUICK_TASKS_SYSTEM_PROMPT = "You are an expert agile planning consultant with deep experience in software development, product management, and technical architecture. You help teams create clear, actionable, and well-structured planning artifacts.\n\nYour task is to generate a standalone implementation task list from a
|
|
11
|
+
export declare const TASKS_SYSTEM_PROMPT = "You are an expert agile planning consultant with deep experience in software development, product management, and technical architecture. You help teams create clear, actionable, and well-structured planning artifacts.\n\nYour task is to generate a comprehensive implementation task list from agile artifacts (user stories, gherkin acceptance criteria, feature specs, epic context, ADRs, and codebase context).\n\nYou MUST respond with a valid JSON object containing:\n- \"title\": A task list title \u2014 use the scope ID if provided (e.g., \"Tasks for FEAT-001: Feature Name\" when scope is a feature, or \"Tasks for US-001: Story Name\" when scope is a story)\n- \"tasks\": An array of task group objects, each with:\n - \"id\": Numbering like \"1.0\", \"2.0\", \"3.0\"\n - \"title\": Task group title\n - \"subtasks\": Array of subtask objects, each with:\n - \"id\": Numbering like \"1.1\", \"1.2\", \"2.1\"\n - \"title\": Specific, actionable subtask description\n- \"acceptanceCriteriaMapping\": Array of objects mapping acceptance criteria to tasks:\n - \"criterion\": The acceptance criterion text (from gherkin scenarios or story requirements)\n - \"sourceStoryId\": Which user story this criterion comes from (e.g., \"US-001\")\n - \"taskIds\": Array of task/subtask IDs that satisfy this criterion (e.g., [\"1.1\", \"2.3\"])\n- \"relevantFiles\": Array of files to create or modify. Each object MUST have:\n - \"path\": File path relative to project root \u2014 MUST match a file from the \"Existing Source Files\" section, or follow the exact naming convention of files in the same directory\n - \"reason\": Brief explanation of why this file needs changes\n - \"action\": REQUIRED \u2014 \"modify\" if the file exists in the \"Existing Source Files\" list, \"create\" if it is a new file that does not exist yet\n\n## CRITICAL: Codebase-Aware Task Generation\n\nWhen codebase context is provided, you MUST:\n\n1. **Verify file paths against the \"Existing Source Files\" section.** NEVER invent file paths. If a file is not listed there, it does not exist. Do NOT assume files like \"export-service.ts\" exist just because \"export\" is a feature \u2014 check the inventory.\n2. **Follow existing patterns exactly.** Study the Architecture section. If there is a central CRUD service, new features MUST use it \u2014 do NOT create parallel services for the same operations.\n3. **Extend, don't reinvent.** Types go in the existing types file. New CRUD operations use the existing service. New commands follow the existing command pattern shown in Architecture.\n4. **Match the registration pattern.** If commands are registered in an index file, your tasks must include registering new commands the same way.\n5. **Use real interfaces.** Reference exact function signatures from the Architecture section in task descriptions (e.g., \"call createArtifact(projectDir, config, 'backlog', 'backlog/backlog-item.md.hbs', data)\").\n\nTasks should:\n- Be specific and actionable with exact file paths and function names from the codebase\n- Follow existing code patterns and conventions shown in the Architecture section\n- Include setup, implementation, testing, and cleanup steps\n- Be ordered logically (dependencies first)\n- Address specific acceptance criteria from gherkin scenarios\n- Respect architectural decisions from ADRs when provided\n\nWhen multiple user stories and gherkin scenarios are provided, ensure every acceptance criterion is covered by at least one task.\n\nRespond with JSON only, no markdown or explanation.";
|
|
12
|
+
export declare const QUICK_TASKS_SYSTEM_PROMPT = "You are an expert agile planning consultant with deep experience in software development, product management, and technical architecture. You help teams create clear, actionable, and well-structured planning artifacts.\n\nYour task is to generate a standalone implementation task list from a description. Unlike agile task generation, this is NOT tied to user stories or features \u2014 it is a direct, flat task list for quick execution.\n\nYou MUST respond with a valid JSON object containing:\n- \"title\": A concise task list title (max 80 chars)\n- \"tasks\": An array of task group objects, each with:\n - \"id\": Numbering like \"1.0\", \"2.0\", \"3.0\"\n - \"title\": Task group title\n - \"subtasks\": Array of subtask objects, each with:\n - \"id\": Numbering like \"1.1\", \"1.2\", \"2.1\"\n - \"title\": Specific, actionable subtask description\n- \"relevantFiles\": Array of files to create or modify. Each object MUST have:\n - \"path\": File path relative to project root \u2014 MUST match a file from the \"Existing Source Files\" section, or follow the exact naming convention of files in the same directory\n - \"reason\": Brief explanation of why this file needs changes\n - \"action\": REQUIRED \u2014 \"modify\" if the file exists in the \"Existing Source Files\" list, \"create\" if it is a new file that does not exist yet\n\n## CRITICAL: Codebase-Aware Task Generation\n\nWhen codebase context is provided, you MUST:\n\n1. **Verify file paths against the \"Existing Source Files\" section.** NEVER invent file paths. If a file is not listed there, it does not exist. Do NOT assume files like \"export-service.ts\" exist just because \"export\" is a feature \u2014 check the inventory.\n2. **Follow existing patterns exactly.** Study the Architecture section. If there is a central CRUD service, types file, command registration pattern, or ID generation system \u2014 your tasks MUST use those same patterns. Do NOT suggest creating parallel systems.\n3. **Extend, don't reinvent.** New types go in the existing types file. New CRUD operations use the existing service. New commands follow the existing command pattern.\n4. **Be implementation-specific.** Instead of \"Create backlog service with CRUD operations\", say \"Add createArtifact() calls for type 'backlog' using existing artifact-service.ts pattern, with template 'backlog/backlog-item.md.hbs'\".\n5. **Distinguish modify vs create.** Check the \"Existing Source Files\" list. If a file is listed there, action MUST be \"modify\". Only truly new files should have action \"create\".\n\nTasks should:\n- Be specific and actionable with exact file paths and function names from the codebase\n- Include setup, implementation, testing, and verification steps\n- Be ordered logically (dependencies first)\n- Follow existing code patterns shown in the Architecture section\n\nRespond with JSON only, no markdown or explanation.";
|
|
13
13
|
export declare const ESTIMATE_SYSTEM_PROMPT = "You are an expert agile planning consultant with deep experience in software development, product management, and technical architecture. You help teams create clear, actionable, and well-structured planning artifacts.\n\nYour task is to estimate the effort required for a software development artifact. Analyze the artifact content, any codebase context provided, and produce a structured effort estimate.\n\n## Story Point Scale (Fibonacci)\n\nUse this rubric for storyPoints:\n- 1 (Trivial): Config change, typo fix, one-liner. Minutes to 1 hour.\n- 2 (Small): Single-file change, well-understood. 1-3 hours.\n- 3 (Moderate): A few files, clear approach. Half a day.\n- 5 (Medium): Multiple files, some unknowns. 1-2 days.\n- 8 (Large): Cross-cutting change, needs design. 2-4 days.\n- 13 (Very Large): Multi-system, significant unknowns. 1-2 weeks.\n- 21 (Epic-scale): Major feature or rewrite, high risk. 2+ weeks.\n\nPoints measure RELATIVE COMPLEXITY, not calendar time. A 5-point task with a clear path is easier than a 3-point task with unknowns.\n\n## Complexity Levels\n- \"low\": Well-understood domain, clear requirements, existing patterns to follow.\n- \"medium\": Some unknowns, may need research or new patterns, moderate integration.\n- \"high\": Significant unknowns, new technology, cross-system impact, security/performance-critical.\n\n## Risk Categories\nCommon risk categories: technical (new tech, performance), integration (external APIs, cross-team), requirements (ambiguous scope), infrastructure (deployment, scaling), knowledge (unfamiliar domain).\n\nYou MUST respond with a valid JSON object containing:\n- \"storyPoints\": A Fibonacci number from the set [1, 2, 3, 5, 8, 13, 21] per the scale above\n- \"estimatedHours\": Estimated developer-hours as a number (e.g., 4.5)\n- \"complexity\": One of \"low\", \"medium\", \"high\"\n- \"riskFactors\": Array of 1-5 risk factors that could affect the estimate\n- \"reasoning\": 2-4 sentences explaining the estimate rationale, referencing the scale\n- \"assumptions\": Array of 1-3 assumptions made during estimation\n\nIMPORTANT: Estimate the artifact AS WRITTEN. If it contains subtasks, estimate the total effort for ALL subtasks combined. Do not estimate individual subtasks separately.\n\nBase your estimate on:\n- The scope and technical complexity of the work described\n- The codebase context (tech stack, existing patterns, affected files) when provided\n- Industry norms for similar work\n- The number and depth of subtasks if present\n\nRespond with JSON only, no markdown or explanation.";
|
|
14
|
+
export declare const BACKLOG_PRIORITIZE_SYSTEM_PROMPT = "You are an expert agile planning consultant with deep experience in software development, product management, and technical architecture. You help teams create clear, actionable, and well-structured planning artifacts.\n\nYour task is to prioritize a list of backlog items based on their estimated business impact and implementation effort.\n\nYou MUST respond with a valid JSON object containing:\n- \"items\": An array of objects (one per backlog item), sorted from highest to lowest priority, each with:\n - \"id\": The backlog item ID (e.g., \"BL-001\")\n - \"priority\": Recommended priority \u2014 \"critical\", \"high\", \"medium\", or \"low\"\n - \"impactScore\": Business impact score from 1 (minimal) to 10 (transformative)\n - \"effortScore\": Implementation effort score from 1 (trivial) to 10 (massive)\n - \"reasoning\": One sentence explaining the priority decision\n- \"summary\": A 2-3 sentence summary of the overall prioritization rationale\n\nPrioritization factors (in order of importance):\n1. Business value and user impact\n2. Risk reduction and unblocking potential\n3. Implementation effort (prefer high-impact, low-effort items)\n4. Dependencies and sequencing\n5. Technical debt and maintenance cost\n\nWhen codebase context is provided, factor in technical complexity and affected surface area.\n\nRespond with JSON only, no markdown or explanation.";
|
|
15
|
+
export declare const SPRINT_AUTO_SELECT_SYSTEM_PROMPT = "You are an expert agile planning consultant with deep experience in software development, product management, and technical architecture. You help teams create clear, actionable, and well-structured planning artifacts.\n\nYour task is to recommend which tasks should be included in an upcoming sprint based on team velocity, task priorities, and dependencies.\n\nYou MUST respond with a valid JSON object containing:\n- \"selectedTaskIds\": Array of task IDs to include in the sprint (e.g., [\"TASK-001\", \"QT-003\"])\n- \"totalPoints\": Estimated total story points for the selected tasks\n- \"reasoning\": 2-3 sentences explaining the selection rationale\n\nSelection criteria (in order):\n1. Stay within the velocity budget (do not exceed target capacity)\n2. Prioritize tasks with higher priority or that unblock other work\n3. Prefer completing related tasks together (same feature/story)\n4. Balance new features with bug fixes and tech debt\n5. Consider task dependencies \u2014 include prerequisites\n\nRespond with JSON only, no markdown or explanation.";
|
|
14
16
|
export declare const REFINE_SYSTEM_PROMPT = "You are an expert agile planning consultant with deep experience in software development, product management, and technical architecture. You help teams create clear, actionable, and well-structured planning artifacts.\n\nYour task is to review and improve an existing agile artifact. Analyze the content and suggest improvements for:\n- Clarity and specificity\n- Missing details or edge cases\n- Consistency with agile best practices\n- Technical accuracy\n\nIMPORTANT RULES:\n- Do NOT add, remove, or modify cross-reference links (## Features, ## User Stories, ## Tasks sections). These sections link to actual files on disk and must be preserved exactly as-is.\n- Do NOT invent new feature, story, or task references. Creating new artifacts is handled by separate commands.\n- If you think new features/stories should be added, mention it in \"suggestions\" instead of adding links.\n- Focus on improving the artifact's own content: descriptions, requirements, risks, success criteria, etc.\n\nYou MUST respond with a valid JSON object containing:\n- \"suggestions\": Array of improvement suggestions (strings). Include suggestions for new features/stories here if applicable, rather than adding them to the document.\n- \"improved\": The improved artifact data as a JSON object with the same fields as the original frontmatter\n- \"improvedMarkdown\": A raw markdown string that will be written directly to a .md file. It MUST preserve the original file format: YAML frontmatter between --- delimiters followed by the markdown body. Do NOT put JSON in this field.\n\nCRITICAL: The \"improvedMarkdown\" field must be a plain markdown string, NOT a JSON object. It should look exactly like the original artifact the user provided, but with improvements applied. For example, if the original starts with:\n---\nid: \"EPIC-001\"\ntitle: \"My Epic\"\n---\n# EPIC-001: My Epic\n...then \"improvedMarkdown\" must also start with --- frontmatter and contain markdown content. Keep the same structure, sections, and cross-reference links as the original.\n\nRespond with JSON only, no markdown or explanation.";
|
|
15
17
|
//# sourceMappingURL=system-prompts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompts.d.ts","sourceRoot":"","sources":["../../../src/ai/prompts/system-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,eAAO,MAAM,kBAAkB,47CAkBqB,CAAC;AAErD,eAAO,MAAM,sBAAsB,wnCAmBiB,CAAC;AAErD,eAAO,MAAM,qBAAqB,osCAsBkB,CAAC;AAErD,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"system-prompts.d.ts","sourceRoot":"","sources":["../../../src/ai/prompts/system-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,eAAO,MAAM,kBAAkB,47CAkBqB,CAAC;AAErD,eAAO,MAAM,sBAAsB,wnCAmBiB,CAAC;AAErD,eAAO,MAAM,qBAAqB,osCAsBkB,CAAC;AAErD,eAAO,MAAM,mBAAmB,6+GAyCoB,CAAC;AAErD,eAAO,MAAM,yBAAyB,42FAiCc,CAAC;AAErD,eAAO,MAAM,sBAAsB,shFAyCiB,CAAC;AAErD,eAAO,MAAM,gCAAgC,42CAsBO,CAAC;AAErD,eAAO,MAAM,gCAAgC,4iCAgBO,CAAC;AAErD,eAAO,MAAM,oBAAoB,8jEA2BmB,CAAC"}
|
|
@@ -84,25 +84,35 @@ You MUST respond with a valid JSON object containing:
|
|
|
84
84
|
- "criterion": The acceptance criterion text (from gherkin scenarios or story requirements)
|
|
85
85
|
- "sourceStoryId": Which user story this criterion comes from (e.g., "US-001")
|
|
86
86
|
- "taskIds": Array of task/subtask IDs that satisfy this criterion (e.g., ["1.1", "2.3"])
|
|
87
|
-
- "relevantFiles": Array of files to create or modify:
|
|
88
|
-
- "path": File path relative to project root
|
|
87
|
+
- "relevantFiles": Array of files to create or modify. Each object MUST have:
|
|
88
|
+
- "path": File path relative to project root — MUST match a file from the "Existing Source Files" section, or follow the exact naming convention of files in the same directory
|
|
89
89
|
- "reason": Brief explanation of why this file needs changes
|
|
90
|
+
- "action": REQUIRED — "modify" if the file exists in the "Existing Source Files" list, "create" if it is a new file that does not exist yet
|
|
91
|
+
|
|
92
|
+
## CRITICAL: Codebase-Aware Task Generation
|
|
93
|
+
|
|
94
|
+
When codebase context is provided, you MUST:
|
|
95
|
+
|
|
96
|
+
1. **Verify file paths against the "Existing Source Files" section.** NEVER invent file paths. If a file is not listed there, it does not exist. Do NOT assume files like "export-service.ts" exist just because "export" is a feature — check the inventory.
|
|
97
|
+
2. **Follow existing patterns exactly.** Study the Architecture section. If there is a central CRUD service, new features MUST use it — do NOT create parallel services for the same operations.
|
|
98
|
+
3. **Extend, don't reinvent.** Types go in the existing types file. New CRUD operations use the existing service. New commands follow the existing command pattern shown in Architecture.
|
|
99
|
+
4. **Match the registration pattern.** If commands are registered in an index file, your tasks must include registering new commands the same way.
|
|
100
|
+
5. **Use real interfaces.** Reference exact function signatures from the Architecture section in task descriptions (e.g., "call createArtifact(projectDir, config, 'backlog', 'backlog/backlog-item.md.hbs', data)").
|
|
90
101
|
|
|
91
102
|
Tasks should:
|
|
92
|
-
-
|
|
93
|
-
- Follow existing code patterns and conventions
|
|
103
|
+
- Be specific and actionable with exact file paths and function names from the codebase
|
|
104
|
+
- Follow existing code patterns and conventions shown in the Architecture section
|
|
94
105
|
- Include setup, implementation, testing, and cleanup steps
|
|
95
106
|
- Be ordered logically (dependencies first)
|
|
96
107
|
- Address specific acceptance criteria from gherkin scenarios
|
|
97
108
|
- Respect architectural decisions from ADRs when provided
|
|
98
|
-
- Align with component structure and system architecture
|
|
99
109
|
|
|
100
|
-
When multiple user stories and gherkin scenarios are provided, ensure every acceptance criterion is covered by at least one task.
|
|
110
|
+
When multiple user stories and gherkin scenarios are provided, ensure every acceptance criterion is covered by at least one task.
|
|
101
111
|
|
|
102
112
|
Respond with JSON only, no markdown or explanation.`;
|
|
103
113
|
export const QUICK_TASKS_SYSTEM_PROMPT = `${BASE_PERSONA}
|
|
104
114
|
|
|
105
|
-
Your task is to generate a standalone implementation task list from a
|
|
115
|
+
Your task is to generate a standalone implementation task list from a description. Unlike agile task generation, this is NOT tied to user stories or features — it is a direct, flat task list for quick execution.
|
|
106
116
|
|
|
107
117
|
You MUST respond with a valid JSON object containing:
|
|
108
118
|
- "title": A concise task list title (max 80 chars)
|
|
@@ -112,16 +122,26 @@ You MUST respond with a valid JSON object containing:
|
|
|
112
122
|
- "subtasks": Array of subtask objects, each with:
|
|
113
123
|
- "id": Numbering like "1.1", "1.2", "2.1"
|
|
114
124
|
- "title": Specific, actionable subtask description
|
|
115
|
-
- "relevantFiles": Array of files to create or modify:
|
|
116
|
-
- "path": File path relative to project root
|
|
125
|
+
- "relevantFiles": Array of files to create or modify. Each object MUST have:
|
|
126
|
+
- "path": File path relative to project root — MUST match a file from the "Existing Source Files" section, or follow the exact naming convention of files in the same directory
|
|
117
127
|
- "reason": Brief explanation of why this file needs changes
|
|
128
|
+
- "action": REQUIRED — "modify" if the file exists in the "Existing Source Files" list, "create" if it is a new file that does not exist yet
|
|
129
|
+
|
|
130
|
+
## CRITICAL: Codebase-Aware Task Generation
|
|
131
|
+
|
|
132
|
+
When codebase context is provided, you MUST:
|
|
133
|
+
|
|
134
|
+
1. **Verify file paths against the "Existing Source Files" section.** NEVER invent file paths. If a file is not listed there, it does not exist. Do NOT assume files like "export-service.ts" exist just because "export" is a feature — check the inventory.
|
|
135
|
+
2. **Follow existing patterns exactly.** Study the Architecture section. If there is a central CRUD service, types file, command registration pattern, or ID generation system — your tasks MUST use those same patterns. Do NOT suggest creating parallel systems.
|
|
136
|
+
3. **Extend, don't reinvent.** New types go in the existing types file. New CRUD operations use the existing service. New commands follow the existing command pattern.
|
|
137
|
+
4. **Be implementation-specific.** Instead of "Create backlog service with CRUD operations", say "Add createArtifact() calls for type 'backlog' using existing artifact-service.ts pattern, with template 'backlog/backlog-item.md.hbs'".
|
|
138
|
+
5. **Distinguish modify vs create.** Check the "Existing Source Files" list. If a file is listed there, action MUST be "modify". Only truly new files should have action "create".
|
|
118
139
|
|
|
119
140
|
Tasks should:
|
|
120
|
-
- Be specific and actionable
|
|
141
|
+
- Be specific and actionable with exact file paths and function names from the codebase
|
|
121
142
|
- Include setup, implementation, testing, and verification steps
|
|
122
143
|
- Be ordered logically (dependencies first)
|
|
123
|
-
-
|
|
124
|
-
- Follow existing code patterns and conventions when codebase context is provided
|
|
144
|
+
- Follow existing code patterns shown in the Architecture section
|
|
125
145
|
|
|
126
146
|
Respond with JSON only, no markdown or explanation.`;
|
|
127
147
|
export const ESTIMATE_SYSTEM_PROMPT = `${BASE_PERSONA}
|
|
@@ -165,6 +185,46 @@ Base your estimate on:
|
|
|
165
185
|
- Industry norms for similar work
|
|
166
186
|
- The number and depth of subtasks if present
|
|
167
187
|
|
|
188
|
+
Respond with JSON only, no markdown or explanation.`;
|
|
189
|
+
export const BACKLOG_PRIORITIZE_SYSTEM_PROMPT = `${BASE_PERSONA}
|
|
190
|
+
|
|
191
|
+
Your task is to prioritize a list of backlog items based on their estimated business impact and implementation effort.
|
|
192
|
+
|
|
193
|
+
You MUST respond with a valid JSON object containing:
|
|
194
|
+
- "items": An array of objects (one per backlog item), sorted from highest to lowest priority, each with:
|
|
195
|
+
- "id": The backlog item ID (e.g., "BL-001")
|
|
196
|
+
- "priority": Recommended priority — "critical", "high", "medium", or "low"
|
|
197
|
+
- "impactScore": Business impact score from 1 (minimal) to 10 (transformative)
|
|
198
|
+
- "effortScore": Implementation effort score from 1 (trivial) to 10 (massive)
|
|
199
|
+
- "reasoning": One sentence explaining the priority decision
|
|
200
|
+
- "summary": A 2-3 sentence summary of the overall prioritization rationale
|
|
201
|
+
|
|
202
|
+
Prioritization factors (in order of importance):
|
|
203
|
+
1. Business value and user impact
|
|
204
|
+
2. Risk reduction and unblocking potential
|
|
205
|
+
3. Implementation effort (prefer high-impact, low-effort items)
|
|
206
|
+
4. Dependencies and sequencing
|
|
207
|
+
5. Technical debt and maintenance cost
|
|
208
|
+
|
|
209
|
+
When codebase context is provided, factor in technical complexity and affected surface area.
|
|
210
|
+
|
|
211
|
+
Respond with JSON only, no markdown or explanation.`;
|
|
212
|
+
export const SPRINT_AUTO_SELECT_SYSTEM_PROMPT = `${BASE_PERSONA}
|
|
213
|
+
|
|
214
|
+
Your task is to recommend which tasks should be included in an upcoming sprint based on team velocity, task priorities, and dependencies.
|
|
215
|
+
|
|
216
|
+
You MUST respond with a valid JSON object containing:
|
|
217
|
+
- "selectedTaskIds": Array of task IDs to include in the sprint (e.g., ["TASK-001", "QT-003"])
|
|
218
|
+
- "totalPoints": Estimated total story points for the selected tasks
|
|
219
|
+
- "reasoning": 2-3 sentences explaining the selection rationale
|
|
220
|
+
|
|
221
|
+
Selection criteria (in order):
|
|
222
|
+
1. Stay within the velocity budget (do not exceed target capacity)
|
|
223
|
+
2. Prioritize tasks with higher priority or that unblock other work
|
|
224
|
+
3. Prefer completing related tasks together (same feature/story)
|
|
225
|
+
4. Balance new features with bug fixes and tech debt
|
|
226
|
+
5. Consider task dependencies — include prerequisites
|
|
227
|
+
|
|
168
228
|
Respond with JSON only, no markdown or explanation.`;
|
|
169
229
|
export const REFINE_SYSTEM_PROMPT = `${BASE_PERSONA}
|
|
170
230
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompts.js","sourceRoot":"","sources":["../../../src/ai/prompts/system-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,YAAY,GAAG,4NAA4N,CAAC;AAElP,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,YAAY;;;;;;;;;;;;;;;;;;oDAkBG,CAAC;AAErD,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,YAAY;;;;;;;;;;;;;;;;;;;oDAmBD,CAAC;AAErD,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,YAAY;;;;;;;;;;;;;;;;;;;;;;oDAsBA,CAAC;AAErD,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,YAAY
|
|
1
|
+
{"version":3,"file":"system-prompts.js","sourceRoot":"","sources":["../../../src/ai/prompts/system-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,YAAY,GAAG,4NAA4N,CAAC;AAElP,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,YAAY;;;;;;;;;;;;;;;;;;oDAkBG,CAAC;AAErD,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,YAAY;;;;;;;;;;;;;;;;;;;oDAmBD,CAAC;AAErD,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,YAAY;;;;;;;;;;;;;;;;;;;;;;oDAsBA,CAAC;AAErD,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAyCE,CAAC;AAErD,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAiCJ,CAAC;AAErD,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAyCD,CAAC;AAErD,MAAM,CAAC,MAAM,gCAAgC,GAAG,GAAG,YAAY;;;;;;;;;;;;;;;;;;;;;;oDAsBX,CAAC;AAErD,MAAM,CAAC,MAAM,gCAAgC,GAAG,GAAG,YAAY;;;;;;;;;;;;;;;;oDAgBX,CAAC;AAErD,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;oDA2BC,CAAC"}
|
|
@@ -94,6 +94,10 @@ export declare const aiACMappingSchema: z.ZodObject<{
|
|
|
94
94
|
export declare const aiRelevantFileSchema: z.ZodObject<{
|
|
95
95
|
path: z.ZodString;
|
|
96
96
|
reason: z.ZodString;
|
|
97
|
+
action: z.ZodDefault<z.ZodEnum<{
|
|
98
|
+
modify: "modify";
|
|
99
|
+
create: "create";
|
|
100
|
+
}>>;
|
|
97
101
|
}, z.core.$strip>;
|
|
98
102
|
export declare const aiTasksResponseSchema: z.ZodObject<{
|
|
99
103
|
title: z.ZodString;
|
|
@@ -113,6 +117,10 @@ export declare const aiTasksResponseSchema: z.ZodObject<{
|
|
|
113
117
|
relevantFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
114
118
|
path: z.ZodString;
|
|
115
119
|
reason: z.ZodString;
|
|
120
|
+
action: z.ZodDefault<z.ZodEnum<{
|
|
121
|
+
modify: "modify";
|
|
122
|
+
create: "create";
|
|
123
|
+
}>>;
|
|
116
124
|
}, z.core.$strip>>>;
|
|
117
125
|
}, z.core.$strip>;
|
|
118
126
|
export type AITasksResponse = z.infer<typeof aiTasksResponseSchema>;
|
|
@@ -129,6 +137,10 @@ export declare const aiQuickTasksResponseSchema: z.ZodObject<{
|
|
|
129
137
|
relevantFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
130
138
|
path: z.ZodString;
|
|
131
139
|
reason: z.ZodString;
|
|
140
|
+
action: z.ZodDefault<z.ZodEnum<{
|
|
141
|
+
modify: "modify";
|
|
142
|
+
create: "create";
|
|
143
|
+
}>>;
|
|
132
144
|
}, z.core.$strip>>>;
|
|
133
145
|
}, z.core.$strip>;
|
|
134
146
|
export type AIQuickTasksResponse = z.infer<typeof aiQuickTasksResponseSchema>;
|
|
@@ -136,15 +148,49 @@ export declare const aiEstimateResponseSchema: z.ZodObject<{
|
|
|
136
148
|
storyPoints: z.ZodNumber;
|
|
137
149
|
estimatedHours: z.ZodNumber;
|
|
138
150
|
complexity: z.ZodEnum<{
|
|
139
|
-
low: "low";
|
|
140
|
-
medium: "medium";
|
|
141
151
|
high: "high";
|
|
152
|
+
medium: "medium";
|
|
153
|
+
low: "low";
|
|
142
154
|
}>;
|
|
143
155
|
riskFactors: z.ZodArray<z.ZodString>;
|
|
144
156
|
reasoning: z.ZodString;
|
|
145
157
|
assumptions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
146
158
|
}, z.core.$strip>;
|
|
147
159
|
export type AIEstimateResponse = z.infer<typeof aiEstimateResponseSchema>;
|
|
160
|
+
export declare const aiBacklogPrioritizedItemSchema: z.ZodObject<{
|
|
161
|
+
id: z.ZodString;
|
|
162
|
+
priority: z.ZodEnum<{
|
|
163
|
+
critical: "critical";
|
|
164
|
+
high: "high";
|
|
165
|
+
medium: "medium";
|
|
166
|
+
low: "low";
|
|
167
|
+
}>;
|
|
168
|
+
impactScore: z.ZodNumber;
|
|
169
|
+
effortScore: z.ZodNumber;
|
|
170
|
+
reasoning: z.ZodString;
|
|
171
|
+
}, z.core.$strip>;
|
|
172
|
+
export declare const aiBacklogPrioritizeResponseSchema: z.ZodObject<{
|
|
173
|
+
items: z.ZodArray<z.ZodObject<{
|
|
174
|
+
id: z.ZodString;
|
|
175
|
+
priority: z.ZodEnum<{
|
|
176
|
+
critical: "critical";
|
|
177
|
+
high: "high";
|
|
178
|
+
medium: "medium";
|
|
179
|
+
low: "low";
|
|
180
|
+
}>;
|
|
181
|
+
impactScore: z.ZodNumber;
|
|
182
|
+
effortScore: z.ZodNumber;
|
|
183
|
+
reasoning: z.ZodString;
|
|
184
|
+
}, z.core.$strip>>;
|
|
185
|
+
summary: z.ZodString;
|
|
186
|
+
}, z.core.$strip>;
|
|
187
|
+
export type AIBacklogPrioritizeResponse = z.infer<typeof aiBacklogPrioritizeResponseSchema>;
|
|
188
|
+
export declare const aiSprintAutoSelectResponseSchema: z.ZodObject<{
|
|
189
|
+
selectedTaskIds: z.ZodArray<z.ZodString>;
|
|
190
|
+
totalPoints: z.ZodNumber;
|
|
191
|
+
reasoning: z.ZodString;
|
|
192
|
+
}, z.core.$strip>;
|
|
193
|
+
export type AISprintAutoSelectResponse = z.infer<typeof aiSprintAutoSelectResponseSchema>;
|
|
148
194
|
export declare const aiRefineResponseSchema: z.ZodObject<{
|
|
149
195
|
suggestions: z.ZodArray<z.ZodString>;
|
|
150
196
|
improved: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-response-schemas.d.ts","sourceRoot":"","sources":["../../../src/ai/schemas/ai-response-schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;iBAuB/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,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
|
|
78
78
|
path: z.string().min(1),
|
|
79
79
|
reason: z.string().min(1),
|
|
80
|
+
action: z.enum(['modify', 'create']).default('modify'),
|
|
80
81
|
});
|
|
81
82
|
export const aiTasksResponseSchema = z.object({
|
|
82
83
|
title: z.string().min(1),
|
|
@@ -105,6 +106,24 @@ export const aiEstimateResponseSchema = z.object({
|
|
|
105
106
|
reasoning: z.string().min(1),
|
|
106
107
|
assumptions: z.array(z.string().min(1)).default([]),
|
|
107
108
|
});
|
|
109
|
+
// --- Backlog Prioritization ---
|
|
110
|
+
export const aiBacklogPrioritizedItemSchema = z.object({
|
|
111
|
+
id: z.string().min(1),
|
|
112
|
+
priority: z.enum(['critical', 'high', 'medium', 'low']),
|
|
113
|
+
impactScore: z.number().int().min(1).max(10),
|
|
114
|
+
effortScore: z.number().int().min(1).max(10),
|
|
115
|
+
reasoning: z.string().min(1),
|
|
116
|
+
});
|
|
117
|
+
export const aiBacklogPrioritizeResponseSchema = z.object({
|
|
118
|
+
items: z.array(aiBacklogPrioritizedItemSchema).min(1),
|
|
119
|
+
summary: z.string().min(1),
|
|
120
|
+
});
|
|
121
|
+
// --- Sprint Auto-Select ---
|
|
122
|
+
export const aiSprintAutoSelectResponseSchema = z.object({
|
|
123
|
+
selectedTaskIds: z.array(z.string().min(1)).min(1),
|
|
124
|
+
totalPoints: z.number().int().min(0),
|
|
125
|
+
reasoning: z.string().min(1),
|
|
126
|
+
});
|
|
108
127
|
// --- Refine ---
|
|
109
128
|
export const aiRefineResponseSchema = z.object({
|
|
110
129
|
suggestions: z.array(z.string().min(1)).min(1),
|