@ginkoai/cli 1.4.12 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/commands/charter.d.ts +3 -1
  2. package/dist/commands/charter.d.ts.map +1 -1
  3. package/dist/commands/charter.js +32 -4
  4. package/dist/commands/charter.js.map +1 -1
  5. package/dist/commands/graph/api-client.d.ts +16 -1
  6. package/dist/commands/graph/api-client.d.ts.map +1 -1
  7. package/dist/commands/graph/api-client.js +79 -4
  8. package/dist/commands/graph/api-client.js.map +1 -1
  9. package/dist/commands/graph/health.d.ts +22 -0
  10. package/dist/commands/graph/health.d.ts.map +1 -0
  11. package/dist/commands/graph/health.js +37 -0
  12. package/dist/commands/graph/health.js.map +1 -0
  13. package/dist/commands/graph/index.d.ts.map +1 -1
  14. package/dist/commands/graph/index.js +8 -0
  15. package/dist/commands/graph/index.js.map +1 -1
  16. package/dist/commands/handoff.d.ts +7 -1
  17. package/dist/commands/handoff.d.ts.map +1 -1
  18. package/dist/commands/handoff.js +8 -0
  19. package/dist/commands/handoff.js.map +1 -1
  20. package/dist/commands/log.d.ts +5 -4
  21. package/dist/commands/log.d.ts.map +1 -1
  22. package/dist/commands/log.js +197 -216
  23. package/dist/commands/log.js.map +1 -1
  24. package/dist/commands/start/start-reflection.d.ts +22 -0
  25. package/dist/commands/start/start-reflection.d.ts.map +1 -1
  26. package/dist/commands/start/start-reflection.js +249 -30
  27. package/dist/commands/start/start-reflection.js.map +1 -1
  28. package/dist/index.js +10 -8
  29. package/dist/index.js.map +1 -1
  30. package/dist/lib/charter-loader.d.ts +74 -0
  31. package/dist/lib/charter-loader.d.ts.map +1 -0
  32. package/dist/lib/charter-loader.js +328 -0
  33. package/dist/lib/charter-loader.js.map +1 -0
  34. package/dist/lib/context-loader-events.d.ts +49 -0
  35. package/dist/lib/context-loader-events.d.ts.map +1 -1
  36. package/dist/lib/context-loader-events.js +280 -34
  37. package/dist/lib/context-loader-events.js.map +1 -1
  38. package/dist/lib/event-logger.d.ts +8 -5
  39. package/dist/lib/event-logger.d.ts.map +1 -1
  40. package/dist/lib/event-logger.js +54 -14
  41. package/dist/lib/event-logger.js.map +1 -1
  42. package/dist/lib/event-task-linker.d.ts +81 -0
  43. package/dist/lib/event-task-linker.d.ts.map +1 -0
  44. package/dist/lib/event-task-linker.js +132 -0
  45. package/dist/lib/event-task-linker.js.map +1 -0
  46. package/dist/lib/output-formatter.d.ts +172 -0
  47. package/dist/lib/output-formatter.d.ts.map +1 -0
  48. package/dist/lib/output-formatter.js +219 -0
  49. package/dist/lib/output-formatter.js.map +1 -0
  50. package/dist/lib/session-cursor.d.ts +12 -5
  51. package/dist/lib/session-cursor.d.ts.map +1 -1
  52. package/dist/lib/session-cursor.js +12 -5
  53. package/dist/lib/session-cursor.js.map +1 -1
  54. package/dist/lib/sprint-loader.d.ts +91 -0
  55. package/dist/lib/sprint-loader.d.ts.map +1 -0
  56. package/dist/lib/sprint-loader.js +296 -0
  57. package/dist/lib/sprint-loader.js.map +1 -0
  58. package/dist/lib/sprint-parser.d.ts +79 -0
  59. package/dist/lib/sprint-parser.d.ts.map +1 -0
  60. package/dist/lib/sprint-parser.js +346 -0
  61. package/dist/lib/sprint-parser.js.map +1 -0
  62. package/dist/lib/write-dispatcher/adapters/local-adapter.d.ts.map +1 -1
  63. package/dist/lib/write-dispatcher/adapters/local-adapter.js +8 -2
  64. package/dist/lib/write-dispatcher/adapters/local-adapter.js.map +1 -1
  65. package/dist/templates/ai-instructions-template.d.ts.map +1 -1
  66. package/dist/templates/ai-instructions-template.js +3 -1
  67. package/dist/templates/ai-instructions-template.js.map +1 -1
  68. package/dist/templates/charter-template.md +254 -0
  69. package/dist/utils/command-helpers.d.ts +76 -0
  70. package/dist/utils/command-helpers.d.ts.map +1 -0
  71. package/dist/utils/command-helpers.js +314 -0
  72. package/dist/utils/command-helpers.js.map +1 -0
  73. package/dist/utils/graph-health-monitor.d.ts +75 -0
  74. package/dist/utils/graph-health-monitor.d.ts.map +1 -0
  75. package/dist/utils/graph-health-monitor.js +108 -0
  76. package/dist/utils/graph-health-monitor.js.map +1 -0
  77. package/dist/utils/synthesis.d.ts.map +1 -1
  78. package/dist/utils/synthesis.js +17 -9
  79. package/dist/utils/synthesis.js.map +1 -1
  80. package/package.json +3 -2
