@relipa/ai-flow-kit 0.1.0 → 0.1.1

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/scripts/guide.js CHANGED
@@ -1,314 +1,314 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const chalk = require('chalk');
4
-
5
- // ──────────────────────────────────────────────────────────────
6
- // Entry point
7
- // ──────────────────────────────────────────────────────────────
8
-
9
- module.exports = function guide(options = {}) {
10
- if (options.flow) return showFlow();
11
- if (options.commands) return showCommands();
12
- showFull();
13
- };
14
-
15
- // ──────────────────────────────────────────────────────────────
16
- // Full guide
17
- // ──────────────────────────────────────────────────────────────
18
-
19
- function showFull() {
20
- showHeader();
21
- showFlow();
22
- showWorkflow();
23
- showCommands();
24
- showPromptGuide();
25
- showFooter();
26
- }
27
-
28
- // ──────────────────────────────────────────────────────────────
29
- // Header
30
- // ──────────────────────────────────────────────────────────────
31
-
32
- function showHeader() {
33
- console.log('\n' + chalk.bold.blue('═'.repeat(62)));
34
- console.log(chalk.bold.white(' AI Flow Kit — Quickstart Guide'));
35
- console.log(chalk.blue('═'.repeat(62)) + '\n');
36
- console.log(chalk.gray(' All-in-one AI workflow for development teams using Claude AI.'));
37
- console.log(chalk.gray(' Developers only need 3 steps for AI to understand the task and start working.\n'));
38
- }
39
-
40
- // ──────────────────────────────────────────────────────────────
41
- // Architecture / Flow diagram
42
- // ──────────────────────────────────────────────────────────────
43
-
44
- function showFlow() {
45
- console.log(chalk.bold.cyan(' ⛩️ WORKFLOW OVERVIEW (AIFLOW.md)\n'));
46
-
47
- try {
48
- const aiflowPath = path.join(__dirname, '../docs/common/AIFLOW.md');
49
- if (!fs.existsSync(aiflowPath)) {
50
- console.log(chalk.red(' Error: AIFLOW.md not found.'));
51
- return;
52
- }
53
-
54
- const content = fs.readFileSync(aiflowPath, 'utf8');
55
- const lines = content.split('\n');
56
-
57
- let inSection = false;
58
- let sectionLines = [];
59
-
60
- for (const line of lines) {
61
- if (line.trim() === '## Workflow Overview') {
62
- inSection = true;
63
- continue;
64
- }
65
- if (inSection) {
66
- if (line.startsWith('## ') || line.trim() === '---') {
67
- break;
68
- }
69
- sectionLines.push(line);
70
- }
71
- }
72
-
73
- if (sectionLines.length > 0) {
74
- console.log(chalk.white(sectionLines.join('\n')));
75
- } else {
76
- console.log(chalk.yellow(' (Workflow Overview section not found in AIFLOW.md)'));
77
- }
78
- } catch (error) {
79
- console.log(chalk.red(' Error reading AIFLOW.md: ' + error.message));
80
- }
81
- console.log();
82
- }
83
-
84
- // ──────────────────────────────────────────────────────────────
85
- // Step-by-step workflow
86
- // ──────────────────────────────────────────────────────────────
87
-
88
- function showWorkflow() {
89
- console.log(chalk.bold.cyan(' 🚀 WORKFLOW STEP-BY-STEP\n'));
90
-
91
- // Step 0: Install
92
- console.log(chalk.bold.white(' Step 0 — Installation (One-time)'));
93
- console.log(chalk.green(' npm install -g ai-flow-kit'));
94
- console.log();
95
-
96
- // Step 1: Init
97
- console.log(chalk.bold.white(' Step 1 — Initialize project (Once per project)'));
98
- console.log(chalk.green(' aiflow init --framework spring-boot --adapter backlog'));
99
- console.log(chalk.gray(' → Creates .claude/, .rules/, CLAUDE.md, .mcp.json'));
100
- console.log();
101
-
102
- // Step 2: Load context
103
- console.log(chalk.bold.white(' Step 2 — Load context from ticket (per task)'));
104
- console.log(chalk.green(' aiflow use PROJ-33') + chalk.gray(' # Fast Mode (Default)'));
105
- console.log(chalk.green(' aiflow use PROJ-33 --full') + chalk.gray(' # Full Mode (Optional)'));
106
- console.log(chalk.green(' claude'));
107
- console.log();
108
-
109
- // Gate workflow
110
- console.log(chalk.bold.white(' Step 3 — AI runs Strict Gate Workflow automatically'));
111
- console.log();
112
- console.log(chalk.yellow(' ⛩️ GATE 1') + chalk.gray(' — AI checks requirement and solution approach'));
113
- console.log(chalk.gray(' Fast Mode (Default): Minimal Q&A, target < 5 min'));
114
- console.log(chalk.gray(' Developer reviews requirement.md → "APPROVED"'));
115
- console.log();
116
- console.log(chalk.yellow(' ⛩️ GATE 2') + chalk.gray(' — AI generates detailed spec + plan'));
117
- console.log(chalk.gray(' Developer reviews each section'));
118
- console.log(chalk.gray(' Developer types "APPROVED" → move to Gate 3'));
119
- console.log();
120
- console.log(chalk.yellow(' ⛩️ GATE 3') + chalk.gray(' — AI generates code (TDD: tests first)'));
121
- console.log(chalk.gray(' Automatic, developer only monitors'));
122
- console.log();
123
- console.log(chalk.yellow(' ⛩️ GATE 4') + chalk.gray(' — AI self-reviews + generates summary'));
124
- console.log(chalk.gray(' Developer review → "APPROVED" or "BUG: ..."'));
125
- console.log();
126
- console.log(chalk.yellow(' ⛩️ GATE 5') + chalk.gray(' — Peer review → create PR → merge'));
127
- console.log();
128
- console.log(chalk.gray(' Full details: ') + chalk.green('cat AIFLOW.md'));
129
- console.log();
130
-
131
- // Frameworks supported
132
- console.log(chalk.bold.white(' Frameworks: ') + chalk.gray('spring-boot │ reactjs │ nextjs │ vue-nuxt │ laravel'));
133
- console.log(chalk.bold.white(' Adapters: ') + chalk.gray('backlog │ jira │ figma'));
134
- console.log();
135
- }
136
-
137
- // ──────────────────────────────────────────────────────────────
138
- // Command reference
139
- // ──────────────────────────────────────────────────────────────
140
-
141
- function showCommands() {
142
- console.log(chalk.bold.cyan(' 📋 COMMAND REFERENCE\n'));
143
-
144
- const commands = [
145
- {
146
- group: 'Setup',
147
- items: [
148
- ['aiflow init', '--framework <fw> --adapter <ad>', 'Initialize project'],
149
- ['aiflow init', '--env <tools>', 'AI tools: cursor,gemini,copilot'],
150
- ['aiflow init', '--with-rtk | --no-rtk', 'RTK bash compression (60–90% saving)'],
151
- // ['aiflow init', '--with-gitnexus', 'GitNexus code intelligence (waits for index)'],
152
- // ['aiflow init', '--with-gitnexus --no-wait', 'GitNexus: index in background'],
153
- ['aiflow doctor', '', 'Check setup health + token savings status'],
154
- ['aiflow doctor', '--verbose', 'Detailed health check output'],
155
- ['aiflow update', '', 'Update to the latest version'],
156
- ['aiflow update', '--force', 'Force update even if already latest'],
157
- ['aiflow sync-skills', '', 'Manually sync AI Instruction files'],
158
- ['aiflow remove', '', 'Remove ai-flow-kit from project'],
159
- ['aiflow remove', '--version <ver>', 'Remove a cached version'],
160
- ['aiflow remove', '--global', 'Uninstall global package'],
161
- ]
162
- },
163
- {
164
- group: 'Workflow (use per task)',
165
- items: [
166
- ['aiflow use <TICKET-ID>', '', 'Load context from Backlog/Jira'],
167
- ['aiflow use <T1> <T2> ...', '', 'Multi-target: 1st is primary, rest supplementary (v0.1.0+)'],
168
- ['aiflow use', '--fast', 'Fast Mode: minimal Q&A (Default)'],
169
- ['aiflow use', '--full', 'Full Mode: deep analysis with Q&A'],
170
- ['aiflow use', '--file <path>', 'Load from local text/json file'],
171
- ['aiflow use', '--manual', 'Enter context manually'],
172
- ['aiflow use', '--with-comments', 'Include all comments'],
173
- ['aiflow use', '--comments-last <n>', 'Only get last N comments'],
174
- ['aiflow use', '--comments-from <n>', 'Get comments from index N onward'],
175
- ['aiflow fetch-links <url>', '', 'Fetch Backlog/Jira link → SupplementaryContext JSON (v0.1.0+)'],
176
- ['aiflow prompt <type>', '', 'Generate AI prompt'],
177
- ['aiflow prompt', '--list', 'View all prompt types'],
178
- ['aiflow prompt', '--output <file>', 'Save prompt to file'],
179
- ['aiflow prompt', '--lang vietnamese', 'Prompt in Vietnamese'],
180
- ['aiflow prompt', '--detail <level>', 'Detail: minimal|standard|comprehensive'],
181
- ['aiflow detect "<description>"', '', 'Auto-detect task type'],
182
- ]
183
- },
184
- {
185
- group: 'Task management',
186
- items: [
187
- ['aiflow task status', '', 'Show active and pending tasks'],
188
- ['aiflow task list', '', 'List all saved tasks'],
189
- ['aiflow task pause', '--note <text>', 'Pause current task and save progress'],
190
- ['aiflow task switch <id>', '', 'Pause current and switch to another'],
191
- ['aiflow task resume <id>', '', 'Resume a paused task'],
192
- ['aiflow task reset <id>', '', 'Reset task to Gate 1 (keeps context)'],
193
- ['aiflow task remove <id>', '', 'Permanently delete all task data'],
194
- ]
195
- },
196
- {
197
- group: 'Context management',
198
- items: [
199
- ['aiflow context show', '', 'View active context'],
200
- ['aiflow context list', '', 'List saved contexts'],
201
- ['aiflow context save <name>', '', 'Save current context'],
202
- ['aiflow context --load <name>', '', 'Load saved context'],
203
- ['aiflow context --delete <name>', '', 'Delete saved context'],
204
- ['aiflow context clear', '', 'Clear all contexts'],
205
- ]
206
- },
207
- {
208
- group: 'Memory (team knowledge)',
209
- items: [
210
- ['aiflow memory save <key> <value>', '', 'Save a note'],
211
- ['aiflow memory get <key>', '', 'Read a note'],
212
- ['aiflow memory list', '', 'List all notes'],
213
- ['aiflow memory search <query>', '', 'Search notes'],
214
- ['aiflow memory delete <key>', '', 'Delete a note'],
215
- ['aiflow memory clear', '', 'Clear all notes'],
216
- ]
217
- },
218
- {
219
- group: 'Validation',
220
- items: [
221
- ['aiflow validate <file>', '', 'Validate code against team rules'],
222
- ['aiflow validate <file>', '--fix', 'Auto-fix trailing whitespace'],
223
- ['aiflow validate <file>', '--verbose', 'Detailed validation report'],
224
- ['aiflow validate <file>', '-r lenient', 'Only report critical errors'],
225
- ['aiflow validate <file>', '-r strict', 'Report all warnings'],
226
- ]
227
- },
228
- {
229
- group: 'Telemetry',
230
- items: [
231
- ['aiflow telemetry status', '', 'View telemetry status'],
232
- ['aiflow telemetry enable', '', 'Enable usage tracking'],
233
- ['aiflow telemetry disable', '', 'Disable usage tracking'],
234
- ['aiflow telemetry flush', '', 'Force-send buffered events now'],
235
- ]
236
- },
237
- {
238
- group: 'AI Workflow Integration',
239
- items: [
240
- ['aiflow gate <n> start', '--ticket <id>', 'Log gate N started (AI calls this)'],
241
- ['aiflow gate <n> approved', '--ticket <id>', 'Log gate N approved (AI calls this)'],
242
- ['aiflow gate <n> start', '--ai-tool <tool>', 'Specify AI tool name'],
243
- ]
244
- },
245
- {
246
- group: 'Help',
247
- items: [
248
- ['aiflow guide', '', 'View this guide again'],
249
- ['aiflow guide', '--flow', 'Only view architecture & flow'],
250
- ['aiflow guide', '--commands', 'Only view command reference'],
251
- ['aiflow <command>', '--help', 'Help for each command'],
252
- ]
253
- },
254
- ];
255
-
256
- for (const { group, items } of commands) {
257
- console.log(chalk.bold.white(` ${group}`));
258
- for (const [cmd, opts, desc] of items) {
259
- const cmdStr = chalk.green(cmd.padEnd(34));
260
- const optStr = chalk.gray((opts || '').padEnd(22));
261
- const descStr = chalk.white(desc);
262
- console.log(` ${cmdStr}${optStr}${descStr}`);
263
- }
264
- console.log();
265
- }
266
- }
267
-
268
- // ──────────────────────────────────────────────────────────────
269
- // Prompt type guide
270
- // ──────────────────────────────────────────────────────────────
271
-
272
- function showPromptGuide() {
273
- console.log(chalk.bold.cyan(' 🤖 PROMPT TYPES — WHEN TO USE?\n'));
274
-
275
- const types = [
276
- ['bug-fix', 'Fixing bugs, crashes, regressions'],
277
- ['feature', 'Implementing new features (user stories)'],
278
- ['investigation', 'Investigating, analyzing root cause'],
279
- ['refactor', 'Improving code without changing behavior'],
280
- ['impact-analysis', 'Analyzing the impact of changes'],
281
- ['documentation', 'Writing docs, README, API reference'],
282
- ];
283
-
284
- for (const [type, when] of types) {
285
- console.log(` ${chalk.green(('aiflow prompt ' + type).padEnd(34))} ${chalk.gray(when)}`);
286
- }
287
- console.log();
288
-
289
- console.log(chalk.bold.white(' Example complete workflow for a bug:\n'));
290
- console.log(chalk.gray(' $ ') + chalk.green('aiflow use PROJ-33 --with-comments'));
291
- console.log(chalk.gray(' ✓ Context loaded: PROJ-33 — Login button crash on iOS\n'));
292
- console.log(chalk.gray(' $ ') + chalk.green('aiflow prompt bug-fix'));
293
- console.log(chalk.gray(' ─────────────────────────────────────────────────────'));
294
- console.log(chalk.gray(' # Fix Bug'));
295
- console.log(chalk.gray(' **Task:** Investigate and fix the bug...'));
296
- console.log(chalk.gray(' **Ticket:** PROJ-33'));
297
- console.log(chalk.gray(' **Title:** Login button crash on iOS'));
298
- console.log(chalk.gray(' ...team rules...'));
299
- console.log(chalk.gray(' ─────────────────────────────────────────────────────\n'));
300
- console.log(chalk.gray(' $ ') + chalk.green('claude'));
301
- console.log(chalk.gray(' > Fix bug PROJ-33'));
302
- console.log(chalk.gray(' → Claude automatically reads context, applies rules, invokes systematic-debugging skill\n'));
303
- }
304
-
305
- // ──────────────────────────────────────────────────────────────
306
- // Footer
307
- // ──────────────────────────────────────────────────────────────
308
-
309
- function showFooter() {
310
- console.log(chalk.blue('─'.repeat(62)));
311
- console.log(chalk.gray(' View the guide anytime: ') + chalk.green('aiflow guide'));
312
- console.log(chalk.gray(' Check setup health: ') + chalk.green('aiflow doctor'));
313
- console.log(chalk.blue('─'.repeat(62)) + '\n');
314
- }
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const chalk = require('chalk');
4
+
5
+ // ──────────────────────────────────────────────────────────────
6
+ // Entry point
7
+ // ──────────────────────────────────────────────────────────────
8
+
9
+ module.exports = function guide(options = {}) {
10
+ if (options.flow) return showFlow();
11
+ if (options.commands) return showCommands();
12
+ showFull();
13
+ };
14
+
15
+ // ──────────────────────────────────────────────────────────────
16
+ // Full guide
17
+ // ──────────────────────────────────────────────────────────────
18
+
19
+ function showFull() {
20
+ showHeader();
21
+ showFlow();
22
+ showWorkflow();
23
+ showCommands();
24
+ showPromptGuide();
25
+ showFooter();
26
+ }
27
+
28
+ // ──────────────────────────────────────────────────────────────
29
+ // Header
30
+ // ──────────────────────────────────────────────────────────────
31
+
32
+ function showHeader() {
33
+ console.log('\n' + chalk.bold.blue('═'.repeat(62)));
34
+ console.log(chalk.bold.white(' AI Flow Kit — Quickstart Guide'));
35
+ console.log(chalk.blue('═'.repeat(62)) + '\n');
36
+ console.log(chalk.gray(' All-in-one AI workflow for development teams using Claude AI.'));
37
+ console.log(chalk.gray(' Developers only need 3 steps for AI to understand the task and start working.\n'));
38
+ }
39
+
40
+ // ──────────────────────────────────────────────────────────────
41
+ // Architecture / Flow diagram
42
+ // ──────────────────────────────────────────────────────────────
43
+
44
+ function showFlow() {
45
+ console.log(chalk.bold.cyan(' ⛩️ WORKFLOW OVERVIEW (AIFLOW.md)\n'));
46
+
47
+ try {
48
+ const aiflowPath = path.join(__dirname, '../docs/common/AIFLOW.md');
49
+ if (!fs.existsSync(aiflowPath)) {
50
+ console.log(chalk.red(' Error: AIFLOW.md not found.'));
51
+ return;
52
+ }
53
+
54
+ const content = fs.readFileSync(aiflowPath, 'utf8');
55
+ const lines = content.split('\n');
56
+
57
+ let inSection = false;
58
+ let sectionLines = [];
59
+
60
+ for (const line of lines) {
61
+ if (line.trim() === '## Workflow Overview') {
62
+ inSection = true;
63
+ continue;
64
+ }
65
+ if (inSection) {
66
+ if (line.startsWith('## ') || line.trim() === '---') {
67
+ break;
68
+ }
69
+ sectionLines.push(line);
70
+ }
71
+ }
72
+
73
+ if (sectionLines.length > 0) {
74
+ console.log(chalk.white(sectionLines.join('\n')));
75
+ } else {
76
+ console.log(chalk.yellow(' (Workflow Overview section not found in AIFLOW.md)'));
77
+ }
78
+ } catch (error) {
79
+ console.log(chalk.red(' Error reading AIFLOW.md: ' + error.message));
80
+ }
81
+ console.log();
82
+ }
83
+
84
+ // ──────────────────────────────────────────────────────────────
85
+ // Step-by-step workflow
86
+ // ──────────────────────────────────────────────────────────────
87
+
88
+ function showWorkflow() {
89
+ console.log(chalk.bold.cyan(' 🚀 WORKFLOW STEP-BY-STEP\n'));
90
+
91
+ // Step 0: Install
92
+ console.log(chalk.bold.white(' Step 0 — Installation (One-time)'));
93
+ console.log(chalk.green(' npm install -g ai-flow-kit'));
94
+ console.log();
95
+
96
+ // Step 1: Init
97
+ console.log(chalk.bold.white(' Step 1 — Initialize project (Once per project)'));
98
+ console.log(chalk.green(' aiflow init --framework spring-boot --adapter backlog'));
99
+ console.log(chalk.gray(' → Creates .claude/, .rules/, CLAUDE.md, .mcp.json'));
100
+ console.log();
101
+
102
+ // Step 2: Load context
103
+ console.log(chalk.bold.white(' Step 2 — Load context from ticket (per task)'));
104
+ console.log(chalk.green(' aiflow use PROJ-33') + chalk.gray(' # Fast Mode (Default)'));
105
+ console.log(chalk.green(' aiflow use PROJ-33 --full') + chalk.gray(' # Full Mode (Optional)'));
106
+ console.log(chalk.green(' claude'));
107
+ console.log();
108
+
109
+ // Gate workflow
110
+ console.log(chalk.bold.white(' Step 3 — AI runs Strict Gate Workflow automatically'));
111
+ console.log();
112
+ console.log(chalk.yellow(' ⛩️ GATE 1') + chalk.gray(' — AI checks requirement and solution approach'));
113
+ console.log(chalk.gray(' Fast Mode (Default): Minimal Q&A, target < 5 min'));
114
+ console.log(chalk.gray(' Developer reviews requirement.md → "APPROVED"'));
115
+ console.log();
116
+ console.log(chalk.yellow(' ⛩️ GATE 2') + chalk.gray(' — AI generates detailed spec + plan'));
117
+ console.log(chalk.gray(' Developer reviews each section'));
118
+ console.log(chalk.gray(' Developer types "APPROVED" → move to Gate 3'));
119
+ console.log();
120
+ console.log(chalk.yellow(' ⛩️ GATE 3') + chalk.gray(' — AI generates code (TDD: tests first)'));
121
+ console.log(chalk.gray(' Automatic, developer only monitors'));
122
+ console.log();
123
+ console.log(chalk.yellow(' ⛩️ GATE 4') + chalk.gray(' — AI self-reviews + generates summary'));
124
+ console.log(chalk.gray(' Developer review → "APPROVED" or "BUG: ..."'));
125
+ console.log();
126
+ console.log(chalk.yellow(' ⛩️ GATE 5') + chalk.gray(' — Peer review → create PR → merge'));
127
+ console.log();
128
+ console.log(chalk.gray(' Full details: ') + chalk.green('cat AIFLOW.md'));
129
+ console.log();
130
+
131
+ // Frameworks supported
132
+ console.log(chalk.bold.white(' Frameworks: ') + chalk.gray('spring-boot │ reactjs │ nextjs │ vue-nuxt │ laravel'));
133
+ console.log(chalk.bold.white(' Adapters: ') + chalk.gray('backlog │ jira │ figma'));
134
+ console.log();
135
+ }
136
+
137
+ // ──────────────────────────────────────────────────────────────
138
+ // Command reference
139
+ // ──────────────────────────────────────────────────────────────
140
+
141
+ function showCommands() {
142
+ console.log(chalk.bold.cyan(' 📋 COMMAND REFERENCE\n'));
143
+
144
+ const commands = [
145
+ {
146
+ group: 'Setup',
147
+ items: [
148
+ ['aiflow init', '--framework <fw> --adapter <ad>', 'Initialize project'],
149
+ ['aiflow init', '--env <tools>', 'AI tools: cursor,gemini,copilot'],
150
+ ['aiflow init', '--with-rtk | --no-rtk', 'RTK bash compression (60–90% saving)'],
151
+ // ['aiflow init', '--with-gitnexus', 'GitNexus code intelligence (waits for index)'],
152
+ // ['aiflow init', '--with-gitnexus --no-wait', 'GitNexus: index in background'],
153
+ ['aiflow doctor', '', 'Check setup health + token savings status'],
154
+ ['aiflow doctor', '--verbose', 'Detailed health check output'],
155
+ ['aiflow update', '', 'Update to the latest version'],
156
+ ['aiflow update', '--force', 'Force update even if already latest'],
157
+ ['aiflow sync-skills', '', 'Manually sync AI Instruction files'],
158
+ ['aiflow remove', '', 'Remove ai-flow-kit from project'],
159
+ ['aiflow remove', '--version <ver>', 'Remove a cached version'],
160
+ ['aiflow remove', '--global', 'Uninstall global package'],
161
+ ]
162
+ },
163
+ {
164
+ group: 'Workflow (use per task)',
165
+ items: [
166
+ ['aiflow use <TICKET-ID>', '', 'Load context from Backlog/Jira'],
167
+ ['aiflow use <T1> <T2> ...', '', 'Multi-target: 1st is primary, rest supplementary (v0.1.0+)'],
168
+ ['aiflow use', '--fast', 'Fast Mode: minimal Q&A (Default)'],
169
+ ['aiflow use', '--full', 'Full Mode: deep analysis with Q&A'],
170
+ ['aiflow use', '--file <path>', 'Load from local text/json file'],
171
+ ['aiflow use', '--manual', 'Enter context manually'],
172
+ ['aiflow use', '--with-comments', 'Include all comments'],
173
+ ['aiflow use', '--comments-last <n>', 'Only get last N comments'],
174
+ ['aiflow use', '--comments-from <n>', 'Get comments from index N onward'],
175
+ ['aiflow fetch-links <url>', '', 'Fetch Backlog/Jira link → SupplementaryContext JSON (v0.1.0+)'],
176
+ ['aiflow prompt <type>', '', 'Generate AI prompt'],
177
+ ['aiflow prompt', '--list', 'View all prompt types'],
178
+ ['aiflow prompt', '--output <file>', 'Save prompt to file'],
179
+ ['aiflow prompt', '--lang vietnamese', 'Prompt in Vietnamese'],
180
+ ['aiflow prompt', '--detail <level>', 'Detail: minimal|standard|comprehensive'],
181
+ ['aiflow detect "<description>"', '', 'Auto-detect task type'],
182
+ ]
183
+ },
184
+ {
185
+ group: 'Task management',
186
+ items: [
187
+ ['aiflow task status', '', 'Show active and pending tasks'],
188
+ ['aiflow task list', '', 'List all saved tasks'],
189
+ ['aiflow task pause', '--note <text>', 'Pause current task and save progress'],
190
+ ['aiflow task switch <id>', '', 'Pause current and switch to another'],
191
+ ['aiflow task resume <id>', '', 'Resume a paused task'],
192
+ ['aiflow task reset <id>', '', 'Reset task to Gate 1 (keeps context)'],
193
+ ['aiflow task remove <id>', '', 'Permanently delete all task data'],
194
+ ]
195
+ },
196
+ {
197
+ group: 'Context management',
198
+ items: [
199
+ ['aiflow context show', '', 'View active context'],
200
+ ['aiflow context list', '', 'List saved contexts'],
201
+ ['aiflow context save <name>', '', 'Save current context'],
202
+ ['aiflow context --load <name>', '', 'Load saved context'],
203
+ ['aiflow context --delete <name>', '', 'Delete saved context'],
204
+ ['aiflow context clear', '', 'Clear all contexts'],
205
+ ]
206
+ },
207
+ {
208
+ group: 'Memory (team knowledge)',
209
+ items: [
210
+ ['aiflow memory save <key> <value>', '', 'Save a note'],
211
+ ['aiflow memory get <key>', '', 'Read a note'],
212
+ ['aiflow memory list', '', 'List all notes'],
213
+ ['aiflow memory search <query>', '', 'Search notes'],
214
+ ['aiflow memory delete <key>', '', 'Delete a note'],
215
+ ['aiflow memory clear', '', 'Clear all notes'],
216
+ ]
217
+ },
218
+ {
219
+ group: 'Validation',
220
+ items: [
221
+ ['aiflow validate <file>', '', 'Validate code against team rules'],
222
+ ['aiflow validate <file>', '--fix', 'Auto-fix trailing whitespace'],
223
+ ['aiflow validate <file>', '--verbose', 'Detailed validation report'],
224
+ ['aiflow validate <file>', '-r lenient', 'Only report critical errors'],
225
+ ['aiflow validate <file>', '-r strict', 'Report all warnings'],
226
+ ]
227
+ },
228
+ {
229
+ group: 'Telemetry',
230
+ items: [
231
+ ['aiflow telemetry status', '', 'View telemetry status'],
232
+ ['aiflow telemetry enable', '', 'Enable usage tracking'],
233
+ ['aiflow telemetry disable', '', 'Disable usage tracking'],
234
+ ['aiflow telemetry flush', '', 'Force-send buffered events now'],
235
+ ]
236
+ },
237
+ {
238
+ group: 'AI Workflow Integration',
239
+ items: [
240
+ ['aiflow gate <n> start', '--ticket <id>', 'Log gate N started (AI calls this)'],
241
+ ['aiflow gate <n> approved', '--ticket <id>', 'Log gate N approved (AI calls this)'],
242
+ ['aiflow gate <n> start', '--ai-tool <tool>', 'Specify AI tool name'],
243
+ ]
244
+ },
245
+ {
246
+ group: 'Help',
247
+ items: [
248
+ ['aiflow guide', '', 'View this guide again'],
249
+ ['aiflow guide', '--flow', 'Only view architecture & flow'],
250
+ ['aiflow guide', '--commands', 'Only view command reference'],
251
+ ['aiflow <command>', '--help', 'Help for each command'],
252
+ ]
253
+ },
254
+ ];
255
+
256
+ for (const { group, items } of commands) {
257
+ console.log(chalk.bold.white(` ${group}`));
258
+ for (const [cmd, opts, desc] of items) {
259
+ const cmdStr = chalk.green(cmd.padEnd(34));
260
+ const optStr = chalk.gray((opts || '').padEnd(22));
261
+ const descStr = chalk.white(desc);
262
+ console.log(` ${cmdStr}${optStr}${descStr}`);
263
+ }
264
+ console.log();
265
+ }
266
+ }
267
+
268
+ // ──────────────────────────────────────────────────────────────
269
+ // Prompt type guide
270
+ // ──────────────────────────────────────────────────────────────
271
+
272
+ function showPromptGuide() {
273
+ console.log(chalk.bold.cyan(' 🤖 PROMPT TYPES — WHEN TO USE?\n'));
274
+
275
+ const types = [
276
+ ['bug-fix', 'Fixing bugs, crashes, regressions'],
277
+ ['feature', 'Implementing new features (user stories)'],
278
+ ['investigation', 'Investigating, analyzing root cause'],
279
+ ['refactor', 'Improving code without changing behavior'],
280
+ ['impact-analysis', 'Analyzing the impact of changes'],
281
+ ['documentation', 'Writing docs, README, API reference'],
282
+ ];
283
+
284
+ for (const [type, when] of types) {
285
+ console.log(` ${chalk.green(('aiflow prompt ' + type).padEnd(34))} ${chalk.gray(when)}`);
286
+ }
287
+ console.log();
288
+
289
+ console.log(chalk.bold.white(' Example complete workflow for a bug:\n'));
290
+ console.log(chalk.gray(' $ ') + chalk.green('aiflow use PROJ-33 --with-comments'));
291
+ console.log(chalk.gray(' ✓ Context loaded: PROJ-33 — Login button crash on iOS\n'));
292
+ console.log(chalk.gray(' $ ') + chalk.green('aiflow prompt bug-fix'));
293
+ console.log(chalk.gray(' ─────────────────────────────────────────────────────'));
294
+ console.log(chalk.gray(' # Fix Bug'));
295
+ console.log(chalk.gray(' **Task:** Investigate and fix the bug...'));
296
+ console.log(chalk.gray(' **Ticket:** PROJ-33'));
297
+ console.log(chalk.gray(' **Title:** Login button crash on iOS'));
298
+ console.log(chalk.gray(' ...team rules...'));
299
+ console.log(chalk.gray(' ─────────────────────────────────────────────────────\n'));
300
+ console.log(chalk.gray(' $ ') + chalk.green('claude'));
301
+ console.log(chalk.gray(' > Fix bug PROJ-33'));
302
+ console.log(chalk.gray(' → Claude automatically reads context, applies rules, invokes systematic-debugging skill\n'));
303
+ }
304
+
305
+ // ──────────────────────────────────────────────────────────────
306
+ // Footer
307
+ // ──────────────────────────────────────────────────────────────
308
+
309
+ function showFooter() {
310
+ console.log(chalk.blue('─'.repeat(62)));
311
+ console.log(chalk.gray(' View the guide anytime: ') + chalk.green('aiflow guide'));
312
+ console.log(chalk.gray(' Check setup health: ') + chalk.green('aiflow doctor'));
313
+ console.log(chalk.blue('─'.repeat(62)) + '\n');
314
+ }