@leejungkiin/awkit 1.5.6 → 1.6.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # AWKit — Antigravity Workflow Kit v1
1
+ # AWKit — Antigravity Workflow Kit v12.5
2
2
 
3
- > **v1.5.0** · Single Source of Truth · Symphony-First · Ambient Memory
3
+ > **v12.5.0** · Single Source of Truth · Symphony-First · Mindful Execution
4
4
 
5
5
  AWKit là framework điều phối AI agent chuyên nghiệp. Đây là **nơi duy nhất** chứa toàn bộ workflows, skills, GEMINI.md và cấu hình — không còn phân tán giữa nhiều repo.
6
6
 
@@ -18,6 +18,7 @@ AWKit (Antigravity v12+) thực thi 8 nguyên tắc lõi (Gstack-inspired) nhằ
18
18
  6. **Scope Freeze:** Khi debugging: KHÔNG sửa code không liên quan, KHÔNG refactor. Chỉ tập trung root cause.
19
19
  7. **Boil-the-Lake Checklist:** Checklist trước khi báo DONE: error handling, edge cases, logging, cleanup, input validation...
20
20
  8. **Safety Guardrails:** Chặn auto-run cho các lệnh nguy hiểm (`rm -rf`, `git push --force`, deploy production). Bắt buộc double-confirm.
21
+ 9. **Mindful Execution (v12.5+):** Chống AI "brain fry" bằng Iteration Counter (dừng sau 3 lần polish), Scope Guard, và Milestone Rest.
21
22
 
22
23
  ---
23
24
 
@@ -191,10 +192,10 @@ AWKit (từ bản cập nhật tích hợp mới) sử dụng **GitNexus** làm
191
192
 
192
193
  ```bash
193
194
  # 1. Quét toàn bộ project để tạo knowledge graph (chỉ cần chạy lần đầu hoặc khi cấu trúc code thay đổi lớn)
194
- npx @leejungkiin/gitnexus analyze
195
+ npx @duytransipher/gitnexus analyze
195
196
 
196
197
  # 2. Setup MCP servers và skills tự động cho Antigravity và các editors khác:
197
- npx @leejungkiin/gitnexus setup
198
+ npx @duytransipher/gitnexus setup
198
199
  ```
199
200
 
200
201
  AI agent của hệ thống cũng tự động gọi qua cổng GitNexus bằng MCP Tools để tự phân tích rủi ro trước khi commit!
@@ -219,6 +220,7 @@ awkit enable-pack creator-studio
219
220
  | 6.x | AWF v6 | main-awf, multiple sources |
220
221
  | **1.1.x** | **AWKit v1.1.9** | **Single source of truth, Native CLI, Telegram Integration** |
221
222
  | **1.5.x** | **AWKit v1.5.0** | **Unified Orchestration, Symphony 1.5.0, 7-Gate Intelligence** |
223
+ | **12.5.x** | **Antigravity v12.5** | **Mindful Checkpoints (TP-ITER, TP-SCOPE, TP-REST), @duytransipher/gitnexus** |
222
224
 
223
225
  ---
224
226
 
package/bin/awk.js CHANGED
@@ -38,6 +38,7 @@ const HOME = process.env.HOME || process.env.USERPROFILE;
38
38
  const { generateClineRules, generateClineWorkflows, generateClineSkills } = require('./cline-generators');
39
39
  const { generateCodexAgentsMd, generateCodexSkills, generateCodexAgents } = require('./codex-generators');
40
40
  const { generateClaudeRules, generateClaudeSkills } = require('./claude-generators');
41
+ const { cmdGate } = require('../scripts/automation-gate');
41
42
 
42
43
  // ─── Platform Definitions ──────────────────────────────────────────────────
43
44
 
@@ -2050,6 +2051,18 @@ function cmdHelp() {
2050
2051
  log(` ${C.gray} --parse-mode <md|html>${C.reset} Formatting mode`);
2051
2052
  log('');
2052
2053
 
2054
+ // GitNexus
2055
+ log(`${C.bold}🔍 GitNexus${C.reset}`);
2056
+ log(line);
2057
+ log(` ${C.green}gitnexus list${C.reset} List all indexed repositories`);
2058
+ log(` ${C.green}gitnexus status${C.reset} Show current project index info`);
2059
+ log(` ${C.green}gitnexus clean${C.reset} Interactive cleanup of old indexes`);
2060
+ log(` ${C.green}gitnexus clean${C.reset} ${C.gray}<name...>${C.reset} Remove specific repo(s) by name`);
2061
+ log(` ${C.gray} --stale${C.reset} Auto-remove repos with missing paths`);
2062
+ log(` ${C.gray} --all${C.reset} Remove all except current project`);
2063
+ log(` ${C.gray} Alias: gn${C.reset}`);
2064
+ log('');
2065
+
2053
2066
  // Available packs
2054
2067
  const packsDir = path.join(AWK_ROOT, 'skill-packs');
2055
2068
  if (fs.existsSync(packsDir)) {
@@ -2871,8 +2884,12 @@ function tgSend(args) {
2871
2884
  dim('Telegram notifications are disabled for this project (.project-identity).');
2872
2885
  return;
2873
2886
  }
2874
- if (tgAuto.chatId) chatId = tgAuto.chatId;
2875
- if (tgAuto.topicId) topicId = tgAuto.topicId;
2887
+ if (tgAuto.chatId) {
2888
+ chatId = tgAuto.chatId;
2889
+ // Reset topicId when chatId is overridden — global topicId belongs to global chatId
2890
+ topicId = null;
2891
+ }
2892
+ if (tgAuto.topicId && parseInt(tgAuto.topicId, 10) > 1) topicId = tgAuto.topicId;
2876
2893
  }
2877
2894
  } catch (e) { }
2878
2895
  }
@@ -3378,6 +3395,309 @@ function checkAutoUpdate() {
3378
3395
  }
3379
3396
  }
3380
3397
 
