@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
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: threejs-textures
|
|
3
|
+
description: "three.js textures: Texture, DataTexture, CubeTexture, CompressedTexture variants, DepthTexture, VideoTexture, CanvasTexture, 3D/array textures, Source; sampling parameters, mipmaps, anisotropy, wrap/mag/min filters; PMREMGenerator in Extras for environment map prefiltering. Use when configuring GPU texture objects and PMREM; for Draco/KTX2 transcoder file paths use threejs-loaders; for material map slots use threejs-materials; for output color pipeline use threejs-renderers."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## When to use this skill
|
|
7
|
+
|
|
8
|
+
**ALWAYS use this skill when the user mentions:**
|
|
9
|
+
|
|
10
|
+
- `texture.wrapS` / `wrapT`, `minFilter`, `magFilter`, `generateMipmaps`, `anisotropy`
|
|
11
|
+
- `colorSpace` / correct handling of sRGB vs linear data maps
|
|
12
|
+
- Creating `DataTexture`, `CubeTexture`, compressed GPU formats, video/canvas driven textures
|
|
13
|
+
- `PMREMGenerator` from environment maps for IBL
|
|
14
|
+
|
|
15
|
+
**IMPORTANT: textures vs loaders**
|
|
16
|
+
|
|
17
|
+
| Step | Skill |
|
|
18
|
+
|------|--------|
|
|
19
|
+
| Decode file / HTTP | **threejs-loaders** |
|
|
20
|
+
| Configure GPU `Texture` | **threejs-textures** |
|
|
21
|
+
|
|
22
|
+
**Trigger phrases include:**
|
|
23
|
+
|
|
24
|
+
- "Texture", "CubeTexture", "PMREM", "colorSpace", "mipmap", "各向异性"
|
|
25
|
+
- "环境贴图", "数据纹理", "压缩纹理"
|
|
26
|
+
|
|
27
|
+
## How to use this skill
|
|
28
|
+
|
|
29
|
+
1. **Classify** texture dimensionality and format (2D, cube, depth, compressed, data).
|
|
30
|
+
2. **Color pipeline**: set `colorSpace` appropriately; normal/roughness maps are non-color data.
|
|
31
|
+
3. **Sampling**: choose filters; enable mipmaps when minification occurs; consider max anisotropy.
|
|
32
|
+
4. **PMREM**: feed env map through `PMREMGenerator` per docs; assign result to scene/env/intensity paths as required.
|
|
33
|
+
5. **Video/canvas**: understand update needs each frame for `VideoTexture` / `CanvasTexture`.
|
|
34
|
+
6. **Disposal**: `dispose()` textures when replacing to free GPU memory.
|
|
35
|
+
7. **KTX2/Basis**: transcoder wiring belongs in **threejs-loaders** before this step.
|
|
36
|
+
|
|
37
|
+
See [examples/workflow-pmrem-env.md](examples/workflow-pmrem-env.md).
|
|
38
|
+
|
|
39
|
+
## Doc map (official)
|
|
40
|
+
|
|
41
|
+
| Docs section | Representative links |
|
|
42
|
+
|--------------|----------------------|
|
|
43
|
+
| Textures | https://threejs.org/docs/Texture.html |
|
|
44
|
+
| Cube | https://threejs.org/docs/CubeTexture.html |
|
|
45
|
+
| Data | https://threejs.org/docs/DataTexture.html |
|
|
46
|
+
| PMREM | https://threejs.org/docs/PMREMGenerator.html |
|
|
47
|
+
|
|
48
|
+
## Scope
|
|
49
|
+
|
|
50
|
+
- **In scope:** Core Textures + PMREMGenerator; sampling and color pipeline at texture level.
|
|
51
|
+
- **Out of scope:** Loader configuration; post-processing passes that sample buffers (threejs-postprocessing).
|
|
52
|
+
|
|
53
|
+
## Common pitfalls and best practices
|
|
54
|
+
|
|
55
|
+
- sRGB albedo in linear workflow without proper colorSpace looks wrong next to renderer output.
|
|
56
|
+
- Non-power-of-two textures have mip/wrap limitations unless padded.
|
|
57
|
+
- Forgetting texture disposal on hot reload leaks VRAM.
|
|
58
|
+
|
|
59
|
+
## Documentation and version
|
|
60
|
+
|
|
61
|
+
Texture classes and `PMREMGenerator` are documented under [Textures](https://threejs.org/docs/#Textures) and [PMREMGenerator](https://threejs.org/docs/PMREMGenerator.html) in [three.js docs](https://threejs.org/docs/). Compressed and KTX2 paths often depend on **threejs-loaders** for transcoder setup before this skill applies.
|
|
62
|
+
|
|
63
|
+
## Agent response checklist
|
|
64
|
+
|
|
65
|
+
When answering under this skill, prefer responses that:
|
|
66
|
+
|
|
67
|
+
1. Link `Texture`, `DataTexture`, `CubeTexture`, or `PMREMGenerator` as appropriate.
|
|
68
|
+
2. Tie `colorSpace` / filtering to **threejs-renderers** output and **threejs-materials** maps.
|
|
69
|
+
3. Send Draco/KTX2 **decoder wiring** questions to **threejs-loaders** first.
|
|
70
|
+
4. Emphasize `dispose()` when replacing env maps or large atlases.
|
|
71
|
+
5. Mention [Global](https://threejs.org/docs/#Global) constants only when wrapping/filter enums matter.
|
|
72
|
+
|
|
73
|
+
## References
|
|
74
|
+
|
|
75
|
+
- https://threejs.org/docs/#Textures
|
|
76
|
+
- https://threejs.org/docs/Texture.html
|
|
77
|
+
- https://threejs.org/docs/PMREMGenerator.html
|
|
78
|
+
|
|
79
|
+
## Keywords
|
|
80
|
+
|
|
81
|
+
**English:** texture, cubemap, pmrem, mipmap, colorspace, compressed texture, data texture, three.js
|
|
82
|
+
|
|
83
|
+
**中文:** 纹理、立方体贴图、PMREM、mipmap、色彩空间、压缩纹理、three.js
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Workflow: PMREM from an equirectangular texture
|
|
2
|
+
|
|
3
|
+
## Preconditions
|
|
4
|
+
|
|
5
|
+
- An equirectangular HDR or suitable env image is already a `Texture` (often via **threejs-loaders**).
|
|
6
|
+
|
|
7
|
+
## Steps
|
|
8
|
+
|
|
9
|
+
1. Create `PMREMGenerator(renderer)`.
|
|
10
|
+
|
|
11
|
+
2. `const envMap = pmremGenerator.fromEquirectangular(equirectTexture).texture;`
|
|
12
|
+
|
|
13
|
+
3. Assign to scene or materials per your lighting model; intensity via renderer or material properties (**threejs-materials**).
|
|
14
|
+
|
|
15
|
+
4. `pmremGenerator.dispose()` when done generating; dispose intermediate textures per docs.
|
|
16
|
+
|
|
17
|
+
5. Dispose `equirectTexture` if no longer needed.
|
|
18
|
+
|
|
19
|
+
Cross-check current [PMREMGenerator](https://threejs.org/docs/PMREMGenerator.html) for API variants (`fromScene`, etc.).
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: threejs-webxr
|
|
3
|
+
description: "WebXR integration for three.js: WebXRManager and XRManager on the renderer, session initialization patterns, VRButton and ARButton helpers, XRControllerModelFactory and hand model families, XREstimatedLight, XRPlanes, and related addon Webxr utilities. Use for immersive sessions and controller/hand tracking—not for standard desktop camera projection (threejs-camera) or composer post effects (threejs-postprocessing)."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## When to use this skill
|
|
7
|
+
|
|
8
|
+
**ALWAYS use this skill when the user mentions:**
|
|
9
|
+
|
|
10
|
+
- Entering VR/AR, `navigator.xr`, reference spaces, session `requestAnimationFrame` loop via renderer
|
|
11
|
+
- `VRButton`, `ARButton`, `XRButton` creation patterns from examples
|
|
12
|
+
- Controller models, hand tracking meshes, estimated real-world lighting probes
|
|
13
|
+
|
|
14
|
+
**IMPORTANT: webxr vs renderers vs camera**
|
|
15
|
+
|
|
16
|
+
| Topic | Skill |
|
|
17
|
+
|-------|--------|
|
|
18
|
+
| Enable XR on renderer, sizing | **threejs-renderers** (basics) + **threejs-webxr** (session) |
|
|
19
|
+
| Desktop projection | **threejs-camera** |
|
|
20
|
+
|
|
21
|
+
**Trigger phrases include:**
|
|
22
|
+
|
|
23
|
+
- "WebXR", "VRButton", "ARButton", "XRControllerModelFactory", "hand tracking"
|
|
24
|
+
- "虚拟现实", "增强现实", "沉浸式"
|
|
25
|
+
|
|
26
|
+
## How to use this skill
|
|
27
|
+
|
|
28
|
+
1. **HTTPS** requirement and feature detection for XR availability.
|
|
29
|
+
2. **Buttons**: use official button factories to create DOM entry points; handle session end.
|
|
30
|
+
3. **Renderer**: call `renderer.xr.enabled = true` patterns per docs; prefer `setAnimationLoop` for XR loops.
|
|
31
|
+
4. **Controllers**: attach models via factories; read gamepad axes/buttons carefully with fallbacks.
|
|
32
|
+
5. **Hands**: opt-in hand models when runtime supports; performance implications.
|
|
33
|
+
6. **Lighting**: `XREstimatedLight` for AR realism—combine with **threejs-lights** cautiously.
|
|
34
|
+
7. **Exit**: restore non-XR render loop and resize handling on session end.
|
|
35
|
+
|
|
36
|
+
### Example: VR session with error handling
|
|
37
|
+
|
|
38
|
+
```javascript
|
|
39
|
+
import { VRButton } from 'three/addons/webxr/VRButton.js';
|
|
40
|
+
|
|
41
|
+
// Feature detection and session start
|
|
42
|
+
if ('xr' in navigator) {
|
|
43
|
+
renderer.xr.enabled = true;
|
|
44
|
+
document.body.appendChild(VRButton.createButton(renderer));
|
|
45
|
+
|
|
46
|
+
renderer.xr.addEventListener('sessionstart', () => {
|
|
47
|
+
console.log('XR session started');
|
|
48
|
+
});
|
|
49
|
+
renderer.xr.addEventListener('sessionend', () => {
|
|
50
|
+
console.log('XR session ended — restoring desktop view');
|
|
51
|
+
});
|
|
52
|
+
} else {
|
|
53
|
+
console.warn('WebXR not supported in this browser');
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
See [examples/workflow-xr-button.md](examples/workflow-xr-button.md).
|
|
58
|
+
|
|
59
|
+
## Doc map (official)
|
|
60
|
+
|
|
61
|
+
| Docs section | Representative links |
|
|
62
|
+
|--------------|----------------------|
|
|
63
|
+
| Renderer XR | https://threejs.org/docs/WebXRManager.html |
|
|
64
|
+
| Webxr addons | https://threejs.org/docs/VRButton.html |
|
|
65
|
+
| Webxr addons | https://threejs.org/docs/ARButton.html |
|
|
66
|
+
| Webxr addons | https://threejs.org/docs/XRControllerModelFactory.html |
|
|
67
|
+
|
|
68
|
+
## Scope
|
|
69
|
+
|
|
70
|
+
- **In scope:** Documented WebXR manager + listed addons for buttons/controllers/hands/planes.
|
|
71
|
+
- **Out of scope:** Store submission, OpenXR runtime specifics, custom native layers.
|
|
72
|
+
|
|
73
|
+
## Common pitfalls and best practices
|
|
74
|
+
|
|
75
|
+
- Desktop testing requires XR emulation or hardware; fail gracefully.
|
|
76
|
+
- Mismatched reference space causes floor offset—validate stage vs local-floor.
|
|
77
|
+
- Heavy post chains may not meet VR frame time—profile aggressively.
|
|
78
|
+
|
|
79
|
+
## Documentation and version
|
|
80
|
+
|
|
81
|
+
WebXR entry points span **Addons → Webxr** and renderer [`WebXRManager`](https://threejs.org/docs/WebXRManager.html) in [three.js docs](https://threejs.org/docs/). Browser and device capabilities vary—answers should cite the official example name and three.js version when possible.
|
|
82
|
+
|
|
83
|
+
## Agent response checklist
|
|
84
|
+
|
|
85
|
+
When answering under this skill, prefer responses that:
|
|
86
|
+
|
|
87
|
+
1. Link `WebXRManager`, `VRButton`, `ARButton`, or controller factories as relevant.
|
|
88
|
+
2. Use `setAnimationLoop` patterns with **threejs-renderers** for XR render loops.
|
|
89
|
+
3. Avoid duplicating desktop **threejs-camera** projection advice for XR eyes.
|
|
90
|
+
4. Mention reference space choice (local-floor, etc.) at a high level with docs link.
|
|
91
|
+
5. Flag performance interaction with **threejs-postprocessing** in VR.
|
|
92
|
+
|
|
93
|
+
## References
|
|
94
|
+
|
|
95
|
+
- https://threejs.org/docs/WebXRManager.html
|
|
96
|
+
- https://threejs.org/docs/VRButton.html
|
|
97
|
+
- https://threejs.org/docs/ARButton.html
|
|
98
|
+
- https://threejs.org/docs/XRControllerModelFactory.html
|
|
99
|
+
|
|
100
|
+
## Keywords
|
|
101
|
+
|
|
102
|
+
**English:** webxr, vr, ar, xr session, controller, hand tracking, three.js
|
|
103
|
+
|
|
104
|
+
**中文:** WebXR、VR、AR、VRButton、手柄、手部追踪、沉浸式、three.js
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Workflow: VR entry button
|
|
2
|
+
|
|
3
|
+
## Steps
|
|
4
|
+
|
|
5
|
+
1. Ensure site served over HTTPS and `navigator.xr` checked.
|
|
6
|
+
|
|
7
|
+
2. `document.body.appendChild(VRButton.createButton(renderer));` per [VRButton](https://threejs.org/docs/VRButton.html) for your three version.
|
|
8
|
+
|
|
9
|
+
3. `renderer.xr.enabled = true;` Use `renderer.setAnimationLoop` callback for render + updates.
|
|
10
|
+
|
|
11
|
+
4. Handle session end to restore window `resize` behavior if needed.
|
|
12
|
+
|
|
13
|
+
5. For AR passthrough use `ARButton` instead—see **threejs-webxr** doc map.
|
|
14
|
+
|
|
15
|
+
Always verify against the official example that matches your three.js revision.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 🎯 Codex Goal Conductor — Pursue high-level goals autonomously using Codex coordination
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /goal — Codex Goal Mode Workflow
|
|
6
|
+
|
|
7
|
+
> Launch Codex in Goal Mode to orchestrate multi-agent task execution and pursue complex goals.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 🛠️ Step-by-Step Execution
|
|
12
|
+
|
|
13
|
+
### 1. Prerequisites Check
|
|
14
|
+
Ensure Codex CLI is installed on the system:
|
|
15
|
+
```bash
|
|
16
|
+
which codex || echo "NOT_INSTALLED"
|
|
17
|
+
```
|
|
18
|
+
If missing, suggest the user install it:
|
|
19
|
+
```bash
|
|
20
|
+
npm i -g @openai/codex
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 2. Launching the Goal
|
|
24
|
+
Initiate the goal execution loop:
|
|
25
|
+
```bash
|
|
26
|
+
awkit goal "Build a simple greeting command line tool"
|
|
27
|
+
```
|
|
28
|
+
Or execute through a specific pipeline command:
|
|
29
|
+
```bash
|
|
30
|
+
awkit pipeline goal "FeatureName"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 3. Loop Execution Flow
|
|
34
|
+
1. **Initialize State:** Create directory `codex-reports/goals/<goal_id>/` and output the planned task list.
|
|
35
|
+
2. **Set Goal Mode:** Set `goal_mode = true` globally so that checkpoints automatically verify and bypass user blocks.
|
|
36
|
+
3. **Task Orchestration:** The loop script (`scripts/codex-goal.js`) executes tasks sequentially:
|
|
37
|
+
- Partition goal → Delegate plan/design to Claude.
|
|
38
|
+
- Implement code → Delegate implementation to Qwen.
|
|
39
|
+
- Verification → Run Codex sub-agents (`critic` or `tester`).
|
|
40
|
+
4. **State Persistence:** Save logs and state changes at the end of each step.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 🔔 Sub-commands
|
|
45
|
+
|
|
46
|
+
### `/goal:status`
|
|
47
|
+
Check the status of the currently active goal and print active task reports:
|
|
48
|
+
```bash
|
|
49
|
+
node scripts/codex-goal.js --status
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### `/goal:pause`
|
|
53
|
+
Pause the active goal execution loop and save the current state:
|
|
54
|
+
```bash
|
|
55
|
+
node scripts/codex-goal.js --pause
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### `/goal:resume`
|
|
59
|
+
Resume the most recently paused or saved goal session:
|
|
60
|
+
```bash
|
|
61
|
+
node scripts/codex-goal.js --resume
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### `/goal:cancel`
|
|
65
|
+
Cancel the active goal session, clean up temporary resources, and reset `goal_mode = false`:
|
|
66
|
+
```bash
|
|
67
|
+
node scripts/codex-goal.js --cancel
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 🔔 Sound Notifications
|
|
73
|
+
|
|
74
|
+
Upon task completion or session completion, trigger sound alerts:
|
|
75
|
+
- Success: `afplay /System/Library/Sounds/Glass.aiff && say "Goal phase completed successfully"`
|
|
76
|
+
- Paused/Blocker: `afplay /System/Library/Sounds/Basso.aiff && say "Goal execution paused. User attention required."`
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 🚫 Fallback Policy
|
|
81
|
+
|
|
82
|
+
- If Codex CLI fails to launch or encounters critical issues:
|
|
83
|
+
- Fall back to standard **Gemini Conductor** or **Claude Planner** workflows (`scripts/claude-plan.js` or `agy`).
|
|
84
|
+
- If Qwen CLI is not available during execution:
|
|
85
|
+
- Fall back to `agy --model gemini-3.5-flash` for code generation.
|
|
86
|
+
- Ensure the orchestration script does not crash and logs error outputs gracefully to `codex-reports/goals/error.log`.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 🎨 GUI Assets Workflow — Quy trình tạo bộ icon, nút bấm, HUD, và ghép atlas GUI đồng bộ chất lượng cao
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
category: workflow
|
|
5
|
+
priority: medium
|
|
6
|
+
---
|
|
7
|
+
triggers:
|
|
8
|
+
- "keywords: generate gui assets, gui icons, app icon set, icon atlas, ui icon pack"
|
|
9
|
+
- "context: UI assets creation, icon generation, atlas assembly"
|
|
10
|
+
version: 1.0.0
|
|
11
|
+
track:
|
|
12
|
+
- quick
|
|
13
|
+
- method
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# /generate-gui-assets — GUI Asset Pack Generation Workflow
|
|
17
|
+
|
|
18
|
+
Quy trình này hướng dẫn cách lập kế hoạch, tạo hàng loạt và hậu kỳ xử lý bộ GUI assets (nút, icon, status badges, HUD...) đồng bộ phong cách trên một canvas/atlas đồng nhất.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 📋 Chuẩn Bị & Chọn Canvas Grid
|
|
23
|
+
|
|
24
|
+
Trước khi khởi chạy, xác định tổng lượng icon cần tạo để chọn kích thước lưới thích hợp. Lưới đồng nhất giúp AI căn giữa tốt và cho phép cắt ảnh tự động chính xác:
|
|
25
|
+
|
|
26
|
+
- **8x6** (48 slots): Lượng icon lớn nhất, tối ưu chi phí sau khi style đã được duyệt.
|
|
27
|
+
- **6x6** (36 slots): Canvas vuông, thoáng.
|
|
28
|
+
- **4x4** (16 slots): Lựa chọn ưu tiên chất lượng và độ tách biệt cao.
|
|
29
|
+
- **3x3** (9 slots): Phù hợp chạy thử (Preview) hoặc precision fallback.
|
|
30
|
+
|
|
31
|
+
Sử dụng tool gợi ý lưới:
|
|
32
|
+
```bash
|
|
33
|
+
python ~/.gemini/antigravity/skills/generate-gui-assets/scripts/suggest_grid_options.py \
|
|
34
|
+
--icon-count <lượng_icon> \
|
|
35
|
+
--strategy throughput
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## ⚡ Các Bước Thực Hiện
|
|
41
|
+
|
|
42
|
+
### Bước 1: Chạy Thử Tạo Phong Cách (Preview Phase)
|
|
43
|
+
Luôn khởi chạy một pack nhỏ (Preview) để duyệt phong cách hình ảnh trước khi tạo hàng loạt (Bulk):
|
|
44
|
+
```bash
|
|
45
|
+
python ~/.gemini/antigravity/skills/generate-gui-assets/scripts/prepare_gui_asset_run.py \
|
|
46
|
+
--run-id gui-v1-preview \
|
|
47
|
+
--output-root "assets/ui/generated" \
|
|
48
|
+
--phase preview \
|
|
49
|
+
--style-notes "cozy mobile wellness garden icons, crisp rounded vector style, soft gradient" \
|
|
50
|
+
--pack "ui_weather_core:3x3:sun,sunCloud,cloud,rain,wind,hot,mild,good,bad"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Bước 2: Sinh Ảnh Preview & Nhận Phản Hồi
|
|
54
|
+
- Đọc file prompt tại `assets/ui/generated/gui-v1-preview/prompts/`.
|
|
55
|
+
- Thực thi `$imagegen` để tạo ảnh atlas thô. Save ảnh vào `raw/` và ghi nhận provenance.
|
|
56
|
+
- Tạo contact sheet để xem trước và QA:
|
|
57
|
+
```bash
|
|
58
|
+
python ~/.gemini/antigravity/skills/generate-gui-assets/scripts/build_gui_contact_sheet.py \
|
|
59
|
+
--run-dir "assets/ui/generated/gui-v1-preview"
|
|
60
|
+
```
|
|
61
|
+
*(Trong Goal Mode, bước duyệt này sẽ tự động thông qua).*
|
|
62
|
+
|
|
63
|
+
### Bước 3: Tạo Hàng Loạt (Bulk Phase)
|
|
64
|
+
Sau khi style được chấp thuận, khóa ngôn ngữ mô tả style lại và khởi chạy bulk run cho các pack còn lại:
|
|
65
|
+
```bash
|
|
66
|
+
python ~/.gemini/antigravity/skills/generate-gui-assets/scripts/prepare_gui_asset_run.py \
|
|
67
|
+
--run-id gui-v1-bulk \
|
|
68
|
+
--output-root "assets/ui/generated" \
|
|
69
|
+
--phase bulk \
|
|
70
|
+
--style-notes "<approved preview style notes>" \
|
|
71
|
+
--pack "ui_nav:4x3:home,garden,profile,settings,search,back,next,add,close,alert" \
|
|
72
|
+
--pack "ui_health:4x3:heart,water,sleep,steps,mood,warning,aid,trend"
|
|
73
|
+
```
|
|
74
|
+
- Chạy sinh ảnh hàng loạt qua `$imagegen` và record kết quả.
|
|
75
|
+
- Xác thực catalog:
|
|
76
|
+
```bash
|
|
77
|
+
python ~/.gemini/antigravity/skills/generate-gui-assets/scripts/validate_gui_catalog.py \
|
|
78
|
+
--run-dir "assets/ui/generated/gui-v1-bulk"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Bước 4: Tách Icon & Khử Viền Màu Nền (Edge Cleanup)
|
|
82
|
+
Khi đã crop và phân tách các icon thành file ảnh PNG có alpha channel, chạy công cụ khử viền màu nền (thường là màu hồng `#FF00FF` hoặc xanh lá `#00FF00` được dùng làm chroma-key):
|
|
83
|
+
```bash
|
|
84
|
+
# 1. Chạy dry-run kiểm tra
|
|
85
|
+
python ~/.gemini/antigravity/skills/generate-gui-assets/scripts/clean_chroma_edges.py \
|
|
86
|
+
"assets/ui/generated/gui-v1-bulk/final/icons" --edge-despill
|
|
87
|
+
|
|
88
|
+
# 2. Áp dụng làm sạch
|
|
89
|
+
python ~/.gemini/antigravity/skills/generate-gui-assets/scripts/clean_chroma_edges.py \
|
|
90
|
+
"assets/ui/generated/gui-v1-bulk/final/icons" --edge-despill --apply
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Bước 5: Đưa Vào Dự Án (Promote)
|
|
94
|
+
Sao chép các icon sạch và manifest sang thư mục chính của dự án:
|
|
95
|
+
```bash
|
|
96
|
+
python ~/.gemini/antigravity/skills/generate-gui-assets/scripts/copy_approved_icons.py \
|
|
97
|
+
--source-dir "assets/ui/generated/gui-v1-bulk/final/icons" \
|
|
98
|
+
--run-dir "assets/ui/generated/gui-v1-bulk" \
|
|
99
|
+
--mapping "assets/ui/generated/gui-v1-bulk/catalog.json"
|
|
100
|
+
```
|
|
101
|
+
Đưa các icon đã phân loại vào `assets/ui/icons/` và dọn dẹp các thư mục staging run.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 🔍 QA Checklist
|
|
106
|
+
|
|
107
|
+
- [ ] Catalog.json hợp lệ và chứa đủ thông tin nguồn gốc.
|
|
108
|
+
- [ ] Không sử dụng shadow rời, glow loang lổ bên ngoài nét vẽ của icon.
|
|
109
|
+
- [ ] Mọi icon căn giữa tốt, không chạm viền cell, không bị cắt cụt.
|
|
110
|
+
- [ ] Nền trong suốt hoàn toàn, không bám viền màu nền cũ khi hiển thị trên cả nền sáng và tối.
|
|
111
|
+
- [ ] Code ứng dụng tham chiếu đúng đường dẫn canonical (`assets/ui/...`), không trỏ tới run staging.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 🐣 Hatch Pet Workflow — Quy trình tạo và đóng gói Codex Pet động từ ý tưởng hoặc hình ảnh
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
category: workflow
|
|
5
|
+
priority: medium
|
|
6
|
+
---
|
|
7
|
+
triggers:
|
|
8
|
+
- "keywords: hatch pet, create pet, custom pet, pet spritesheet, animated pet"
|
|
9
|
+
- "context: pet creation, mascot animation, pet bundle"
|
|
10
|
+
version: 1.0.0
|
|
11
|
+
track:
|
|
12
|
+
- quick
|
|
13
|
+
- method
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# /hatch-pet — Animated Companion Hatching Workflow
|
|
17
|
+
|
|
18
|
+
Quy trình này giúp bạn (hoặc AI) tự động hóa việc tạo một Codex Pet động (spritesheet 8x9) từ ý tưởng, ảnh tham chiếu hoặc grounding images.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 📋 Hướng Dẫn Chuẩn Bị
|
|
23
|
+
|
|
24
|
+
1. **Thông tin cơ bản**:
|
|
25
|
+
- **Tên Pet** (Name): Chọn tên ngắn gọn (ví dụ: `Dewey`, `BSOD`).
|
|
26
|
+
- **Mô tả** (Description): Một câu mô tả tính cách.
|
|
27
|
+
- **Chroma Key**: Màu nền tách (mặc định: `#00FF00` hoặc `#FF00FF`).
|
|
28
|
+
- **Mẫu Thiết Kế**: Phong cách Vector 2D, nét vẽ viền đen dày, bóng đổ phẳng (Cel-shading).
|
|
29
|
+
|
|
30
|
+
2. **Folder Chạy Thử**:
|
|
31
|
+
- Mọi tiến trình chạy sẽ được lưu trữ tại một thư mục tạm thời (staging run), ví dụ: `assets/pets/runs/<pet-name>`.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## ⚡ Các Bước Thực Hiện
|
|
36
|
+
|
|
37
|
+
### Bước 1: Chuẩn Bị Run Folder & Manifest
|
|
38
|
+
Khởi tạo run folder và tạo danh sách các frame cần sinh (base và các trạng thái động như `idle`, `jumping`, `running-right`, `running-left`, `waving`, `failed`, `review`, `sleeping`, `eating`):
|
|
39
|
+
```bash
|
|
40
|
+
python ~/.gemini/antigravity/skills/hatch-pet/scripts/prepare_pet_run.py \
|
|
41
|
+
--pet-name "<PetName>" \
|
|
42
|
+
--description "<One sentence description>" \
|
|
43
|
+
--reference "/path/to/reference.png" \
|
|
44
|
+
--output-dir "assets/pets/runs/<pet-name>" \
|
|
45
|
+
--pet-notes "<stability notes>" \
|
|
46
|
+
--style-notes "smooth vector-2d, digital chibi mascot, bold outline, cel-shading"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Bước 2: Sinh Ảnh Base (Mẫu)
|
|
50
|
+
AI sẽ sử dụng file prompt được sinh ra tại `assets/pets/runs/<pet-name>/prompts/base.txt` kết hợp công cụ `$imagegen` để tạo ảnh mẫu ban đầu.
|
|
51
|
+
Sau khi ảnh mẫu được sinh, record kết quả:
|
|
52
|
+
```bash
|
|
53
|
+
python ~/.gemini/antigravity/skills/hatch-pet/scripts/record_imagegen_result.py \
|
|
54
|
+
--run-dir "assets/pets/runs/<pet-name>" \
|
|
55
|
+
--job-id base \
|
|
56
|
+
--source "/path/to/generated-base.png"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Bước 3: Sinh Các Dãy Trạng Thái Động (Row Strips)
|
|
60
|
+
Với mỗi trạng thái động còn lại, AI chạy subagents song song sử dụng hướng dẫn layout guide và file prompt mẫu tương ứng. Sau khi nhận được ảnh strip thô từ subagent:
|
|
61
|
+
```bash
|
|
62
|
+
python ~/.gemini/antigravity/skills/hatch-pet/scripts/record_imagegen_result.py \
|
|
63
|
+
--run-dir "assets/pets/runs/<pet-name>" \
|
|
64
|
+
--job-id <state-id> \
|
|
65
|
+
--source "/path/to/generated-strip.png"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
*Mẹo*: Với `running-left`, nếu pet có tính đối xứng cao, có thể tạo nhanh bằng cách lật gương từ `running-right`:
|
|
69
|
+
```bash
|
|
70
|
+
python ~/.gemini/antigravity/skills/hatch-pet/scripts/derive_running_left_from_running_right.py \
|
|
71
|
+
--run-dir "assets/pets/runs/<pet-name>" \
|
|
72
|
+
--confirm-appropriate-mirror \
|
|
73
|
+
--decision-note "Pet is symmetrical and has no text/directional lighting"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Bước 4: Ghép Ảnh Atlas & Validate
|
|
77
|
+
Sau khi tất cả trạng thái đã được record, tiến hành trích xuất frame nhỏ (`192x208`), ghép thành atlas tổng hợp (`1536x1872`), validate hình học và tạo video preview QA:
|
|
78
|
+
```bash
|
|
79
|
+
python ~/.gemini/antigravity/skills/hatch-pet/scripts/finalize_pet_run.py \
|
|
80
|
+
--run-dir "assets/pets/runs/<pet-name>"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Bước 5: Khử Viền Màu Nền (Chroma Edge Despill)
|
|
84
|
+
Nếu ảnh spritesheet xuất hiện viền hồng hoặc xanh lá (fringe) do tách nền tự động, thực hiện chạy công cụ khử viền:
|
|
85
|
+
```bash
|
|
86
|
+
# 1. Chạy dry-run kiểm tra số lượng file
|
|
87
|
+
python ~/.gemini/antigravity/skills/hatch-pet/scripts/clean_chroma_edges.py \
|
|
88
|
+
"assets/pets/runs/<pet-name>/frames" --edge-despill
|
|
89
|
+
|
|
90
|
+
# 2. Áp dụng sửa đổi trực tiếp lên các frame
|
|
91
|
+
python ~/.gemini/antigravity/skills/hatch-pet/scripts/clean_chroma_edges.py \
|
|
92
|
+
"assets/pets/runs/<pet-name>/frames" --edge-despill --apply
|
|
93
|
+
|
|
94
|
+
# 3. Ghép lại Atlas từ các frame đã làm sạch
|
|
95
|
+
python ~/.gemini/antigravity/skills/hatch-pet/scripts/compose_atlas.py \
|
|
96
|
+
--frames-root "assets/pets/runs/<pet-name>/frames" \
|
|
97
|
+
--output "assets/pets/runs/<pet-name>/final/spritesheet.png" \
|
|
98
|
+
--webp-output "assets/pets/runs/<pet-name>/final/spritesheet.webp"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Bước 6: Đóng Gói (Package & Promote)
|
|
102
|
+
Chuyển pet đã được kiểm duyệt và làm sạch vào thư mục chính thức của ứng dụng:
|
|
103
|
+
- Sao chép `spritesheet.webp` và `pet.json` sang `assets/pets/<pet-slug>/`
|
|
104
|
+
- Cập nhật file manifest của game/app.
|
|
105
|
+
- Xóa dọn dẹp các thư mục staging run tạm để giữ sạch repository.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 🔍 QA Checklist
|
|
110
|
+
|
|
111
|
+
- [ ] Spritesheet có kích thước chuẩn `1536x1872`, định dạng WebP/PNG có alpha channel.
|
|
112
|
+
- [ ] Các cell trống trong grid phải hoàn toàn trong suốt.
|
|
113
|
+
- [ ] Nét vẽ, màu sắc, chi tiết của pet đồng nhất trên tất cả 9 hàng trạng thái.
|
|
114
|
+
- [ ] Video preview trong `qa/videos/*.mp4` chạy mượt mà, không bị rung giật hoặc lệch trục.
|
|
115
|
+
- [ ] Không chứa các hiệu ứng lơ lửng, shadow tách rời hay bụi mù xung quanh.
|
|
116
|
+
- [ ] Không có viền màu xanh lá hoặc hồng trên nền tối (test qua contact sheet).
|