@relipa/ai-flow-kit 0.0.4 → 0.0.5-beta.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/{docs/README.md → README.md} +8 -7
- package/bin/aiflow.js +77 -7
- package/custom/templates/shared/gate-workflow.md +13 -0
- package/docs/AIFLOW.md +5 -0
- package/docs/CHANGELOG.md +29 -1
- package/docs/cli-reference.md +97 -27
- package/docs/troubleshooting.md +15 -0
- package/package.json +5 -4
- package/scripts/guide.js +16 -0
- package/scripts/hooks/session-start.js +4 -0
- package/scripts/init.js +22 -5
- package/scripts/telemetry/cli.js +249 -0
- package/scripts/telemetry/config.js +94 -0
- package/scripts/telemetry/crypto.js +20 -0
- package/scripts/telemetry/flush.js +159 -0
- package/scripts/telemetry/record.js +138 -0
- package/upstream/skills/using-superpowers/SKILL.md +14 -0
- package/upstream/tests/brainstorm-server/package-lock.json +0 -36
|
@@ -23,11 +23,11 @@ Developers only need a single command to load ticket context → AI automaticall
|
|
|
23
23
|
> [!TIP]
|
|
24
24
|
> After running `aiflow init`, all documentation files are automatically copied to your project root and `.aiflow/docs/` for easy access.
|
|
25
25
|
|
|
26
|
-
- **[Quick Start Guide](./QUICK_START.md)** — Step-by-step instructions for developers.
|
|
27
|
-
- **[Full Workflow (5 Gates)](./AIFLOW.md)** — In-depth look at the Gate process.
|
|
28
|
-
- **[Developer Onboarding](./developer-overview.md)** — Presentation-ready guide for new team members.
|
|
29
|
-
- **[Troubleshooting](./troubleshooting.md)** — Common issues and fixes.
|
|
30
|
-
- **[Integration Guide](./ai-integration.md)** — Advanced tool setup (Claude, Cursor, Gemini).
|
|
26
|
+
- **[Quick Start Guide](./docs/QUICK_START.md)** — Step-by-step instructions for developers.
|
|
27
|
+
- **[Full Workflow (5 Gates)](./docs/AIFLOW.md)** — In-depth look at the Gate process.
|
|
28
|
+
- **[Developer Onboarding](./docs/developer-overview.md)** — Presentation-ready guide for new team members.
|
|
29
|
+
- **[Troubleshooting](./docs/troubleshooting.md)** — Common issues and fixes.
|
|
30
|
+
- **[Integration Guide](./docs/ai-integration.md)** — Advanced tool setup (Claude, Cursor, Gemini).
|
|
31
31
|
|
|
32
32
|
---
|
|
33
33
|
|
|
@@ -122,6 +122,7 @@ npm uninstall -g @relipa/ai-flow-kit
|
|
|
122
122
|
| `aiflow init` | Setup framework, adapters, and multi-AI rules. |
|
|
123
123
|
| `aiflow use <ticket>` | Load ticket context (Backlog/Jira). |
|
|
124
124
|
| `aiflow prompt` | Generate tool-optimized prompts (`--env cursor`). |
|
|
125
|
+
| `aiflow telemetry` | Manage telemetry tracking (enable/disable/status). |
|
|
125
126
|
| `aiflow guide` | View integrated multi-AI integration guide. |
|
|
126
127
|
|
|
127
128
|
### `aiflow init`
|
|
@@ -280,9 +281,9 @@ aiflow memory --list
|
|
|
280
281
|
|
|
281
282
|
```
|
|
282
283
|
ai-flow-kit/
|
|
284
|
+
├── README.md # Main documentation
|
|
283
285
|
├── bin/aiflow.js # CLI entry
|
|
284
286
|
├── docs/ # Documentation and Guides
|
|
285
|
-
│ ├── README.md # Main documentation
|
|
286
287
|
│ ├── QUICK_START.md # Quick start guide
|
|
287
288
|
│ ├── AIFLOW.md # Workflow (5 Gates) detail
|
|
288
289
|
│ ├── CHANGELOG.md # Version history
|
|
@@ -352,4 +353,4 @@ aiflow init --adapter backlog
|
|
|
352
353
|
aiflow doctor
|
|
353
354
|
```
|
|
354
355
|
|
|
355
|
-
See more: [docs/troubleshooting.md](./troubleshooting.md)
|
|
356
|
+
See more: [docs/troubleshooting.md](./docs/troubleshooting.md)
|
package/bin/aiflow.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const { program } = require('commander');
|
|
4
4
|
const chalk = require('chalk');
|
|
@@ -14,11 +14,45 @@ const contextCommand = require('../scripts/context');
|
|
|
14
14
|
const promptCommand = require('../scripts/prompt');
|
|
15
15
|
const removeCommand = require('../scripts/remove');
|
|
16
16
|
const guideCommand = require('../scripts/guide');
|
|
17
|
+
const telemetryCommand= require('../scripts/telemetry/cli');
|
|
18
|
+
const { record } = require('../scripts/telemetry/record');
|
|
17
19
|
|
|
18
20
|
program
|
|
19
21
|
.version(packageJson.version)
|
|
20
22
|
.description('AI Flow Kit CLI - AI-powered development workflows for teams');
|
|
21
23
|
|
|
24
|
+
// ── GLOBAL TELEMETRY HOOK ────────────────────────────────────
|
|
25
|
+
// We intercept raw argv here so we can catch --version, --help,
|
|
26
|
+
// and invalid commands *before* Commander exits the process.
|
|
27
|
+
(() => {
|
|
28
|
+
const args = process.argv.slice(2);
|
|
29
|
+
let cmd = 'help';
|
|
30
|
+
if (args.length > 0) {
|
|
31
|
+
const first = args[0];
|
|
32
|
+
if (['-V', '-v', '--version'].includes(first)) {
|
|
33
|
+
cmd = 'version';
|
|
34
|
+
} else if (['-h', '--help'].includes(first)) {
|
|
35
|
+
cmd = 'help';
|
|
36
|
+
} else if (first.startsWith('-')) {
|
|
37
|
+
cmd = 'unknown_flag';
|
|
38
|
+
if (args.includes('--help') || args.includes('-h')) cmd = 'help';
|
|
39
|
+
} else if (first === 'memory') {
|
|
40
|
+
const sec = args[1];
|
|
41
|
+
cmd = (sec && !sec.startsWith('-')) ? `memory.${sec}` : 'memory';
|
|
42
|
+
} else {
|
|
43
|
+
cmd = first;
|
|
44
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
45
|
+
cmd = `${first}.help`;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// Record everything except telemetry and gate actions (gate records its own rich event)
|
|
50
|
+
if (cmd !== 'telemetry' && !cmd.startsWith('telemetry.') && cmd !== 'gate') {
|
|
51
|
+
record('command.invoked', { command: cmd });
|
|
52
|
+
}
|
|
53
|
+
})();
|
|
54
|
+
|
|
55
|
+
|
|
22
56
|
// ── init ──────────────────────────────────────────────────────
|
|
23
57
|
program
|
|
24
58
|
.command('init')
|
|
@@ -37,6 +71,7 @@ program
|
|
|
37
71
|
? options.env.split(',').map(s => s.trim()).filter(Boolean)
|
|
38
72
|
: Object.keys(require('../scripts/init').AI_TOOL_FILES || {});
|
|
39
73
|
|
|
74
|
+
record('command.invoked', { command: 'init' });
|
|
40
75
|
initCommand(options);
|
|
41
76
|
});
|
|
42
77
|
|
|
@@ -51,6 +86,7 @@ program
|
|
|
51
86
|
.option('--comments-last <n>', 'load only the last N comments', parseInt)
|
|
52
87
|
.option('--comments-from <n>', 'load comments from index N onward (0-based)', parseInt)
|
|
53
88
|
.action((target, options) => {
|
|
89
|
+
record('command.invoked', { command: 'use' });
|
|
54
90
|
useCommand(target, options);
|
|
55
91
|
});
|
|
56
92
|
|
|
@@ -63,6 +99,7 @@ program
|
|
|
63
99
|
.option('--lang <lang>', 'language: english (default) or vietnamese')
|
|
64
100
|
.option('--detail <level>', 'detail level: minimal | standard (default) | comprehensive')
|
|
65
101
|
.action((type, options) => {
|
|
102
|
+
record('command.invoked', { command: 'prompt' });
|
|
66
103
|
promptCommand(type, options);
|
|
67
104
|
});
|
|
68
105
|
|
|
@@ -73,6 +110,7 @@ program
|
|
|
73
110
|
.option('-v, --verbose', 'show detection details')
|
|
74
111
|
.option('-t, --threshold <number>', 'confidence threshold (0-100)')
|
|
75
112
|
.action((description, options) => {
|
|
113
|
+
record('command.invoked', { command: 'detect' });
|
|
76
114
|
const detector = new TaskDetector();
|
|
77
115
|
const threshold = options.threshold ? parseInt(options.threshold) / 100 : 0.8;
|
|
78
116
|
const result = detector.detect(description, threshold);
|
|
@@ -90,6 +128,7 @@ program
|
|
|
90
128
|
.option('--clear', 'clear all saved contexts')
|
|
91
129
|
.option('--show', 'show current context')
|
|
92
130
|
.action((action, options) => {
|
|
131
|
+
record('command.invoked', { command: 'context' });
|
|
93
132
|
contextCommand(action, options);
|
|
94
133
|
});
|
|
95
134
|
|
|
@@ -101,6 +140,7 @@ program
|
|
|
101
140
|
.option('-v, --verbose', 'detailed report')
|
|
102
141
|
.option('--fix', 'auto-fix trailing whitespace')
|
|
103
142
|
.action((file, options) => {
|
|
143
|
+
record('command.invoked', { command: 'validate' });
|
|
104
144
|
validateCommand(file, {
|
|
105
145
|
ruleset: options.ruleset,
|
|
106
146
|
verbose: options.verbose,
|
|
@@ -115,32 +155,32 @@ const memCmd = program.command('memory').description('Manage team knowledge and
|
|
|
115
155
|
memCmd
|
|
116
156
|
.command('save <key> <value>')
|
|
117
157
|
.description('Save a memory entry')
|
|
118
|
-
.action((key, value) => memoryCommand('save', { key, value }));
|
|
158
|
+
.action((key, value) => { record('command.invoked', { command: 'memory.save' }); memoryCommand('save', { key, value }); });
|
|
119
159
|
|
|
120
160
|
memCmd
|
|
121
161
|
.command('get <key>')
|
|
122
162
|
.description('Retrieve a memory entry')
|
|
123
|
-
.action((key) => memoryCommand('get', { key }));
|
|
163
|
+
.action((key) => { record('command.invoked', { command: 'memory.get' }); memoryCommand('get', { key }); });
|
|
124
164
|
|
|
125
165
|
memCmd
|
|
126
166
|
.command('list')
|
|
127
167
|
.description('List all memories')
|
|
128
|
-
.action(() => memoryCommand('list'));
|
|
168
|
+
.action(() => { record('command.invoked', { command: 'memory.list' }); memoryCommand('list'); });
|
|
129
169
|
|
|
130
170
|
memCmd
|
|
131
171
|
.command('search <query>')
|
|
132
172
|
.description('Search memories by keyword')
|
|
133
|
-
.action((query) => memoryCommand('search', { query }));
|
|
173
|
+
.action((query) => { record('command.invoked', { command: 'memory.search' }); memoryCommand('search', { query }); });
|
|
134
174
|
|
|
135
175
|
memCmd
|
|
136
176
|
.command('delete <key>')
|
|
137
177
|
.description('Delete a memory entry')
|
|
138
|
-
.action((key) => memoryCommand('delete', { key }));
|
|
178
|
+
.action((key) => { record('command.invoked', { command: 'memory.delete' }); memoryCommand('delete', { key }); });
|
|
139
179
|
|
|
140
180
|
memCmd
|
|
141
181
|
.command('clear')
|
|
142
182
|
.description('Clear all memories')
|
|
143
|
-
.action(() => memoryCommand('clear'));
|
|
183
|
+
.action(() => { record('command.invoked', { command: 'memory.clear' }); memoryCommand('clear'); });
|
|
144
184
|
|
|
145
185
|
// ── guide ─────────────────────────────────────────────────────
|
|
146
186
|
program
|
|
@@ -149,9 +189,28 @@ program
|
|
|
149
189
|
.option('--flow', 'show architecture & flow diagram only')
|
|
150
190
|
.option('--commands', 'show command reference only')
|
|
151
191
|
.action((options) => {
|
|
192
|
+
record('command.invoked', { command: 'guide' });
|
|
152
193
|
guideCommand(options);
|
|
153
194
|
});
|
|
154
195
|
|
|
196
|
+
// ── gate (telemetry for gate workflow events) ─────────────────
|
|
197
|
+
program
|
|
198
|
+
.command('gate <number> <action>')
|
|
199
|
+
.description('Log a gate workflow event (start|approved) — called by AI during gate workflow')
|
|
200
|
+
.option('--ticket <id>', 'ticket ID')
|
|
201
|
+
.option('--ai-tool <tool>', 'AI tool name')
|
|
202
|
+
.action((number, action, options) => {
|
|
203
|
+
const gateNum = parseInt(number);
|
|
204
|
+
if (isNaN(gateNum) || gateNum < 1 || gateNum > 5) return;
|
|
205
|
+
if (!['start', 'approved'].includes(action)) return;
|
|
206
|
+
record(`gate.${action}`, {
|
|
207
|
+
gate: gateNum,
|
|
208
|
+
ticket_id: options.ticket || '',
|
|
209
|
+
command: `gate${gateNum}.${action}`,
|
|
210
|
+
ai_tool: options.aiTool || ''
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
|
|
155
214
|
// ── remove ────────────────────────────────────────────────────
|
|
156
215
|
program
|
|
157
216
|
.command('remove')
|
|
@@ -159,6 +218,7 @@ program
|
|
|
159
218
|
.option('--version <ver>', 'remove a specific cached version from .aiflow/versions/')
|
|
160
219
|
.option('--global', 'uninstall the global npm package (removes `aiflow` command)')
|
|
161
220
|
.action((options) => {
|
|
221
|
+
record('command.invoked', { command: 'remove' });
|
|
162
222
|
removeCommand(options);
|
|
163
223
|
});
|
|
164
224
|
|
|
@@ -168,6 +228,7 @@ program
|
|
|
168
228
|
.description('Update to latest version')
|
|
169
229
|
.option('--force', 'force update even if already on latest')
|
|
170
230
|
.action((options) => {
|
|
231
|
+
record('command.invoked', { command: 'update' });
|
|
171
232
|
updateCommand(options);
|
|
172
233
|
});
|
|
173
234
|
|
|
@@ -177,7 +238,16 @@ program
|
|
|
177
238
|
.description('Health check of AI Flow Kit setup')
|
|
178
239
|
.option('-v, --verbose', 'detailed output')
|
|
179
240
|
.action(() => {
|
|
241
|
+
record('command.invoked', { command: 'doctor' });
|
|
180
242
|
doctorCommand();
|
|
181
243
|
});
|
|
182
244
|
|
|
245
|
+
// ── telemetry ──────────────────────────────────────────────────
|
|
246
|
+
program
|
|
247
|
+
.command('telemetry [action]')
|
|
248
|
+
.description('Manage telemetry logging (enable|disable|status)')
|
|
249
|
+
.action((action) => {
|
|
250
|
+
telemetryCommand(action || 'status');
|
|
251
|
+
});
|
|
252
|
+
|
|
183
253
|
program.parse(process.argv);
|
|
@@ -28,6 +28,9 @@ AI actively reads ticket + source code to understand the requirement:
|
|
|
28
28
|
|
|
29
29
|
DO NOT just check format — **understand the content and propose solutions**.
|
|
30
30
|
|
|
31
|
+
> **Telemetry:** Run `aiflow gate 1 start --ticket [ticket-id]` when starting this gate (auto-start or when developer types "start"/"Gate 1").
|
|
32
|
+
> Run `aiflow gate 1 approved --ticket [ticket-id]` immediately when APPROVED is received.
|
|
33
|
+
|
|
31
34
|
---
|
|
32
35
|
|
|
33
36
|
### GATE 2 — Implementation Plan (wait for APPROVED)
|
|
@@ -38,6 +41,9 @@ DO NOT just check format — **understand the content and propose solutions**.
|
|
|
38
41
|
- Display: "GATE 2 PAUSED: type APPROVED to start coding".
|
|
39
42
|
- CODE WILL NOT BE GENERATED until "APPROVED" is received.
|
|
40
43
|
|
|
44
|
+
> **Telemetry:** Run `aiflow gate 2 start --ticket [ticket-id]` when starting this gate.
|
|
45
|
+
> Run `aiflow gate 2 approved --ticket [ticket-id]` immediately when APPROVED is received.
|
|
46
|
+
|
|
41
47
|
---
|
|
42
48
|
|
|
43
49
|
### GATE 3 — Code Generation (TDD only)
|
|
@@ -49,6 +55,8 @@ Only runs after Gate 2 has been APPROVED.
|
|
|
49
55
|
- Write tests FIRST — run to confirm FAIL -> implement -> PASS.
|
|
50
56
|
- Bug fix EXTRA: `superpowers:systematic-debugging` + `investigate-bug` skill first.
|
|
51
57
|
|
|
58
|
+
> **Telemetry:** Run `aiflow gate 3 start --ticket [ticket-id]` when starting this gate.
|
|
59
|
+
|
|
52
60
|
---
|
|
53
61
|
|
|
54
62
|
### GATE 4 — AI Self-Review (wait for APPROVED)
|
|
@@ -65,6 +73,9 @@ Then: "GATE 4 PAUSED: type APPROVED or BUG: [description]"
|
|
|
65
73
|
- Coding bug -> fix -> repeat Gate 4.
|
|
66
74
|
- Requirement bug -> return to Gate 1.
|
|
67
75
|
|
|
76
|
+
> **Telemetry:** Run `aiflow gate 4 start --ticket [ticket-id]` when starting this gate.
|
|
77
|
+
> Run `aiflow gate 4 approved --ticket [ticket-id]` immediately when APPROVED is received.
|
|
78
|
+
|
|
68
79
|
---
|
|
69
80
|
|
|
70
81
|
### GATE 5 — Peer Review and Done
|
|
@@ -73,3 +84,5 @@ Only runs after Gate 4 has been APPROVED.
|
|
|
73
84
|
|
|
74
85
|
**INVOKE:** `superpowers:requesting-code-review`
|
|
75
86
|
Guide on creating a Pull Request with the ticket link.
|
|
87
|
+
|
|
88
|
+
> **Telemetry:** Run `aiflow gate 5 start --ticket [ticket-id]` when starting this gate.
|
package/docs/AIFLOW.md
CHANGED
|
@@ -409,6 +409,11 @@ aiflow context show # view active context
|
|
|
409
409
|
aiflow memory save "key" "value" # save team knowledge
|
|
410
410
|
aiflow doctor # health check
|
|
411
411
|
aiflow guide # view quickstart guide
|
|
412
|
+
|
|
413
|
+
# Telemetry (team leads)
|
|
414
|
+
aiflow telemetry status # view status
|
|
415
|
+
aiflow telemetry enable # setup tracking
|
|
416
|
+
aiflow telemetry disable # disable tracking
|
|
412
417
|
```
|
|
413
418
|
|
|
414
419
|
---
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -21,10 +21,38 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
|
24
|
-
## [
|
|
24
|
+
## [0.0.5-beta.0] - 2026-04-23
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
- **`aiflow gate <n> <action>` command** — Called automatically by AI during gate transitions. Supports `start` and `approved` actions for gates 1-5. Options: `--ticket <id>`, `--ai-tool <tool>`.
|
|
28
|
+
- **Telemetry gate logging** — Gate workflow templates now emit `aiflow gate N start/approved --ticket [id]` telemetry calls at each gate transition for usage metrics.
|
|
29
|
+
- **`aiflow telemetry flush` command** — Force-sends buffered telemetry events immediately.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
- **Fix TEAM_SECRET input** — Replaced `password()` prompt with `input()` using a masked hint `[Reli***!@#]`; pressing Enter retains the existing value.
|
|
33
|
+
- **Fix Apps Script URL input** — Same pattern as TEAM_SECRET: masked hint `[https://script.google.com/macros/s/AKfy***xxxx/exec]`; pressing Enter retains the existing value.
|
|
34
|
+
- **Downgrade dependencies for Node >=16 compatibility** — `@inquirer/prompts` downgraded from `^8.3.2` to `^3.0.0`; `commander` downgraded from `^14.0.3` to `^11.0.0`.
|
|
35
|
+
- **`engines.node`** updated from `>=14.0.0` to `>=16.0.0`.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## [0.0.5] - 2026-04-23
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
- **Telemetry System (MVP)**: Added anonymous usage tracking to measure command metrics and user adoption.
|
|
43
|
+
- `aiflow telemetry enable/disable/status` commands to easily opt-in or opt-out.
|
|
44
|
+
- Automatically captures environment metadata and Git email via `git config --global user.email`.
|
|
45
|
+
- Secure payload signing natively using Node `crypto` HMAC-SHA256 to ensure data authenticity.
|
|
46
|
+
- Asynchronous payload flusher to ensure zero impact on command execution time (`< 5ms` overhead).
|
|
47
|
+
- Support tracking for multiple AI platforms including Cursor and Gemini via Command Execution events and the new Telemetry SDK.
|
|
48
|
+
|
|
49
|
+
### Security
|
|
50
|
+
- **Strict Privacy**: Explicitly removed all prompt content and chat history tracking to ensure 100% confidentiality of company code and PII.
|
|
25
51
|
|
|
26
52
|
---
|
|
27
53
|
|
|
54
|
+
## [Unreleased]
|
|
55
|
+
|
|
28
56
|
## [0.0.3-beta.0] - 2026-04-13
|
|
29
57
|
### Security
|
|
30
58
|
- Removed internal GitLab repository links and tracking information.
|
package/docs/cli-reference.md
CHANGED
|
@@ -30,6 +30,7 @@ aiflow init --framework laravel --adapter jira
|
|
|
30
30
|
**Options:**
|
|
31
31
|
- `-f, --framework <type>` — Framework template (laravel, nextjs, vue-nuxt)
|
|
32
32
|
- `-a, --adapter <type>` — MCP adapter (jira, backlog, google-sheets)
|
|
33
|
+
- `-e, --env <types>` — AI tools to configure (cursor, gemini, copilot)
|
|
33
34
|
|
|
34
35
|
**What it does:**
|
|
35
36
|
1. Creates `.claude/skills/` with all available skills
|
|
@@ -76,6 +77,9 @@ aiflow use 1.0.0
|
|
|
76
77
|
- `-m, --manual` — Manual context entry
|
|
77
78
|
- `-f, --file <path>` — Load from JSON file
|
|
78
79
|
- `-s, --save <name>` — Save as named context
|
|
80
|
+
- `--with-comments` — Include all ticket comments
|
|
81
|
+
- `--comments-last <n>` — Only fetch last N comments
|
|
82
|
+
- `--comments-from <n>` — Fetch comments starting from comment N
|
|
79
83
|
|
|
80
84
|
**What it does:**
|
|
81
85
|
1. Fetches context from MCP adapter (if applicable)
|
|
@@ -123,7 +127,6 @@ aiflow prompt --list
|
|
|
123
127
|
- `<type>` — Prompt type (bug-fix, feature, investigation, refactor, impact, docs)
|
|
124
128
|
- `-l, --list` — List available prompt types
|
|
125
129
|
- `-o, --output <file>` — Save to file instead of printing
|
|
126
|
-
- `-c, --copy` — Copy to clipboard
|
|
127
130
|
- `--lang <lang>` — Language (english, vietnamese)
|
|
128
131
|
- `--detail <level>` — Detail level (minimal, standard, comprehensive)
|
|
129
132
|
|
|
@@ -258,12 +261,11 @@ Update to the latest version.
|
|
|
258
261
|
# Update to latest
|
|
259
262
|
aiflow update
|
|
260
263
|
|
|
261
|
-
#
|
|
262
|
-
aiflow update --
|
|
264
|
+
# Force update even if already latest
|
|
265
|
+
aiflow update --force
|
|
263
266
|
```
|
|
264
267
|
|
|
265
268
|
**Options:**
|
|
266
|
-
- `--keep-old` — Don't delete previous version
|
|
267
269
|
- `--force` — Force update even if already latest
|
|
268
270
|
|
|
269
271
|
**What it does:**
|
|
@@ -296,12 +298,11 @@ Health check for your setup.
|
|
|
296
298
|
# Run health check
|
|
297
299
|
aiflow doctor
|
|
298
300
|
|
|
299
|
-
#
|
|
300
|
-
aiflow doctor --
|
|
301
|
+
# Run with verbose output
|
|
302
|
+
aiflow doctor --verbose
|
|
301
303
|
```
|
|
302
304
|
|
|
303
305
|
**Options:**
|
|
304
|
-
- `--fix` — Attempt to fix found issues
|
|
305
306
|
- `-v, --verbose` — Show detailed checks
|
|
306
307
|
|
|
307
308
|
**What it does:**
|
|
@@ -367,61 +368,130 @@ Issues found: 2 warnings, 1 error
|
|
|
367
368
|
Suggestions: Add test case, rename variable
|
|
368
369
|
```
|
|
369
370
|
|
|
371
|
+
## telemetry
|
|
372
|
+
|
|
373
|
+
Manage usage telemetry.
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
# View current status, buffer size, last flush
|
|
377
|
+
aiflow telemetry status
|
|
378
|
+
|
|
379
|
+
# Interactive setup (URL, secret, email)
|
|
380
|
+
aiflow telemetry enable
|
|
381
|
+
|
|
382
|
+
# Disable tracking (config retained)
|
|
383
|
+
aiflow telemetry disable
|
|
384
|
+
|
|
385
|
+
# Force-send buffered events now
|
|
386
|
+
aiflow telemetry flush
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
**Sub-commands:**
|
|
390
|
+
- `status` — View current status, buffer size, last flush time
|
|
391
|
+
- `enable` — Interactive setup (Apps Script URL, team secret, email)
|
|
392
|
+
- `disable` — Disable tracking; configuration is retained
|
|
393
|
+
- `flush` — Force-send all buffered events immediately
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
370
397
|
## memory
|
|
371
398
|
|
|
372
399
|
Manage team knowledge and context memory.
|
|
373
400
|
|
|
374
401
|
```bash
|
|
375
402
|
# Save knowledge
|
|
376
|
-
aiflow memory
|
|
403
|
+
aiflow memory save "payment-flow" "Process: 1. Validate amount, 2. Call Stripe API, 3. Update DB"
|
|
377
404
|
|
|
378
405
|
# Retrieve knowledge
|
|
379
|
-
aiflow memory
|
|
406
|
+
aiflow memory get "payment-flow"
|
|
380
407
|
|
|
381
408
|
# List all memories
|
|
382
|
-
aiflow memory
|
|
409
|
+
aiflow memory list
|
|
383
410
|
|
|
384
411
|
# Delete memory
|
|
385
|
-
aiflow memory
|
|
412
|
+
aiflow memory delete "old-memory"
|
|
386
413
|
|
|
387
414
|
# Search memories
|
|
388
|
-
aiflow memory
|
|
415
|
+
aiflow memory search "validation"
|
|
416
|
+
|
|
417
|
+
# Clear all memories
|
|
418
|
+
aiflow memory clear
|
|
389
419
|
```
|
|
390
420
|
|
|
391
|
-
**
|
|
392
|
-
-
|
|
393
|
-
-
|
|
394
|
-
-
|
|
395
|
-
-
|
|
396
|
-
-
|
|
397
|
-
-
|
|
421
|
+
**Sub-commands:**
|
|
422
|
+
- `save <key> <value>` — Save a note
|
|
423
|
+
- `get <key>` — Read a note
|
|
424
|
+
- `list` — List all notes
|
|
425
|
+
- `search <query>` — Search notes
|
|
426
|
+
- `delete <key>` — Delete a note
|
|
427
|
+
- `clear` — Clear all notes
|
|
398
428
|
|
|
399
429
|
**What it does:**
|
|
400
430
|
1. Stores team knowledge in `.aiflow/memory/`
|
|
401
|
-
2.
|
|
402
|
-
3. Makes knowledge discoverable across team
|
|
431
|
+
2. Makes knowledge discoverable across the team
|
|
403
432
|
|
|
404
433
|
**Example:**
|
|
405
434
|
```bash
|
|
406
|
-
$ aiflow memory
|
|
435
|
+
$ aiflow memory save "payment-flow" "Process: 1. Validate amount, 2. Call Stripe API, 3. Update DB"
|
|
407
436
|
✓ Saved: payment-flow
|
|
408
437
|
|
|
409
|
-
$ aiflow memory
|
|
438
|
+
$ aiflow memory search "payment"
|
|
410
439
|
Found 3 memories matching "payment":
|
|
411
440
|
1. payment-flow
|
|
412
441
|
2. payment-error-handling
|
|
413
442
|
3. payment-tests
|
|
414
443
|
```
|
|
415
444
|
|
|
445
|
+
## guide
|
|
446
|
+
|
|
447
|
+
Show quickstart guide.
|
|
448
|
+
|
|
449
|
+
```bash
|
|
450
|
+
# Full guide
|
|
451
|
+
aiflow guide
|
|
452
|
+
|
|
453
|
+
# Architecture & flow only
|
|
454
|
+
aiflow guide --flow
|
|
455
|
+
|
|
456
|
+
# Command reference only
|
|
457
|
+
aiflow guide --commands
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
**Options:**
|
|
461
|
+
- `--flow` — Show architecture & flow diagram only
|
|
462
|
+
- `--commands` — Show command reference only
|
|
463
|
+
|
|
464
|
+
---
|
|
465
|
+
|
|
466
|
+
## gate (AI workflow logging)
|
|
467
|
+
|
|
468
|
+
Called automatically by AI during gate workflow — not intended for manual use.
|
|
469
|
+
|
|
470
|
+
```bash
|
|
471
|
+
# Log gate N started
|
|
472
|
+
aiflow gate <n> start --ticket <id>
|
|
473
|
+
|
|
474
|
+
# Log gate N approved
|
|
475
|
+
aiflow gate <n> approved --ticket <id>
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
**Arguments:**
|
|
479
|
+
- `<n>` — Gate number (1-5)
|
|
480
|
+
- `<action>` — `start` or `approved`
|
|
481
|
+
|
|
482
|
+
**Options:**
|
|
483
|
+
- `--ticket <id>` — Ticket ID associated with the gate transition
|
|
484
|
+
- `--ai-tool <tool>` — AI tool that triggered the gate (e.g. claude, cursor, gemini)
|
|
485
|
+
|
|
486
|
+
---
|
|
487
|
+
|
|
416
488
|
## Global Options
|
|
417
489
|
|
|
418
490
|
These work with any command:
|
|
419
491
|
|
|
420
492
|
```bash
|
|
421
|
-
aiflow
|
|
422
|
-
aiflow <command> --
|
|
423
|
-
aiflow <command> --debug # Debug mode
|
|
424
|
-
aiflow <command> --config <file> # Use custom config file
|
|
493
|
+
aiflow --version # Show installed version
|
|
494
|
+
aiflow <command> --help # Show help for a command
|
|
425
495
|
```
|
|
426
496
|
|
|
427
497
|
## Exit Codes
|
package/docs/troubleshooting.md
CHANGED
|
@@ -545,6 +545,21 @@ cat CLAUDE.md | grep -i "rule"
|
|
|
545
545
|
- Close and reopen
|
|
546
546
|
- Run `aiflow doctor` to verify setup
|
|
547
547
|
|
|
548
|
+
## Telemetry Tracking
|
|
549
|
+
|
|
550
|
+
### "Telemetry connection test failed"
|
|
551
|
+
|
|
552
|
+
**Verify Apps Script settings:**
|
|
553
|
+
- Ensure the Apps Script Web App is deployed and accessible.
|
|
554
|
+
- Ensure the `TEAM_SECRET` is exactly correct without trailing spaces.
|
|
555
|
+
|
|
556
|
+
**Bypass / Opt-out locally:**
|
|
557
|
+
If you don't want telemetry tracked on a specific repo, or the upload is failing constantly:
|
|
558
|
+
```bash
|
|
559
|
+
touch .aiflow/no-telemetry
|
|
560
|
+
# CLI will automatically ignore logging for this repo.
|
|
561
|
+
```
|
|
562
|
+
|
|
548
563
|
---
|
|
549
564
|
|
|
550
565
|
## Getting More Help
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@relipa/ai-flow-kit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5-beta.0",
|
|
4
4
|
"description": "All-in-one AI Flow Kit for team development with Claude AI - skills, templates, and MCP adapters",
|
|
5
5
|
"author": "Relipa AI Team",
|
|
6
6
|
"publishConfig": {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"aiflow": "./bin/aiflow.js"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
|
+
"README.md",
|
|
17
18
|
"bin",
|
|
18
19
|
"custom",
|
|
19
20
|
"scripts",
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
"productivity"
|
|
34
35
|
],
|
|
35
36
|
"engines": {
|
|
36
|
-
"node": ">=
|
|
37
|
+
"node": ">=16.0.0",
|
|
37
38
|
"npm": ">=6.0.0"
|
|
38
39
|
},
|
|
39
40
|
"scripts": {
|
|
@@ -45,9 +46,9 @@
|
|
|
45
46
|
"publish:stable": "npm publish"
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@inquirer/prompts": "^
|
|
49
|
+
"@inquirer/prompts": "^3.0.0",
|
|
49
50
|
"chalk": "^4.1.2",
|
|
50
|
-
"commander": "^
|
|
51
|
+
"commander": "^11.0.0",
|
|
51
52
|
"fs-extra": "^11.3.4",
|
|
52
53
|
"semver": "^7.7.4"
|
|
53
54
|
},
|
package/scripts/guide.js
CHANGED
|
@@ -210,6 +210,22 @@ function showCommands() {
|
|
|
210
210
|
['aiflow validate <file>', '-r strict', 'Report all warnings'],
|
|
211
211
|
]
|
|
212
212
|
},
|
|
213
|
+
{
|
|
214
|
+
group: 'Telemetry',
|
|
215
|
+
items: [
|
|
216
|
+
['aiflow telemetry status', '', 'View telemetry status'],
|
|
217
|
+
['aiflow telemetry enable', '', 'Enable usage tracking'],
|
|
218
|
+
['aiflow telemetry disable', '', 'Disable usage tracking'],
|
|
219
|
+
['aiflow telemetry flush', '', 'Force-send buffered events now'],
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
group: 'AI Workflow Integration',
|
|
224
|
+
items: [
|
|
225
|
+
['aiflow gate <n> start', '--ticket <id>', 'Log gate N started (AI calls this)'],
|
|
226
|
+
['aiflow gate <n> approved', '--ticket <id>', 'Log gate N approved (AI calls this)'],
|
|
227
|
+
]
|
|
228
|
+
},
|
|
213
229
|
{
|
|
214
230
|
group: 'Help',
|
|
215
231
|
items: [
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
const fs = require('fs');
|
|
11
11
|
const path = require('path');
|
|
12
|
+
const { record } = require('../telemetry/record');
|
|
13
|
+
|
|
14
|
+
// Record session start telemetry
|
|
15
|
+
record('session.start');
|
|
12
16
|
|
|
13
17
|
// This script lives at .claude/hooks/session-start.js
|
|
14
18
|
// Project root is 3 levels up
|