3398
+ // ─── GitNexus Management ──────────────────────────────────────────────────────
3399
+
3400
+ const GITNEXUS_REGISTRY = path.join(HOME, '.gitnexus', 'registry.json');
3401
+
3402
+ function readGitnexusRegistry() {
3403
+ if (!fs.existsSync(GITNEXUS_REGISTRY)) return [];
3404
+ try {
3405
+ return JSON.parse(fs.readFileSync(GITNEXUS_REGISTRY, 'utf8'));
3406
+ } catch (_) {
3407
+ return [];
3408
+ }
3409
+ }
3410
+
3411
+ function writeGitnexusRegistry(registry) {
3412
+ fs.mkdirSync(path.dirname(GITNEXUS_REGISTRY), { recursive: true });
3413
+ fs.writeFileSync(GITNEXUS_REGISTRY, JSON.stringify(registry, null, 2) + '\n');
3414
+ }
3415
+
3416
+ function cmdGitnexus(args) {
3417
+ const sub = args[0] || 'list';
3418
+
3419
+ switch (sub) {
3420
+ case 'list':
3421
+ case 'ls': {
3422
+ const registry = readGitnexusRegistry();
3423
+ if (registry.length === 0) {
3424
+ info('No GitNexus indexed repositories found.');
3425
+ dim('Run `npx gitnexus analyze` in a project to index it.');
3426
+ return;
3427
+ }
3428
+
3429
+ log('');
3430
+ log(`${C.cyan}${C.bold}🔍 GitNexus Indexed Repositories (${registry.length})${C.reset}`);
3431
+ log(`${C.gray}${'─'.repeat(56)}${C.reset}`);
3432
+
3433
+ const cwd = process.cwd();
3434
+ for (const repo of registry) {
3435
+ const isCurrent = repo.path === cwd;
3436
+ const marker = isCurrent ? `${C.green}◉` : `${C.gray}○`;
3437
+ const nameColor = isCurrent ? C.green : C.reset;
3438
+ const stats = repo.stats || {};
3439
+ const indexDate = repo.indexedAt ? new Date(repo.indexedAt).toLocaleDateString() : 'unknown';
3440
+ const pathExists = fs.existsSync(repo.path);
3441
+ const pathStatus = pathExists ? '' : ` ${C.red}(path missing!)${C.reset}`;
3442
+
3443
+ log(` ${marker} ${nameColor}${C.bold}${repo.name}${C.reset}${pathStatus}`);
3444
+ dim(` Path: ${repo.path}`);
3445
+ dim(` Indexed: ${indexDate} | ${stats.nodes || 0} symbols, ${stats.edges || 0} edges, ${stats.processes || 0} flows`);
3446
+ }
3447
+ log('');
3448
+ break;
3449
+ }
3450
+
3451
+ case 'status': {
3452
+ const cwd = process.cwd();
3453
+ const registry = readGitnexusRegistry();
3454
+ const match = registry.find(r => r.path === cwd);
3455
+
3456
+ if (!match) {
3457
+ warn('Current directory is not indexed by GitNexus.');
3458
+ dim('Run `npx gitnexus analyze` to index this project.');
3459
+ return;
3460
+ }
3461
+
3462
+ const stats = match.stats || {};
3463
+ const indexDate = match.indexedAt ? new Date(match.indexedAt) : null;
3464
+ const ageMs = indexDate ? Date.now() - indexDate.getTime() : 0;
3465
+ const ageDays = Math.floor(ageMs / (1000 * 60 * 60 * 24));
3466
+ const stale = ageDays > 7;
3467
+
3468
+ log('');
3469
+ log(`${C.cyan}${C.bold}🔍 GitNexus: ${match.name}${C.reset}`);
3470
+ log(`${C.gray}${'─'.repeat(56)}${C.reset}`);
3471
+ dim(`Path: ${match.path}`);
3472
+ dim(`Storage: ${match.storagePath}`);
3473
+ dim(`Indexed: ${indexDate ? indexDate.toLocaleString() : 'unknown'} (${ageDays}d ago)`);
3474
+ dim(`Last Commit: ${match.lastCommit || 'n/a'}`);
3475
+ dim(`Symbols: ${stats.nodes || 0}`);
3476
+ dim(`Relations: ${stats.edges || 0}`);
3477
+ dim(`Communities: ${stats.communities || 0}`);
3478
+ dim(`Processes: ${stats.processes || 0}`);
3479
+ dim(`Embeddings: ${stats.embeddings || 0}`);
3480
+
3481
+ if (stale) {
3482
+ log('');
3483
+ warn(`Index is ${ageDays} days old. Consider refreshing:`);
3484
+ dim(' npx gitnexus analyze');
3485
+ }
3486
+
3487
+ // Show projectId from .project-identity if available
3488
+ const identityPath = path.join(cwd, '.project-identity');
3489
+ const identity = readJsonFile(identityPath);
3490
+ if (identity && identity.projectId) {
3491
+ dim(`Project ID: ${identity.projectId}`);
3492
+ }
3493
+ log('');
3494
+ break;
3495
+ }
3496
+
3497
+ case 'clean': {
3498
+ const registry = readGitnexusRegistry();
3499
+ if (registry.length === 0) {
3500
+ info('No GitNexus indexed repositories to clean.');
3501
+ return;
3502
+ }
3503
+
3504
+ const cwd = process.cwd();
3505
+ const isStaleMode = args.includes('--stale');
3506
+ const isAllMode = args.includes('--all');
3507
+
3508
+ // Named repos: awkit gn clean <name1> <name2> ...
3509
+ const namedArgs = args.slice(1).filter(a => !a.startsWith('--'));
3510
+ if (namedArgs.length > 0 && !isStaleMode && !isAllMode) {
3511
+ const nameLookup = new Map(registry.map(r => [r.name.toLowerCase(), r]));
3512
+ const matched = [];
3513
+ const notFound = [];
3514
+
3515
+ for (const name of namedArgs) {
3516
+ const entry = nameLookup.get(name.toLowerCase());
3517
+ if (entry) matched.push(entry);
3518
+ else notFound.push(name);
3519
+ }
3520
+
3521
+ if (notFound.length > 0) {
3522
+ warn(`Not found in registry: ${notFound.join(', ')}`);
3523
+ dim('Available repos:');
3524
+ for (const r of registry) dim(` • ${r.name}`);
3525
+ }
3526
+
3527
+ if (matched.length === 0) {
3528
+ info('No matching repos to clean.');
3529
+ return;
3530
+ }
3531
+
3532
+ log('');
3533
+ log(`${C.yellow}${C.bold}🧹 Will remove ${matched.length} repo(s):${C.reset}`);
3534
+ for (const r of matched) {
3535
+ log(` ${C.red}✗${C.reset} ${r.name} — ${r.path}`);
3536
+ }
3537
+ log('');
3538
+
3539
+ if (!promptYN('Confirm?')) {
3540
+ info('Cancelled.');
3541
+ return;
3542
+ }
3543
+
3544
+ const removeNames = new Set(matched.map(r => r.name));
3545
+ for (const r of matched) {
3546
+ if (r.storagePath && fs.existsSync(r.storagePath)) {
3547
+ try {
3548
+ fs.rmSync(r.storagePath, { recursive: true, force: true });
3549
+ dim(`Deleted: ${r.storagePath}`);
3550
+ } catch (e) {
3551
+ warn(`Failed to delete ${r.storagePath}: ${e.message}`);
3552
+ }
3553
+ }
3554
+ }
3555
+
3556
+ const remaining = registry.filter(r => !removeNames.has(r.name));
3557
+ writeGitnexusRegistry(remaining);
3558
+ ok(`Removed ${matched.length} repos. ${remaining.length} remaining.`);
3559
+ return;
3560
+ }
3561
+
3562
+ if (isStaleMode) {
3563
+ // Auto-clean repos whose paths no longer exist
3564
+ const stale = registry.filter(r => !fs.existsSync(r.path));
3565
+ if (stale.length === 0) {
3566
+ ok('No stale repos found. All paths are valid.');
3567
+ return;
3568
+ }
3569
+
3570
+ log('');
3571
+ log(`${C.yellow}${C.bold}🧹 Found ${stale.length} stale repo(s):${C.reset}`);
3572
+ for (const r of stale) {
3573
+ log(` ${C.red}✗${C.reset} ${r.name} — ${r.path}`);
3574
+ }
3575
+ log('');
3576
+
3577
+ if (!promptYN('Remove these stale entries?')) {
3578
+ info('Cancelled.');
3579
+ return;
3580
+ }
3581
+
3582
+ for (const r of stale) {
3583
+ // Remove .gitnexus storage if it exists
3584
+ if (r.storagePath && fs.existsSync(r.storagePath)) {
3585
+ try {
3586
+ fs.rmSync(r.storagePath, { recursive: true, force: true });
3587
+ dim(`Deleted: ${r.storagePath}`);
3588
+ } catch (e) {
3589
+ warn(`Failed to delete ${r.storagePath}: ${e.message}`);
3590
+ }
3591
+ }
3592
+ }
3593
+
3594
+ const remaining = registry.filter(r => fs.existsSync(r.path));
3595
+ writeGitnexusRegistry(remaining);
3596
+ ok(`Removed ${stale.length} stale entries. ${remaining.length} repos remaining.`);
3597
+ return;
3598
+ }
3599
+
3600
+ if (isAllMode) {
3601
+ const toRemove = registry.filter(r => r.path !== cwd);
3602
+ if (toRemove.length === 0) {
3603
+ info('Only current project is indexed. Nothing to clean.');
3604
+ return;
3605
+ }
3606
+
3607
+ log('');
3608
+ log(`${C.yellow}${C.bold}🧹 Will remove ${toRemove.length} repo(s) (keeping current project):${C.reset}`);
3609
+ for (const r of toRemove) {
3610
+ log(` ${C.red}✗${C.reset} ${r.name} — ${r.path}`);
3611
+ }
3612
+ log('');
3613
+
3614
+ if (!promptYN('Proceed?')) {
3615
+ info('Cancelled.');
3616
+ return;
3617
+ }
3618
+
3619
+ for (const r of toRemove) {
3620
+ if (r.storagePath && fs.existsSync(r.storagePath)) {
3621
+ try {
3622
+ fs.rmSync(r.storagePath, { recursive: true, force: true });
3623
+ dim(`Deleted: ${r.storagePath}`);
3624
+ } catch (e) {
3625
+ warn(`Failed to delete ${r.storagePath}: ${e.message}`);
3626
+ }
3627
+ }
3628
+ }
3629
+
3630
+ const remaining = registry.filter(r => r.path === cwd);
3631
+ writeGitnexusRegistry(remaining);
3632
+ ok(`Removed ${toRemove.length} repos. Current project preserved.`);
3633
+ return;
3634
+ }
3635
+
3636
+ // Interactive mode: show numbered list, user selects
3637
+ log('');
3638
+ log(`${C.cyan}${C.bold}🔍 Select repos to remove:${C.reset}`);
3639
+ log(`${C.gray}${'─'.repeat(56)}${C.reset}`);
3640
+
3641
+ for (let i = 0; i < registry.length; i++) {
3642
+ const r = registry[i];
3643
+ const isCurrent = r.path === cwd;
3644
+ const pathExists = fs.existsSync(r.path);
3645
+ const tag = isCurrent ? ` ${C.green}(current)${C.reset}` : !pathExists ? ` ${C.red}(missing)${C.reset}` : '';
3646
+ log(` ${C.yellow}${i + 1}${C.reset}. ${r.name}${tag}`);
3647
+ dim(` ${r.path}`);
3648
+ }
3649
+ log('');
3650
+
3651
+ const input = promptChoice('Enter numbers to remove (e.g. 2,3,5)', '').trim();
3652
+ if (!input) {
3653
+ info('No selection. Cancelled.');
3654
+ return;
3655
+ }
3656
+
3657
+ const indices = input.split(',').map(s => parseInt(s.trim(), 10) - 1).filter(i => i >= 0 && i < registry.length);
3658
+ if (indices.length === 0) {
3659
+ info('Invalid selection. Cancelled.');
3660
+ return;
3661
+ }
3662
+
3663
+ const selected = indices.map(i => registry[i]);
3664
+ log('');
3665
+ log(`${C.yellow}Will remove:${C.reset}`);
3666
+ for (const r of selected) {
3667
+ log(` ${C.red}✗${C.reset} ${r.name}`);
3668
+ }
3669
+ log('');
3670
+
3671
+ if (!promptYN('Confirm?')) {
3672
+ info('Cancelled.');
3673
+ return;
3674
+ }
3675
+
3676
+ const removeNames = new Set(selected.map(r => r.name));
3677
+ for (const r of selected) {
3678
+ if (r.storagePath && fs.existsSync(r.storagePath)) {
3679
+ try {
3680
+ fs.rmSync(r.storagePath, { recursive: true, force: true });
3681
+ dim(`Deleted: ${r.storagePath}`);
3682
+ } catch (e) {
3683
+ warn(`Failed to delete ${r.storagePath}: ${e.message}`);
3684
+ }
3685
+ }
3686
+ }
3687
+
3688
+ const remaining = registry.filter(r => !removeNames.has(r.name));
3689
+ writeGitnexusRegistry(remaining);
3690
+ ok(`Removed ${selected.length} repos. ${remaining.length} remaining.`);
3691
+ break;
3692
+ }
3693
+
3694
+ default:
3695
+ err(`Unknown gitnexus sub-command: ${sub}`);
3696
+ log(` Available: list, status, clean`);
3697
+ break;
3698
+ }
3699
+ }
3700
+
3381
3701
  // ─── Native HTTP Server ───────────────────────────────────────────────────────
