@leejungkiin/awkit 1.7.6 → 1.7.7
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/bin/awk.js +44 -23
- package/bin/codex-generators.js +32 -3
- package/core/GEMINI.md +10 -5
- package/core/GEMINI.md.bak +2 -2
- package/package.json +1 -1
- package/scripts/exec-progress.js +116 -0
- package/skills/generate-gui-assets/SKILL.md +5 -5
- package/skills/hatch-pet/SKILL.md +2 -2
- package/skills/threejs-animation/SKILL.md +86 -0
- package/skills/threejs-animation/examples/workflow-mixer-action.md +20 -0
- package/skills/threejs-animation/references/official-sections.md +19 -0
- package/skills/threejs-audio/SKILL.md +112 -0
- package/skills/threejs-audio/examples/workflow-positional-audio.md +15 -0
- package/skills/threejs-audio/references/official-sections.md +16 -0
- package/skills/threejs-camera/SKILL.md +96 -0
- package/skills/threejs-camera/examples/workflow-perspective-resize.md +13 -0
- package/skills/threejs-controls/SKILL.md +101 -0
- package/skills/threejs-controls/examples/workflow-orbit-damping.md +15 -0
- package/skills/threejs-dev-setup/SKILL.md +102 -0
- package/skills/threejs-dev-setup/examples/workflow-scaffold.md +24 -0
- package/skills/threejs-geometries/SKILL.md +108 -0
- package/skills/threejs-geometries/examples/workflow-extrude-shape.md +13 -0
- package/skills/threejs-helpers/SKILL.md +103 -0
- package/skills/threejs-helpers/examples/workflow-light-camera-helpers.md +13 -0
- package/skills/threejs-lights/SKILL.md +103 -0
- package/skills/threejs-lights/examples/workflow-directional-shadow.md +17 -0
- package/skills/threejs-loaders/SKILL.md +89 -0
- package/skills/threejs-loaders/examples/workflow-gltf-draco.md +22 -0
- package/skills/threejs-loaders/references/official-sections.md +27 -0
- package/skills/threejs-materials/SKILL.md +102 -0
- package/skills/threejs-materials/examples/workflow-pbr-transparent.md +15 -0
- package/skills/threejs-math/SKILL.md +102 -0
- package/skills/threejs-math/examples/workflow-ray-aabb.md +11 -0
- package/skills/threejs-node-tsl/SKILL.md +83 -0
- package/skills/threejs-node-tsl/examples/workflow-tsl-entry.md +13 -0
- package/skills/threejs-node-tsl/references/official-links.md +8 -0
- package/skills/threejs-node-tsl/references/tsl-vs-classic.md +23 -0
- package/skills/threejs-objects/SKILL.md +111 -0
- package/skills/threejs-objects/examples/workflow-raycaster-pick.md +17 -0
- package/skills/threejs-postprocessing/SKILL.md +116 -0
- package/skills/threejs-postprocessing/examples/workflow-composer-bloom.md +15 -0
- package/skills/threejs-renderers/SKILL.md +91 -0
- package/skills/threejs-renderers/examples/workflow-renderer-resize.md +21 -0
- package/skills/threejs-renderers/references/official-sections.md +14 -0
- package/skills/threejs-scenes/SKILL.md +90 -0
- package/skills/threejs-scenes/examples/workflow-fog-background.md +13 -0
- package/skills/threejs-textures/SKILL.md +83 -0
- package/skills/threejs-textures/examples/workflow-pmrem-env.md +19 -0
- package/skills/threejs-webxr/SKILL.md +104 -0
- package/skills/threejs-webxr/examples/workflow-xr-button.md +15 -0
- package/workflows/_uncategorized/goal.md +86 -0
- package/workflows/ui/generate-gui-assets.md +111 -0
- package/workflows/ui/hatch-pet.md +116 -0
package/bin/awk.js
CHANGED
|
@@ -67,16 +67,18 @@ const PLATFORMS = {
|
|
|
67
67
|
},
|
|
68
68
|
supportsCustomModes: false,
|
|
69
69
|
supportsSubagents: false,
|
|
70
|
+
isGlobal: true,
|
|
70
71
|
},
|
|
71
72
|
cline: {
|
|
72
73
|
name: 'Cline (VS Code)',
|
|
73
|
-
globalRoot:
|
|
74
|
+
globalRoot: path.join(HOME, '.cline'),
|
|
74
75
|
rulesFile: path.join(HOME, '.cline', 'rules', 'antigravity-rules.md'),
|
|
75
76
|
versionFile: path.join(HOME, '.cline', 'awk_version'),
|
|
76
77
|
dirs: {
|
|
77
|
-
workflows: '
|
|
78
|
-
skills: '
|
|
78
|
+
workflows: 'rules',
|
|
79
|
+
skills: 'rules',
|
|
79
80
|
},
|
|
81
|
+
isGlobal: true,
|
|
80
82
|
},
|
|
81
83
|
codex: {
|
|
82
84
|
name: 'Codex (OpenAI)',
|
|
@@ -87,15 +89,17 @@ const PLATFORMS = {
|
|
|
87
89
|
agents: 'agents',
|
|
88
90
|
skills: '../.agents/skills',
|
|
89
91
|
},
|
|
92
|
+
isGlobal: true,
|
|
90
93
|
},
|
|
91
94
|
claude: {
|
|
92
95
|
name: 'Claude Code',
|
|
93
|
-
globalRoot:
|
|
96
|
+
globalRoot: path.join(HOME, '.claude'),
|
|
94
97
|
rulesFile: 'CLAUDE.md',
|
|
95
|
-
versionFile: '
|
|
98
|
+
versionFile: 'awk_version',
|
|
96
99
|
dirs: {
|
|
97
|
-
skills: '
|
|
100
|
+
skills: 'skills',
|
|
98
101
|
},
|
|
102
|
+
isGlobal: true,
|
|
99
103
|
},
|
|
100
104
|
qwen: {
|
|
101
105
|
name: 'Qwen Code',
|
|
@@ -105,15 +109,17 @@ const PLATFORMS = {
|
|
|
105
109
|
dirs: {
|
|
106
110
|
skills: 'skills',
|
|
107
111
|
},
|
|
112
|
+
isGlobal: true,
|
|
108
113
|
},
|
|
109
114
|
cursor: {
|
|
110
115
|
name: 'Cursor AI',
|
|
111
|
-
globalRoot:
|
|
112
|
-
rulesFile: '.cursor
|
|
113
|
-
versionFile: '.cursor
|
|
116
|
+
globalRoot: path.join(HOME, '.cursor'),
|
|
117
|
+
rulesFile: path.join(HOME, '.cursor', 'rules', 'antigravity-rules.mdc'),
|
|
118
|
+
versionFile: path.join(HOME, '.cursor', 'awk_version'),
|
|
114
119
|
dirs: {
|
|
115
|
-
skills: '
|
|
120
|
+
skills: 'rules',
|
|
116
121
|
},
|
|
122
|
+
isGlobal: true,
|
|
117
123
|
}
|
|
118
124
|
};
|
|
119
125
|
|
|
@@ -538,8 +544,19 @@ function cmdInstall(args = []) {
|
|
|
538
544
|
const isUpdate = args.includes('--update');
|
|
539
545
|
let selectedPlatforms = [];
|
|
540
546
|
|
|
541
|
-
|
|
542
|
-
|
|
547
|
+
const hasAll = args.includes('--all') || args.includes('-a') || args.includes('all');
|
|
548
|
+
const hasLocal = args.includes('--local') || args.includes('-l') || args.includes('local');
|
|
549
|
+
|
|
550
|
+
if (hasAll) {
|
|
551
|
+
// Mặc định --all chỉ cài đặt các platform Global
|
|
552
|
+
selectedPlatforms = Object.keys(PLATFORMS).filter(p => PLATFORMS[p].isGlobal);
|
|
553
|
+
if (hasLocal) {
|
|
554
|
+
// Nếu có cả --local thì cài tất cả các platform
|
|
555
|
+
selectedPlatforms = Object.keys(PLATFORMS);
|
|
556
|
+
}
|
|
557
|
+
} else if (hasLocal) {
|
|
558
|
+
// Chỉ cài các platform Local
|
|
559
|
+
selectedPlatforms = Object.keys(PLATFORMS).filter(p => !PLATFORMS[p].isGlobal);
|
|
543
560
|
} else {
|
|
544
561
|
if (args.includes('--gemini') || args.includes('-g') || args.includes('antigravity')) selectedPlatforms.push('antigravity');
|
|
545
562
|
if (args.includes('--cline') || args.includes('cline')) selectedPlatforms.push('cline');
|
|
@@ -552,7 +569,7 @@ function cmdInstall(args = []) {
|
|
|
552
569
|
let legacyArg = null;
|
|
553
570
|
if (pIdx !== -1 && args[pIdx + 1]) {
|
|
554
571
|
legacyArg = args[pIdx + 1];
|
|
555
|
-
} else if (args.length > 0 && !args[0].startsWith('-') && args[0] !== 'all' && args[0] !== '--update') {
|
|
572
|
+
} else if (args.length > 0 && !args[0].startsWith('-') && args[0] !== 'all' && args[0] !== '--update' && args[0] !== 'local') {
|
|
556
573
|
legacyArg = args[0];
|
|
557
574
|
}
|
|
558
575
|
|
|
@@ -569,17 +586,17 @@ function cmdInstall(args = []) {
|
|
|
569
586
|
const defaultPlatform = getActivePlatform();
|
|
570
587
|
const defaultChoice = String(Math.max(platformOrder.indexOf(defaultPlatform), 0) + 1);
|
|
571
588
|
log(`${C.cyan}Select platforms to install (e.g., type "1,2", "all", or "1-6"):${C.reset}`);
|
|
572
|
-
log(` 1. Gemini Code Assist (antigravity)`);
|
|
573
|
-
log(` 2. Cline (VS Code)`);
|
|
574
|
-
log(` 3. Codex CLI (codex)`);
|
|
575
|
-
log(` 4. Claude Code (.claude/)`);
|
|
576
|
-
log(` 5. Qwen Code (~/.qwen/)`);
|
|
577
|
-
log(` 6. Cursor AI (.cursor/rules/)`);
|
|
578
|
-
log(` 7. All
|
|
589
|
+
log(` 1. Gemini Code Assist (antigravity) [Global]`);
|
|
590
|
+
log(` 2. Cline (VS Code) [Global]`);
|
|
591
|
+
log(` 3. Codex CLI (codex) [Global]`);
|
|
592
|
+
log(` 4. Claude Code (.claude/) [Global]`);
|
|
593
|
+
log(` 5. Qwen Code (~/.qwen/) [Global]`);
|
|
594
|
+
log(` 6. Cursor AI (.cursor/rules/) [Global]`);
|
|
595
|
+
log(` 7. All platforms (1-6)`);
|
|
579
596
|
log(`${C.gray}Press Enter to install only the active platform: ${PLATFORMS[defaultPlatform].name}.${C.reset}`);
|
|
580
597
|
const choice = promptChoice('Choice', defaultChoice).trim().toLowerCase();
|
|
581
598
|
|
|
582
|
-
if (choice === '7' || choice === 'all') {
|
|
599
|
+
if (choice === '7' || choice === 'all' || choice === '1-6') {
|
|
583
600
|
selectedPlatforms = Object.keys(PLATFORMS);
|
|
584
601
|
} else {
|
|
585
602
|
if (choice.includes('1')) selectedPlatforms.push('antigravity');
|
|
@@ -704,6 +721,8 @@ function cmdInstall(args = []) {
|
|
|
704
721
|
generateClineSkills(skillsSrc, skillsDest, coreSkills);
|
|
705
722
|
} else if (platform === 'codex') {
|
|
706
723
|
generateCodexSkills(skillsSrc, skillsDest, coreSkills);
|
|
724
|
+
const codexSkillsDest = path.join(target, 'skills');
|
|
725
|
+
generateCodexSkills(skillsSrc, codexSkillsDest, coreSkills);
|
|
707
726
|
const agentsDest = path.join(target, plat.dirs.agents);
|
|
708
727
|
generateCodexAgents(skillsSrc, agentsDest, coreSkills);
|
|
709
728
|
} else if (platform === 'claude') {
|
|
@@ -1067,7 +1086,8 @@ async function cmdDoctor() {
|
|
|
1067
1086
|
log('');
|
|
1068
1087
|
log(`${C.bold}Runtime Profile:${C.reset}`);
|
|
1069
1088
|
log(` Profile: ${C.cyan}${installState.profile}${C.reset}`);
|
|
1070
|
-
|
|
1089
|
+
const visiblePacks = (installState.enabledPacks || []).filter(p => p !== 'reverse-engineering');
|
|
1090
|
+
log(` Optional packs: ${visiblePacks.length ? visiblePacks.join(', ') : C.gray + 'none' + C.reset}`);
|
|
1071
1091
|
|
|
1072
1092
|
// Summary
|
|
1073
1093
|
log('');
|
|
@@ -1929,7 +1949,8 @@ function cmdStatus() {
|
|
|
1929
1949
|
}
|
|
1930
1950
|
|
|
1931
1951
|
log(` ${C.gray}Profile:${C.reset} ${installState.profile}`);
|
|
1932
|
-
|
|
1952
|
+
const visiblePacksStatus = (installState.enabledPacks || []).filter(p => p !== 'reverse-engineering');
|
|
1953
|
+
log(` ${C.gray}Optional packs:${C.reset} ${visiblePacksStatus.length ? visiblePacksStatus.join(', ') : 'none'}`);
|
|
1933
1954
|
|
|
1934
1955
|
log('');
|
|
1935
1956
|
|
package/bin/codex-generators.js
CHANGED
|
@@ -16,9 +16,36 @@ function generateCodexAgentsMd(sourcePath, destPath) {
|
|
|
16
16
|
console.log(`✅ Codex AGENTS.md generated at: ${destPath}`);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Recursively copies a skill directory preserving structure.
|
|
21
|
+
*/
|
|
22
|
+
function copySkillDir(src, dest) {
|
|
23
|
+
if (!fs.existsSync(src)) return 0;
|
|
24
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
25
|
+
|
|
26
|
+
let count = 0;
|
|
27
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
28
|
+
|
|
29
|
+
for (const entry of entries) {
|
|
30
|
+
if (entry.name === '.DS_Store') continue;
|
|
31
|
+
if (entry.name === '__pycache__') continue;
|
|
32
|
+
|
|
33
|
+
const srcPath = path.join(src, entry.name);
|
|
34
|
+
const destPath = path.join(dest, entry.name);
|
|
35
|
+
|
|
36
|
+
if (entry.isDirectory()) {
|
|
37
|
+
count += copySkillDir(srcPath, destPath);
|
|
38
|
+
} else {
|
|
39
|
+
fs.copyFileSync(srcPath, destPath);
|
|
40
|
+
count++;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return count;
|
|
44
|
+
}
|
|
45
|
+
|
|
19
46
|
/**
|
|
20
47
|
* Generates Codex skills directory structure.
|
|
21
|
-
* Copies
|
|
48
|
+
* Copies the entire skill directory and parses/injects frontmatter to SKILL.md.
|
|
22
49
|
*/
|
|
23
50
|
function generateCodexSkills(srcDir, destDir, selectedSkills = null) {
|
|
24
51
|
if (!fs.existsSync(srcDir)) return;
|
|
@@ -37,11 +64,13 @@ function generateCodexSkills(srcDir, destDir, selectedSkills = null) {
|
|
|
37
64
|
const skillFile = path.join(skillDir, 'SKILL.md');
|
|
38
65
|
if (fs.existsSync(skillFile)) {
|
|
39
66
|
const destSkillDir = path.join(destDir, skill);
|
|
40
|
-
|
|
67
|
+
|
|
68
|
+
// Copy the entire directory first
|
|
69
|
+
copySkillDir(skillDir, destSkillDir);
|
|
41
70
|
|
|
42
71
|
const destPath = path.join(destSkillDir, 'SKILL.md');
|
|
43
72
|
|
|
44
|
-
let content = fs.readFileSync(
|
|
73
|
+
let content = fs.readFileSync(destPath, 'utf8');
|
|
45
74
|
|
|
46
75
|
if (content.startsWith('---\n')) {
|
|
47
76
|
if (!content.match(/^name:/m)) {
|
package/core/GEMINI.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# GEMINI.md — Antigravity v12.6
|
|
2
2
|
|
|
3
|
-
> Rules only. Updated: 2026-06-
|
|
3
|
+
> Rules only. Updated: 2026-06-23
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -62,11 +62,12 @@ symphony-orchestrator → awf-session-restore (gitnexus state) → nm-memory-syn
|
|
|
62
62
|
- Build: CHỈ dùng `awkit build`. CẤM gọi native (`xcodebuild`, `./gradlew`, `npm run build`).
|
|
63
63
|
- `automation.build.enabled: false` → DỪNG, báo user. KHÔNG fallback native.
|
|
64
64
|
- Thêm params qua `--`: `awkit build -- -destination '...'`. Bypass wrapper = VI PHẠM.
|
|
65
|
+
- **Chạy tác vụ nền (Background Tasks)**: Khi chạy các tác vụ nền hoặc tác vụ dài (>30 giây) như Codex CLI, PHẢI chạy qua wrapper `node scripts/exec-progress.js "<command>"` để hiển thị checklist tiến trình trực quan cho người dùng thay vì để trống màn hình.
|
|
65
66
|
|
|
66
67
|
### 7-Gate System
|
|
67
68
|
- Triage: TRIVIAL (→ Gate 4 thẳng) | MODERATE (→ G3+4+5) | COMPLEX (→ all gates).
|
|
68
69
|
- Gates: G1 brainstorm → G1.5 module-spec (COMPLEX+>3mod) → G2 spec-gate → G2.5 visual (skip nếu backend) → G3 symphony-enforcer → G4 execution → G5 verification.
|
|
69
|
-
- **Goal Mode Override:** Khi đang ở goal mode (`/goal`, active Codex goal, hoặc user nói rõ "goal mode") → gates là checklist nội bộ, KHÔNG dừng chờ user approval ở G2/G2.5/G4 checkpoints. AI tự chọn best-effort, tự verify, ghi
|
|
70
|
+
- **Goal Mode Override (NO-CONFIRM):** Khi đang ở goal mode (`/goal`, active Codex goal, hoặc user nói rõ "goal mode") → gates là checklist nội bộ, KHÔNG dừng chờ user approval ở bất kỳ bước nào (G2/G2.5/G4 checkpoints, prompt audit, style preview, grid configuration, specs approval, v.v.). AI tự động chọn phương án tối ưu (best-effort/recommended default), tự verify, ghi nhận giả định (assumptions) vào logs/walkthrough, rồi tiếp tục cho đến khi goal hoàn thành hoặc bị block thực sự bởi lỗi kỹ thuật/permission. Chỉ dừng lại hỏi ý kiến khi gặp lệnh thực sự nguy hại (destructive) hoặc nhạy cảm bảo mật quy định tại Safety Guardrails.
|
|
70
71
|
- **Gate 4 Three-Phase:**
|
|
71
72
|
- Phase A 🏗️ Infrastructure → B 🎨 UI Shell (mock) → C ⚡ Logic (real data).
|
|
72
73
|
- COMPLEX+UI: 3 phases bắt buộc. MODERATE+UI: A+C gộp, B optional. TRIVIAL: bypass.
|
|
@@ -102,8 +103,11 @@ symphony-orchestrator → awf-session-restore (gitnexus state) → nm-memory-syn
|
|
|
102
103
|
- Sau khi dùng tool sửa code → KHÔNG in lại code trong chat. Tóm tắt bằng bullets.
|
|
103
104
|
- Code block trong chat: tối đa 10 dòng. Show diff → dùng `render_diffs()`.
|
|
104
105
|
|
|
105
|
-
### Image Generation
|
|
106
|
-
-
|
|
106
|
+
### Image Generation & Asset Mandates (BẮT BUỘC)
|
|
107
|
+
- **Cấm tự tạo SVG:** CẤM tự sinh, tự tạo hoặc thiết kế mã SVG cho các UI assets, biểu tượng trang trí, hoặc spritesheet (do chất lượng SVG tự tạo không đảm bảo và không bám sát thiết kế). BẮT BUỘC sử dụng Codex CLI để tạo hình ảnh và spritesheet UI.
|
|
108
|
+
- **Sử dụng Skill bắt buộc:** Tuyệt đối sử dụng các skill `generate-gui-assets` và `hatch-pet` theo tài liệu tương ứng tại `/Users/trungkientn/.agents/skills/generate-gui-assets/SKILL.md` và `/Users/trungkientn/.codex/skills/hatch-pet/SKILL.md`.
|
|
109
|
+
- **Thiết kế dùng Grid để tiết kiệm:** Bắt buộc thiết kế các assets (ngoại trừ background) bằng dạng Grid (spritesheet/atlas) để tối ưu chi phí và tài nguyên.
|
|
110
|
+
- **Quy trình Grid & Tự Động Phê Duyệt:** Luôn ưu tiên tạo và kiểm chứng (verify) theo hướng lưới `8x6` trước. Nếu chất lượng quá xấu, tự động giảm dần số lượng item/kích thước grid xuống các cấu hình nhỏ hơn (ví dụ: 8x5, 6x6, 6x5, v.v.) mà KHÔNG cần hỏi ý kiến hoặc bắt user xác nhận lại (kể cả trong Normal hay Goal Mode).
|
|
107
111
|
|
|
108
112
|
### Proactive UI Asset Generation (MANDATORY)
|
|
109
113
|
- **Asset Audit:** Trong Gate 2.5 (Visual Design) và Gate 4 Phase B (UI Shell), BẮT BUỘC rà soát mã nguồn/thiết kế để phát hiện các UI assets bị thiếu (nút bấm, panel, icon, pet, egg...).
|
|
@@ -112,7 +116,8 @@ symphony-orchestrator → awf-session-restore (gitnexus state) → nm-memory-syn
|
|
|
112
116
|
- **Cấu trúc Lệnh:**
|
|
113
117
|
- Đối với UI assets: `codex exec "Generate GUI asset: [Prompt/Style/Theme] and save it to [path] using the generate-gui-assets skill rules."`
|
|
114
118
|
- Đối với Pet/Egg assets: `codex exec "Generate pet companion asset: [Pet Type/State] and save it to [path] using the hatch-pet skill rules and grid configuration [grid]."`
|
|
115
|
-
- **Chi tiết & Approval:** Tự động thiết lập prompt chi tiết dựa trên Theme của App, tuân thủ tiêu chuẩn Solid Background và hỏi ý kiến user trước khi thực thi lệnh.
|
|
119
|
+
- **Chi tiết & Approval:** Tự động thiết lập prompt chi tiết dựa trên Theme của App, tuân thủ tiêu chuẩn Solid Background và hỏi ý kiến user trước khi thực thi lệnh (Trừ Goal Mode hoặc trường hợp tự động giảm cấu hình lưới grid: Tự động phê duyệt prompt/cấu hình và thực thi lệnh không cần hỏi).
|
|
120
|
+
|
|
116
121
|
|
|
117
122
|
|
|
118
123
|
### Communication (CAVEMAN ULTRA)
|
package/core/GEMINI.md.bak
CHANGED
|
@@ -191,5 +191,5 @@ Complete>Shortcuts, Evidence>Assumptions, Standard>Custom, Explicit>Implicit, Te
|
|
|
191
191
|
- **Gate skills:** `orchestrator` (triage) → `brainstorm-agent` (G1) → `module-spec-writer` (G1.5) → `spec-gate` (G2) → `visual-design-gate` (G2.5) → `symphony-enforcer` (G3) → `verification-gate` (G5)
|
|
192
192
|
- **Code intelligence:** `gitnexus-intelligence` (impact analysis, blast radius, safe refactoring)
|
|
193
193
|
- **Skill catalog:** xem `orchestrator/SKILL.md`
|
|
194
|
-
- **Workflows:** 75+ (/xxx). Core: /init /code /debug /recap /next /todo /gitnexus /teach
|
|
195
|
-
- **Shortcuts:** `/todo` `/done` `/next`
|
|
194
|
+
- **Workflows:** 75+ (/xxx). Core: /init /code /debug /recap /next /todo /gitnexus /teach /goal
|
|
195
|
+
- **Shortcuts:** `/todo` `/done` `/next` `/goal`
|
package/package.json
CHANGED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Progress Tracker Wrapper for Background Tasks
|
|
5
|
+
* Spawns a process, pipes logs to a temp file, and prints a dynamic step checklist
|
|
6
|
+
* to prevent the IDE from looking like it hung.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const { spawn } = require('child_process');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
const path = require('path');
|
|
12
|
+
|
|
13
|
+
const args = process.argv.slice(2);
|
|
14
|
+
if (args.length === 0) {
|
|
15
|
+
console.error('Usage: node scripts/exec-progress.js <command> [args...]');
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const command = args.join(' ');
|
|
20
|
+
|
|
21
|
+
const LOG_DIR = path.join(process.cwd(), 'tmp');
|
|
22
|
+
if (!fs.existsSync(LOG_DIR)) {
|
|
23
|
+
fs.mkdirSync(LOG_DIR, { recursive: true });
|
|
24
|
+
}
|
|
25
|
+
const logFile = path.join(LOG_DIR, 'background_process.log');
|
|
26
|
+
const logStream = fs.createWriteStream(logFile, { flags: 'w' });
|
|
27
|
+
|
|
28
|
+
console.log(`\n\x1b[36m\x1b[1m🚀 Running Process with Progress Tracker\x1b[0m`);
|
|
29
|
+
console.log(`\x1b[90mCommand: ${command}\x1b[0m`);
|
|
30
|
+
console.log(`\x1b[90mFull log redirected to: file://${logFile}\x1b[0m\n`);
|
|
31
|
+
|
|
32
|
+
const steps = [
|
|
33
|
+
{ name: 'Khởi tạo tiến trình (Initialization)', pattern: /init|start|launching/i, status: 'pending' },
|
|
34
|
+
{ name: 'Lập kế hoạch & Phân tích (Planning)', pattern: /plan|analyz/i, status: 'pending' },
|
|
35
|
+
{ name: 'Thực thi tác vụ chính (Execution)', pattern: /execut|generat|render|process/i, status: 'pending' },
|
|
36
|
+
{ name: 'Kiểm tra & Hoàn thiện (Verification)', pattern: /verify|check|done|finish/i, status: 'pending' }
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
let activeStepIndex = -1;
|
|
40
|
+
|
|
41
|
+
function renderChecklist() {
|
|
42
|
+
// Clear last lines using ANSI escape codes
|
|
43
|
+
process.stdout.write('\x1b[1F\x1b[2K'.repeat(steps.length + 1));
|
|
44
|
+
console.log(`\x1b[36m📊 Trạng thái tiến trình:\x1b[0m`);
|
|
45
|
+
steps.forEach((step, idx) => {
|
|
46
|
+
let icon = '⬜';
|
|
47
|
+
let color = '\x1b[0m';
|
|
48
|
+
if (step.status === 'done') {
|
|
49
|
+
icon = '✅';
|
|
50
|
+
color = '\x1b[32m';
|
|
51
|
+
} else if (step.status === 'running') {
|
|
52
|
+
icon = '🔄';
|
|
53
|
+
color = '\x1b[33m\x1b[1m';
|
|
54
|
+
}
|
|
55
|
+
console.log(` ${icon} ${color}${step.name}\x1b[0m`);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Print initial spacing for checklist
|
|
60
|
+
console.log('\n'.repeat(steps.length + 1));
|
|
61
|
+
renderChecklist();
|
|
62
|
+
|
|
63
|
+
// Spawn process via shell to support command strings with arguments/pipes
|
|
64
|
+
const proc = spawn(command, { shell: true });
|
|
65
|
+
|
|
66
|
+
proc.stdout.on('data', (data) => {
|
|
67
|
+
const text = data.toString();
|
|
68
|
+
logStream.write(text);
|
|
69
|
+
|
|
70
|
+
// Parse output to update steps
|
|
71
|
+
const lines = text.split('\n');
|
|
72
|
+
lines.forEach(line => {
|
|
73
|
+
if (!line.trim()) return;
|
|
74
|
+
|
|
75
|
+
// Scan for patterns to progress steps
|
|
76
|
+
steps.forEach((step, idx) => {
|
|
77
|
+
if (step.pattern.test(line)) {
|
|
78
|
+
if (step.status === 'pending') {
|
|
79
|
+
// Mark previous active step as done
|
|
80
|
+
if (activeStepIndex >= 0 && activeStepIndex < idx) {
|
|
81
|
+
steps[activeStepIndex].status = 'done';
|
|
82
|
+
}
|
|
83
|
+
step.status = 'running';
|
|
84
|
+
activeStepIndex = idx;
|
|
85
|
+
renderChecklist();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
proc.stderr.on('data', (data) => {
|
|
93
|
+
const text = data.toString();
|
|
94
|
+
logStream.write(text);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
proc.on('close', (code) => {
|
|
98
|
+
logStream.end();
|
|
99
|
+
if (activeStepIndex >= 0) {
|
|
100
|
+
steps[activeStepIndex].status = code === 0 ? 'done' : 'pending';
|
|
101
|
+
}
|
|
102
|
+
// If successful, mark all steps as done
|
|
103
|
+
if (code === 0) {
|
|
104
|
+
steps.forEach(s => s.status = 'done');
|
|
105
|
+
}
|
|
106
|
+
renderChecklist();
|
|
107
|
+
|
|
108
|
+
if (code === 0) {
|
|
109
|
+
console.log(`\n\x1b[32m\x1b[1m🎉 Hoàn thành tiến trình thành công!\x1b[0m\n`);
|
|
110
|
+
process.exit(0);
|
|
111
|
+
} else {
|
|
112
|
+
console.log(`\n\x1b[31m\x1b[1m❌ Tiến trình kết thúc với lỗi (Mã lỗi: ${code}).\x1b[0m`);
|
|
113
|
+
console.log(`\x1b[90mChi tiết lỗi xem tại file log trên.\x1b[0m\n`);
|
|
114
|
+
process.exit(code);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
@@ -65,7 +65,7 @@ After the canonical files and manifests exist, the app points at them, and verif
|
|
|
65
65
|
|
|
66
66
|
## Default Workflow
|
|
67
67
|
|
|
68
|
-
1. Build canvas grid options and ask for one-time confirmation before any generation.
|
|
68
|
+
1. Build canvas grid options and ask for one-time confirmation before any generation (Goal Mode: Auto-select recommended grid strategy, e.g. 8x6 for high throughput, and proceed).
|
|
69
69
|
|
|
70
70
|
Always present total icon capacity from larger to smaller. These are uniform canvas grids for deterministic slicing, not arbitrary pack boxes:
|
|
71
71
|
|
|
@@ -87,7 +87,7 @@ SKILL_DIR="${CODEX_HOME:-$HOME/.codex}/skills/generate-gui-assets"
|
|
|
87
87
|
python "$SKILL_DIR/scripts/suggest_grid_options.py" --icon-count 18 --strategy throughput
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
Do not generate preview or bulk until the user confirms one canvas grid strategy.
|
|
90
|
+
Do not generate preview or bulk until the user confirms one canvas grid strategy (Goal Mode: Auto-select recommended grid strategy and proceed).
|
|
91
91
|
|
|
92
92
|
Use this confirmation template exactly (largest to smallest, one-time confirm):
|
|
93
93
|
|
|
@@ -137,7 +137,7 @@ python "$SKILL_DIR/scripts/build_gui_contact_sheet.py" \
|
|
|
137
137
|
--run-dir assets/ui/generated/gui-v1-preview
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
5. Wait for explicit user confirmation. Do not run bulk generation before preview is approved.
|
|
140
|
+
5. Wait for explicit user confirmation. Do not run bulk generation before preview is approved (Goal Mode: Auto-approve preview and immediately launch bulk generation).
|
|
141
141
|
|
|
142
142
|
6. After approval, create the bulk run using locked style language:
|
|
143
143
|
|
|
@@ -265,8 +265,8 @@ Quality rules: no text, no labels, no scenery, no glow, no shadows outside silho
|
|
|
265
265
|
|
|
266
266
|
## Iteration Strategy
|
|
267
267
|
|
|
268
|
-
- Always run preview-first and require explicit user confirmation before bulk generation.
|
|
269
|
-
- Ask for grid confirmation exactly once per run before preview.
|
|
268
|
+
- Always run preview-first and require explicit user confirmation before bulk generation (Goal Mode: Bypass confirmation, auto-approve).
|
|
269
|
+
- Ask for grid confirmation exactly once per run before preview (Goal Mode: Bypass confirmation, auto-select recommended).
|
|
270
270
|
- Prefer larger total canvas grids first to reduce generation count, then step down only if preview quality is unacceptable.
|
|
271
271
|
- In throughput strategy, recommend `8x6` first for up to 48 icons per image.
|
|
272
272
|
- Treat `4x4` as a compact quality-priority option, not the default large-layout recommendation.
|
|
@@ -21,7 +21,7 @@ Before generating base art, row strips, or repair rows, load and follow the inst
|
|
|
21
21
|
${CODEX_HOME:-$HOME/.codex}/skills/.system/imagegen/SKILL.md
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Do not call the Image API directly for the normal path. Let `$imagegen` choose its own built-in-first path and its own CLI fallback rules. If `$imagegen` says a fallback requires confirmation, ask the user before continuing.
|
|
24
|
+
Do not call the Image API directly for the normal path. Let `$imagegen` choose its own built-in-first path and its own CLI fallback rules. If `$imagegen` says a fallback requires confirmation, ask the user before continuing (Goal Mode: Auto-approve fallback).
|
|
25
25
|
|
|
26
26
|
Fallback providers are opt-in only and require explicit user request plus both `OPENAI_API_KEY` and `OPENROUTER_API_KEY`.
|
|
27
27
|
Do not precheck, mention, or require provider API keys unless the user explicitly requests fallback.
|
|
@@ -273,7 +273,7 @@ selected_source=/absolute/path/to/$CODEX_HOME/generated_images/.../ig_*.png
|
|
|
273
273
|
qa_note=<one sentence>
|
|
274
274
|
```
|
|
275
275
|
|
|
276
|
-
No silent sequential fallback: if subagents cannot be used for row-strip visual generation, stop and ask for explicit user direction before continuing without them. Only an explicit user instruction such as "do not use subagents" or "run this sequentially" authorizes a normal sequential row-generation path. The final answer must report which row jobs were delegated to subagents and which, if any, were mirrored or repaired by the parent.
|
|
276
|
+
No silent sequential fallback: if subagents cannot be used for row-strip visual generation, stop and ask for explicit user direction before continuing without them (Goal Mode: Automatically fall back to sequential generation without asking). Only an explicit user instruction such as "do not use subagents" or "run this sequentially" authorizes a normal sequential row-generation path. The final answer must report which row jobs were delegated to subagents and which, if any, were mirrored or repaired by the parent.
|
|
277
277
|
|
|
278
278
|
## Repair Workflow
|
|
279
279
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: threejs-animation
|
|
3
|
+
description: "three.js keyframe animation system: AnimationMixer, AnimationClip, AnimationAction, KeyframeTrack variants, PropertyBinding, PropertyMixer, AnimationObjectGroup, AnimationUtils; mixing and crossfading clips, loop modes, timeScale, weight; addon AnimationClipCreator and CCDIKSolver for procedural rigs. Use when playing glTF clips, blending actions, or authoring procedural tracks; for skin deformation rigging on meshes see threejs-objects; for math interpolants without clips see threejs-math only when not tied to AnimationMixer."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## When to use this skill
|
|
7
|
+
|
|
8
|
+
**ALWAYS use this skill when the user mentions:**
|
|
9
|
+
|
|
10
|
+
- `AnimationMixer.update`, `AnimationAction` play/pause/stop, crossfade, synchronized clips
|
|
11
|
+
- `AnimationClip` from glTF or `AnimationClipCreator`, retargeting caveats at API level
|
|
12
|
+
- Keyframe tracks: position/rotation/scale/color tracks, boolean/string tracks where applicable
|
|
13
|
+
- IK: `CCDIKSolver` / `CCDIKHelper` from addons
|
|
14
|
+
|
|
15
|
+
**IMPORTANT: animation vs objects**
|
|
16
|
+
|
|
17
|
+
- **threejs-animation** = time evaluation and tracks.
|
|
18
|
+
- **threejs-objects** = `SkinnedMesh`/`Skeleton` attachment, bind pose—mesh side.
|
|
19
|
+
|
|
20
|
+
**Trigger phrases include:**
|
|
21
|
+
|
|
22
|
+
- "AnimationMixer", "AnimationAction", "AnimationClip", "crossFade", "KeyframeTrack"
|
|
23
|
+
- "动画混合", "骨骼动画", "剪辑", "淡入淡出"
|
|
24
|
+
|
|
25
|
+
## How to use this skill
|
|
26
|
+
|
|
27
|
+
1. **Collect clips** from `gltf.animations` or create with utilities / `AnimationClipCreator`.
|
|
28
|
+
2. **Create mixer** bound to root object (often `scene` or rig root).
|
|
29
|
+
3. **Create actions** per clip via `mixer.clipAction(clip)`; configure loop mode (`LoopOnce`, `LoopRepeat`, `LoopPingPong`).
|
|
30
|
+
4. **Per frame**: compute delta seconds (use `Clock` from core—documented under Core in docs index), call `mixer.update(delta)`.
|
|
31
|
+
5. **Blending**: adjust `weight`, `crossFadeTo`, `enabled` flags; watch for additive vs full replacement semantics per docs.
|
|
32
|
+
6. **PropertyBinding**: understand path strings targeting bones/morphs—errors often from wrong object names.
|
|
33
|
+
7. **IK addon**: attach solver after base animation if using CCD IK from examples.
|
|
34
|
+
|
|
35
|
+
See [examples/workflow-mixer-action.md](examples/workflow-mixer-action.md).
|
|
36
|
+
|
|
37
|
+
## Doc map (official)
|
|
38
|
+
|
|
39
|
+
| Docs section | Representative links |
|
|
40
|
+
|--------------|----------------------|
|
|
41
|
+
| Animation (index) | https://threejs.org/docs/#Animation |
|
|
42
|
+
| Action | https://threejs.org/docs/AnimationAction.html |
|
|
43
|
+
| Mixer | https://threejs.org/docs/AnimationMixer.html |
|
|
44
|
+
| Clip | https://threejs.org/docs/AnimationClip.html |
|
|
45
|
+
| Tracks | https://threejs.org/docs/KeyframeTrack.html |
|
|
46
|
+
|
|
47
|
+
More: [references/official-sections.md](references/official-sections.md).
|
|
48
|
+
|
|
49
|
+
## Scope
|
|
50
|
+
|
|
51
|
+
- **In scope:** Core Animation module, keyframe pipeline, listed addons for clip creation and IK.
|
|
52
|
+
- **Out of scope:** DCC export best practices; physics ragdoll; audio sync (link conceptually only).
|
|
53
|
+
|
|
54
|
+
## Common pitfalls and best practices
|
|
55
|
+
|
|
56
|
+
- Forgetting `mixer.update` freezes animation; double `update` per frame speeds up.
|
|
57
|
+
- Mixing clips with incompatible hierarchies causes violent pops—validate bind pose.
|
|
58
|
+
- Root motion must be handled in game logic if not baked—document explicitly.
|
|
59
|
+
- Large track counts cost CPU—strip unused tracks in preprocessing when possible.
|
|
60
|
+
|
|
61
|
+
## Documentation and version
|
|
62
|
+
|
|
63
|
+
Behavior of `AnimationMixer`, tracks, and glTF animation import can change between three.js majors. Treat the [Animation](https://threejs.org/docs/#Animation) section of the [docs index](https://threejs.org/docs/) as authoritative for the user’s installed version; when upgrading, check the three.js repository release notes and migration notes for renamed properties or loader output.
|
|
64
|
+
|
|
65
|
+
## Agent response checklist
|
|
66
|
+
|
|
67
|
+
When answering under this skill, prefer responses that:
|
|
68
|
+
|
|
69
|
+
1. Cite the exact class (`AnimationMixer`, `AnimationAction`, etc.) or addon (`CCDIKSolver`) from the official docs.
|
|
70
|
+
2. Include at least one `https://threejs.org/docs/...` link (e.g. [AnimationAction](https://threejs.org/docs/AnimationAction.html)).
|
|
71
|
+
3. Relate clips to `SkinnedMesh` / skeleton via **threejs-objects** when deformation is involved.
|
|
72
|
+
4. Mention `mixer.update(delta)` and a stable time source (`Clock`) explicitly.
|
|
73
|
+
5. Reference official **examples** by name only (no full file paste).
|
|
74
|
+
|
|
75
|
+
## References
|
|
76
|
+
|
|
77
|
+
- https://threejs.org/docs/#Animation
|
|
78
|
+
- https://threejs.org/docs/AnimationMixer.html
|
|
79
|
+
- https://threejs.org/docs/AnimationAction.html
|
|
80
|
+
- https://threejs.org/docs/PropertyBinding.html
|
|
81
|
+
|
|
82
|
+
## Keywords
|
|
83
|
+
|
|
84
|
+
**English:** animationmixer, animationaction, animationclip, keyframetrack, crossfade, skinning, propertybinding, three.js
|
|
85
|
+
|
|
86
|
+
**中文:** 动画混合、AnimationMixer、AnimationAction、关键帧、骨骼动画、剪辑、淡入淡出、three.js
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Workflow: play one glTF clip
|
|
2
|
+
|
|
3
|
+
## Steps
|
|
4
|
+
|
|
5
|
+
1. After **threejs-loaders** provides `gltf` with `animations` array non-empty.
|
|
6
|
+
|
|
7
|
+
2. `const mixer = new THREE.AnimationMixer(gltf.scene);`
|
|
8
|
+
|
|
9
|
+
3. `const clip = gltf.animations[0]; const action = mixer.clipAction(clip); action.play();`
|
|
10
|
+
|
|
11
|
+
4. In the render loop: `const delta = clock.getDelta(); mixer.update(delta);` then render (**threejs-renderers**).
|
|
12
|
+
|
|
13
|
+
5. To switch clips, prepare second `clipAction`, then `action.crossFadeTo(nextAction, duration, false)` per docs.
|
|
14
|
+
|
|
15
|
+
6. Dispose mixer when discarding the rig if your app hot-swaps characters.
|
|
16
|
+
|
|
17
|
+
## Anchor
|
|
18
|
+
|
|
19
|
+
- https://threejs.org/docs/AnimationMixer.html
|
|
20
|
+
- https://threejs.org/docs/AnimationAction.html
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Animation module (core)
|
|
2
|
+
|
|
3
|
+
- https://threejs.org/docs/AnimationAction.html
|
|
4
|
+
- https://threejs.org/docs/AnimationClip.html
|
|
5
|
+
- https://threejs.org/docs/AnimationMixer.html
|
|
6
|
+
- https://threejs.org/docs/AnimationObjectGroup.html
|
|
7
|
+
- https://threejs.org/docs/AnimationUtils.html
|
|
8
|
+
- https://threejs.org/docs/KeyframeTrack.html
|
|
9
|
+
- https://threejs.org/docs/VectorKeyframeTrack.html
|
|
10
|
+
- https://threejs.org/docs/QuaternionKeyframeTrack.html
|
|
11
|
+
- https://threejs.org/docs/PropertyBinding.html
|
|
12
|
+
- https://threejs.org/docs/PropertyMixer.html
|
|
13
|
+
|
|
14
|
+
**Addons**
|
|
15
|
+
|
|
16
|
+
- https://threejs.org/docs/AnimationClipCreator.html
|
|
17
|
+
- https://threejs.org/docs/CCDIKSolver.html
|
|
18
|
+
|
|
19
|
+
See https://threejs.org/docs/#Animation
|