@leejungkiin/awkit 1.5.5 → 1.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/bin/awk.js +188 -8
  2. package/core/GEMINI.md +15 -7
  3. package/core/work-modes.json +45 -0
  4. package/package.json +1 -1
  5. package/skill-packs/cocos2d/pack.json +8 -0
  6. package/skill-packs/cocos2d/skills/cocos2d-x/LICENSE.txt +8 -0
  7. package/skill-packs/cocos2d/skills/cocos2d-x/SKILL.md +168 -0
  8. package/skill-packs/cocos2d/skills/cocos2d-x/examples/core/action.md +278 -0
  9. package/skill-packs/cocos2d/skills/cocos2d-x/examples/core/animation.md +220 -0
  10. package/skill-packs/cocos2d/skills/cocos2d-x/examples/core/event.md +133 -0
  11. package/skill-packs/cocos2d/skills/cocos2d-x/examples/core/input.md +291 -0
  12. package/skill-packs/cocos2d/skills/cocos2d-x/examples/core/label.md +184 -0
  13. package/skill-packs/cocos2d/skills/cocos2d-x/examples/core/node-scene.md +212 -0
  14. package/skill-packs/cocos2d/skills/cocos2d-x/examples/core/scene.md +228 -0
  15. package/skill-packs/cocos2d/skills/cocos2d-x/examples/core/sprite.md +206 -0
  16. package/skill-packs/cocos2d/skills/cocos2d-x/examples/core/texture.md +186 -0
  17. package/skill-packs/cocos2d/skills/cocos2d-x/examples/getting-started/about-engine.md +53 -0
  18. package/skill-packs/cocos2d/skills/cocos2d-x/examples/getting-started/installation.md +203 -0
  19. package/skill-packs/cocos2d/skills/cocos2d-x/examples/getting-started/quick-start.md +134 -0
  20. package/skill-packs/electron/pack.json +9 -0
  21. package/skill-packs/electron/skills/electron/LICENSE.txt +202 -0
  22. package/skill-packs/electron/skills/electron/SKILL.md +160 -0
  23. package/skill-packs/electron/skills/electron/api/app.md +83 -0
  24. package/skill-packs/electron/skills/electron/api/browser-window.md +84 -0
  25. package/skill-packs/electron/skills/electron/examples/advanced/packaging.md +140 -0
  26. package/skill-packs/electron/skills/electron/examples/api/browser-window.md +182 -0
  27. package/skill-packs/electron/skills/electron/examples/api/menu.md +187 -0
  28. package/skill-packs/electron/skills/electron/examples/getting-started/installation.md +88 -0
  29. package/skill-packs/electron/skills/electron/examples/getting-started/quick-start.md +104 -0
  30. package/skill-packs/electron/skills/electron/examples/processes/ipc-communication.md +140 -0
  31. package/skill-packs/electron/skills/electron/examples/processes/main-process.md +121 -0
  32. package/skill-packs/electron/skills/electron/templates/main-process.md +105 -0
  33. package/skill-packs/electron/skills/electron/templates/preload-script.md +84 -0
  34. package/skill-packs/electron/skills/electron-egg/LICENSE.txt +202 -0
  35. package/skill-packs/electron/skills/electron-egg/SKILL.md +154 -0
  36. package/skill-packs/electron/skills/electron-egg/api/config-api.md +62 -0
  37. package/skill-packs/electron/skills/electron-egg/api/ipc-api.md +55 -0
  38. package/skill-packs/electron/skills/electron-egg/api/main-api.md +54 -0
  39. package/skill-packs/electron/skills/electron-egg/api/renderer-api.md +62 -0
  40. package/skill-packs/electron/skills/electron-egg/api/window-api.md +64 -0
  41. package/skill-packs/electron/skills/electron-egg/examples/features/ipc-communication.md +84 -0
  42. package/skill-packs/electron/skills/electron-egg/examples/features/main-process.md +89 -0
  43. package/skill-packs/electron/skills/electron-egg/examples/features/renderer-process.md +74 -0
  44. package/skill-packs/electron/skills/electron-egg/examples/guide/build.md +77 -0
  45. package/skill-packs/electron/skills/electron-egg/examples/guide/configuration.md +88 -0
  46. package/skill-packs/electron/skills/electron-egg/examples/guide/installation.md +66 -0
  47. package/skill-packs/electron/skills/electron-egg/examples/guide/intro.md +47 -0
  48. package/skill-packs/electron/skills/electron-egg/examples/guide/project-structure.md +73 -0
  49. package/skill-packs/electron/skills/electron-egg/examples/guide/quick-start.md +78 -0
  50. package/skill-packs/electron/skills/electron-egg/templates/configuration.md +63 -0
  51. package/skill-packs/electron/skills/electron-egg/templates/installation.md +42 -0
  52. package/skill-packs/electron/skills/electron-egg/templates/project-setup.md +75 -0
  53. package/skill-packs/flutter/pack.json +9 -0
  54. package/skill-packs/flutter/skills/flutter/LICENSE.txt +202 -0
  55. package/skill-packs/flutter/skills/flutter/SKILL.md +127 -0
  56. package/skill-packs/flutter/skills/flutter-project-creater/LICENSE.txt +202 -0
  57. package/skill-packs/flutter/skills/flutter-project-creater/SKILL.md +106 -0
  58. package/skill-packs/threejs/pack.json +25 -0
  59. package/skill-packs/threejs/skills/README.md +95 -0
  60. package/skill-packs/threejs/skills/threejs-animation/SKILL.md +86 -0
  61. package/skill-packs/threejs/skills/threejs-animation/examples/workflow-mixer-action.md +20 -0
  62. package/skill-packs/threejs/skills/threejs-animation/references/official-sections.md +19 -0
  63. package/skill-packs/threejs/skills/threejs-audio/SKILL.md +112 -0
  64. package/skill-packs/threejs/skills/threejs-audio/examples/workflow-positional-audio.md +15 -0
  65. package/skill-packs/threejs/skills/threejs-audio/references/official-sections.md +16 -0
  66. package/skill-packs/threejs/skills/threejs-camera/SKILL.md +96 -0
  67. package/skill-packs/threejs/skills/threejs-camera/examples/workflow-perspective-resize.md +13 -0
  68. package/skill-packs/threejs/skills/threejs-controls/SKILL.md +101 -0
  69. package/skill-packs/threejs/skills/threejs-controls/examples/workflow-orbit-damping.md +15 -0
  70. package/skill-packs/threejs/skills/threejs-dev-setup/SKILL.md +102 -0
  71. package/skill-packs/threejs/skills/threejs-dev-setup/examples/workflow-scaffold.md +24 -0
  72. package/skill-packs/threejs/skills/threejs-geometries/SKILL.md +108 -0
  73. package/skill-packs/threejs/skills/threejs-geometries/examples/workflow-extrude-shape.md +13 -0
  74. package/skill-packs/threejs/skills/threejs-helpers/SKILL.md +103 -0
  75. package/skill-packs/threejs/skills/threejs-helpers/examples/workflow-light-camera-helpers.md +13 -0
  76. package/skill-packs/threejs/skills/threejs-lights/SKILL.md +103 -0
  77. package/skill-packs/threejs/skills/threejs-lights/examples/workflow-directional-shadow.md +17 -0
  78. package/skill-packs/threejs/skills/threejs-loaders/SKILL.md +89 -0
  79. package/skill-packs/threejs/skills/threejs-loaders/examples/workflow-gltf-draco.md +22 -0
  80. package/skill-packs/threejs/skills/threejs-loaders/references/official-sections.md +27 -0
  81. package/skill-packs/threejs/skills/threejs-materials/SKILL.md +102 -0
  82. package/skill-packs/threejs/skills/threejs-materials/examples/workflow-pbr-transparent.md +15 -0
  83. package/skill-packs/threejs/skills/threejs-math/SKILL.md +102 -0
  84. package/skill-packs/threejs/skills/threejs-math/examples/workflow-ray-aabb.md +11 -0
  85. package/skill-packs/threejs/skills/threejs-node-tsl/SKILL.md +83 -0
  86. package/skill-packs/threejs/skills/threejs-node-tsl/examples/workflow-tsl-entry.md +13 -0
  87. package/skill-packs/threejs/skills/threejs-node-tsl/references/official-links.md +8 -0
  88. package/skill-packs/threejs/skills/threejs-node-tsl/references/tsl-vs-classic.md +23 -0
  89. package/skill-packs/threejs/skills/threejs-objects/SKILL.md +111 -0
  90. package/skill-packs/threejs/skills/threejs-objects/examples/workflow-raycaster-pick.md +17 -0
  91. package/skill-packs/threejs/skills/threejs-postprocessing/SKILL.md +116 -0
  92. package/skill-packs/threejs/skills/threejs-postprocessing/examples/workflow-composer-bloom.md +15 -0
  93. package/skill-packs/threejs/skills/threejs-renderers/SKILL.md +91 -0
  94. package/skill-packs/threejs/skills/threejs-renderers/examples/workflow-renderer-resize.md +21 -0
  95. package/skill-packs/threejs/skills/threejs-renderers/references/official-sections.md +14 -0
  96. package/skill-packs/threejs/skills/threejs-scenes/SKILL.md +90 -0
  97. package/skill-packs/threejs/skills/threejs-scenes/examples/workflow-fog-background.md +13 -0
  98. package/skill-packs/threejs/skills/threejs-textures/SKILL.md +83 -0
  99. package/skill-packs/threejs/skills/threejs-textures/examples/workflow-pmrem-env.md +19 -0
  100. package/skill-packs/threejs/skills/threejs-webxr/SKILL.md +104 -0
  101. package/skill-packs/threejs/skills/threejs-webxr/examples/workflow-xr-button.md +15 -0
  102. package/skills/telegram-notify/SKILL.md +1 -0
  103. package/skills/trello-sync/SKILL.md +7 -0
  104. package/templates/project-identity/android.json +26 -1
  105. package/templates/project-identity/backend-nestjs.json +26 -1
  106. package/templates/project-identity/expo.json +26 -1
  107. package/templates/project-identity/ios.json +26 -1
  108. package/templates/project-identity/web-nextjs.json +26 -1