3382
3702
 
3383
3703
  function cmdServe(args) {
@@ -3540,6 +3860,13 @@ const [, , command, ...args] = process.argv;
3540
3860
  case 'serve':
3541
3861
  cmdServe(args);
3542
3862
  break;
3863
+ case 'gitnexus':
3864
+ case 'gn':
3865
+ cmdGitnexus(args);
3866
+ break;
3867
+ case 'gate':
3868
+ cmdGate(args);
3869
+ break;
3543
3870
  case 'admin':
3544
3871
  cmdAdmin();
3545
3872
  break;
package/core/GEMINI.md CHANGED
@@ -49,15 +49,23 @@ Mỗi skill tự xử lý gate logic riêng — xem SKILL.md của từng skill.
49
49
  - AI models: Gemini 2.5+ only.
50
50
  - Firebase: Firebase AI Logic SDK.
51
51
 
52
- ### Auto-Commit & Push (Per-Project Automation)
53
- - **ĐIỀU KIỆN:** Bắt buộc tuân thủ config `automation.git` trong `.project-identity` (nếu có).
54
- - Nếu `autoCommit: false` → **KHÔNG** tự commit.
55
- - Nếu `autoPush: false` → **KHÔNG** tự push.
56
- - Nếu được phép: Build thành công (0 errors) → **TỰ ĐỘNG** `git add` `git commit` `git push` (non-force, không chờ approval).
57
- - Commit message: conventional format (`fix:`, `feat:`, `refactor:`, `chore:`).
58
- - `git push` (non-force) được phép `SafeToAutoRun=true`. Nếu push fail → retry 1 lần với `git pull --rebase && git push`.
59
- - **Telegram Notification:** Sau khi push thành công → Đọc config `automation.telegram.triggers.git_push`. Nếu bật (hoặc default true) → tự động báo qua lệnh `awkit tg send`.
60
- - Cấm force push. Cấm push fail không báo cáo.
52
+ ### Automation Gate (BẮT BUỘC)
53
+ - AI **PHẢI** dùng `awkit gate` thay gọi trực tiếp `git commit/push`, `awkit trello`, `awkit tg send`.
54
+ - `awkit gate` tự đọc `.project-identity` → enforce `automation.*` config → execute hoặc block.
55
+ - **Git:**
56
+ - `awkit gate git auto "message"` commit + push + telegram notify (nếu enabled).
57
+ - `awkit gate git commit "message"` chỉ commit.
58
+ - `awkit gate git push` chỉ push.
59
+ - Commit message: conventional format (`fix:`, `feat:`, `refactor:`, `chore:`).
60
+ - Push fail auto-retry 1 lần với `git pull --rebase`. Cấm force push.
61
+ - **Trello:**
62
+ - `awkit gate trello complete "Task"` — gated trello complete.
63
+ - `awkit gate trello comment "Note"` — gated trello comment.
64
+ - `awkit gate trello block "Reason"` — gated trello block.
65
+ - **Telegram:**
66
+ - `awkit gate telegram send "Message"` — gated telegram send.
67
+ - **Dry-run:** `awkit gate check` — hiển thị trạng thái gate hiện tại (không execute).
68
+ - ⛔ Gọi `git commit/push` hoặc `awkit trello/tg` trực tiếp (bypass gate) = **VI PHẠM**.
61
69
 
62
70
  ### 7-Gate Autonomous System (v12.3)
63
71
  - orchestrator PHẢI triage complexity (TRIVIAL/MODERATE/COMPLEX) trước mọi task.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@leejungkiin/awkit",
3
- "version": "1.5.6",
4
- "description": "Antigravity Workflow Kit. Unified AI agent orchestration system.",
3
+ "version": "1.6.1",
4
+ "description": "Antigravity Workflow Kit v12.5. Unified AI agent orchestration system with Mindful Checkpoints.",
5
5
  "main": "bin/awk.js",
6
6
  "bin": {
7
7
  "awkit": "bin/awk.js",
@@ -38,6 +38,6 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@leejungkiin/awkit-symphony": "^1.5.0",
41
- "@leejungkiin/gitnexus": "file:../gitnexus/gitnexus"
41
+ "@duytransipher/gitnexus": "latest"
42
42
  }
43
43
  }
