clavix 4.11.2 → 5.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 +72 -60
- package/dist/cli/commands/update.js +9 -10
- package/dist/templates/agents/agents.md +14 -8
- package/dist/templates/agents/copilot-instructions.md +1 -1
- package/dist/templates/instructions/core/verification.md +2 -2
- package/dist/templates/slash-commands/_canonical/archive.md +83 -121
- package/dist/templates/slash-commands/_canonical/execute.md +32 -42
- package/dist/templates/slash-commands/_canonical/implement.md +32 -44
- package/dist/templates/slash-commands/_canonical/improve.md +14 -53
- package/dist/templates/slash-commands/_canonical/start.md +1 -1
- package/dist/templates/slash-commands/_canonical/summarize.md +8 -8
- package/dist/templates/slash-commands/_components/agent-protocols/cli-reference.md +84 -180
- package/dist/templates/slash-commands/_components/agent-protocols/error-handling.md +2 -2
- package/dist/templates/slash-commands/_components/agent-protocols/file-formats.md +41 -59
- package/dist/templates/slash-commands/_components/agent-protocols/state-assertion.md +1 -1
- package/dist/templates/slash-commands/_components/references/intent-types.md +1 -1
- package/dist/templates/slash-commands/_components/sections/file-saving-protocol.md +20 -27
- package/dist/templates/slash-commands/_components/sections/pattern-visibility.md +29 -46
- package/dist/templates/slash-commands/_components/troubleshooting/file-not-saved.md +4 -5
- package/dist/types/config.d.ts +57 -0
- package/dist/utils/legacy-command-cleanup.js +31 -4
- package/package.json +5 -4
- package/dist/cli/commands/analyze.d.ts +0 -17
- package/dist/cli/commands/analyze.js +0 -133
- package/dist/cli/commands/archive.d.ts +0 -36
- package/dist/cli/commands/archive.js +0 -266
- package/dist/cli/commands/deep.d.ts +0 -17
- package/dist/cli/commands/deep.js +0 -170
- package/dist/cli/commands/execute.d.ts +0 -15
- package/dist/cli/commands/execute.js +0 -168
- package/dist/cli/commands/fast.d.ts +0 -18
- package/dist/cli/commands/fast.js +0 -219
- package/dist/cli/commands/implement.d.ts +0 -24
- package/dist/cli/commands/implement.js +0 -289
- package/dist/cli/commands/improve.d.ts +0 -32
- package/dist/cli/commands/improve.js +0 -250
- package/dist/cli/commands/list.d.ts +0 -17
- package/dist/cli/commands/list.js +0 -217
- package/dist/cli/commands/plan.d.ts +0 -21
- package/dist/cli/commands/plan.js +0 -297
- package/dist/cli/commands/prd.d.ts +0 -24
- package/dist/cli/commands/prd.js +0 -321
- package/dist/cli/commands/prompts/clear.d.ts +0 -16
- package/dist/cli/commands/prompts/clear.js +0 -222
- package/dist/cli/commands/prompts/list.d.ts +0 -8
- package/dist/cli/commands/prompts/list.js +0 -88
- package/dist/cli/commands/show.d.ts +0 -21
- package/dist/cli/commands/show.js +0 -191
- package/dist/cli/commands/start.d.ts +0 -40
- package/dist/cli/commands/start.js +0 -210
- package/dist/cli/commands/summarize.d.ts +0 -17
- package/dist/cli/commands/summarize.js +0 -196
- package/dist/cli/commands/task-complete.d.ts +0 -27
- package/dist/cli/commands/task-complete.js +0 -269
- package/dist/cli/commands/verify.d.ts +0 -28
- package/dist/cli/commands/verify.js +0 -349
- package/dist/core/archive-manager.d.ts +0 -100
- package/dist/core/archive-manager.js +0 -302
- package/dist/core/basic-checklist-generator.d.ts +0 -35
- package/dist/core/basic-checklist-generator.js +0 -344
- package/dist/core/checklist-parser.d.ts +0 -48
- package/dist/core/checklist-parser.js +0 -238
- package/dist/core/config-manager.d.ts +0 -149
- package/dist/core/config-manager.js +0 -230
- package/dist/core/conversation-analyzer.d.ts +0 -86
- package/dist/core/conversation-analyzer.js +0 -387
- package/dist/core/conversation-quality-tracker.d.ts +0 -81
- package/dist/core/conversation-quality-tracker.js +0 -195
- package/dist/core/git-manager.d.ts +0 -126
- package/dist/core/git-manager.js +0 -282
- package/dist/core/intelligence/confidence-calculator.d.ts +0 -93
- package/dist/core/intelligence/confidence-calculator.js +0 -124
- package/dist/core/intelligence/index.d.ts +0 -11
- package/dist/core/intelligence/index.js +0 -15
- package/dist/core/intelligence/intent-detector.d.ts +0 -54
- package/dist/core/intelligence/intent-detector.js +0 -723
- package/dist/core/intelligence/pattern-library.d.ts +0 -104
- package/dist/core/intelligence/pattern-library.js +0 -339
- package/dist/core/intelligence/patterns/actionability-enhancer.d.ts +0 -27
- package/dist/core/intelligence/patterns/actionability-enhancer.js +0 -192
- package/dist/core/intelligence/patterns/alternative-phrasing-generator.d.ts +0 -29
- package/dist/core/intelligence/patterns/alternative-phrasing-generator.js +0 -239
- package/dist/core/intelligence/patterns/ambiguity-detector.d.ts +0 -22
- package/dist/core/intelligence/patterns/ambiguity-detector.js +0 -196
- package/dist/core/intelligence/patterns/assumption-explicitizer.d.ts +0 -30
- package/dist/core/intelligence/patterns/assumption-explicitizer.js +0 -296
- package/dist/core/intelligence/patterns/base-pattern.d.ts +0 -192
- package/dist/core/intelligence/patterns/base-pattern.js +0 -103
- package/dist/core/intelligence/patterns/completeness-validator.d.ts +0 -27
- package/dist/core/intelligence/patterns/completeness-validator.js +0 -221
- package/dist/core/intelligence/patterns/conciseness-filter.d.ts +0 -20
- package/dist/core/intelligence/patterns/conciseness-filter.js +0 -92
- package/dist/core/intelligence/patterns/context-precision.d.ts +0 -32
- package/dist/core/intelligence/patterns/context-precision.js +0 -389
- package/dist/core/intelligence/patterns/conversation-summarizer.d.ts +0 -30
- package/dist/core/intelligence/patterns/conversation-summarizer.js +0 -277
- package/dist/core/intelligence/patterns/dependency-identifier.d.ts +0 -23
- package/dist/core/intelligence/patterns/dependency-identifier.js +0 -166
- package/dist/core/intelligence/patterns/domain-context-enricher.d.ts +0 -21
- package/dist/core/intelligence/patterns/domain-context-enricher.js +0 -198
- package/dist/core/intelligence/patterns/edge-case-identifier.d.ts +0 -30
- package/dist/core/intelligence/patterns/edge-case-identifier.js +0 -269
- package/dist/core/intelligence/patterns/error-tolerance-enhancer.d.ts +0 -22
- package/dist/core/intelligence/patterns/error-tolerance-enhancer.js +0 -179
- package/dist/core/intelligence/patterns/implicit-requirement-extractor.d.ts +0 -24
- package/dist/core/intelligence/patterns/implicit-requirement-extractor.js +0 -259
- package/dist/core/intelligence/patterns/objective-clarifier.d.ts +0 -22
- package/dist/core/intelligence/patterns/objective-clarifier.js +0 -126
- package/dist/core/intelligence/patterns/output-format-enforcer.d.ts +0 -22
- package/dist/core/intelligence/patterns/output-format-enforcer.js +0 -151
- package/dist/core/intelligence/patterns/prd-structure-enforcer.d.ts +0 -23
- package/dist/core/intelligence/patterns/prd-structure-enforcer.js +0 -183
- package/dist/core/intelligence/patterns/prerequisite-identifier.d.ts +0 -23
- package/dist/core/intelligence/patterns/prerequisite-identifier.js +0 -221
- package/dist/core/intelligence/patterns/requirement-prioritizer.d.ts +0 -24
- package/dist/core/intelligence/patterns/requirement-prioritizer.js +0 -134
- package/dist/core/intelligence/patterns/scope-definer.d.ts +0 -26
- package/dist/core/intelligence/patterns/scope-definer.js +0 -236
- package/dist/core/intelligence/patterns/step-decomposer.d.ts +0 -31
- package/dist/core/intelligence/patterns/step-decomposer.js +0 -242
- package/dist/core/intelligence/patterns/structure-organizer.d.ts +0 -31
- package/dist/core/intelligence/patterns/structure-organizer.js +0 -218
- package/dist/core/intelligence/patterns/success-criteria-enforcer.d.ts +0 -22
- package/dist/core/intelligence/patterns/success-criteria-enforcer.js +0 -165
- package/dist/core/intelligence/patterns/success-metrics-enforcer.d.ts +0 -24
- package/dist/core/intelligence/patterns/success-metrics-enforcer.js +0 -165
- package/dist/core/intelligence/patterns/technical-context-enricher.d.ts +0 -25
- package/dist/core/intelligence/patterns/technical-context-enricher.js +0 -165
- package/dist/core/intelligence/patterns/topic-coherence-analyzer.d.ts +0 -26
- package/dist/core/intelligence/patterns/topic-coherence-analyzer.js +0 -300
- package/dist/core/intelligence/patterns/user-persona-enricher.d.ts +0 -24
- package/dist/core/intelligence/patterns/user-persona-enricher.js +0 -141
- package/dist/core/intelligence/patterns/validation-checklist-creator.d.ts +0 -31
- package/dist/core/intelligence/patterns/validation-checklist-creator.js +0 -242
- package/dist/core/intelligence/quality-assessor.d.ts +0 -51
- package/dist/core/intelligence/quality-assessor.js +0 -505
- package/dist/core/intelligence/types.d.ts +0 -111
- package/dist/core/intelligence/types.js +0 -3
- package/dist/core/intelligence/universal-optimizer.d.ts +0 -84
- package/dist/core/intelligence/universal-optimizer.js +0 -371
- package/dist/core/prd-generator.d.ts +0 -76
- package/dist/core/prd-generator.js +0 -173
- package/dist/core/prompt-manager.d.ts +0 -110
- package/dist/core/prompt-manager.js +0 -274
- package/dist/core/prompt-optimizer.d.ts +0 -268
- package/dist/core/prompt-optimizer.js +0 -959
- package/dist/core/question-engine.d.ts +0 -167
- package/dist/core/question-engine.js +0 -356
- package/dist/core/session-manager.d.ts +0 -139
- package/dist/core/session-manager.js +0 -365
- package/dist/core/task-manager.d.ts +0 -211
- package/dist/core/task-manager.js +0 -981
- package/dist/core/verification-hooks.d.ts +0 -67
- package/dist/core/verification-hooks.js +0 -309
- package/dist/core/verification-manager.d.ts +0 -107
- package/dist/core/verification-manager.js +0 -415
- package/dist/index 2.js +0 -13
- package/dist/index.d 2.ts +0 -4
- package/dist/types/session.d.ts +0 -78
- package/dist/types/session.js +0 -8
- package/dist/types/verification.d.ts +0 -205
- package/dist/types/verification.js +0 -9
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ConfigManager - Manages .clavix-implement-config.json
|
|
3
|
-
*
|
|
4
|
-
* This class handles:
|
|
5
|
-
* - Reading/writing implementation configuration
|
|
6
|
-
* - Tracking task completion state
|
|
7
|
-
* - Managing resume checkpoints
|
|
8
|
-
* - Storing git commit strategy preferences
|
|
9
|
-
*/
|
|
10
|
-
import { Task } from './task-manager.js';
|
|
11
|
-
import { CommitStrategy } from './git-manager.js';
|
|
12
|
-
/**
|
|
13
|
-
* Configuration for task implementation
|
|
14
|
-
*/
|
|
15
|
-
export interface ImplementConfig {
|
|
16
|
-
/** Git commit strategy */
|
|
17
|
-
commitStrategy: CommitStrategy;
|
|
18
|
-
/** Path to tasks.md file */
|
|
19
|
-
tasksPath: string;
|
|
20
|
-
/** Current task being worked on */
|
|
21
|
-
currentTask: Task;
|
|
22
|
-
/** Overall task statistics */
|
|
23
|
-
stats: {
|
|
24
|
-
total: number;
|
|
25
|
-
completed: number;
|
|
26
|
-
remaining: number;
|
|
27
|
-
percentage: number;
|
|
28
|
-
};
|
|
29
|
-
/** Timestamp when config was last updated */
|
|
30
|
-
timestamp: string;
|
|
31
|
-
/** ID of the last completed task */
|
|
32
|
-
lastCompletedTaskId?: string;
|
|
33
|
-
/** Array of all completed task IDs (for validation and resume) */
|
|
34
|
-
completedTaskIds?: string[];
|
|
35
|
-
/** Timestamps for each task completion (for tracking progress) */
|
|
36
|
-
completionTimestamps?: Record<string, string>;
|
|
37
|
-
/** Array of blocked task IDs with reasons */
|
|
38
|
-
blockedTasks?: Array<{
|
|
39
|
-
taskId: string;
|
|
40
|
-
reason: string;
|
|
41
|
-
timestamp: string;
|
|
42
|
-
}>;
|
|
43
|
-
/** Resume checkpoint for interrupted sessions */
|
|
44
|
-
resumeCheckpoint?: {
|
|
45
|
-
lastTaskId: string;
|
|
46
|
-
phaseProgress: Record<string, number>;
|
|
47
|
-
sessionStartTime: string;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Options for updating config
|
|
52
|
-
*/
|
|
53
|
-
export interface ConfigUpdateOptions {
|
|
54
|
-
/** Merge with existing config (true) or overwrite (false) */
|
|
55
|
-
merge?: boolean;
|
|
56
|
-
/** Validate config structure before writing */
|
|
57
|
-
validate?: boolean;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* ConfigManager class
|
|
61
|
-
*
|
|
62
|
-
* Manages implementation configuration and task tracking state
|
|
63
|
-
*/
|
|
64
|
-
export declare class ConfigManager {
|
|
65
|
-
/**
|
|
66
|
-
* Read implementation config from file
|
|
67
|
-
* @param configPath - Path to config file (.clavix-implement-config.json)
|
|
68
|
-
* @returns Implementation configuration
|
|
69
|
-
*/
|
|
70
|
-
read(configPath: string): Promise<ImplementConfig>;
|
|
71
|
-
/**
|
|
72
|
-
* Write implementation config to file
|
|
73
|
-
* @param configPath - Path to config file
|
|
74
|
-
* @param config - Configuration to write
|
|
75
|
-
* @param options - Update options
|
|
76
|
-
*/
|
|
77
|
-
write(configPath: string, config: ImplementConfig, options?: ConfigUpdateOptions): Promise<void>;
|
|
78
|
-
/**
|
|
79
|
-
* Update specific fields in config
|
|
80
|
-
* @param configPath - Path to config file
|
|
81
|
-
* @param updates - Partial config updates
|
|
82
|
-
*/
|
|
83
|
-
update(configPath: string, updates: Partial<ImplementConfig>): Promise<void>;
|
|
84
|
-
/**
|
|
85
|
-
* Track a task completion
|
|
86
|
-
* @param configPath - Path to config file
|
|
87
|
-
* @param taskId - ID of completed task
|
|
88
|
-
*/
|
|
89
|
-
trackCompletion(configPath: string, taskId: string): Promise<void>;
|
|
90
|
-
/**
|
|
91
|
-
* Add a blocked task
|
|
92
|
-
* @param configPath - Path to config file
|
|
93
|
-
* @param taskId - ID of blocked task
|
|
94
|
-
* @param reason - Reason for blocking
|
|
95
|
-
*/
|
|
96
|
-
addBlockedTask(configPath: string, taskId: string, reason: string): Promise<void>;
|
|
97
|
-
/**
|
|
98
|
-
* Remove a blocked task (unblock)
|
|
99
|
-
* @param configPath - Path to config file
|
|
100
|
-
* @param taskId - ID of task to unblock
|
|
101
|
-
*/
|
|
102
|
-
removeBlockedTask(configPath: string, taskId: string): Promise<void>;
|
|
103
|
-
/**
|
|
104
|
-
* Get current implementation state
|
|
105
|
-
* @param configPath - Path to config file
|
|
106
|
-
* @returns State summary
|
|
107
|
-
*/
|
|
108
|
-
getState(configPath: string): Promise<{
|
|
109
|
-
currentTaskId: string;
|
|
110
|
-
completedCount: number;
|
|
111
|
-
remainingCount: number;
|
|
112
|
-
blockedCount: number;
|
|
113
|
-
lastCompletedTaskId?: string;
|
|
114
|
-
lastCompletionTime?: string;
|
|
115
|
-
}>;
|
|
116
|
-
/**
|
|
117
|
-
* Check if a task has been completed
|
|
118
|
-
* @param configPath - Path to config file
|
|
119
|
-
* @param taskId - Task ID to check
|
|
120
|
-
* @returns true if task is in completed list
|
|
121
|
-
*/
|
|
122
|
-
isTaskCompleted(configPath: string, taskId: string): Promise<boolean>;
|
|
123
|
-
/**
|
|
124
|
-
* Validate config structure
|
|
125
|
-
* @param config - Configuration to validate
|
|
126
|
-
* @throws Error if config is invalid
|
|
127
|
-
*/
|
|
128
|
-
private validateConfig;
|
|
129
|
-
/**
|
|
130
|
-
* Migrate old config format to new format
|
|
131
|
-
* @param config - Old config format
|
|
132
|
-
* @returns Migrated config
|
|
133
|
-
*/
|
|
134
|
-
private migrateConfig;
|
|
135
|
-
/**
|
|
136
|
-
* Create a resume checkpoint
|
|
137
|
-
* @param configPath - Path to config file
|
|
138
|
-
* @param currentTaskId - Current task being worked on
|
|
139
|
-
* @param phaseProgress - Progress by phase (phase name -> completed count)
|
|
140
|
-
*/
|
|
141
|
-
createResumeCheckpoint(configPath: string, currentTaskId: string, phaseProgress: Record<string, number>): Promise<void>;
|
|
142
|
-
/**
|
|
143
|
-
* Get the config file path for a PRD directory
|
|
144
|
-
* @param prdPath - Path to PRD directory
|
|
145
|
-
* @returns Path to config file
|
|
146
|
-
*/
|
|
147
|
-
static getConfigPath(prdPath: string): string;
|
|
148
|
-
}
|
|
149
|
-
//# sourceMappingURL=config-manager.d.ts.map
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ConfigManager - Manages .clavix-implement-config.json
|
|
3
|
-
*
|
|
4
|
-
* This class handles:
|
|
5
|
-
* - Reading/writing implementation configuration
|
|
6
|
-
* - Tracking task completion state
|
|
7
|
-
* - Managing resume checkpoints
|
|
8
|
-
* - Storing git commit strategy preferences
|
|
9
|
-
*/
|
|
10
|
-
import fs from 'fs-extra';
|
|
11
|
-
import * as path from 'path';
|
|
12
|
-
/**
|
|
13
|
-
* ConfigManager class
|
|
14
|
-
*
|
|
15
|
-
* Manages implementation configuration and task tracking state
|
|
16
|
-
*/
|
|
17
|
-
export class ConfigManager {
|
|
18
|
-
/**
|
|
19
|
-
* Read implementation config from file
|
|
20
|
-
* @param configPath - Path to config file (.clavix-implement-config.json)
|
|
21
|
-
* @returns Implementation configuration
|
|
22
|
-
*/
|
|
23
|
-
async read(configPath) {
|
|
24
|
-
if (!(await fs.pathExists(configPath))) {
|
|
25
|
-
throw new Error(`Config file not found: ${configPath}\n\nHint: Run "clavix implement" first to initialize configuration`);
|
|
26
|
-
}
|
|
27
|
-
try {
|
|
28
|
-
const config = await fs.readJson(configPath);
|
|
29
|
-
// Migrate old config format if needed
|
|
30
|
-
return this.migrateConfig(config);
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
34
|
-
throw new Error(`Failed to read config file: ${errorMessage}`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Write implementation config to file
|
|
39
|
-
* @param configPath - Path to config file
|
|
40
|
-
* @param config - Configuration to write
|
|
41
|
-
* @param options - Update options
|
|
42
|
-
*/
|
|
43
|
-
async write(configPath, config, options = {}) {
|
|
44
|
-
const { validate = true } = options;
|
|
45
|
-
if (validate) {
|
|
46
|
-
this.validateConfig(config);
|
|
47
|
-
}
|
|
48
|
-
try {
|
|
49
|
-
await fs.writeJson(configPath, config, { spaces: 2 });
|
|
50
|
-
}
|
|
51
|
-
catch (error) {
|
|
52
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
53
|
-
throw new Error(`Failed to write config file: ${errorMessage}`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Update specific fields in config
|
|
58
|
-
* @param configPath - Path to config file
|
|
59
|
-
* @param updates - Partial config updates
|
|
60
|
-
*/
|
|
61
|
-
async update(configPath, updates) {
|
|
62
|
-
const existing = await this.read(configPath);
|
|
63
|
-
const updated = {
|
|
64
|
-
...existing,
|
|
65
|
-
...updates,
|
|
66
|
-
timestamp: new Date().toISOString(),
|
|
67
|
-
};
|
|
68
|
-
await this.write(configPath, updated);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Track a task completion
|
|
72
|
-
* @param configPath - Path to config file
|
|
73
|
-
* @param taskId - ID of completed task
|
|
74
|
-
*/
|
|
75
|
-
async trackCompletion(configPath, taskId) {
|
|
76
|
-
const config = await this.read(configPath);
|
|
77
|
-
// Initialize tracking arrays if not present
|
|
78
|
-
if (!config.completedTaskIds) {
|
|
79
|
-
config.completedTaskIds = [];
|
|
80
|
-
}
|
|
81
|
-
if (!config.completionTimestamps) {
|
|
82
|
-
config.completionTimestamps = {};
|
|
83
|
-
}
|
|
84
|
-
// Add to completed tasks (avoid duplicates)
|
|
85
|
-
if (!config.completedTaskIds.includes(taskId)) {
|
|
86
|
-
config.completedTaskIds.push(taskId);
|
|
87
|
-
}
|
|
88
|
-
// Record completion timestamp
|
|
89
|
-
config.completionTimestamps[taskId] = new Date().toISOString();
|
|
90
|
-
// Update last completed task
|
|
91
|
-
config.lastCompletedTaskId = taskId;
|
|
92
|
-
// Update timestamp
|
|
93
|
-
config.timestamp = new Date().toISOString();
|
|
94
|
-
await this.write(configPath, config);
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Add a blocked task
|
|
98
|
-
* @param configPath - Path to config file
|
|
99
|
-
* @param taskId - ID of blocked task
|
|
100
|
-
* @param reason - Reason for blocking
|
|
101
|
-
*/
|
|
102
|
-
async addBlockedTask(configPath, taskId, reason) {
|
|
103
|
-
const config = await this.read(configPath);
|
|
104
|
-
if (!config.blockedTasks) {
|
|
105
|
-
config.blockedTasks = [];
|
|
106
|
-
}
|
|
107
|
-
// Remove existing entry for this task if present
|
|
108
|
-
config.blockedTasks = config.blockedTasks.filter(b => b.taskId !== taskId);
|
|
109
|
-
// Add new blocked task
|
|
110
|
-
config.blockedTasks.push({
|
|
111
|
-
taskId,
|
|
112
|
-
reason,
|
|
113
|
-
timestamp: new Date().toISOString(),
|
|
114
|
-
});
|
|
115
|
-
config.timestamp = new Date().toISOString();
|
|
116
|
-
await this.write(configPath, config);
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Remove a blocked task (unblock)
|
|
120
|
-
* @param configPath - Path to config file
|
|
121
|
-
* @param taskId - ID of task to unblock
|
|
122
|
-
*/
|
|
123
|
-
async removeBlockedTask(configPath, taskId) {
|
|
124
|
-
const config = await this.read(configPath);
|
|
125
|
-
if (config.blockedTasks) {
|
|
126
|
-
config.blockedTasks = config.blockedTasks.filter(b => b.taskId !== taskId);
|
|
127
|
-
config.timestamp = new Date().toISOString();
|
|
128
|
-
await this.write(configPath, config);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Get current implementation state
|
|
133
|
-
* @param configPath - Path to config file
|
|
134
|
-
* @returns State summary
|
|
135
|
-
*/
|
|
136
|
-
async getState(configPath) {
|
|
137
|
-
const config = await this.read(configPath);
|
|
138
|
-
return {
|
|
139
|
-
currentTaskId: config.currentTask.id,
|
|
140
|
-
completedCount: config.completedTaskIds?.length ?? 0,
|
|
141
|
-
remainingCount: config.stats.remaining,
|
|
142
|
-
blockedCount: config.blockedTasks?.length ?? 0,
|
|
143
|
-
lastCompletedTaskId: config.lastCompletedTaskId,
|
|
144
|
-
lastCompletionTime: config.lastCompletedTaskId
|
|
145
|
-
? config.completionTimestamps?.[config.lastCompletedTaskId]
|
|
146
|
-
: undefined,
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Check if a task has been completed
|
|
151
|
-
* @param configPath - Path to config file
|
|
152
|
-
* @param taskId - Task ID to check
|
|
153
|
-
* @returns true if task is in completed list
|
|
154
|
-
*/
|
|
155
|
-
async isTaskCompleted(configPath, taskId) {
|
|
156
|
-
const config = await this.read(configPath);
|
|
157
|
-
return config.completedTaskIds?.includes(taskId) ?? false;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Validate config structure
|
|
161
|
-
* @param config - Configuration to validate
|
|
162
|
-
* @throws Error if config is invalid
|
|
163
|
-
*/
|
|
164
|
-
validateConfig(config) {
|
|
165
|
-
if (!config.commitStrategy) {
|
|
166
|
-
throw new Error('Config validation failed: commitStrategy is required');
|
|
167
|
-
}
|
|
168
|
-
if (!config.tasksPath) {
|
|
169
|
-
throw new Error('Config validation failed: tasksPath is required');
|
|
170
|
-
}
|
|
171
|
-
if (!config.currentTask) {
|
|
172
|
-
throw new Error('Config validation failed: currentTask is required');
|
|
173
|
-
}
|
|
174
|
-
if (!config.stats) {
|
|
175
|
-
throw new Error('Config validation failed: stats is required');
|
|
176
|
-
}
|
|
177
|
-
const validStrategies = ['per-task', 'per-5-tasks', 'per-phase', 'none'];
|
|
178
|
-
if (!validStrategies.includes(config.commitStrategy)) {
|
|
179
|
-
throw new Error(`Config validation failed: invalid commitStrategy "${config.commitStrategy}"`);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Migrate old config format to new format
|
|
184
|
-
* @param config - Old config format
|
|
185
|
-
* @returns Migrated config
|
|
186
|
-
*/
|
|
187
|
-
migrateConfig(config) {
|
|
188
|
-
// If already has new fields, return as-is
|
|
189
|
-
if (config.completedTaskIds !== undefined) {
|
|
190
|
-
return config;
|
|
191
|
-
}
|
|
192
|
-
// Migrate from old format
|
|
193
|
-
const migrated = {
|
|
194
|
-
commitStrategy: config.commitStrategy ?? 'none',
|
|
195
|
-
tasksPath: config.tasksPath ?? '',
|
|
196
|
-
currentTask: config.currentTask ?? { id: 'initial', description: 'Initial Task', phase: 'initialization', completed: false },
|
|
197
|
-
stats: config.stats ?? { total: 0, completed: 0, remaining: 0, percentage: 0 },
|
|
198
|
-
timestamp: config.timestamp ?? new Date().toISOString(),
|
|
199
|
-
completedTaskIds: [],
|
|
200
|
-
completionTimestamps: {},
|
|
201
|
-
blockedTasks: [],
|
|
202
|
-
};
|
|
203
|
-
return migrated;
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Create a resume checkpoint
|
|
207
|
-
* @param configPath - Path to config file
|
|
208
|
-
* @param currentTaskId - Current task being worked on
|
|
209
|
-
* @param phaseProgress - Progress by phase (phase name -> completed count)
|
|
210
|
-
*/
|
|
211
|
-
async createResumeCheckpoint(configPath, currentTaskId, phaseProgress) {
|
|
212
|
-
const config = await this.read(configPath);
|
|
213
|
-
config.resumeCheckpoint = {
|
|
214
|
-
lastTaskId: currentTaskId,
|
|
215
|
-
phaseProgress,
|
|
216
|
-
sessionStartTime: new Date().toISOString(),
|
|
217
|
-
};
|
|
218
|
-
config.timestamp = new Date().toISOString();
|
|
219
|
-
await this.write(configPath, config);
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Get the config file path for a PRD directory
|
|
223
|
-
* @param prdPath - Path to PRD directory
|
|
224
|
-
* @returns Path to config file
|
|
225
|
-
*/
|
|
226
|
-
static getConfigPath(prdPath) {
|
|
227
|
-
return path.join(prdPath, '.clavix-implement-config.json');
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
//# sourceMappingURL=config-manager.js.map
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ConversationAnalyzer - Analyzes conversation sessions and extracts structured requirements
|
|
3
|
-
*
|
|
4
|
-
* This class handles:
|
|
5
|
-
* - Conversation analysis and pattern extraction
|
|
6
|
-
* - Key requirement identification
|
|
7
|
-
* - Technical constraint extraction
|
|
8
|
-
* - Success criteria identification
|
|
9
|
-
* - Mini-PRD and optimized prompt generation
|
|
10
|
-
*/
|
|
11
|
-
import { Session } from '../types/session.js';
|
|
12
|
-
/**
|
|
13
|
-
* Analyzed conversation data
|
|
14
|
-
*/
|
|
15
|
-
export interface ConversationAnalysis {
|
|
16
|
-
summary: string;
|
|
17
|
-
keyRequirements: string[];
|
|
18
|
-
technicalConstraints: string[];
|
|
19
|
-
successCriteria: string[];
|
|
20
|
-
outOfScope: string[];
|
|
21
|
-
additionalContext: string[];
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* ConversationAnalyzer class
|
|
25
|
-
*
|
|
26
|
-
* Analyzes conversational sessions to extract structured requirements
|
|
27
|
-
* suitable for PRD generation or AI prompting
|
|
28
|
-
*/
|
|
29
|
-
export declare class ConversationAnalyzer {
|
|
30
|
-
/**
|
|
31
|
-
* Analyze a conversation session
|
|
32
|
-
*
|
|
33
|
-
* @param session - The session to analyze
|
|
34
|
-
* @returns Structured analysis of the conversation
|
|
35
|
-
*/
|
|
36
|
-
analyze(session: Session): ConversationAnalysis;
|
|
37
|
-
/**
|
|
38
|
-
* Generate a mini-PRD from analyzed conversation
|
|
39
|
-
*
|
|
40
|
-
* @param session - The session
|
|
41
|
-
* @param analysis - The conversation analysis
|
|
42
|
-
* @returns Mini-PRD content
|
|
43
|
-
*/
|
|
44
|
-
generateMiniPrd(session: Session, analysis: ConversationAnalysis): string;
|
|
45
|
-
/**
|
|
46
|
-
* Generate an optimized prompt for AI consumption
|
|
47
|
-
*
|
|
48
|
-
* @param session - The session
|
|
49
|
-
* @param analysis - The conversation analysis
|
|
50
|
-
* @returns Optimized prompt content
|
|
51
|
-
*/
|
|
52
|
-
generateOptimizedPrompt(session: Session, analysis: ConversationAnalysis): string;
|
|
53
|
-
/**
|
|
54
|
-
* Extract a summary from the conversation
|
|
55
|
-
*/
|
|
56
|
-
private extractSummary;
|
|
57
|
-
/**
|
|
58
|
-
* Extract key requirements from messages
|
|
59
|
-
*/
|
|
60
|
-
private extractKeyRequirements;
|
|
61
|
-
/**
|
|
62
|
-
* Extract technical constraints from messages
|
|
63
|
-
*/
|
|
64
|
-
private extractTechnicalConstraints;
|
|
65
|
-
/**
|
|
66
|
-
* Extract success criteria from messages
|
|
67
|
-
*/
|
|
68
|
-
private extractSuccessCriteria;
|
|
69
|
-
/**
|
|
70
|
-
* Extract out-of-scope items from messages
|
|
71
|
-
*/
|
|
72
|
-
private extractOutOfScope;
|
|
73
|
-
/**
|
|
74
|
-
* Extract additional context from messages
|
|
75
|
-
*/
|
|
76
|
-
private extractAdditionalContext;
|
|
77
|
-
/**
|
|
78
|
-
* Clean up extracted text
|
|
79
|
-
*/
|
|
80
|
-
private cleanupText;
|
|
81
|
-
/**
|
|
82
|
-
* Check if message matches any pattern
|
|
83
|
-
*/
|
|
84
|
-
private matchesAnyPattern;
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=conversation-analyzer.d.ts.map
|