package/bin/awk.js CHANGED
@@ -280,7 +280,8 @@ function readInstallState(platform = activePlatform) {
280
280
  const fallback = {
281
281
  version: 1,
282
282
  profile: getDefaultSkillProfileName(),
283
- enabledPacks: []
283
+ enabledPacks: [],
284
+ activeMode: null
284
285
  };
285
286
  return readJsonFile(getInstallStatePath(platform), fallback) || fallback;
286
287
  }
@@ -725,8 +726,7 @@ function cmdInstall(args = []) {
725
726
  }
726
727
 
727
728
  writeInstallState({
728
- version: 1,
729
- profile: getDefaultSkillProfileName(),
729
+ ...previousState,
730
730
  enabledPacks: activePacks
731
731
  }, platform);
732
732
  ok(`Install state saved (${desiredSkills.size} active skills)`);
@@ -1421,8 +1421,7 @@ function cmdEnablePack(packName, { autoMode = false } = {}) {
1421
1421
  const enabledPacks = new Set(state.enabledPacks || []);
1422
1422
  enabledPacks.add(packName);
1423
1423
  writeInstallState({
1424
- version: 1,
1425
- profile: getDefaultSkillProfileName(),
1424
+ ...state,
1426
1425
  enabledPacks: [...enabledPacks].sort()
1427
1426
  });
1428
1427
 
@@ -1491,14 +1490,146 @@ function cmdDisablePack(packName) {
1491
1490
 
1492
1491
  const state = readInstallState();
1493
1492
  writeInstallState({
1494
- version: 1,
1495
- profile: getDefaultSkillProfileName(),
1493
+ ...state,
1496
1494
  enabledPacks: (state.enabledPacks || []).filter(name => name !== packName)
1497
1495
  });
1498
1496
 
1499
1497
  ok(`Skill pack "${packName}" disabled (skills backed up to ${backupDir})`);
1500
1498
  }
1501
1499
 
1500
+ function loadWorkModes() {
1501
+ const defaultsPath = path.join(AWK_ROOT, 'core', 'work-modes.json');
1502
+ const userPath = path.join(HOME, '.awkit_modes.json');
1503
+ const modes = readJsonFile(defaultsPath, { modes: {} }).modes || {};
1504
+
1505
+ if (fs.existsSync(userPath)) {
1506
+ const userModes = readJsonFile(userPath, { modes: {} }).modes || {};
1507
+ for (const [key, val] of Object.entries(userModes)) {
1508
+ modes[key] = { ...modes[key], ...val };
1509
+ }
1510
+ }
1511
+ return modes;
1512
+ }
1513
+
1514
+ function cmdMode(args = []) {
1515
+ const modes = loadWorkModes();
1516
+ const state = readInstallState();
1517
+
1518
+ if (args.length === 0) {
1519
+ log('');
1520
+ log(`${C.cyan}${C.bold}🔄 AWK Work Modes${C.reset}`);
1521
+ log('');
1522
+
1523
+ const active = state.activeMode;
1524
+ if (active && modes[active]) {
1525
+ log(`Current Mode: ${C.green}${C.bold}${active}${C.reset} - ${modes[active].description}`);
1526
+ } else {
1527
+ log(`Current Mode: ${C.yellow}core-only${C.reset}`);
1528
+ }
1529
+ log('');
1530
+ log(`${C.cyan}Available Modes:${C.reset}`);
1531
+ for (const [modeName, data] of Object.entries(modes)) {
1532
+ if (data.hidden && modeName !== active) continue;
1533
+ const marker = modeName === active ? `${C.green}▶${C.reset}` : ` `;
1534
+ log(` ${marker} ${C.green}${modeName.padEnd(15)}${C.reset} ${C.gray}${data.description}${C.reset}`);
1535
+ }
1536
+ log('');
1537
+ log(`${C.cyan}Commands:${C.reset}`);
1538
+ log(` awkit mode <name> Switch to a mode`);
1539
+ log(` awkit mode --create <name> <pack1,pack2,...>`);
1540
+ log(` awkit mode --delete <name>`);
1541
+ log(` awkit mode --reset Back to core-only`);
1542
+ log('');
1543
+ return;
1544
+ }
1545
+
1546
+ const subCmd = args[0];
1547
+
1548
+ if (subCmd === '--reset') {
1549
+ if (!state.activeMode) {
1550
+ info(`Already in core-only mode.`);
1551
+ return;
1552
+ }
1553
+ const activePacks = modes[state.activeMode]?.packs || [];
1554
+ for (const p of activePacks) cmdDisablePack(p);
1555
+
1556
+ state.activeMode = null;
1557
+ writeInstallState(state);
1558
+ ok(`Disabled mode packs. Back to core-only.`);
1559
+ return;
1560
+ }
1561
+
1562
+ if (subCmd === '--create') {
1563
+ const name = args[1];
1564
+ const packsList = args[2];
1565
+ if (!name || !packsList) {
1566
+ err(`Usage: awkit mode --create <name> <pack1,pack2,...>`);
1567
+ return;
1568
+ }
1569
+ const packs = packsList.split(',').map(s => s.trim()).filter(Boolean);
1570
+ const userPath = path.join(HOME, '.awkit_modes.json');
1571
+ const userConfig = readJsonFile(userPath, { version: 1, modes: {} }) || { version: 1, modes: {} };
1572
+ if (!userConfig.modes) userConfig.modes = {};
1573
+ userConfig.modes[name] = {
1574
+ description: "Custom user mode",
1575
+ packs
1576
+ };
1577
+ fs.writeFileSync(userPath, JSON.stringify(userConfig, null, 2));
1578
+ ok(`Created custom mode: ${name} with packs: ${packs.join(', ')}`);
1579
+ return;
1580
+ }
1581
+
1582
+ if (subCmd === '--delete') {
1583
+ const name = args[1];
1584
+ const userPath = path.join(HOME, '.awkit_modes.json');
1585
+ if (fs.existsSync(userPath)) {
1586
+ const userConfig = readJsonFile(userPath, { version: 1, modes: {} });
1587
+ if (userConfig?.modes?.[name]) {
1588
+ delete userConfig.modes[name];
1589
+ fs.writeFileSync(userPath, JSON.stringify(userConfig, null, 2));
1590
+ ok(`Deleted custom mode: ${name}`);
1591
+ } else {
1592
+ err(`Mode '${name}' not found in user configs.`);
1593
+ }
1594
+ } else {
1595
+ err(`No user modes config found.`);
1596
+ }
1597
+ return;
1598
+ }
1599
+
1600
+ // Switch mode
1601
+ const modeName = subCmd;
1602
+ if (!modes[modeName]) {
1603
+ err(`Work mode '${modeName}' not found.`);
1604
+ return;
1605
+ }
1606
+
1607
+ info(`Switching to mode: ${modeName}`);
1608
+
1609
+ const currentActive = state.activeMode;
1610
+ if (currentActive && currentActive !== modeName && modes[currentActive]) {
1611
+ const oldPacks = modes[currentActive].packs || [];
1612
+ // Disable packs that are not in the new mode to avoid toggling what we want to keep
1613
+ const newPacksSet = new Set(modes[modeName].packs || []);
1614
+ for (const p of oldPacks) {
1615
+ if (!newPacksSet.has(p)) {
1616
+ cmdDisablePack(p);
1617
+ }
1618
+ }
1619
+ }
1620
+
1621
+ const newPacks = modes[modeName].packs || [];
1622
+ for (const p of newPacks) {
1623
+ cmdEnablePack(p, { autoMode: true });
1624
+ }
1625
+
1626
+ const freshState = readInstallState();
1627
+ freshState.activeMode = modeName;
1628
+ writeInstallState(freshState);
1629
+
1630
+ ok(`Successfully switched to mode: ${C.bold}${modeName}${C.reset}`);
1631
+ }
1632
+
1502
1633
  function cmdListPacks() {
1503
1634
  const packsDir = path.join(AWK_ROOT, 'skill-packs');
1504
1635
 
@@ -1888,8 +2019,10 @@ function cmdHelp() {
1888
2019
  log('');
1889
2020
 
1890
2021
  // Packs
1891
- log(`${C.bold}📦 Skill Packs${C.reset}`);
2022
+ log(`${C.bold}📦 Skill Packs & Modes${C.reset}`);
1892
2023
  log(line);
2024
+ log(` ${C.green}mode${C.reset} Show active mode & list modes`);
2025
+ log(` ${C.green}mode <name>${C.reset} Switch to a work mode`);
1893
2026
  log(` ${C.green}list-packs${C.reset} List available skill packs`);
1894
2027
  log(` ${C.green}enable-pack${C.reset} <name> Install a skill pack`);
1895
2028
  log(` ${C.green}disable-pack${C.reset} <name> Uninstall a skill pack (backed up)`);
@@ -2354,6 +2487,32 @@ async function cmdInit(forceFlag = false) {
2354
2487
  } catch (_) { /* ignore */ }
2355
2488
  }
2356
2489
 
2490
+ // ── 3.6. Automation config migration ─────────────────────────────────────────
2491
+ try {
2492
+ const currentIdentity = JSON.parse(fs.readFileSync(identityPath, 'utf8'));
2493
+ if (!currentIdentity.automation) {
2494
+ currentIdentity.automation = {
2495
+ telegram: {
2496
+ enabled: true,
2497
+ chatId: "",
2498
+ topicId: "",
2499
+ triggers: { git_push: true, task_complete: false, deploy: true }
2500
+ },
2501
+ trello: {
2502
+ enabled: true,
2503
+ autoSync: true,
2504
+ triggers: { task_complete: true, milestone: true, blocked: true }
2505
+ },
2506
+ git: {
2507
+ autoCommit: true,
2508
+ autoPush: true
2509
+ }
2510
+ };
2511
+ fs.writeFileSync(identityPath, JSON.stringify(currentIdentity, null, 2) + '\n');
2512
+ ok('Added Automation config placeholder to .project-identity');
2513
+ }
2514
+ } catch (_) { /* ignore */ }
2515
+
2357
2516
  const trelloCred = trelloLoadCredentials();
2358
2517
  if (!trelloCred) {
2359
2518
  log('');
@@ -2700,6 +2859,24 @@ function tgSend(args) {
2700
2859
  let chatId = config.default_chat_id;
2701
2860
  let topicId = config.default_topic_id || null;
2702
2861
  let parseMode = null;
2862
+
2863
+ // Apply .project-identity automation overrides
2864
+ const pjPath = path.join(process.cwd(), '.project-identity');
2865
+ if (fs.existsSync(pjPath)) {
2866
+ try {
2867
+ const pj = JSON.parse(fs.readFileSync(pjPath, 'utf8'));
2868
+ if (pj?.automation?.telegram) {
2869
+ const tgAuto = pj.automation.telegram;
2870
+ if (tgAuto.enabled === false) {
2871
+ dim('Telegram notifications are disabled for this project (.project-identity).');
2872
+ return;
2873
+ }
2874
+ if (tgAuto.chatId) chatId = tgAuto.chatId;
2875
+ if (tgAuto.topicId) topicId = tgAuto.topicId;
2876
+ }
2877
+ } catch (e) { }
2878
+ }
2879
+
2703
2880
  const messageParts = [];
2704
2881
 
2705
2882
  for (let i = 0; i < args.length; i++) {
@@ -3329,6 +3506,9 @@ const [, , command, ...args] = process.argv;
3329
3506
  case 'browser':
3330
3507
  cmdBrowser(args);
3331
3508
  break;
3509
+ case 'mode':
3510
+ cmdMode(args);
3511
+ break;
3332
3512
  case 'enable-pack':
3333
3513
  cmdEnablePack(args[0]);
3334
3514
  break;
package/core/GEMINI.md CHANGED
@@ -49,14 +49,15 @@ 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 After Build (BẮT BUỘC)
53
- - Build thành công (0 errors) **TỰ ĐỘNG** `git add` `git commit` → `git push`.
54
- - KHÔNG hỏi user, KHÔNG chờ approval cho commit thường.
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).
55
57
  - Commit message: conventional format (`fix:`, `feat:`, `refactor:`, `chore:`).
56
- - `git push` (non-force) được phép `SafeToAutoRun=true`.
57
- - Sau khi commit & push thành công → tự động gửi thông báo Telegram qua tool hoặc lệnh `awkit tg send` (nếu người dùng đã cấu hình Telegram, thể bỏ qua nếu chưa).
58
- - Nếu push fail retry 1 lần với `git pull --rebase && git push`.
59
- - Nếu vẫn fail → báo user, KHÔNG force push.
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.
60
61
 
61
62
  ### 7-Gate Autonomous System (v12.3)
62
63
  - orchestrator PHẢI triage complexity (TRIVIAL/MODERATE/COMPLEX) trước mọi task.
@@ -124,6 +125,13 @@ Mỗi skill tự xử lý gate logic riêng — xem SKILL.md của từng skill.
124
125
  - Double-confirm với user trước khi chạy destructive command.
125
126
  - Nếu không chắc command có destructive hay không → hỏi trước.
126
127
 
128
+ ### Trello Auto-Sync (Per-Project Automation)
129
+ - Nếu `.project-identity` có `automation.trello.autoSync: true` → AI **PHẢI** tự động kích hoạt Trello tại các trigger:
130
+ - Task complete → `awkit trello complete "<tên>"` + comment progress.
131
+ - Milestone (gate transition, 40/60/80%) → `awkit trello comment`.
132
+ - Blocked → `awkit trello block`.
133
+ - Nếu `autoSync: false` hoặc không có config → chỉ sync khi user yêu cầu rõ ràng.
134
+
127
135
  ### 6 Decision Principles (Auto-decide)
128
136
  Khi AI cần tự quyết định mà không hỏi user:
129
137
  1. **Complete > Shortcuts** — Implement đủ, không bỏ edge cases.
@@ -0,0 +1,45 @@
1
+ {
2
+ "version": 1,
3
+ "modes": {
4
+ "mobile": {
5
+ "description": "Mobile app development (iOS, Android, Flutter)",
6
+ "packs": [
7
+ "mobile-ios",
8
+ "mobile-android",
9
+ "flutter"
10
+ ]
11
+ },
12
+ "ads": {
13
+ "description": "Monetization & ads optimization",
14
+ "packs": [
15
+ "ads-management"
16
+ ]
17
+ },
18
+ "marketing": {
19
+ "description": "ASO, UA, app marketing",
20
+ "packs": [
21
+ "marketing"
22
+ ]
23
+ },
24
+ "web": {
25
+ "description": "Web & desktop app development",
26
+ "packs": [
27
+ "electron"
28
+ ]
29
+ },
30
+ "game": {
31
+ "description": "Game & 3D development",
32
+ "packs": [
33
+ "cocos2d",
34
+ "threejs"
35
+ ]
36
+ },
37
+ "mod": {
38
+ "description": "Reverse engineering & modding",
39
+ "packs": [
40
+ "reverse-engineering"
41
+ ],
42
+ "hidden": true
43
+ }
44
+ }
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leejungkiin/awkit",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "description": "Antigravity Workflow Kit. Unified AI agent orchestration system.",
5
5
  "main": "bin/awk.js",
6
6
  "bin": {
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "cocos2d",
3
+ "auto_install": false,
4
+ "description": "Game development capabilities using Cocos2d-x",
5
+ "skills": [
6
+ "cocos2d-x"
7
+ ]
8
+ }
@@ -0,0 +1,8 @@
1
+ This skill is based on the official Cocos2d-x v4 documentation.
2
+
3
+ Official Documentation: https://docs.cocos.com/cocos2d-x/v4/manual/zh/
4
+
5
+ Cocos2d-x is licensed under the MIT License.
6
+
7
+ For complete license terms, please refer to:
8
+ https://github.com/cocos2d/cocos2d-x/blob/v4/LICENSE
@@ -0,0 +1,168 @@
1
+ ---
2
+ name: cocos2d-x
3
+ description: "Provides comprehensive guidance for Cocos2d-x v4 game engine including scene graph, nodes, sprites, actions, animations, physics, rendering, shaders, and platform deployment. Use when the user asks about Cocos2d-x, needs to create games, implement game features, set up development environments, or deploy games to multiple platforms."
4
+ license: Complete terms in LICENSE.txt
5
+ ---
6
+
7
+ ## When to use this skill
8
+
9
+ Use this skill whenever the user wants to:
10
+ - Create Cocos2d-x v4 games or applications
11
+ - Learn Cocos2d-x v4 core concepts (Node, Sprite, Scene, Action)
12
+ - Set up Cocos2d-x v4 development environment
13
+ - Work with sprites, textures, animations, and labels
14
+ - Implement scene management and node lifecycle
15
+ - Handle input events (touch, mouse, keyboard)
16
+ - Use physics engine (Box2D) and collision detection
17
+ - Implement rendering pipeline, shaders, and particle systems
18
+ - Build and deploy games for multiple platforms (Windows, macOS, Linux, Android, iOS)
19
+ - Use CMake build system and command-line tools
20
+ - Migrate from older Cocos2d-x versions
21
+ - Extend engine with custom rendering and script bindings
22
+
23
+ ## How to use this skill
24
+
25
+ To work with Cocos2d-x v4:
26
+
27
+ 1. **Identify the topic** from the user's request:
28
+ - Engine overview/了解引擎 → `examples/getting-started/about-engine.md`
29
+ - Quick start/快速上手 → `examples/getting-started/quick-start.md`
30
+ - Installation/安装配置 → `examples/getting-started/installation.md`
31
+ - Node and Scene/节点和场景 → `examples/core/node-scene.md`
32
+ - Sprite/精灵 → `examples/core/sprite.md`
33
+ - Texture/纹理 → `examples/core/texture.md`
34
+ - Animation/动画 → `examples/core/animation.md`
35
+ - Action/动作 → `examples/core/action.md`
36
+ - Label/标签 → `examples/core/label.md`
37
+ - Scene management/场景管理 → `examples/core/scene.md`
38
+ - Input handling/输入处理 → `examples/core/input.md`
39
+ - Event system/事件系统 → `examples/core/event.md`
40
+ - Physics/物理引擎 → `examples/advanced/physics.md`
41
+ - Rendering/渲染 → `examples/advanced/rendering.md`
42
+ - Shaders/着色器 → `examples/advanced/shader.md`
43
+ - Particle system/粒子系统 → `examples/advanced/particle.md`
44
+ - Build system/构建系统 → `examples/tools/build-system.md`
45
+ - Platform deployment/平台部署 → `examples/tools/deployment.md`
46
+
47
+ 2. **Load the appropriate example file** from the `examples/` directory:
48
+ - `examples/getting-started/about-engine.md` - Engine overview and features
49
+ - `examples/getting-started/quick-start.md` - Create first project
50
+ - `examples/getting-started/installation.md` - Environment setup
51
+ - `examples/core/node-scene.md` - Node and Scene concepts
52
+ - `examples/core/sprite.md` - Sprite creation and manipulation
53
+ - `examples/core/texture.md` - Texture loading and management
54
+ - `examples/core/animation.md` - Animation system
55
+ - `examples/core/action.md` - Action system and sequences
56
+ - `examples/core/label.md` - Label and text rendering
57
+ - `examples/core/scene.md` - Scene management and transitions
58
+ - `examples/core/input.md` - Touch, mouse, and keyboard input
59
+ - `examples/core/event.md` - Event system and listeners
60
+ - `examples/advanced/physics.md` - Physics engine integration
61
+ - `examples/advanced/rendering.md` - Rendering pipeline
62
+ - `examples/advanced/shader.md` - Custom shaders
63
+ - `examples/advanced/particle.md` - Particle effects
64
+ - `examples/tools/build-system.md` - CMake and build configuration
65
+ - `examples/tools/deployment.md` - Platform-specific deployment
66
+
67
+ 3. **Follow the specific instructions** in that example file for syntax, structure, and best practices
68
+
69
+ Each example file contains:
70
+ - **Instructions**: Overview and usage guidelines
71
+ - **Syntax**: API syntax and parameters
72
+ - **Examples**: Complete code examples with explanations
73
+ - **Reference**: Links to official documentation
74
+
75
+ 4. **Generate C++ code** following Cocos2d-x v4 conventions:
76
+ - Use `USING_NS_CC;` for namespace
77
+ - Use `CREATE_FUNC()` macro for create functions
78
+ - Follow Cocos2d-x naming conventions
79
+ - Include proper error handling
80
+ - Use smart pointers where appropriate
81
+
82
+ 5. **Reference the official documentation**:
83
+ - Official manual: https://docs.cocos.com/cocos2d-x/v4/manual/zh/
84
+ - API reference: Check `api/` directory for detailed API documentation
85
+ - Examples: Check `examples/` directory for code examples
86
+
87
+ 6. **Use templates** when creating new projects:
88
+ - `templates/project-structure.md` - Standard project structure
89
+ - `templates/cmake-config.md` - CMake configuration examples
90
+
91
+
92
+ ### Doc mapping (one-to-one with official documentation)
93
+
94
+ - See examples and API files → https://docs.cocos.com/cocos2d-x/v4/manual/zh/
95
+
96
+ ## Core Concepts
97
+
98
+ ### Node System
99
+ - **Node**: Base class for all display objects
100
+ - **Scene**: Root node of the scene graph
101
+ - **Sprite**: Image display node
102
+ - **Label**: Text display node
103
+ - **Node hierarchy**: Parent-child relationships
104
+
105
+ ### Coordinate System
106
+ - Origin at bottom-left (OpenGL style)
107
+ - Anchor point for positioning
108
+ - Local and world coordinates
109
+
110
+ ### Action System
111
+ - **Action**: Base class for node transformations
112
+ - **Sequence**: Chain multiple actions
113
+ - **Spawn**: Run actions simultaneously
114
+ - **Repeat**: Repeat actions multiple times
115
+ - **Ease**: Apply easing functions
116
+
117
+ ### Scene Management
118
+ - Scene transitions
119
+ - Scene lifecycle (onEnter, onExit)
120
+ - Director for scene management
121
+
122
+ ### Input Handling
123
+ - Touch events (single and multi-touch)
124
+ - Mouse events
125
+ - Keyboard events
126
+ - Event dispatcher system
127
+
128
+ ## Platform Support
129
+
130
+ Cocos2d-x v4 supports:
131
+ - **Desktop**: Windows, macOS, Linux
132
+ - **Mobile**: Android, iOS
133
+ - **Web**: (via Cocos Creator)
134
+
135
+ ## Build System
136
+
137
+ - **CMake**: Primary build system
138
+ - **Command-line tools**: `cocos` command
139
+ - **IDE support**: Visual Studio, Xcode, Android Studio
140
+
141
+ ## Migration Guide
142
+
143
+ For migrating from older versions:
144
+ - Check `examples/migration/` for migration guides
145
+ - API changes and compatibility notes
146
+ - CMake migration from older build systems
147
+
148
+ ## Reference Resources
149
+
150
+ - **Official Documentation**: https://docs.cocos.com/cocos2d-x/v4/manual/zh/
151
+ - **API Reference**: See `api/` directory
152
+ - **Examples**: See `examples/` directory
153
+ - **Templates**: See `templates/` directory
154
+
155
+ ## Keywords
156
+
157
+ cocos2d-x, cocos2d, game engine, game development, C++ game, 2D game, cross-platform game, sprite, scene, node, action, animation, physics, rendering, shader, particle system, CMake, game framework, 游戏引擎, 游戏开发, 精灵, 场景, 节点, 动作, 动画, 物理引擎, 渲染, 着色器, 粒子系统
158
+
159
+ ## Important Notes
160
+
161
+ 1. **Version**: This skill covers Cocos2d-x v4 specifically
162
+ 2. **Language**: C++ is the primary development language
163
+ 3. **Build System**: CMake is required for building projects
164
+ 4. **Platform**: Ensure platform-specific dependencies are installed
165
+ 5. **Examples**: All code examples use C++ syntax
166
+ 6. **Memory Management**: Cocos2d-x uses reference counting, be careful with retain/release cycles
167
+ 7. **Coordinate System**: Uses OpenGL-style coordinates (origin at bottom-left)
168
+ 8. **Thread Safety**: Most Cocos2d-x operations must be performed on the main thread