package/skills/CATALOG.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # 📋 AWF Skill Catalog
2
2
 
3
- > Classification of core runtime skills and optional packs.
4
- > Updated: 2026-04-02
3
+ > Classification of all skills by type, trigger, and priority.
4
+ > Updated: 2026-03-06
5
5
 
6
6
  ---
7
7
 
@@ -9,65 +9,60 @@
9
9
 
10
10
  | Type | Description | Example |
11
11
  |------|-------------|---------|
12
- | `auto` | Always active, runs silently without user command | `orchestrator`, `nm-memory-sync` |
12
+ | `auto` | Always active, runs silently without user command | `orchestrator`, `memory-sync` |
13
13
  | `manual` | User must explicitly invoke via `/command` or keyword | `brainstorm-agent`, `ios-engineer` |
14
14
 
15
15
  ---
16
16
 
17
- ## Default Runtime Profile (`awkit install`)
17
+ ## Active Skills
18
+
19
+ | # | Skill | Type | Trigger | Priority | Version | Status |
20
+ |---|-------|------|---------|----------|---------|--------|
21
+ | 1 | `orchestrator` | `auto` | Always (first) | 1 | 2.1.0 | ✅ Active |
22
+ | 2 | `awf-session-restore` | `auto` | Session start | 2 | — | ✅ Active |
23
+ | 3 | `memory-sync` | `auto` | Always | 3 | 2.2.0 | ✅ Active |
24
+ | 4 | `symphony-orchestrator` | `auto` | Always | 4 | 1.0.0 | ✅ Active |
25
+ | 5 | `brainstorm-agent` | `manual` | `/brainstorm`, keywords | 5 | 1.0.0 | ✅ Active |
26
+ | 6 | `awf-error-translator` | `auto` | Error detected | 6 | — | ✅ Active |
27
+ | 7 | `awf-adaptive-language` | `auto` | Always | 7 | — | ✅ Active |
28
+ | 8 | `ios-engineer` | `manual` | iOS tasks | — | — | ✅ Active |
29
+ | 9 | `smali-to-kotlin` | `manual` | `/reverse-android` | 8 | — | ✅ Active |
30
+ | 10 | `smali-to-swift` | `manual` | `/reverse-ios` | 9 | — | ✅ Active |
31
+ | 11 | `awf-context-help` | `auto` | `/help`, stuck | — | — | ✅ Active |
32
+ | 12 | `auto-save` | `auto` | Session end | — | — | ✅ Background |
33
+ | 13 | `awf-version-tracker` | `auto` | Skill changes | — | — | ✅ Background |
34
+ | 14 | `module-spec-writer` | `auto` | Gate 1.5 check fail | 1.5 | 1.0.0 | ✅ Active |
35
+ | 15 | `spec-gate` | `auto` | Gate 2 check fail | 2 | 1.0.0 | ✅ Active |
36
+ | 16 | `visual-design-gate` | `auto` | Gate 2.5 check fail | 2.5 | 1.0.0 | ✅ Active |
37
+ | 17 | `trello-sync` | `auto` | Always | 2 | 3.0.0 | ✅ Active |
18
38
 
19
- `awkit install` now installs a lean runtime profile instead of the full source skill library.
20
-
21
- ### Core Lifecycle & Coordination
22
-
23
- - `orchestrator`
24
- - `symphony-orchestrator`
25
- - `awf-session-restore`
26
- - `nm-memory-sync`
27
- - `symphony-enforcer`
28
- - `trello-sync`
29
-
30
- ### Planning & Execution
31
-
32
- - `brainstorm-agent`
33
- - `module-spec-writer`
34
- - `spec-gate`
35
- - `visual-design-gate`
36
- - `single-flow-task-execution`
39
+ ---
37
40
 
38
- ### Quality & Debugging
41
+ ## Quality & Discipline Skills (Superpowers-Inspired)
39
42
 
