@leejungkiin/awkit 1.7.6 → 1.7.8
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 +213 -92
- package/bin/codex-generators.js +32 -3
- package/core/GEMINI.md +18 -5
- package/core/GEMINI.md.bak +20 -7
- package/core/skill-runtime-manifest.json +1 -0
- package/package.json +1 -1
- package/scripts/exec-progress.js +116 -0
- package/scripts/exec-rtk.js +105 -10
- package/skills/CATALOG.md +1 -1
- package/skills/awf-caveman/SKILL.md +13 -1
- package/skills/code-review/SKILL.md +40 -68
- package/skills/generate-gui-assets/SKILL.md +5 -5
- package/skills/hatch-pet/SKILL.md +2 -2
- package/skills/review/SKILL.md +40 -68
- 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/generate-gui-assets.md +111 -0
- package/workflows/_uncategorized/goal.md +86 -0
- package/workflows/_uncategorized/hatch-pet.md +116 -0
- package/workflows/_uncategorized/office-hours.md +38 -0
- package/workflows/_uncategorized/plan-ceo-review.md +34 -0
- package/workflows/_uncategorized/plan-design-review.md +38 -0
- package/workflows/_uncategorized/plan-eng-review.md +43 -0
- package/workflows/quality/plan-ceo-review.md +34 -0
- package/workflows/quality/plan-design-review.md +38 -0
- package/workflows/quality/plan-eng-review.md +43 -0
- package/workflows/roles/office-hours.md +38 -0
- package/workflows/ui/generate-gui-assets.md +111 -0
- package/workflows/ui/hatch-pet.md +116 -0
package/core/GEMINI.md.bak
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,12 +116,15 @@ 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)
|
|
119
124
|
- Chat: Tiếng Việt, tối đa 1-2 câu ngắn. Code/Docs: Tiếng Anh.
|
|
120
125
|
- CẤM giải thích dài, chào hỏi. Chỉ xuất KẾT QUẢ.
|
|
126
|
+
- Caveman chỉ nén prose chat. KHÔNG cắt/mất thông tin kỹ thuật: command output, error, stack trace, diff, JSON/API response, file path, line ref, test evidence.
|
|
127
|
+
- Khi relay output, giữ nguyên dòng quan trọng; chỉ tóm tắt phần nhiễu xung quanh.
|
|
121
128
|
- Planning artifacts (implementation_plan.md, walkthrough.md) VẪN chi tiết theo format chuẩn.
|
|
122
129
|
- Tài liệu thảo luận & brainstorm (Brief, Requirements, Brainstorm) PHẢI dùng tiếng Việt (hoặc ngôn ngữ giao tiếp của User), chỉ Code/Architecture mới bắt buộc dùng tiếng Anh.
|
|
123
130
|
|
|
@@ -145,6 +152,12 @@ symphony-orchestrator → awf-session-restore (gitnexus state) → nm-memory-syn
|
|
|
145
152
|
- Commit: CHỈ qua `awkit gate git auto`. CẤM `git commit` trực tiếp qua bash.
|
|
146
153
|
- Destructive command → double-confirm user. Không chắc → hỏi trước.
|
|
147
154
|
|
|
155
|
+
### GStack Planning & Code Safety
|
|
156
|
+
- **Office Hours & CEO Review**: Chạy `/office-hours` để thử nghiệm ý tưởng dưới góc nhìn startup/YC. Dùng `/plan-ceo-review` để đạt "trải nghiệm sản phẩm 10 sao" và quản lý phạm vi (scope).
|
|
157
|
+
- **Eng Review & Data Safety**: Chốt kiến trúc và thiết kế dữ liệu. Quét an toàn SQL, concurrency/races, và enum completeness trước khi code.
|
|
158
|
+
- **Pass 1 & Pass 2 Review**: Đánh giá code hai lượt (Pass 1: Critical - SQL/data safety, races, LLM boundary, shell injection, enum; Pass 2: Informational - logic/syntax).
|
|
159
|
+
- **Fix-First Heuristic**: Tự động sửa lỗi cơ học (dead code, N+1 queries, stale comments) và hỏi ý kiến user đối với các quyết định rủi ro/kiến trúc.
|
|
160
|
+
|
|
148
161
|
### Subagent Orchestration & Protocol
|
|
149
162
|
- **Định tuyến trước, Tìm kiếm sau:** Tuyệt đối không dùng `grep_search` hoặc `list_dir` diện rộng để định vị subagents (như `critic`). Bắt buộc tra cứu chỉ mục tại `skills/CATALOG.md`, `skills/TRIGGER_INDEX.md` hoặc `skills/review/SKILL.md` trước.
|
|
150
163
|
- **Tận dụng Subagents Cô lập:** Sử dụng built-in subagents (`research` cho tìm kiếm codebase/log thô, `browser` cho các tác vụ UI) để tránh ô nhiễm context trên luồng chat chính.
|
|
@@ -191,5 +204,5 @@ Complete>Shortcuts, Evidence>Assumptions, Standard>Custom, Explicit>Implicit, Te
|
|
|
191
204
|
- **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
205
|
- **Code intelligence:** `gitnexus-intelligence` (impact analysis, blast radius, safe refactoring)
|
|
193
206
|
- **Skill catalog:** xem `orchestrator/SKILL.md`
|
|
194
|
-
- **Workflows:** 75+ (/xxx). Core: /init /code /debug /recap /next /todo /gitnexus /teach
|
|
195
|
-
- **Shortcuts:** `/todo` `/done` `/next`
|
|
207
|
+
- **Workflows:** 75+ (/xxx). Core: /init /code /debug /recap /next /todo /gitnexus /teach /goal
|
|
208
|
+
- **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
|
+
});
|
package/scripts/exec-rtk.js
CHANGED
|
@@ -1,6 +1,83 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const os = require('os');
|
|
1
4
|
const { execSync } = require('child_process');
|
|
2
5
|
|
|
3
6
|
let hasRtkCache = null;
|
|
7
|
+
const HOME = os.homedir();
|
|
8
|
+
const CONFIG_DIR = path.join(HOME, '.gemini', 'antigravity');
|
|
9
|
+
const CONFIG_FILE = path.join(CONFIG_DIR, 'rtk.json');
|
|
10
|
+
const VALID_MODES = new Set(['off', 'proxy', 'safe', 'aggressive']);
|
|
11
|
+
const DEFAULT_MODE = 'safe';
|
|
12
|
+
|
|
13
|
+
function readJsonFile(file) {
|
|
14
|
+
try {
|
|
15
|
+
return JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
16
|
+
} catch (_) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function findProjectIdentity(startDir = process.cwd()) {
|
|
22
|
+
let dir = path.resolve(startDir);
|
|
23
|
+
const root = path.parse(dir).root;
|
|
24
|
+
|
|
25
|
+
while (dir !== root) {
|
|
26
|
+
const candidate = path.join(dir, '.project-identity');
|
|
27
|
+
if (fs.existsSync(candidate)) return readJsonFile(candidate);
|
|
28
|
+
dir = path.dirname(dir);
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function normalizeMode(mode) {
|
|
34
|
+
const normalized = String(mode || '').trim().toLowerCase();
|
|
35
|
+
return VALID_MODES.has(normalized) ? normalized : null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function getGlobalRtkConfig() {
|
|
39
|
+
return readJsonFile(CONFIG_FILE) || {};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function getProjectRtkMode(startDir = process.cwd()) {
|
|
43
|
+
const identity = findProjectIdentity(startDir);
|
|
44
|
+
const rtkConfig = identity && identity.automation && identity.automation.rtk;
|
|
45
|
+
if (!rtkConfig) return null;
|
|
46
|
+
if (rtkConfig.enabled === false) return 'off';
|
|
47
|
+
return normalizeMode(rtkConfig.mode);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function getRtkMode(startDir = process.cwd()) {
|
|
51
|
+
const envMode = normalizeMode(process.env.AWKIT_RTK_MODE || process.env.RTK_MODE);
|
|
52
|
+
if (envMode) return { mode: envMode, source: 'env' };
|
|
53
|
+
|
|
54
|
+
const globalConfig = getGlobalRtkConfig();
|
|
55
|
+
const globalMode = normalizeMode(globalConfig.mode);
|
|
56
|
+
if (globalMode) return { mode: globalMode, source: CONFIG_FILE };
|
|
57
|
+
|
|
58
|
+
const projectMode = getProjectRtkMode(startDir);
|
|
59
|
+
if (projectMode) return { mode: projectMode, source: '.project-identity' };
|
|
60
|
+
|
|
61
|
+
return { mode: DEFAULT_MODE, source: 'default' };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function setGlobalRtkMode(mode) {
|
|
65
|
+
const normalized = normalizeMode(mode);
|
|
66
|
+
if (!normalized) {
|
|
67
|
+
throw new Error(`Invalid RTK mode: ${mode}. Expected: ${Array.from(VALID_MODES).join(', ')}`);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
fs.mkdirSync(CONFIG_DIR, { recursive: true });
|
|
71
|
+
fs.writeFileSync(CONFIG_FILE, JSON.stringify({
|
|
72
|
+
mode: normalized,
|
|
73
|
+
updatedAt: new Date().toISOString()
|
|
74
|
+
}, null, 2) + '\n');
|
|
75
|
+
return CONFIG_FILE;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function startsWithAny(command, prefixes) {
|
|
79
|
+
return prefixes.some(prefix => command === prefix || command.startsWith(`${prefix} `));
|
|
80
|
+
}
|
|
4
81
|
|
|
5
82
|
/**
|
|
6
83
|
* Check if rtk binary is available in the current environment PATH.
|
|
@@ -26,12 +103,21 @@ function checkRtk() {
|
|
|
26
103
|
function execRtkSync(command, options = {}) {
|
|
27
104
|
const opts = { timeout: 30000, ...options };
|
|
28
105
|
const trimmed = command.trim();
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
106
|
+
const { mode } = getRtkMode();
|
|
107
|
+
|
|
108
|
+
const safeCommands = ['git status', 'git branch', 'git remote', 'git rev-parse', 'git log'];
|
|
109
|
+
const safePrefixes = ['git add', 'git commit', 'git push'];
|
|
110
|
+
const aggressivePrefixes = [
|
|
111
|
+
'git ', 'npm ', 'cargo ', 'yarn ', 'pnpm ', 'grep ', 'find ', 'awkit trello ',
|
|
112
|
+
'cat ', 'curl ', 'xcodebuild ', './gradlew ', 'swift ', 'flutter ', 'dart ', 'pod ', 'brew '
|
|
113
|
+
];
|
|
114
|
+
const safeEligible = startsWithAny(trimmed, safeCommands) || startsWithAny(trimmed, safePrefixes);
|
|
115
|
+
const aggressiveEligible = aggressivePrefixes.some(prefix => trimmed.startsWith(prefix));
|
|
116
|
+
const isEligible = mode === 'aggressive' ? aggressiveEligible : safeEligible;
|
|
117
|
+
|
|
118
|
+
if (mode === 'off') {
|
|
119
|
+
return execSync(command, opts);
|
|
120
|
+
}
|
|
35
121
|
|
|
36
122
|
if (!checkRtk()) {
|
|
37
123
|
if (isEligible && !opts.stdio) {
|
|
@@ -41,17 +127,26 @@ function execRtkSync(command, options = {}) {
|
|
|
41
127
|
}
|
|
42
128
|
|
|
43
129
|
if (trimmed.startsWith('rtk ')) {
|
|
44
|
-
return execSync(command,
|
|
130
|
+
return execSync(command, opts);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (mode === 'proxy' && aggressiveEligible) {
|
|
134
|
+
return execSync(`rtk proxy ${command}`, opts);
|
|
45
135
|
}
|
|
46
136
|
|
|
47
137
|
if (isEligible) {
|
|
48
|
-
return execSync(`rtk ${command}`,
|
|
138
|
+
return execSync(`rtk ${command}`, opts);
|
|
49
139
|
}
|
|
50
140
|
|
|
51
|
-
return execSync(command,
|
|
141
|
+
return execSync(command, opts);
|
|
52
142
|
}
|
|
53
143
|
|
|
54
144
|
module.exports = {
|
|
55
145
|
execRtkSync,
|
|
56
|
-
checkRtk
|
|
146
|
+
checkRtk,
|
|
147
|
+
getRtkMode,
|
|
148
|
+
getGlobalRtkConfig,
|
|
149
|
+
getRtkConfigPath: () => CONFIG_FILE,
|
|
150
|
+
setGlobalRtkMode,
|
|
151
|
+
VALID_RTK_MODES: Array.from(VALID_MODES)
|
|
57
152
|
};
|
package/skills/CATALOG.md
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
| 5 | `brainstorm-agent` | `manual` | `/brainstorm`, keywords | 5 | 1.0.0 | ✅ Active |
|
|
26
26
|
| 6 | `awf-error-translator` | `auto` | Error detected | 6 | — | ✅ Active |
|
|
27
27
|
| 7 | `awf-adaptive-language` | `auto` | Always | 7 | — | ✅ Active |
|
|
28
|
-
| 8 | `awf-caveman` | `auto` | `.project-identity` check | 7.5 | 1.0.
|
|
28
|
+
| 8 | `awf-caveman` | `auto` | `.project-identity` check | 7.5 | 1.0.1 | ✅ Active |
|
|
29
29
|
| 9 | `ios-engineer` | `manual` | iOS tasks | — | — | ✅ Active |
|
|
30
30
|
| 9 | `smali-to-kotlin` | `manual` | `/reverse-android` | 8 | — | ✅ Active |
|
|
31
31
|
| 10 | `smali-to-swift` | `manual` | `/reverse-ios` | 9 | — | ✅ Active |
|
|
@@ -4,7 +4,7 @@ description: >-
|
|
|
4
4
|
Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman.
|
|
5
5
|
Checks `.project-identity` for `communication.cavemanMode.enabled`.
|
|
6
6
|
Supports both Vietnamese and English.
|
|
7
|
-
version: 1.0.
|
|
7
|
+
version: 1.0.1
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# AWF Caveman Mode
|
|
@@ -28,6 +28,17 @@ if config?.communication?.cavemanMode?.enabled == true:
|
|
|
28
28
|
|
|
29
29
|
Áp dụng cho mọi phản hồi của AI (cả Tiếng Việt và Tiếng Anh). Mọi hàm lượng kỹ thuật phải giữ nguyên, CHỈ lược bỏ từ thừa.
|
|
30
30
|
|
|
31
|
+
### Scope Guard
|
|
32
|
+
|
|
33
|
+
Caveman chỉ được nén phần prose/chat. KHÔNG được cắt, viết tắt, tái diễn giải, hoặc gom nhóm các bằng chứng kỹ thuật cần độ chính xác cao:
|
|
34
|
+
- Command output quan trọng.
|
|
35
|
+
- Error message, stack trace, warning.
|
|
36
|
+
- Diff, patch, JSON/API response.
|
|
37
|
+
- File path, symbol name, line number.
|
|
38
|
+
- Test/build evidence.
|
|
39
|
+
|
|
40
|
+
Khi cần tiết kiệm token: tóm tắt phần nhiễu xung quanh, nhưng giữ nguyên các dòng kỹ thuật quyết định.
|
|
41
|
+
|
|
31
42
|
1. **BỎ TỪ ĐỆM**: Bỏ mọi từ thừa, từ lịch sự ("Vâng", "Dạ", "Chắc chắn rồi", "Theo tôi thấy thì...", "Tôi hiểu ý anh...").
|
|
32
43
|
2. **NÓI CỤT LỦN**: Đi thẳng vào vấn đề. Bắt đầu ngay bằng nguyên nhân lỗi hoặc hành động. Dùng câu mảnh (fragments).
|
|
33
44
|
3. **KHÔNG GIẢI THÍCH DÀI DÒNG**: Dùng mũi tên `->` để chỉ nguyên nhân/kết quả.
|
|
@@ -55,6 +66,7 @@ if config?.communication?.cavemanMode?.enabled == true:
|
|
|
55
66
|
Tạm thời ngưng Caveman (trở lại bình thường) khi:
|
|
56
67
|
- Cảnh báo bảo mật quan trọng (Security warnings).
|
|
57
68
|
- Hành động không thể hoàn tác (Xóa DB, git reset --hard).
|
|
69
|
+
- Command output/error/diff là bằng chứng chính của task.
|
|
58
70
|
- Các bước hướng dẫn quá phức tạp dễ gây hiểu nhầm nếu nói tắt.
|
|
59
71
|
- Chữa cháy / Giải thích lỗi quá lắt léo cần rõ nghĩa.
|
|
60
72
|
|
|
@@ -1,87 +1,59 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-review
|
|
3
|
-
description: Use when completing tasks, implementing features, or before merging. Dispatch structured code review with severity classification
|
|
3
|
+
description: Use when completing tasks, implementing features, or before merging. Dispatch structured code review with severity classification.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
# Smart Code Review
|
|
6
|
+
# Smart Code Review v2.0 (GStack-Powered)
|
|
9
7
|
|
|
10
8
|
## Overview
|
|
9
|
+
Perform structured code reviews on modified files (using git diff against origin/main or staged changes) to catch issues before they are committed or merged.
|
|
10
|
+
Antigravity uses the `codex` CLI (or active LLM runner) to perform deep, multi-file code reviews across specific safety and quality domains.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
Antigravity uses `codex` CLI to perform deep, multi-file code reviews across specific domains (Security, Localization, Compliance, Quality).
|
|
14
|
-
|
|
15
|
-
**Core principle:** Actionable, domain-specific feedback via Multi-Agent Flow.
|
|
16
|
-
|
|
17
|
-
## The Review Modules (Execution via Codex CLI)
|
|
12
|
+
## 📋 The Two-Pass Review Rubric
|
|
18
13
|
|
|
19
|
-
|
|
20
|
-
Dưới đây là 5 Module Review Tự Động. Antigravity tự động map intent của User để chọn Module phù hợp:
|
|
14
|
+
Reviews are divided into two distinct passes depending on severity:
|
|
21
15
|
|
|
22
|
-
### 1
|
|
23
|
-
**
|
|
16
|
+
### Pass 1 — CRITICAL (Highest Severity)
|
|
17
|
+
* **SQL & Data Safety:** String interpolation in SQL (require parameterized queries/prepared statements), TOCTOU race conditions (require atomic `WHERE` checks), and bypassing model validations for direct DB writes.
|
|
18
|
+
* **Race Conditions & Concurrency:** Read-check-write patterns without uniqueness constraints, find-or-create without unique DB indices, and status transitions that are not atomic.
|
|
19
|
+
* **LLM Output Trust Boundaries:** Ensure LLM-generated values are type/shape/format checked before saving to database, and external URLs generated by LLM are allowlisted.
|
|
20
|
+
* **Shell Injection:** Variable interpolation in shell execution commands (e.g. `subprocess` with `shell=True` or `exec`/`eval` without sandboxing). Use argument arrays instead.
|
|
21
|
+
* **Enum & Value Completeness:** When a new enum, status string, tier, or type constant is added, trace it through every switch, filter, or conditional block across the entire project. Ensure all consumers handle the new value.
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Trả về báo cáo phân loại Critical/High/Low." --approval-mode auto
|
|
33
|
-
```
|
|
23
|
+
### Pass 2 — INFORMATIONAL (Lower Severity)
|
|
24
|
+
* **Async/Sync Mixing:** Running synchronous calls (blocking calls, file I/O, sync requests) inside async event loops.
|
|
25
|
+
* **Column/Field Name Safety:** Verify ORM query columns match actual database schemas.
|
|
26
|
+
* **LLM Prompt Issues:** 0-indexed lists in prompts (LLMs expect 1-indexed) or listing tools/capabilities that don't match the wired array.
|
|
27
|
+
* **Completeness Gaps:** Shortcut implementations where complete versions are achievable within 30 minutes, or missing test paths (negative paths, edge cases).
|
|
28
|
+
* **Time Window Safety:** Date-key lookups assuming 24h coverage without timezone normalization.
|
|
29
|
+
* **Type Coercion:** Values crossing language/JSON boundaries where types change (e.g. numeric vs string).
|
|
34
30
|
|
|
35
|
-
|
|
36
|
-
**Dùng khi User yêu cầu:** *"review đa ngôn ngữ", "check hardcode string", "kiểm tra UI"*
|
|
31
|
+
---
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
codex -p "Thực hiện Localization Review. Quét các file UI (Views, Components):
|
|
40
|
-
1. Tìm tất cả các string hiển thị cho người dùng bị hardcode mà chưa bọc qua hàm dịch (i18n, LocalizedStringKey, R.string).
|
|
41
|
-
2. Đối chiếu xem các key được gọi trong UI đã tồn tại trong file từ điển (en/vi) chưa.
|
|
42
|
-
Liệt kê chi tiết tên file và số dòng vi phạm." --approval-mode auto
|
|
43
|
-
```
|
|
33
|
+
## ⚡ The Fix-First Heuristic
|
|
44
34
|
|
|
45
|
-
|
|
46
|
-
**Dùng khi User yêu cầu:** *"review appstore", "check compliance", "chuẩn bị submit"*
|
|
35
|
+
When reviewing, classify findings into AUTO-FIX (applied automatically without prompting) or ASK (require user confirmation):
|
|
47
36
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
37
|
+
| AUTO-FIX (Apply without asking) | ASK (Needs user confirmation) |
|
|
38
|
+
| :--- | :--- |
|
|
39
|
+
| Dead code & unused variables | Security issues (auth, XSS, injection) |
|
|
40
|
+
| Missing eager loading (N+1 queries) | Race conditions & concurrency |
|
|
41
|
+
| Stale comments contradicting code | Design decisions |
|
|
42
|
+
| Magic numbers → named constants | Large fixes (>20 lines of code) |
|
|
43
|
+
| Missing basic input/regex validation | Enum & value completeness changes |
|
|
44
|
+
| Version/dependency mismatches | Anything changing user-visible behavior |
|
|
55
45
|
|
|
56
|
-
|
|
57
|
-
**Dùng khi User yêu cầu:** *"review kiến trúc", "review logic", "code smell"*
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
codex -p "Thực hiện Architecture & Logic Review. Đánh giá:
|
|
61
|
-
1. Vi phạm nguyên tắc SOLID và Clean Architecture (VD: View xử lý Business Logic).
|
|
62
|
-
2. Code duplication (Lặp code) hoặc Hàm quá dài (>50 lines).
|
|
63
|
-
3. Thiếu Error Handling trong các async function / API calls.
|
|
64
|
-
4. Memory Leaks (Retain cycles, forgot to unsubscribe)." --approval-mode auto
|
|
65
|
-
```
|
|
46
|
+
---
|
|
66
47
|
|
|
67
|
-
|
|
68
|
-
|
|
48
|
+
## 🚫 Harmless Noise Suppressions (DO NOT flag)
|
|
49
|
+
* Harmless redundancies that aid readability (e.g., `present?` vs `length > 0`).
|
|
50
|
+
* Harmless no-ops (e.g., `.reject` on an element never present in the array).
|
|
51
|
+
* Requests to add comments explaining "why" a threshold was chosen.
|
|
52
|
+
* Suggestions to write tighter assertions in test cases that are already covering the behavior.
|
|
53
|
+
* Anything already addressed in the diff.
|
|
69
54
|
|
|
55
|
+
## 🛠️ Execution via Codex CLI
|
|
56
|
+
Invoke the review module using the non-interactive Codex CLI or active model runner:
|
|
70
57
|
```bash
|
|
71
|
-
codex -p "
|
|
58
|
+
codex -p "Perform a GStack-style pre-landing review. Highlight Pass 1 (Critical) and Pass 2 (Informational) issues, then apply the Fix-First heuristic." --approval-mode auto
|
|
72
59
|
```
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## Cách Xử Lý Output Từ Codex
|
|
77
|
-
1. Fix 🔴 **Critical** issues NGAY LẬP TỨC. (VD: Lộ Key, API chưa chặn rate limit).
|
|
78
|
-
2. Fix 🟡 **Important** issues trước khi kết thúc task hoặc chuyển sang Phase mới. (VD: Quên localize string).
|
|
79
|
-
3. Log 🟢 **Minor** issues để cấu trúc lại sau.
|
|
80
|
-
4. Proceed nếu Subagent Codex báo "LGTM" hoặc không có issue nào nghiêm trọng.
|
|
81
|
-
|
|
82
|
-
## Integration
|
|
83
|
-
|
|
84
|
-
**Used by:**
|
|
85
|
-
- `single-flow-task-execution` — Review sau mỗi task
|
|
86
|
-
- `symphony-enforcer` — Review trước khi `symphony_complete_task`
|
|
87
|
-
- Thay thế hoàn toàn quy trình thủ công của `/audit` workflow.
|
|
@@ -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
|
|