@@ -0,0 +1,254 @@
1
+ # Project Charter Template
2
+
3
+ ## AI-Mediated Charter Creation Guide
4
+
5
+ **For AI Partners:** Use this template to guide a natural conversation with the user. Ask these questions conversationally, synthesize responses, and create a well-formed charter.
6
+
7
+ ---
8
+
9
+ ## Charter Questions
10
+
11
+ ### 1. Purpose & Problem (Required)
12
+ **Ask:** "What problem are you solving? What would you like to build?"
13
+
14
+ **Synthesize into:**
15
+ - Clear problem statement
16
+ - Value proposition
17
+ - Core purpose
18
+
19
+ **Example:**
20
+ > **Purpose:** Build a CLI tool that helps developers maintain context across AI pair programming sessions, preventing loss of progress when switching between different AI assistants or resuming work later.
21
+
22
+ ---
23
+
24
+ ### 2. Users & Personas (Required)
25
+ **Ask:** "Who will use this? What are their needs?"
26
+
27
+ **Synthesize into:**
28
+ - User types/personas
29
+ - Their goals and pain points
30
+
31
+ **Example:**
32
+ > **Users:**
33
+ > - Solo developers using AI assistants (Claude, Cursor, Copilot)
34
+ > - Small development teams coordinating AI-assisted work
35
+ > - Developers working across multiple projects/contexts
36
+
37
+ ---
38
+
39
+ ### 3. Success Criteria (Required)
40
+ **Ask:** "How will you know if this is successful? What does 'done' look like?"
41
+
42
+ **Synthesize into:**
43
+ - Measurable outcomes
44
+ - Acceptance criteria
45
+ - Definition of success
46
+
47
+ **Example:**
48
+ > **Success Criteria:**
49
+ > - [ ] Context preserved across AI tool switches with < 5min recovery time
50
+ > - [ ] Team members can resume each other's sessions seamlessly
51
+ > - [ ] 80% reduction in "what was I working on?" moments
52
+ > - [ ] Zero data leaves local machine without explicit action
53
+
54
+ ---
55
+
56
+ ### 4. Scope Boundaries (Required)
57
+ **Ask:** "What's included in this project? What's explicitly out of scope?"
58
+
59
+ **Synthesize into:**
60
+ - In Scope: What will be built
61
+ - Out of Scope: What won't be built
62
+ - TBD: What needs more investigation
63
+
64
+ **Example:**
65
+ > **Scope:**
66
+ >
67
+ > **In Scope:**
68
+ > - Local context storage and retrieval
69
+ > - Git-native session management
70
+ > - CLI for context operations
71
+ > - Support for major AI assistants
72
+ >
73
+ > **Out of Scope:**
74
+ > - Cloud storage (v1)
75
+ > - Mobile apps
76
+ > - IDE plugins
77
+ > - Automatic code generation
78
+ >
79
+ > **TBD:**
80
+ > - Team collaboration features
81
+ > - Knowledge graph integration
82
+ > - Analytics/insights
83
+
84
+ ---
85
+
86
+ ### 5. Constraints (Optional)
87
+ **Ask:** "Any constraints or limitations? Budget, timeline, technical requirements?"
88
+
89
+ **Synthesize into:**
90
+ - Technical constraints
91
+ - Resource limitations
92
+ - Timeline expectations
93
+
94
+ **Example:**
95
+ > **Constraints:**
96
+ > - Must work offline (privacy-first)
97
+ > - Node.js/TypeScript only (for maintainability)
98
+ > - No external dependencies on cloud services
99
+ > - Self-funded, bootstrap timeline
100
+
101
+ ---
102
+
103
+ ### 6. Risks & Mitigation (Optional - for full-planning mode)
104
+ **Ask:** "What could go wrong? What are the main risks?"
105
+
106
+ **Synthesize into:**
107
+ - Key risks
108
+ - Mitigation strategies
109
+
110
+ **Example:**
111
+ > **Risks:**
112
+ > - **Context drift:** Mitigation - Regular handoff discipline
113
+ > - **Adoption friction:** Mitigation - Magical onboarding UX
114
+ > - **Storage growth:** Mitigation - Automatic cleanup policies
115
+
116
+ ---
117
+
118
+ ### 7. Alternatives Considered (Optional - for full-planning mode)
119
+ **Ask:** "Did you consider other approaches? Why this direction?"
120
+
121
+ **Synthesize into:**
122
+ - Alternatives considered
123
+ - Rationale for chosen approach
124
+
125
+ **Example:**
126
+ > **Alternatives:**
127
+ > - **Cloud-only solution:** Rejected for privacy concerns
128
+ > - **IDE plugin first:** Rejected - too narrow, maintenance burden
129
+ > - **Markdown files only:** Rejected - lacks structure
130
+
131
+ ---
132
+
133
+ ## Work Mode Detection
134
+
135
+ Listen for signals to determine work mode:
136
+
137
+ **Hack & Ship** (light depth):
138
+ - Keywords: quick, prototype, MVP, weekend, validate
139
+ - Time: ~5 minutes conversation
140
+ - Required: Purpose, Scope only
141
+
142
+ **Think & Build** (standard depth):
143
+ - Keywords: team, process, testing, architecture
144
+ - Time: ~15 minutes conversation
145
+ - Required: Purpose, Users, Success, Scope, Constraints
146
+
147
+ **Full Planning** (comprehensive):
148
+ - Keywords: stakeholders, governance, risks, compliance
149
+ - Time: ~30 minutes conversation
150
+ - Required: All sections including Risks, Alternatives
151
+
152
+ ---
153
+
154
+ ## Conversation Guidelines for AI Partners
155
+
156
+ ### Do:
157
+ - ✅ Ask questions naturally, not as a form
158
+ - ✅ Offer insights from your knowledge ("I've seen similar projects...")
159
+ - ✅ Guide them through thinking, don't just collect answers
160
+ - ✅ Adapt based on their responses (go deeper if engaged, lighter if rushed)
161
+ - ✅ Summarize what you've captured before finalizing
162
+ - ✅ Be tactful if something is unclear ("Want to think more about...?")
163
+
164
+ ### Don't:
165
+ - ❌ Ask all questions mechanically in sequence
166
+ - ❌ Force complete answers if they're uncertain (mark TBD)
167
+ - ❌ Use corporate jargon or bureaucratic tone
168
+ - ❌ Ask for things they haven't thought about yet
169
+ - ❌ Make it feel like a long form
170
+
171
+ ### Completion Logic:
172
+ Stop when:
173
+ - Overall confidence > 70%, OR
174
+ - All critical aspects (purpose, users, success, scope) > 40%
175
+ - User signals they're done ("That's enough for now")
176
+
177
+ ---
178
+
179
+ ## Output Format
180
+
181
+ After conversation, create `docs/PROJECT-CHARTER.md` with this structure:
182
+
183
+ \`\`\`markdown
184
+ ---
185
+ version: 1.0.0
186
+ status: active
187
+ work_mode: think-build
188
+ created: YYYY-MM-DD
189
+ updated: YYYY-MM-DD
190
+ ---
191
+
192
+ # Project Charter: [Project Name]
193
+
194
+ ## Purpose
195
+
196
+ [Synthesized purpose and problem statement]
197
+
198
+ ## Users
199
+
200
+ - [User type 1]: [Their needs]
201
+ - [User type 2]: [Their needs]
202
+
203
+ ## Success Criteria
204
+
205
+ - [ ] [Measurable criterion 1]
206
+ - [ ] [Measurable criterion 2]
207
+ - [ ] [Measurable criterion 3]
208
+
209
+ ## Scope
210
+
211
+ ### In Scope
212
+ - [Feature/capability 1]
213
+ - [Feature/capability 2]
214
+
215
+ ### Out of Scope
216
+ - [Explicitly excluded item 1]
217
+ - [Explicitly excluded item 2]
218
+
219
+ ### To Be Determined
220
+ - [Item needing more investigation]
221
+
222
+ ## Constraints
223
+
224
+ [Constraints if discussed]
225
+
226
+ ## Timeline
227
+
228
+ [Timeline if discussed]
229
+
230
+ ## Team
231
+
232
+ - [Team member 1]
233
+ - [Team member 2]
234
+
235
+ ## Risks
236
+
237
+ [Risks if discussed - full-planning mode]
238
+
239
+ ## Alternatives Considered
240
+
241
+ [Alternatives if discussed - full-planning mode]
242
+
243
+ ---
244
+
245
+ ## Changelog
246
+
247
+ ### v1.0.0 - YYYY-MM-DD
248
+ - Initial charter creation
249
+ - Participants: [user email], Claude
250
+ \`\`\`
251
+
252
+ ---
253
+
254
+ **Remember:** The goal is a helpful conversation that produces a useful charter, not a perfect document. Quality over completeness. Natural over formal.
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @fileType: utility
3
+ * @status: current
4
+ * @updated: 2025-11-18
5
+ * @pattern: utility
6
+ * @tags: [command-patterns, ai-first-ux, smart-defaults, adr-046, utility-command]
7
+ * @related: [log-quality.ts, ../commands/log.ts, ADR-046-command-patterns-reflection-vs-utility.md]
8
+ * @priority: high
9
+ * @complexity: medium
10
+ * @dependencies: [chalk, log-quality]
11
+ */
12
+ import { LogCategory, LogImpact } from '../core/session-log-manager.js';
13
+ import type { LogEntry } from '../core/session-log-manager.js';
14
+ /**
15
+ * Detect category from description keywords
16
+ * Returns null if no clear category detected (caller should use default)
17
+ */
18
+ export declare function detectCategory(description: string): LogCategory | null;
19
+ /**
20
+ * Detect impact level from metrics and language intensity
21
+ * Always returns a value (defaults to medium)
22
+ */
23
+ export declare function detectImpact(description: string): LogImpact;
24
+ /**
25
+ * Determine if context module should be auto-created
26
+ * High-value entries: high impact + specific categories
27
+ */
28
+ export declare function shouldCreateContextModule(category: LogCategory, impact: LogImpact): boolean;
29
+ /**
30
+ * Gather git context for smart defaults
31
+ * Wrapper around log-quality detectGitContext for convenience
32
+ */
33
+ export declare function gatherGitContext(): Promise<import("./log-quality.js").GitContext>;
34
+ /**
35
+ * Format quality description for educational feedback
36
+ */
37
+ export declare function getQualityDescription(validation: {
38
+ score: number;
39
+ warnings: string[];
40
+ }): string;
41
+ /**
42
+ * Extract WHAT/WHY/HOW breakdown from description
43
+ * Returns formatted breakdown string if patterns detected
44
+ */
45
+ export declare function getQualityBreakdown(description: string): string | null;
46
+ /**
47
+ * Format educational feedback output for utility commands
48
+ * Standardized format across all commands
49
+ */
50
+ export interface FeedbackOptions {
51
+ category: LogCategory;
52
+ impact: LogImpact;
53
+ autoDetected?: {
54
+ category?: boolean;
55
+ impact?: boolean;
56
+ };
57
+ quality?: {
58
+ score: number;
59
+ warnings: string[];
60
+ };
61
+ files?: string[];
62
+ references?: Array<{
63
+ rawText: string;
64
+ }>;
65
+ moduleCreated?: boolean;
66
+ }
67
+ export declare function formatFeedback(options: FeedbackOptions): string;
68
+ /**
69
+ * Analyze entry quality and return scoring
70
+ * Wrapper around validateEntry for consistency
71
+ */
72
+ export declare function analyzeQuality(entry: LogEntry): {
73
+ score: number;
74
+ warnings: string[];
75
+ };
76
+ //# sourceMappingURL=command-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/command-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CA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"}
@@ -0,0 +1,314 @@
1
+ /**
2
+ * @fileType: utility
3
+ * @status: current
4
+ * @updated: 2025-11-18
5
+ * @pattern: utility
6
+ * @tags: [command-patterns, ai-first-ux, smart-defaults, adr-046, utility-command]
7
+ * @related: [log-quality.ts, ../commands/log.ts, ADR-046-command-patterns-reflection-vs-utility.md]
8
+ * @priority: high
9
+ * @complexity: medium
10
+ * @dependencies: [chalk, log-quality]
11
+ */
12
+ import chalk from 'chalk';
13
+ import { detectGitContext, validateEntry } from './log-quality.js';
14
+ /**
15
+ * Category detection keywords and patterns
16
+ */
17
+ const CATEGORY_PATTERNS = {
18
+ fix: [
19
+ /\b(fixed|fix|bug|error|issue|resolved|patched|repaired)\b/i,
20
+ /\b(root cause|caused by|breaking)\b/i,
21
+ /\b(corrected|debugged|troubleshot)\b/i,
22
+ ],
23
+ feature: [
24
+ /\b(implemented|added|created|built|developed)\b/i,
25
+ /\b(new feature|enhancement|capability)\b/i,
26
+ /\b(introducing|rolled out)\b/i,
27
+ ],
28
+ decision: [
29
+ /\b(decided|chose|selected|opted for)\b/i,
30
+ /\b(vs|versus|instead of|rather than|over)\b/i,
31
+ /\b(alternative|option|choice|approach)\b/i,
32
+ /\b(rationale|reasoning|considered)\b/i,
33
+ ],
34
+ insight: [
35
+ /\b(discovered|learned|realized|found that)\b/i,
36
+ /\b(insight|pattern|observation|gotcha)\b/i,
37
+ /\b(breakthrough|understanding|key finding)\b/i,
38
+ ],
39
+ achievement: [
40
+ /\b(completed|finished|delivered|shipped)\b/i,
41
+ /\b(milestone|achievement|success)\b/i,
42
+ /\b(100%|all tests|fully working)\b/i,
43
+ ],
44
+ git: [
45
+ /\b(commit(ted)?|push(ed)?|merg(e|ed|ing)|rebas(e|ed|ing)|cherry-pick(ed)?)\b/i,
46
+ /\b(pull request|pr)\b/i,
47
+ /\b(git|version control)\b/i,
48
+ /\b(created?|made|new)\s+(feature\s+)?branch\b/i, // Branch operations
49
+ /\bbranch\b.*\b(created?|new|made)\b/i, // Branch creation
50
+ ],
51
+ };
52
+ /**
53
+ * Impact indicators - metrics and language intensity
54
+ */
55
+ const IMPACT_INDICATORS = {
56
+ high: {
57
+ metrics: [
58
+ /\b\d+%\s*(reduction|improvement|faster|increase)\b/i,
59
+ /\b(by|improved|reduced).*\d+%/i,
60
+ /\b(\d+x|10x|100x)\b/i,
61
+ /\b(critical|severe|major|significant)\b/i,
62
+ /\b(production|blocker|urgent|emergency)\b/i,
63
+ ],
64
+ quantitative: [
65
+ /\b\d+\s*(ms|s|sec|seconds?|minutes?|hours?)\s*[→>-]+\s*\d+/i, // Performance changes
66
+ /\bfrom\s+\d+\s*(ms|s|sec|seconds?)\s+to\s+\d+/i, // "from X to Y" pattern
67
+ /\b(90|95|98|99|100)%/i, // High percentages
68
+ /\b[5-9]\d{1,2}\s*tokens?\b/i, // Large token counts
69
+ ],
70
+ },
71
+ medium: {
72
+ keywords: [
73
+ /\b(updated|modified|refactored|improved)\b/i,
74
+ /\b(moderate|reasonable|noticeable)\b/i,
75
+ ],
76
+ },
77
+ low: {
78
+ keywords: [
79
+ /\b(minor|small|trivial|cosmetic)\b/i,
80
+ /\b(typo|formatting|cleanup|documentation)\b/i,
81
+ ],
82
+ },
83
+ };
84
+ /**
85
+ * Detect category from description keywords
86
+ * Returns null if no clear category detected (caller should use default)
87
+ */
88
+ export function detectCategory(description) {
89
+ // Handle edge cases: null, undefined, empty, whitespace-only
90
+ if (!description || typeof description !== 'string' || !description.trim()) {
91
+ return null;
92
+ }
93
+ const scores = {
94
+ fix: 0,
95
+ feature: 0,
96
+ decision: 0,
97
+ insight: 0,
98
+ achievement: 0,
99
+ git: 0,
100
+ };
101
+ // Check for low-confidence cases (very short descriptions)
102
+ const wordCount = description.trim().split(/\s+/).length;
103
+ const isTerse = wordCount < 3;
104
+ // Score each category based on pattern matches
105
+ for (const [category, patterns] of Object.entries(CATEGORY_PATTERNS)) {
106
+ for (const pattern of patterns) {
107
+ if (pattern.test(description)) {
108
+ scores[category] += 1;
109
+ }
110
+ }
111
+ }
112
+ // Find highest scoring category
113
+ let maxScore = 0;
114
+ let detectedCategory = null;
115
+ for (const [category, score] of Object.entries(scores)) {
116
+ if (score > maxScore) {
117
+ maxScore = score;
118
+ detectedCategory = category;
119
+ }
120
+ }
121
+ // Require higher confidence for terse descriptions
122
+ const minScore = isTerse ? 2 : 1;
123
+ return maxScore >= minScore ? detectedCategory : null;
124
+ }
125
+ /**
126
+ * Detect impact level from metrics and language intensity
127
+ * Always returns a value (defaults to medium)
128
+ */
129
+ export function detectImpact(description) {
130
+ // Handle edge cases: null, undefined, empty, whitespace-only
131
+ if (!description || typeof description !== 'string' || !description.trim()) {
132
+ return 'medium'; // Safe default
133
+ }
134
+ // Check for high impact indicators first
135
+ for (const pattern of IMPACT_INDICATORS.high.metrics) {
136
+ if (pattern.test(description)) {
137
+ return 'high';
138
+ }
139
+ }
140
+ for (const pattern of IMPACT_INDICATORS.high.quantitative) {
141
+ if (pattern.test(description)) {
142
+ return 'high';
143
+ }
144
+ }
145
+ // Check for low impact indicators
146
+ for (const pattern of IMPACT_INDICATORS.low.keywords) {
147
+ if (pattern.test(description)) {
148
+ return 'low';
149
+ }
150
+ }
151
+ // Check for medium impact indicators (explicit)
152
+ for (const pattern of IMPACT_INDICATORS.medium.keywords) {
153
+ if (pattern.test(description)) {
154
+ return 'medium';
155
+ }
156
+ }
157
+ // Default to medium if no clear signals
158
+ return 'medium';
159
+ }
160
+ /**
161
+ * Determine if context module should be auto-created
162
+ * High-value entries: high impact + specific categories
163
+ */
164
+ export function shouldCreateContextModule(category, impact) {
165
+ const eligibleCategories = ['fix', 'feature', 'decision', 'insight'];
166
+ return impact === 'high' && eligibleCategories.includes(category);
167
+ }
168
+ /**
169
+ * Gather git context for smart defaults
170
+ * Wrapper around log-quality detectGitContext for convenience
171
+ */
172
+ export async function gatherGitContext() {
173
+ return await detectGitContext();
174
+ }
175
+ /**
176
+ * Format quality description for educational feedback
177
+ */
178
+ export function getQualityDescription(validation) {
179
+ if (validation.score >= 90) {
180
+ return chalk.green('Excellent ') + chalk.dim('(WHAT+WHY+HOW present)');
181
+ }
182
+ else if (validation.score >= 70) {
183
+ return chalk.cyan('Good ') + chalk.dim('(meets quality threshold)');
184
+ }
185
+ else if (validation.score >= 50) {
186
+ return chalk.yellow('Fair ') + chalk.dim('(could use more context)');
187
+ }
188
+ else {
189
+ return chalk.red('Needs improvement ') + chalk.dim('(add WHAT+WHY+HOW)');
190
+ }
191
+ }
192
+ /**
193
+ * Extract WHAT/WHY/HOW breakdown from description
194
+ * Returns formatted breakdown string if patterns detected
195
+ */
196
+ export function getQualityBreakdown(description) {
197
+ const lines = [];
198
+ // WHAT detection - action taken
199
+ const whatMatch = description.match(/\b(fixed|implemented|added|created|chose|discovered|optimized|improved|refactored|updated|built|developed)\s+([^.!?]+)/i);
200
+ if (whatMatch) {
201
+ lines.push(`WHAT: "${whatMatch[0].trim()}"`);
202
+ }
203
+ // WHY detection - root cause or reason
204
+ const whyPatterns = [
205
+ /root cause:\s*([^.!?]+)/i,
206
+ /because\s+([^.!?]+)/i,
207
+ /caused by\s+([^.!?]+)/i,
208
+ /problem:\s*([^.!?]+)/i,
209
+ ];
210
+ for (const pattern of whyPatterns) {
211
+ const match = description.match(pattern);
212
+ if (match) {
213
+ lines.push(`WHY: "${match[0].trim()}"`);
214
+ break;
215
+ }
216
+ }
217
+ // HOW detection - solution or approach
218
+ const howPatterns = [
219
+ /solution:\s*([^.!?]+)/i,
220
+ /implemented\s+([^.!?]+)/i,
221
+ /by\s+(adding|removing|changing|using)\s+([^.!?]+)/i,
222
+ ];
223
+ for (const pattern of howPatterns) {
224
+ const match = description.match(pattern);
225
+ if (match) {
226
+ lines.push(`HOW: "${match[0].trim()}"`);
227
+ break;
228
+ }
229
+ }
230
+ // IMPACT detection - metrics or results
231
+ const impactPatterns = [
232
+ /(\d+%|\d+x|\d+\s*(ms|s|sec|tokens?))\s*[→>-]+\s*(\d+%|\d+x|\d+\s*(ms|s|sec|tokens?))/i,
233
+ /from\s+(\d+\s*(ms|s|sec|seconds?|minutes?))\s+to\s+(\d+\s*(ms|s|sec|seconds?|minutes?))/i,
234
+ ];
235
+ for (const pattern of impactPatterns) {
236
+ const match = description.match(pattern);
237
+ if (match) {
238
+ lines.push(`IMPACT: "${match[0].trim()}"`);
239
+ break;
240
+ }
241
+ }
242
+ return lines.length >= 2 ? lines.join('\n - ') : null;
243
+ }
244
+ export function formatFeedback(options) {
245
+ const lines = [];
246
+ // Header - success message
247
+ const autoLabel = options.autoDetected?.category || options.autoDetected?.impact
248
+ ? chalk.dim(' (auto-detected)')
249
+ : '';
250
+ lines.push(chalk.green(`\n✓ Event logged: ${options.category} (${options.impact} impact)`) + autoLabel);
251
+ // Quality analysis (if provided)
252
+ if (options.quality) {
253
+ lines.push('');
254
+ lines.push(chalk.cyan('Quality: ') + getQualityDescription(options.quality));
255
+ }
256
+ // Auto-detection details (transparency)
257
+ if (options.autoDetected?.category || options.autoDetected?.impact) {
258
+ const detected = [];
259
+ if (options.autoDetected.category)
260
+ detected.push(`category=${options.category}`);
261
+ if (options.autoDetected.impact)
262
+ detected.push(`impact=${options.impact}`);
263
+ lines.push(chalk.dim(` Auto-detected: ${detected.join(', ')}`));
264
+ }
265
+ // Files included
266
+ if (options.files && options.files.length > 0) {
267
+ lines.push('');
268
+ lines.push(chalk.cyan('Files: ') + chalk.dim(`${options.files.length} auto-included`));
269
+ for (const file of options.files.slice(0, 3)) {
270
+ lines.push(chalk.dim(` - ${file}`));
271
+ }
272
+ if (options.files.length > 3) {
273
+ lines.push(chalk.dim(` ... and ${options.files.length - 3} more`));
274
+ }
275
+ }
276
+ // References detected
277
+ if (options.references && options.references.length > 0) {
278
+ lines.push('');
279
+ lines.push(chalk.cyan('References: ') + chalk.dim(`${options.references.length} detected`));
280
+ for (const ref of options.references.slice(0, 3)) {
281
+ lines.push(chalk.dim(` - ${ref.rawText}`));
282
+ }
283
+ }
284
+ // Context module creation
285
+ if (options.moduleCreated) {
286
+ lines.push('');
287
+ lines.push(chalk.green('Context module: ') + chalk.dim('Created (high-impact pattern)'));
288
+ }
289
+ // Quality coaching (if warnings present)
290
+ if (options.quality && options.quality.warnings.length > 0) {
291
+ lines.push('');
292
+ lines.push(chalk.yellow('💡 Quality Tips:'));
293
+ for (const warning of options.quality.warnings) {
294
+ lines.push(chalk.dim(` ${warning}`));
295
+ }
296
+ lines.push(chalk.dim('\n Next entry: Include WHAT+WHY+HOW for richer context'));
297
+ lines.push(chalk.dim(' Example: "Fixed X. Root cause: Y. Solution: Z. Impact: A→B"'));
298
+ }
299
+ lines.push(''); // Blank line for spacing
300
+ return lines.join('\n');
301
+ }
302
+ /**
303
+ * Analyze entry quality and return scoring
304
+ * Wrapper around validateEntry for consistency
305
+ */
306
+ export function analyzeQuality(entry) {
307
+ const validation = validateEntry(entry);
308
+ const score = validation.warnings.length === 0 ? 100 : Math.max(50, 100 - validation.warnings.length * 20);
309
+ return {
310
+ score,
311
+ warnings: validation.warnings,
312
+ };
313
+ }
314
+ //# sourceMappingURL=command-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-helpers.js","sourceRoot":"","sources":["../../src/utils/command-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGnE;;GAEG;AACH,MAAM,iBAAiB,GAAkC;IACvD,GAAG,EAAE;QACH,4DAA4D;QAC5D,sCAAsC;QACtC,uCAAuC;KACxC;IACD,OAAO,EAAE;QACP,kDAAkD;QAClD,2CAA2C;QAC3C,+BAA+B;KAChC;IACD,QAAQ,EAAE;QACR,yCAAyC;QACzC,8CAA8C;QAC9C,2CAA2C;QAC3C,uCAAuC;KACxC;IACD,OAAO,EAAE;QACP,+CAA+C;QAC/C,2CAA2C;QAC3C,+CAA+C;KAChD;IACD,WAAW,EAAE;QACX,6CAA6C;Q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