40
- - `systematic-debugging`
41
- - `verification-gate`
42
- - `code-review`
43
- - `gitnexus-intelligence`
43
+ > Skills ported and adapted from [obra/superpowers](https://github.com/obra/superpowers) framework.
44
+ > Integrated into AWKit with NeuralMemory + Symphony extensions.
44
45
 
45
- ### Meta / Self-Evolution
46
+ | # | Skill | Type | Trigger | Priority | Status |
47
+ |---|-------|------|---------|----------|--------|
48
+ | 14 | `verification-gate` | `auto` | Task completion, commit, deploy | 1 | ✅ Active |
49
+ | 15 | `systematic-debugging` | `auto` | `/debug`, error detected, test failures | 2 | ✅ Active |
50
+ | 16 | `code-review` | `auto` | Task completion, before merge | 3 | ✅ Active |
51
+ | 17 | `writing-skills` | `manual` | Creating/modifying skills | — | ✅ Active |
46
52
 
47
- - `writing-skills`
48
- - `skill-creator`
49
- - `awf-version-tracker`
50
- - `auto-save`
51
- - `awf-adaptive-language`
52
- - `awf-context-help`
53
- - `awf-error-translator`
54
- - `gemini-conductor`
55
- - `codex-conductor`
56
- - `telegram-notify`
57
- - `ship-to-code`
58
53
 
59
54
  ---
60
55
 
61
- ## Optional Packs
56
+ ## NeuralMemory Skill Pack (Optional Upgrade)
57
+
58
+ When NeuralMemory is installed, these skills provide enhanced capabilities:
62
59
 
63
- | Pack | Purpose |
64
- |------|---------|
65
- | `mobile-ios` | iOS, SwiftUI, Xcode, reverse engineering |
66
- | `mobile-android` | Android, Kotlin, Compose, AdMob, APK analysis |
67
- | `marketing` | ASO, App Store marketing, analytics, growth |
68
- | `creator-studio` | Sprites, LucyLab TTS, short-form video workflows |
69
- | `neural-memory` | Memory audit, intake, evolution, extra workflows |
70
- | `superpowers` | Additional execution/TDD/reference skills ported from Superpowers |
60
+ | # | Skill | Type | Replaces | Trigger |
61
+ |---|-------|------|----------|---------|
62
+ | 1 | `nm-memory-sync` | `auto` | `memory-sync` | Session start, debug, errors |
63
+ | 2 | `nm-memory-intake` | `manual` | | `/memory-intake` |
64
+ | 3 | `nm-memory-audit` | `manual` | | `/memory-audit` |
65
+ | 4 | `nm-memory-evolution` | `manual` | | `/memory-evolution` |
71
66
 
72
67
  ---
73
68
 
@@ -76,7 +71,7 @@
76
71
  Skills marked with self-evolution have a `## Learnings` section that accumulates insights:
77
72
 
78
73
  - ✅ `orchestrator` — routing improvements
79
- - ✅ `nm-memory-sync` — trigger pattern refinements
74
+ - ✅ `memory-sync` — trigger pattern refinements
80
75
  - ✅ `symphony-orchestrator` — task management optimizations
81
76
 
82
77
  ---
@@ -0,0 +1,30 @@
1
+ # Skill Trigger Index
2
+
3
+ > ⚠️ TRƯỚC mọi side-effect, scan bảng này → load skill tương ứng TRƯỚC khi act.
4
+ > Check THEN act — never act THEN check.
5
+
6
+ | Skill | Trigger | Path | Pri |
7
+ |:---|:---|:---|:---|
8
+ | orchestrator | Mọi request (routing) | orchestrator/SKILL.md | 🔴 |
9
+ | symphony-enforcer | Task create/update/complete, progress report | symphony-enforcer/SKILL.md | 🔴 |
10
+ | symphony-orchestrator | Session start, server check | symphony-orchestrator/SKILL.md | 🔴 |
11
+ | awf-session-restore | Session start, init chain | awf-session-restore/SKILL.md | 🔴 |
12
+ | nm-memory-sync | Session start/end, debug, errors | nm-memory-sync/SKILL.md | 🟡 |
13
+ | verification-gate | Task completion, commit, deploy, success claims | verification-gate/SKILL.md | 🟡 |
14
+ | code-review | Task completion, before merge | code-review/SKILL.md | 🟡 |
15
+ | spec-gate | Gate 2 architecture design | spec-gate/SKILL.md | 🟡 |
16
+ | brainstorm-agent | `/brainstorm`, ý tưởng, ideation | brainstorm-agent/SKILL.md | 🟢 |
17
+ | skill-creator | `/create-agent-skill`, tạo/sửa skill | skill-creator/SKILL.md | 🟢 |
18
+ | gitnexus-intelligence | Refactoring, impact analysis, pre-commit | gitnexus-intelligence/SKILL.md | 🟢 |
19
+ | ship-to-code | Code porting, migration, language translation | ship-to-code/SKILL.md | 🟢 |
20
+ | visual-design-gate | Gate 2.5 UI/UX design sync | visual-design-gate/SKILL.md | 🟢 |
21
+ | module-spec-writer | Gate 1.5 COMPLEX + >3 modules | module-spec-writer/SKILL.md | 🟢 |
22
+
23
+ ## File Guards
24
+
25
+ | File pattern | PHẢI đọc lại | Lý do |
26
+ |:---|:---|:---|
27
+ | `symphony/**/*.json` | `symphony-enforcer/SKILL.md` | Task integrity |
28
+ | `.project-identity` | `orchestrator/SKILL.md` | Project config |
29
+ | `**/SKILL.md` | `skill-creator/SKILL.md` | Skill format |
30
+ | `GEMINI.md` | N/A (self-referencing) | Core rules |
@@ -15,7 +15,9 @@ invocation-type: auto
15
15
  priority: 2
16
16
  ---
17
17
 
18
- # AWF Session Restore (v7.0Symphony Native)
18
+ <!-- ⚠️ INIT CHAIN CRITICALFile này quyết định thứ tự context loading. Sai = rò rỉ cross-project memory. -->
19
+
20
+ # AWF Session Restore (v7.2 — Symphony Native + Trigger Index)
19
21
 
20
22
  > **Purpose:** Silently gather unstructured context (Git, Plans, Memory) at session start.
21
23
  > **Key Change v7.0:** Symphony-native. Strict brain scoping.
@@ -63,7 +65,8 @@ cat .project-identity 2>/dev/null || echo "NO_PROJECT"
63
65
  ```
64
66
 
65
67
  **Nếu tìm thấy:** Extract `projectId` và `projectName` từ JSON.
66
- **Nếu không:** Ghi nhận `raw mode` các bước sau vẫn chạy nhưng không scope theo project.
68
+ **Cache Mindful Config:** Extract `mindfulCheckpoint` `mindfulCheckpointConfig` (defaults: enabled=true, threshold=3, scopeGuard=true, milestoneRest=true).
69
+ **Nếu không:** Ghi nhận `raw mode` — các bước sau vẫn chạy nhưng không scope theo project. Mindful defaults vẫn ON.
67
70
 
68
71
  ### Step 2: Switch NeuralMemory Brain (CHẠY THỨ HAI)
69
72
 
@@ -119,6 +122,14 @@ Hoặc dùng MCP tool (sau khi brain đã switch):
119
122
  symphony_available_tasks(filter="my")
120
123
  ```
121
124
 
125
+ #### 3e. Skill Trigger Index (v7.2 — Two-Tier Loading)
126
+ ```
127
+ Read: ~/.gemini/antigravity/skills/TRIGGER_INDEX.md
128
+ → Memorize trigger table (~150 tokens)
129
+ → Load specific SKILL.md files ON DEMAND khi action matches trigger
130
+ → KHÔNG load toàn bộ SKILL.md files upfront
131
+ ```
132
+
122
133
  ### Step 4: Compose Silent Context
123
134
 
124
135
  **KHÔNG in ra console.** Tổng hợp thành context object ngầm cho AI sử dụng nội bộ:
@@ -141,6 +152,12 @@ symphony_available_tasks(filter="my")
141
152
  "brain": {
142
153
  "switched_to": "<projectId>",
143
154
  "active_plan": "plans/260316-auth/implementation_plan.md"
155
+ },
156
+ "mindful": {
157
+ "enabled": true,
158
+ "iteration_threshold": 3,
159
+ "scope_guard": true,
160
+ "milestone_rest": true
144
161
  }
145
162
  }
146
163
  ```
@@ -17,6 +17,8 @@ activation_keywords:
17
17
  priority: medium
18
18
  ---
19
19
 
20
+ <!-- ⚠️ GATE 1 — Brainstorm ONLY. Không code trong phase này. Output = BRIEF.md. -->
21
+
20
22
  # 💡 Brainstorm Agent — Router
21
23
 
22
24
  > **Purpose:** Biến ý tưởng mơ hồ thành bản thiết kế rõ ràng qua phiên brainstorm có cấu trúc.
@@ -3,6 +3,8 @@ name: code-review
3
3
  description: Use when completing tasks, implementing features, or before merging. Dispatch structured code review with severity classification. Auto-triggers after task completion in subagent-driven or single-flow execution.
4
4
  ---
5
5
 
6
+ <!-- ⚠️ REVIEW GATE — Spec compliance FIRST, then code quality. No merge without review. -->
7
+
6
8
  # Code Review
7
9
 
8
10
  ## Overview
@@ -0,0 +1,154 @@
1
+ ---
2
+ name: code-review-system-principles
3
+ description: "Nguyên tắc cốt lõi, tiêu chí đánh giá và output schema cho hệ thống tự động Code Review. Sử dụng khi AI đóng vai trò người kiểm duyệt (reviewer) tìm bugs trong một bản vá (patch/diff)."
4
+ version: 1.0.0
5
+ trigger: conditional
6
+ activation_keywords:
7
+ - "code review principles"
8
+ - "review principles"
9
+ - "nguyên tắc review"
10
+ - "code review rules"
11
+ ---
12
+
13
+ <!-- ⚠️ DUAL-SYNCED: Thực thi đồng bộ chéo giữa ~/.gemini/antigravity và main-awf. -->
14
+
15
+ # Code Review System Principles
16
+
17
+ This document summarizes the active review prompt rules used when evaluating a patch.
18
+ It is a human-readable restatement, not a verbatim raw prompt dump.
19
+
20
+ ## 1. Reviewer role
21
+
22
+ - Act as a reviewer for a proposed code change made by another engineer.
23
+ - Focus on discrete, actionable bugs introduced by the patch.
24
+ - Prefer no findings over weak or speculative findings.
25
+
26
+ ## 2. What counts as a bug worth flagging
27
+
28
+ A finding should generally satisfy all of the following:
29
+
30
+ 1. It meaningfully impacts correctness, performance, security, or maintainability.
31
+ 2. It is discrete and actionable.
32
+ 3. Fixing it matches the rigor level already present in the codebase.
33
+ 4. It was introduced by the current patch, not pre-existing.
34
+ 5. The original author would likely want to fix it if informed.
35
+ 6. It does not depend on unstated assumptions about intent.
36
+ 7. It identifies provably affected code or scenarios, not vague downstream risk.
37
+ 8. It is not merely an intentional product or behavior change.
38
+
39
+ ## 3. What to ignore
40
+
41
+ - Trivial style issues, unless they obscure meaning or violate a documented standard.
42
+ - General codebase quality complaints.
43
+ - Speculative regressions without a concrete affected path.
44
+ - Pre-existing problems not introduced by the patch.
45
+ - Non-actionable feedback.
46
+
47
+ ## 4. Finding coverage rules
48
+
49
+ - Return **all** findings the author would likely fix.
50
+ - Do **not** stop at the first valid issue.
51
+ - If there is no clearly valuable issue, return an empty findings list.
52
+
53
+ ## 5. Comment-writing rules
54
+
55
+ Each finding comment should:
56
+
57
+ - Clearly explain why the issue is a bug.
58
+ - Accurately communicate severity.
59
+ - Stay brief: at most one paragraph.
60
+ - Avoid unnecessary praise or blame.
61
+ - State the conditions, environments, or inputs required for the issue to occur.
62
+ - Be understandable without close reading.
63
+ - Avoid large code blocks; any included code should be very small.
64
+ - Use matter-of-fact, assistant-like tone.
65
+ - Use an imperative finding title with a priority prefix.
66
+ - Keep the title short (no more than 80 characters).
67
+
68
+ ## 6. Location rules
69
+
70
+ - Use one comment per distinct issue.
71
+ - Keep the line range as short as possible.
72
+ - Prefer the smallest diff-overlapping range that pinpoints the issue.
73
+ - Avoid large ranges when a smaller subrange can explain the bug.
74
+
75
+ ## 7. Suggestion block rules
76
+
77
+ - Use `suggestion` blocks **only** for concrete replacement code.
78
+ - Keep them minimal.
79
+ - Preserve exact leading whitespace.
80
+ - Do not change outer indentation unless the fix truly requires it.
81
+
82
+ ## 8. Priority rules
83
+
84
+ Every finding title must begin with a priority tag:
85
+
86
+ - `[P0]` Blocking / universal / drop-everything issue
87
+ - `[P1]` Urgent, should be fixed next cycle
88
+ - `[P2]` Normal bug, fix eventually
89
+ - `[P3]` Low priority, nice to have
90
+
91
+ Also include numeric priority in JSON:
92
+
93
+ - `0` for P0
94
+ - `1` for P1
95
+ - `2` for P2
96
+ - `3` for P3
97
+
98
+ ## 9. Output schema rules
99
+
100
+ The output must be valid JSON with exactly this top-level shape:
101
+
102
+ - `findings`: array
103
+ - `overall_correctness`: `"patch is correct"` or `"patch is incorrect"`
104
+ - `overall_explanation`: short justification
105
+ - `overall_confidence_score`: float
106
+
107
+ Each finding must include:
108
+
109
+ - `title`
110
+ - `body`
111
+ - `confidence_score`
112
+ - `priority` (when determinable)
113
+ - `code_location.absolute_file_path`
114
+ - `code_location.line_range.start`
115
+ - `code_location.line_range.end`
116
+
117
+ Additional formatting constraints:
118
+
119
+ - Output raw JSON only; no markdown fences or extra prose.
120
+ - `code_location` is required for every finding.
121
+ - The location should overlap the diff.
122
+ - Do not generate a PR fix in the final review output.
123
+
124
+ ## 10. Correctness verdict rules
125
+
126
+ Use `patch is correct` only when:
127
+
128
+ - Existing code and tests should not break, and
129
+ - The patch is free of blocking bugs.
130
+
131
+ Ignore non-blocking nits such as:
132
+
133
+ - style
134
+ - formatting
135
+ - typos
136
+ - documentation polish
137
+
138
+ ## 11. Practical review heuristic
139
+
140
+ A good finding usually answers all of these quickly:
141
+
142
+ - **Where is the problem?**
143
+ - **When does it break?**
144
+ - **Why is it a real bug?**
145
+ - **How severe is it?**
146
+ - **Is it definitely introduced by this patch?**
147
+
148
+ ## 12. Review philosophy summary
149
+
150
+ - Precision over volume
151
+ - Evidence over speculation
152
+ - Patch-introduced regressions over legacy issues
153
+ - Author-useful feedback over theoretical concerns
154
+ - Concise comments over long essays
@@ -15,6 +15,8 @@ invocation-type: auto
15
15
  priority: 5
16
16
  ---
17
17
 
18
+ <!-- ⚠️ INSPECT ONLY — Codex TUYỆT ĐỐI KHÔNG sửa code. Output = .md reports. approval-mode suggest. -->
19
+
18
20
  # 🔍 Codex Conductor — Router
19
21
 
20
22
  > **Purpose:** Gọi Codex CLI qua terminal khi cần rà soát logic, debug, review code chuyên sâu.
@@ -38,7 +40,7 @@ Codex CLI = Inspector — debug, review, verify, test
38
40
 
39
41
  ```bash
40
42
  which codex || command -v codex
41
- # NOTE: If not installed, IMMEDIATELY fallback to IDE context. DO NOT ask user to install.
43
+ # If not installed: npm i -g @openai/codex
42
44
  ```
43
45
 
44
46
  ## 🎯 Trigger Conditions
@@ -88,9 +90,9 @@ cd <PROJECT_ROOT> && timeout 180 codex exec \
88
90
  | Event | Action |
89
91
  |-------|--------|
90
92
  | Success | Parse → save report → summarize → suggest fixes |
91
- | Timeout | "⏳ Timed out (>120s)" → fallback Antigravity-only smoothly |
92
- | Error | Fallback Antigravity-only smoothly. Do NOT ask user to install |
93
- | Not installed | Fallback Antigravity-only smoothly. Do NOT ask user to install |
93
+ | Timeout | "⏳ Timed out (>120s)" → fallback Antigravity-only |
94
+ | Error | Check `codex --version` suggest install |
95
+ | Not installed | Ask user to install |
94
96
 
95
97
  ## 📁 Report Structure
96
98
 
@@ -15,6 +15,8 @@ invocation-type: auto
15
15
  priority: 5
16
16
  ---
17
17
 
18
+ <!-- ⚠️ READ-ONLY CLI — Gemini CLI KHÔNG ĐƯỢC sửa code. Chỉ .md files. Timeout 60s. -->
19
+
18
20
  # 🎼 Gemini Conductor Skill
19
21
 
20
22
  > **Purpose:** Antigravity tự gọi Gemini CLI qua terminal khi cần tầm nhìn rộng hơn scope IDE.
@@ -194,9 +196,8 @@ on_timeout:
194
196
  - Fall back to Antigravity-only analysis
195
197
 
196
198
  on_error:
197
- - Log: "⚠️ CLI invocation failed or not set up, continuing without conductor"
198
- - IMMEDIATELY fallback to Antigravity-only mode
199
- - Do NOT ask the user to install or authenticate the CLI. It is strictly optional
199
+ - Log: "⚠️ CLI invocation failed, continuing without conductor"
200
+ - Do NOT block the workflow — CLI is enhancement, not dependency
200
201
  ```
201
202
 
202
203
  ---
@@ -14,6 +14,8 @@ invocation-type: auto
14
14
  priority: 5
15
15
  ---
16
16
 
17
+ <!-- ⚠️ IMPACT-FIRST — PHẢI chạy gitnexus_impact TRƯỚC khi edit symbol. Chưa index → KHÔNG dùng tools. -->
18
+
17
19
  # GitNexus Intelligence v1.0 — Code-Aware Agent Skill
18
20
 
19
21
  > **Purpose:** Cung cấp architectural awareness cho AI agent thông qua knowledge graph.
@@ -39,6 +41,31 @@ INDEX STALE (tool trả warning):
39
41
 
40
42
  ---
41
43
 
44
+ ## 🔑 Auto-Repo Detection Protocol (BẮT BUỘC)
45
+
46
+ ```
47
+ TRƯỚC KHI gọi bất kỳ GitNexus MCP tool nào:
48
+
49
+ 1. Gọi gitnexus_list_repos() → lấy danh sách repos đã index
50
+ 2. Match project directory (từ .project-identity hoặc cwd) với repo paths
51
+ 3. Dùng matched repo name làm `repo` param cho MỌI tool call
52
+
53
+ VÍ DỤ:
54
+ gitnexus_list_repos() trả về repo path "/Users/.../FitWitnessSimple"
55
+ → project đang mở = FitWitnessSimple
56
+ → gitnexus_query({query: "weather", repo: "FitWitnessSimple"})
57
+
58
+ FALLBACK (nếu không match path):
59
+ 1. So sánh projectId (từ .project-identity) với repo names
60
+ 2. Nếu vẫn không match → hỏi user chọn repo
61
+
62
+ ⚠️ KHÔNG BAO GIỜ gọi GitNexus tool mà THIẾU `repo` param khi có >1 repo indexed.
63
+ ```
64
+
65
+ > **Quản lý repos:** `awkit gitnexus list` để xem, `awkit gitnexus clean` để dọn repos cũ.
66
+
67
+ ---
68
+
42
69
  ## 🎯 When to Activate
43
70
 
44
71
  | Trigger | Action |
@@ -23,6 +23,8 @@ activation_keywords:
23
23
  - "product spec"
24
24
  ---
25
25
 
26
+ <!-- ⚠️ GATE 1.5 — User PHẢI approve module specs. COMPLEX + >3 modules = MANDATORY. -->
27
+
26
28
  # Module Spec Writer v1.2 — Gate 1.5: Product Specification (Router)
27
29
 
28
30
  > **Purpose:** Tạo tài liệu product-level cho từng module (screens, flows, rules)
@@ -11,6 +11,8 @@ activation_keywords:
11
11
  - "bổ sung skill"
12
12
  ---
13
13
 
14
+ <!-- ⚠️ DUAL-SYNC BẮT BUỘC — Mọi thay đổi PHẢI sync sang main-awf. Không được bỏ qua Bước 3. -->
15
+
14
16
  # 🛠️ Skill Creator (with Auto-Sync to main-awf)
15
17
 
16
18
  **Purpose**: Hỗ trợ người dùng thiết kế, lập trình và tinh chỉnh các Antigravity Skills theo chuẩn.
@@ -21,6 +21,8 @@ activation_keywords:
21
21
  - "API design"
22
22
  ---
23
23
 
24
+ <!-- ⚠️ GATE 2 — User PHẢI approve design. AI KHÔNG được tự approve. Đọc GEMINI.md § 7-Gate trước khi sửa. -->
25
+
24
26
  # Spec Gate v1.2 — Architecture & Data Design Gate (Router)
25
27
 
26
28
  > **Purpose:** Chốt thiết kế kỹ thuật (DB Schema, API Contract, State Machine)
@@ -17,6 +17,8 @@ invocation-type: auto
17
17
  priority: 1
18
18
  ---
19
19
 
20
+ <!-- ⚠️ TASK INTEGRITY — Sửa file này PHẢI đọc lại GEMINI.md § Symphony rules. Không sửa format Sync Block. -->
21
+
20
22
  # Symphony Enforcer v3.7 — Router
21
23
 
22
24
  > **Purpose:** Đảm bảo AI KHÔNG BAO GIỜ quên cập nhật Symphony.
@@ -31,6 +33,12 @@ KHÔNG CÓ NGOẠI LỆ:
31
33
  - AI tự detect completion và auto-complete task
32
34
  - Task done → PHẢI atomic git commit trước khi suggest next
33
35
  - BỎ QUA BẤT KỲ STEP NÀO = VI PHẠM
36
+
37
+ GATE 3 VIOLATION (NẶNG):
38
+ - Tạo implementation plan mà KHÔNG tạo Symphony tickets = VI PHẠM NẶNG
39
+ - Dùng artifact task.md thay cho Symphony = VI PHẠM
40
+ (task.md = IDE-level tracking, KHÔNG thay thế Symphony)
41
+ - Severity tương đương: code logic khi chưa confirm UI
34
42
  ```
35
43
 
36
44
  ## 📋 Topic Index — Load file theo nhu cầu
@@ -41,6 +49,7 @@ KHÔNG CÓ NGOẠI LỆ:
41
49
  | Three-Phase Execution | Gate 4 với COMPLEX + UI tasks | `examples/three-phase.md` |
42
50
  | Trigger Points (TP1, TP1.5, TP1.7) | Milestone, schema changes, checkpoints | `examples/trigger-points.md` |
43
51
  | Task Completion (TP2-TP4) | Khi task sắp done | `examples/task-completion.md` |
52
+ | Mindful Stop (TP-ITER, TP-SCOPE, TP-REST) | Iteration counter, scope guard, milestone rest | `examples/mindful-stop.md` |
44
53
 
45
54
  ## Auto-Lifecycle: task_boundary ↔ Symphony
46
55
 
@@ -0,0 +1,141 @@
1
+ # Mindful Stop Protocol — Detailed Logic
2
+
3
+ > **Purpose:** Chống vòng xoáy tối ưu không hồi kết ("AI brain fry").
4
+ > **Design:** Default-ON trong GEMINI.md, enforcement gắn vào TP1/TP2/TP4.
5
+ > **Opt-out:** `.project-identity` → `mindfulCheckpoint: false`.
6
+
7
+ ## Gate Check (Init Chain Cache)
8
+
9
+ ```
10
+ Trong awf-session-restore, khi đọc .project-identity:
11
+ → Cache mindful config vào session state:
12
+ mindful_enabled = .mindfulCheckpoint ?? true
13
+ iteration_threshold = .mindfulCheckpointConfig?.iterationThreshold ?? 3
14
+ scope_guard = .mindfulCheckpointConfig?.scopeGuard ?? true
15
+ milestone_rest = .mindfulCheckpointConfig?.milestoneRest ?? true
16
+
17
+ Nếu .project-identity không tồn tại → dùng defaults (tất cả ON)
18
+ ```
19
+
20
+ ---
21
+
22
+ ## Session State Tracking
23
+
24
+ ```
25
+ AI duy trì state xuyên suốt session:
26
+ iteration_map = {} # feature_name → count
27
+ tasks_completed = 0 # count tasks done trong session
28
+ last_gate_completed = "" # "phase_c" | "gate_5" | ""
29
+ ```
30
+
31
+ ---
32
+
33
+ ## TP-ITER: Iteration Counter
34
+
35
+ **Gắn vào:** TP1 (Progress Milestone) — mỗi lần report progress
36
+
37
+ **Trigger:** User request chứa keywords refactor/polish/optimize TRÊN feature đã hoàn thành
38
+
39
+ ```
40
+ IF NOT mindful_enabled → SKIP
41
+
42
+ Khi nhận request iterate trên feature X:
43
+ iteration_map[X] = (iteration_map[X] ?? 0) + 1
44
+
45
+ IF iteration_map[X] >= iteration_threshold:
46
+ ⏸️ MINDFUL PAUSE
47
+ ──────────────────────────────────────
48
+ Cảnh báo: "⏸️ Đã iterate {N} lần trên [{feature}].
49
+ Code đang hoạt động ổn định. Đề xuất:
50
+ 1. Commit code hiện tại
51
+ 2. Trải nghiệm thực tế trên device/production
52
+ 3. Quay lại sau nếu phát hiện vấn đề cụ thể"
53
+ ──────────────────────────────────────
54
+
55
+ User response:
56
+ "tiếp tục" / "tôi hiểu, tiếp" / "override" → reset iteration_map[X] = 0, proceed
57
+ Bất kỳ response khác → commit + dừng feature đó
58
+ ```
59
+
60
+ ---
61
+
62
+ ## TP-SCOPE: Scope Guard
63
+
64
+ **Gắn vào:** Trước khi bắt đầu EXECUTION — khi nhận request mới
65
+
66
+ **Trigger keywords:** `[polish, optimize, refine, tối ưu, cải thiện, tweak, mượt hơn, đẹp hơn, smooth, better]`
67
+
68
+ ```
69
+ IF NOT mindful_enabled OR NOT scope_guard → SKIP
70
+
71
+ Khi nhận request chứa trigger keyword:
72
+ Hỏi: "Thay đổi này giải quyết vấn đề cụ thể nào đang gặp trên device/production?
73
+ Hay đây là tối ưu phòng ngừa?"
74
+
75
+ User response:
76
+ Nêu vấn đề cụ thể (lỗi, lag, UX problem) → proceed bình thường
77
+ Không rõ / "muốn đẹp hơn thôi" → Đề xuất:
78
+ "📋 Bookmark vào Symphony backlog (P2):
79
+ symphony task create 'Optimize: {description}' --priority 2
80
+ Quay lại khi có feedback từ real users."
81
+ ```
82
+
83
+ ---
84
+
85
+ ## TP-REST: Milestone Rest Gate
86
+
87
+ **Gắn vào:** TP4 (Auto-Next Suggestion) — sau khi task complete
88
+
89
+ **Trigger conditions (BẤT KỲ 1):**
90
+ 1. `tasks_completed >= 3` trong session hiện tại
91
+ 2. `last_gate_completed` = "phase_c" hoặc "gate_5"
92
+
93
+ ```
94
+ IF NOT mindful_enabled OR NOT milestone_rest → SKIP (TP4 chạy như cũ)
95
+
96
+ Khi trigger:
97
+ TP4 output THAY ĐỔI thành:
98
+
99
+ ➡️ NEXT STEPS ({projectName})
100
+ ──────────────────────────────────────
101
+ 🧘 Đề xuất: Dừng phiên tại đây.
102
+ Bạn đã hoàn thành {tasks_completed} tasks hôm nay.
103
+ Tiến độ project: {X}% → {Y}%
104
+ Commit, nghỉ ngơi, quay lại phiên mới sau.
105
+ ──────────────────────────────────────
106
+ Hoặc tiếp tục:
107
+ 📋 #sym-A1 — Task Name (P0, ready)
108
+ 📋 #sym-A2 — Task Name (P1, ready)
109
+
110
+ → 🧘 REST option hiển thị TRƯỚC danh sách tasks
111
+ → User vẫn có thể chọn task để tiếp tục
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Enforcement Matrix
117
+
118
+ | Mechanism | Gắn vào TP | Mandatory? | Opt-out key |
119
+ |:---|:---|:---|:---|
120
+ | Iteration Counter | TP1 | ✅ (khi enabled) | `mindfulCheckpoint: false` |
121
+ | Scope Guard | Pre-EXECUTION | ✅ (khi enabled) | `scopeGuard: false` |
122
+ | Milestone Rest | TP4 | ✅ (khi enabled) | `milestoneRest: false` |
123
+
124
+ ## .project-identity Config
125
+
126
+ ```json
127
+ {
128
+ "mindfulCheckpoint": true,
129
+ "mindfulCheckpointConfig": {
130
+ "iterationThreshold": 3,
131
+ "scopeGuard": true,
132
+ "milestoneRest": true
133
+ }
134
+ }
135
+ ```
136
+
137
+ | Giá trị | Hành vi |
138
+ |:---|:---|
139
+ | Không khai báo | = `true` (an toàn mặc định) |
140
+ | `true` | Bật toàn bộ, dùng defaults hoặc sub-config |
141
+ | `false` | Tắt hoàn toàn, AI chạy full speed |
@@ -88,13 +88,22 @@ NEEDS_CONTEXT:
88
88
  2. symphony task list -P <projectId> -s ready (CHỈ tasks cùng project)
89
89
  ⚠️ TUYỆT ĐỐI KHÔNG dùng filter="ready" không có project filter
90
90
  3. Lọc top 2-3 ready tasks theo priority
91
- 4. Present cho user:
91
+ 4. Kiểm tra Mindful Rest trigger:
92
+ IF mindful_enabled VÀ milestone_rest VÀ (tasks_completed >= 3 OR vừa xong Phase C / Gate 5):
93
+ → Hiển thị REST option TRƯỚC danh sách tasks:
94
+ 🧘 Đề xuất: Dừng phiên tại đây.
95
+ Bạn đã hoàn thành {tasks_completed} tasks hôm nay.
96
+ Commit, nghỉ ngơi, quay lại phiên mới sau.
97
+ ─────────────
98
+ Hoặc tiếp tục:
99
+ 5. Present cho user:
92
100
  ➡️ NEXT STEPS ({projectName})
93
101
  📋 #sym-A1 — Auth Module (P0, ready)
94
102
  📋 #sym-A2 — Dashboard UI (P1, ready)
95
- 5. Nếu KHÔNG CÓ ready tasks → "✨ Không còn task ready! Tạo task mới hoặc chuyển phase."
103
+ 6. Nếu KHÔNG CÓ ready tasks → "✨ Không còn task ready! Tạo task mới hoặc chuyển phase."
96
104
  ```
97
105
 
98
106
  **Enforcement:**
99
107
  - ❌ KHÔNG kết thúc conversation mà KHÔNG present next suggestion
100
108
  - ❌ KHÔNG show tasks từ project khác
109
+ - ❌ KHÔNG bỏ qua Mindful Rest khi trigger conditions đạt (nếu enabled)
@@ -35,6 +35,13 @@ symphony_report_progress(
35
35
  - ❌ KHÔNG được gọi `notify_user` mà chưa `report_progress` trước đó
36
36
  - ❌ KHÔNG được chuyển mode (task_boundary) mà chưa report
37
37
 
38
+ **Mindful Check (gắn vào TP1):**
39
+ ```
40
+ Nếu mindful_enabled VÀ request là iterate/polish trên feature đã done:
41
+ iteration_map[feature]++
42
+ IF >= iteration_threshold → ⏸️ MINDFUL PAUSE (xem mindful-stop.md)
43
+ ```
44
+
38
45
  ---
39
46
 
40
47
  ## TP1.5: Design Compliance Check (Gate 4 Enforcement)
@@ -20,6 +20,8 @@ invocation-type: auto
20
20
  priority: 0
21
21
  ---
22
22
 
23
+ <!-- ⚠️ GATE 0 — Preflight checklist PHẢI hiển thị. Bỏ qua = VI PHẠM. DB centralized = cross-project. -->
24
+
23
25
  # Symphony Orchestrator Skill — Multi-Project & Agent Orchestration
24
26
 
25
27
  > **Purpose:** Đảm bảo Symphony server luôn sẵn sàng cho mọi session.
@@ -3,6 +3,8 @@ name: verification-gate
3
3
  description: Use BEFORE claiming any work is complete, fixed, or passing. Requires running verification commands and confirming output before making success claims. Evidence before assertions, always. Auto-triggers on task completion, commit, deploy, or any positive status claim.
4
4
  ---
5
5
 
6
+ <!-- ⚠️ IRON LAW — NO completion claims without FRESH verification evidence. Non-negotiable. -->
7
+
6
8
  # Verification Before Completion
7
9
 
8
10
  ## Overview
@@ -22,6 +22,8 @@ activation_keywords:
22
22
  - "pencil"
23
23
  ---
24
24
 
25
+ <!-- ⚠️ GATE 2.5 — Không code UI khi chưa có design approval. Backend-only tasks SKIP gate này. -->
26
+
25
27
  # Visual Design Gate v1.0 (Gate 2.5) — UI/UX Sync Gate
26
28
 
27
29
  > **Purpose:** Giúp AI và người dùng đồng bộ cách hiểu về ý tưởng giao diện (UI/UX)