@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.
Files changed (69) hide show
  1. package/bin/awk.js +213 -92
  2. package/bin/codex-generators.js +32 -3
  3. package/core/GEMINI.md +18 -5
  4. package/core/GEMINI.md.bak +20 -7
  5. package/core/skill-runtime-manifest.json +1 -0
  6. package/package.json +1 -1
  7. package/scripts/exec-progress.js +116 -0
  8. package/scripts/exec-rtk.js +105 -10
  9. package/skills/CATALOG.md +1 -1
  10. package/skills/awf-caveman/SKILL.md +13 -1
  11. package/skills/code-review/SKILL.md +40 -68
  12. package/skills/generate-gui-assets/SKILL.md +5 -5
  13. package/skills/hatch-pet/SKILL.md +2 -2
  14. package/skills/review/SKILL.md +40 -68
  15. package/skills/threejs-animation/SKILL.md +86 -0
  16. package/skills/threejs-animation/examples/workflow-mixer-action.md +20 -0
  17. package/skills/threejs-animation/references/official-sections.md +19 -0
  18. package/skills/threejs-audio/SKILL.md +112 -0
  19. package/skills/threejs-audio/examples/workflow-positional-audio.md +15 -0
  20. package/skills/threejs-audio/references/official-sections.md +16 -0
  21. package/skills/threejs-camera/SKILL.md +96 -0
  22. package/skills/threejs-camera/examples/workflow-perspective-resize.md +13 -0
  23. package/skills/threejs-controls/SKILL.md +101 -0
  24. package/skills/threejs-controls/examples/workflow-orbit-damping.md +15 -0
  25. package/skills/threejs-dev-setup/SKILL.md +102 -0
  26. package/skills/threejs-dev-setup/examples/workflow-scaffold.md +24 -0
  27. package/skills/threejs-geometries/SKILL.md +108 -0
  28. package/skills/threejs-geometries/examples/workflow-extrude-shape.md +13 -0
  29. package/skills/threejs-helpers/SKILL.md +103 -0
  30. package/skills/threejs-helpers/examples/workflow-light-camera-helpers.md +13 -0
  31. package/skills/threejs-lights/SKILL.md +103 -0
  32. package/skills/threejs-lights/examples/workflow-directional-shadow.md +17 -0
  33. package/skills/threejs-loaders/SKILL.md +89 -0
  34. package/skills/threejs-loaders/examples/workflow-gltf-draco.md +22 -0
  35. package/skills/threejs-loaders/references/official-sections.md +27 -0
  36. package/skills/threejs-materials/SKILL.md +102 -0
  37. package/skills/threejs-materials/examples/workflow-pbr-transparent.md +15 -0
  38. package/skills/threejs-math/SKILL.md +102 -0
  39. package/skills/threejs-math/examples/workflow-ray-aabb.md +11 -0
  40. package/skills/threejs-node-tsl/SKILL.md +83 -0
  41. package/skills/threejs-node-tsl/examples/workflow-tsl-entry.md +13 -0
  42. package/skills/threejs-node-tsl/references/official-links.md +8 -0
  43. package/skills/threejs-node-tsl/references/tsl-vs-classic.md +23 -0
  44. package/skills/threejs-objects/SKILL.md +111 -0
  45. package/skills/threejs-objects/examples/workflow-raycaster-pick.md +17 -0
  46. package/skills/threejs-postprocessing/SKILL.md +116 -0
  47. package/skills/threejs-postprocessing/examples/workflow-composer-bloom.md +15 -0
  48. package/skills/threejs-renderers/SKILL.md +91 -0
  49. package/skills/threejs-renderers/examples/workflow-renderer-resize.md +21 -0
  50. package/skills/threejs-renderers/references/official-sections.md +14 -0
  51. package/skills/threejs-scenes/SKILL.md +90 -0
  52. package/skills/threejs-scenes/examples/workflow-fog-background.md +13 -0
  53. package/skills/threejs-textures/SKILL.md +83 -0
  54. package/skills/threejs-textures/examples/workflow-pmrem-env.md +19 -0
  55. package/skills/threejs-webxr/SKILL.md +104 -0
  56. package/skills/threejs-webxr/examples/workflow-xr-button.md +15 -0
  57. package/workflows/_uncategorized/generate-gui-assets.md +111 -0
  58. package/workflows/_uncategorized/goal.md +86 -0
  59. package/workflows/_uncategorized/hatch-pet.md +116 -0
  60. package/workflows/_uncategorized/office-hours.md +38 -0
  61. package/workflows/_uncategorized/plan-ceo-review.md +34 -0
  62. package/workflows/_uncategorized/plan-design-review.md +38 -0
  63. package/workflows/_uncategorized/plan-eng-review.md +43 -0
  64. package/workflows/quality/plan-ceo-review.md +34 -0
  65. package/workflows/quality/plan-design-review.md +38 -0
  66. package/workflows/quality/plan-eng-review.md +43 -0
  67. package/workflows/roles/office-hours.md +38 -0
  68. package/workflows/ui/generate-gui-assets.md +111 -0
  69. package/workflows/ui/hatch-pet.md +116 -0
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: threejs-materials
3
+ description: "Classic three.js materials (non-Node): MeshStandardMaterial, MeshPhysicalMaterial, Phong/Lambert/Toon/Basic, Line/Points/Sprite materials, MeshMatcapMaterial, MeshNormalMaterial, depth/distance materials, ShaderMaterial and RawShaderMaterial. Use when tuning PBR maps, transparency, depth write, skinning flags, or writing GLSL in ShaderMaterial; for TSL/NodeMaterial/WebGPU shader graphs use threejs-node-tsl instead."
4
+ ---
5
+
6
+ ## When to use this skill
7
+
8
+ **ALWAYS use this skill when the user mentions:**
9
+
10
+ - Choosing among built-in mesh materials, map slots (albedo, normal, roughness, metalness, ao, emissive), `envMap`
11
+ - Transparency sorting issues, `alphaTest`, `depthWrite`, blending modes, side/double-sided rendering
12
+ - `ShaderMaterial` / `RawShaderMaterial` uniforms, includes, and compatibility with lights pipeline
13
+ - Line, points, sprite materials for vector overlays and particles
14
+
15
+ **IMPORTANT: classic materials vs node-tsl**
16
+
17
+ | Need | Skill |
18
+ |------|--------|
19
+ | Standard PBR with maps, physical clearcoat/sheen | **threejs-materials** |
20
+ | TSL nodes, `NodeMaterial`, WebGPU-first shading, compute-style graph | **threejs-node-tsl** |
21
+ | Migrating ShaderMaterial → TSL | **threejs-node-tsl** (conceptual), keep ShaderMaterial here until cutover |
22
+
23
+ **Trigger phrases include:**
24
+
25
+ - "MeshStandardMaterial", "MeshPhysicalMaterial", "ShaderMaterial", "transparent", "alphaTest"
26
+ - "PBR", "物理材质", "透明", "自定义着色器"
27
+
28
+ ## How to use this skill
29
+
30
+ 1. **Select class** by lighting model: `MeshBasic` (unlit), Lambert/Phong (legacy lit), Standard/Physical (PBR).
31
+ 2. **Assign maps** and ensure **color space** correctness for albedo vs data maps (link threejs-textures).
32
+ 3. **Environment**: set `envMap` from cube or equirect; align `metalness`/`roughness`; consider `MeshPhysicalMaterial` for transmission/IOR when needed.
33
+ 4. **Transparency**: order objects or use `alphaTest`/`depthWrite` trade-offs; mention sorting limitations.
34
+ 5. **ShaderMaterial**: minimize re-lit work unless intentional; document required lights and `lights: true` flag behavior per version docs.
35
+ 6. **Performance**: share materials across meshes; avoid cloning per frame.
36
+ 7. **Skinning/morph**: set `skinning`/`morphTargets` where applicable—mesh side in **threejs-objects**.
37
+
38
+ ### Example: Transparency with alphaTest vs depthWrite
39
+
40
+ ```javascript
41
+ // Option A: alphaTest — hard cutoff, no sorting issues
42
+ const matA = new THREE.MeshStandardMaterial({
43
+ map: texture, alphaMap: alphaTexture,
44
+ alphaTest: 0.5, transparent: true
45
+ });
46
+
47
+ // Option B: depthWrite false — soft transparency, needs manual sorting
48
+ const matB = new THREE.MeshStandardMaterial({
49
+ map: texture, transparent: true, opacity: 0.6,
50
+ depthWrite: false // prevents depth-fighting but requires back-to-front sorting
51
+ });
52
+ ```
53
+
54
+ See [examples/workflow-pbr-transparent.md](examples/workflow-pbr-transparent.md).
55
+
56
+ ## Doc map (official)
57
+
58
+ | Docs section | Representative links |
59
+ |--------------|----------------------|
60
+ | Materials (core) | https://threejs.org/docs/Material.html |
61
+ | PBR | https://threejs.org/docs/MeshStandardMaterial.html |
62
+ | Physical | https://threejs.org/docs/MeshPhysicalMaterial.html |
63
+ | Custom GLSL | https://threejs.org/docs/ShaderMaterial.html |
64
+
65
+ ## Scope
66
+
67
+ - **In scope:** Non-Node materials listed under Core **Materials** in docs (except `*NodeMaterial`).
68
+ - **Out of scope:** Full Nodes catalog (threejs-node-tsl); post pass materials inside composer (threejs-postprocessing).
69
+
70
+ ## Common pitfalls and best practices
71
+
72
+ - Wrong normal map `normalMapType` or tangent space breaks lighting; verify geometry has tangents or use appropriate mode.
73
+ - Premultiplied alpha vs straight alpha mismatches cause fringe halos on foliage.
74
+ - `MeshPhysicalMaterial` `transmission` needs thickness and good env—combine with **threejs-textures** / PMREM.
75
+ - Too many unique materials hurts sorting and batching—merge where possible.
76
+
77
+ ## Documentation and version
78
+
79
+ PBR and `ShaderMaterial` behavior track the [Materials](https://threejs.org/docs/#Materials) section in [three.js docs](https://threejs.org/docs/). Color management and default `envMap` handling changed in modern releases—always pair material answers with renderer/output settings from **threejs-renderers** when colors look wrong.
80
+
81
+ ## Agent response checklist
82
+
83
+ When answering under this skill, prefer responses that:
84
+
85
+ 1. Link `MeshStandardMaterial`, `MeshPhysicalMaterial`, or `ShaderMaterial` pages as appropriate.
86
+ 2. Force a clear choice vs **threejs-node-tsl** when the user asks for “shaders” or “nodes”.
87
+ 3. Separate map **roles** (albedo vs roughness vs normal) and `colorSpace` expectations with **threejs-textures**.
88
+ 4. Call out transparency and `depthWrite` trade-offs for sorted rendering.
89
+ 5. Note that `*NodeMaterial` types belong to the node skill, not this one.
90
+
91
+ ## References
92
+
93
+ - https://threejs.org/docs/#Materials
94
+ - https://threejs.org/docs/MeshStandardMaterial.html
95
+ - https://threejs.org/docs/MeshPhysicalMaterial.html
96
+ - https://threejs.org/docs/ShaderMaterial.html
97
+
98
+ ## Keywords
99
+
100
+ **English:** meshstandardmaterial, meshphysicalmaterial, shadermaterial, pbr, transparency, envmap, materials, three.js
101
+
102
+ **中文:** 材质、PBR、MeshStandardMaterial、物理材质、透明、环境贴图、ShaderMaterial、three.js
@@ -0,0 +1,15 @@
1
+ # Workflow: PBR mesh with transparency
2
+
3
+ ## Steps
4
+
5
+ 1. Start from `MeshStandardMaterial` with `transparent: true`, `opacity < 1`, or texture alpha.
6
+
7
+ 2. Decide sorting strategy: opaque first, then transparent; or use `alphaTest` for cutouts (foliage).
8
+
9
+ 3. For refractive glass-like look, consider `MeshPhysicalMaterial` with `transmission`—verify thickness and env map (see **threejs-textures** for PMREM).
10
+
11
+ 4. If depth artifacts appear, tune `depthWrite` (often `false` for transparent) and render order.
12
+
13
+ 5. Validate under correct `outputColorSpace` on renderer (**threejs-renderers**).
14
+
15
+ This file is guidance only—parameter names follow the current [MeshStandardMaterial](https://threejs.org/docs/MeshStandardMaterial.html) page.
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: threejs-math
3
+ description: "three.js math library: Vector2/3/4, Matrix3/4, Quaternion, Euler, Color, Box2/Box3, Sphere, Plane, Ray, Line3, Triangle, Frustum, Cylindrical/Spherical coords, MathUtils, and Interpolant base classes; addon math utilities such as OBB, Octree, Capsule, ConvexHull, MeshSurfaceSampler. Use for transforms, intersection tests, and spatial queries; for keyframe interpolation tied to AnimationMixer use threejs-animation; for picking implementation use threejs-objects with Raycaster."
4
+ ---
5
+
6
+ ## When to use this skill
7
+
8
+ **ALWAYS use this skill when the user mentions:**
9
+
10
+ - Vector/matrix math order, `applyQuaternion`, `lookAt`, world vs local transforms
11
+ - Bounding volumes `Box3`/`Sphere`, containment/intersection tests
12
+ - `Ray` vs `Plane` vs `Frustum` tests (without full picking pipeline)
13
+
14
+ **IMPORTANT: math vs objects vs animation**
15
+
16
+ | Need | Skill |
17
+ |------|--------|
18
+ | Raw math types | **threejs-math** |
19
+ | `Raycaster` + layers picking | **threejs-objects** |
20
+ | QuaternionKeyframeTrack playback | **threejs-animation** |
21
+
22
+ **Trigger phrases include:**
23
+
24
+ - "Vector3", "Matrix4", "Quaternion", "Box3", "Ray", "Frustum"
25
+ - "向量", "矩阵", "四元数", "包围盒"
26
+
27
+ ## How to use this skill
28
+
29
+ 1. **Conventions**: multiply vectors by matrices on the left as three.js examples show; call `updateMatrixWorld` before world-space queries (**threejs-objects**).
30
+ 2. **Bounding**: `Box3().setFromObject(object)` for rough bounds; refine per need.
31
+ 3. **Collision-ish checks**: `ray.intersectBox`, `sphere.containsPoint`, etc., per docs.
32
+ 4. **Addon structures**: `Octree`/`OBB` for games—cite addon pages, avoid copying full API tables here.
33
+ 5. **Color**: `Color` conversions relate to materials/textures—cross-link.
34
+ 6. **Random sampling**: `MeshSurfaceSampler` for distributing points on meshes.
35
+
36
+ ### Example: Ray-AABB intersection test
37
+
38
+ ```javascript
39
+ import * as THREE from 'three';
40
+
41
+ const ray = new THREE.Ray(
42
+ new THREE.Vector3(0, 1, 0), // origin
43
+ new THREE.Vector3(0, 0, -1) // direction
44
+ );
45
+ const box = new THREE.Box3(
46
+ new THREE.Vector3(-1, -1, -5),
47
+ new THREE.Vector3(1, 1, -3)
48
+ );
49
+
50
+ const hit = ray.intersectBox(box, new THREE.Vector3());
51
+ if (hit) {
52
+ console.log('Intersection at:', hit);
53
+ }
54
+ ```
55
+
56
+ See [examples/workflow-ray-aabb.md](examples/workflow-ray-aabb.md).
57
+
58
+ ## Doc map (official)
59
+
60
+ | Docs section | Representative links |
61
+ |--------------|----------------------|
62
+ | Math | https://threejs.org/docs/Vector3.html |
63
+ | Math | https://threejs.org/docs/Matrix4.html |
64
+ | Math | https://threejs.org/docs/Quaternion.html |
65
+ | Math | https://threejs.org/docs/Ray.html |
66
+
67
+ ## Scope
68
+
69
+ - **In scope:** Core Math types; addon math entries as pointers.
70
+ - **Out of scope:** Keyframe track evaluation beyond type references (animation skill).
71
+
72
+ ## Common pitfalls and best practices
73
+
74
+ - Euler gimbal lock—prefer quaternions for arbitrary rotations.
75
+ - Reusing temporary vectors reduces GC thrash in hot loops.
76
+ - Frustum culling helpers vary—verify against your three version.
77
+
78
+ ## Documentation and version
79
+
80
+ Core math types are listed under [Math](https://threejs.org/docs/#Math); addon utilities (`Octree`, `OBB`, …) appear under **Addons → Math** in [three.js docs](https://threejs.org/docs/). [Global](https://threejs.org/docs/#Global) also lists constants (e.g. wrapping, blending) sometimes needed alongside materials.
81
+
82
+ ## Agent response checklist
83
+
84
+ When answering under this skill, prefer responses that:
85
+
86
+ 1. Link the concrete type (`Vector3`, `Matrix4`, `Quaternion`, …) from the docs.
87
+ 2. Send `AnimationMixer` / track math to **threejs-animation** when time-sampled.
88
+ 3. Send `Raycaster` picking flows to **threejs-objects** when interaction is the goal.
89
+ 4. Mention numeric stability (epsilon) where comparisons matter.
90
+ 5. Point to **Addons → Math** for game-oriented structures when users need spatial acceleration.
91
+
92
+ ## References
93
+
94
+ - https://threejs.org/docs/#Math
95
+ - https://threejs.org/docs/MathUtils.html
96
+ - https://threejs.org/docs/Ray.html
97
+
98
+ ## Keywords
99
+
100
+ **English:** vector, matrix, quaternion, euler, box3, sphere, ray, frustum, three.js
101
+
102
+ **中文:** 向量、矩阵、四元数、欧拉角、包围盒、射线、three.js
@@ -0,0 +1,11 @@
1
+ # Workflow: test Ray against Box3
2
+
3
+ ## Steps
4
+
5
+ 1. Build `THREE.Ray(origin, direction)`; ensure `direction` is normalized if using distance-sensitive APIs.
6
+
7
+ 2. Compute world-space `Box3` for an object: `new THREE.Box3().setFromObject(mesh)`.
8
+
9
+ 3. `const hit = ray.intersectBox(box, targetPoint);` — check return value per [Ray](https://threejs.org/docs/Ray.html).
10
+
11
+ 4. For mesh-accurate picking, prefer `Raycaster` in **threejs-objects** instead of manual triangle tests unless you optimize custom cases.
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: threejs-node-tsl
3
+ description: "three.js node-based shading: Nodes API surface, NodeMaterial and MeshStandardNodeMaterial-style families, TSL (Three.js Shading Language) entry at TSL.html, WebGPURenderer pairing, and core PostProcessing (class) versus addon EffectComposer at a high level. Use when authoring shaders as graphs, using TSL builtins, compute-oriented nodes, or modern WebGPU pipelines; for classic ShaderMaterial GLSL use threejs-materials; for stock EffectComposer passes use threejs-postprocessing; for WebGLRenderer-only tuning use threejs-renderers."
4
+ ---
5
+
6
+ ## When to use this skill
7
+
8
+ **ALWAYS use this skill when the user mentions:**
9
+
10
+ - `NodeMaterial`, `TSL`, imports from `three/nodes` or WebGPU entry points in docs
11
+ - Building materials or post effects from nodes instead of string GLSL
12
+ - `WebGPURenderer`, `PostProcessing` (core class) in a node-centric pipeline
13
+
14
+ **IMPORTANT: node-tsl vs materials vs postprocessing**
15
+
16
+ | Situation | Skill |
17
+ |-----------|--------|
18
+ | Standard PBR tuning, no nodes | **threejs-materials** |
19
+ | TSL graph, NodeMaterial, WGSL path | **threejs-node-tsl** |
20
+ | Classic `EffectComposer` + Pass classes | **threejs-postprocessing** |
21
+ | Node post passes listed under Addons TSL in docs | **threejs-node-tsl** + **threejs-postprocessing** awareness |
22
+
23
+ **Trigger phrases include:**
24
+
25
+ - "TSL", "NodeMaterial", "three/nodes", "WebGPU", "node builder"
26
+ - "节点材质", "着色语言 TSL"
27
+
28
+ ## How to use this skill
29
+
30
+ 1. **Decide path**: WebGPU + nodes vs WebGL + classic materials—do not hybridize blindly.
31
+ 2. **Anchor docs**: start from [Nodes index](https://threejs.org/docs/#Nodes) and [TSL.html](https://threejs.org/docs/TSL.html); use [NodeMaterial](https://threejs.org/docs/NodeMaterial.html) for material entry.
32
+ 3. **Progressive disclosure**: keep SKILL.md navigational; long symbol lists live in [references/official-links.md](references/official-links.md) and [references/tsl-vs-classic.md](references/tsl-vs-classic.md); see [examples/workflow-tsl-entry.md](examples/workflow-tsl-entry.md) for navigation habits.
33
+ 4. **Renderer**: enable `WebGPURenderer` per docs; fall back notes belong in **threejs-renderers**.
34
+ 5. **Debugging**: use version-stamped examples in three.js repo; avoid copying deprecated import paths.
35
+ 6. **Post stack**: if user names `PostProcessing` core class vs addon composer, clarify table in **threejs-renderers** / **threejs-postprocessing**.
36
+
37
+ ## Doc map (official)
38
+
39
+ | Docs section | Representative links |
40
+ |--------------|----------------------|
41
+ | Nodes | https://threejs.org/docs/#Nodes |
42
+ | TSL | https://threejs.org/docs/TSL.html |
43
+ | NodeMaterial | https://threejs.org/docs/NodeMaterial.html |
44
+ | WebGPU renderer | https://threejs.org/docs/WebGPURenderer.html |
45
+
46
+ ## Scope
47
+
48
+ - **In scope:** Nodes/TSL discovery, architecture, renderer pairing, where to look next, migration hints from ShaderMaterial.
49
+ - **Out of scope:** Pasting entire TSL symbol tables into SKILL.md; guaranteeing API stability across rapid releases—always cite "current docs".
50
+
51
+ ## Common pitfalls and best practices
52
+
53
+ - Three.js node APIs evolve quickly—tie answers to a **version** or "current docs".
54
+ - Do not confuse **core** `PostProcessing` class with **addons** `EffectComposer`—names collide in conversation.
55
+ - WGSL vs GLSL expectations differ; TSL abstracts but limits still apply.
56
+ - Keep graphs modular; use references for lookup instead of bloating agent context.
57
+
58
+ ## Documentation and version
59
+
60
+ The [Nodes](https://threejs.org/docs/#Nodes) index and [TSL](https://threejs.org/docs/TSL.html) page are large and **fast-moving**. Treat https://threejs.org/docs/ as the source of truth for the user’s installed three.js; prefer linking [NodeMaterial](https://threejs.org/docs/NodeMaterial.html) and [WebGPURenderer](https://threejs.org/docs/WebGPURenderer.html) over paraphrasing long symbol lists.
61
+
62
+ ## Agent response checklist
63
+
64
+ When answering under this skill, prefer responses that:
65
+
66
+ 1. Anchor on [TSL.html](https://threejs.org/docs/TSL.html) and/or `#Nodes` rather than inventing API names.
67
+ 2. Contrast **threejs-materials** (classic) vs node/TSL path explicitly.
68
+ 3. Warn that WebGPU + nodes examples may require recent minors—cite version when known.
69
+ 4. Point to [references/tsl-vs-classic.md](references/tsl-vs-classic.md) and [references/official-links.md](references/official-links.md) for long lookups.
70
+ 5. Disambiguate core `PostProcessing` vs addon `EffectComposer` (**threejs-postprocessing**).
71
+
72
+ ## References
73
+
74
+ - https://threejs.org/docs/#Nodes
75
+ - https://threejs.org/docs/TSL.html
76
+ - https://threejs.org/docs/NodeMaterial.html
77
+ - https://threejs.org/docs/WebGPURenderer.html
78
+
79
+ ## Keywords
80
+
81
+ **English:** tsl, node material, nodes, webgpu, wgsl, three.js shading language, node builder, nodematerial
82
+
83
+ **中文:** TSL、节点材质、WebGPU、着色语言、NodeMaterial、three.js
@@ -0,0 +1,13 @@
1
+ # Workflow: finding the right TSL entry
2
+
3
+ ## Steps
4
+
5
+ 1. Open https://threejs.org/docs/TSL.html and locate the function or node category matching the effect (lighting, texture, math).
6
+
7
+ 2. Cross-check [Nodes](https://threejs.org/docs/#Nodes) for class-style nodes if TSL links to underlying node types.
8
+
9
+ 3. Pair with `WebGPURenderer` setup from **threejs-renderers**.
10
+
11
+ 4. For post effects expressed as nodes, compare with addon `EffectComposer` path in **threejs-postprocessing** and pick one pipeline per project.
12
+
13
+ Do not duplicate upstream example code here—link to the official example filename instead.
@@ -0,0 +1,8 @@
1
+ # Official entry points (Nodes / TSL)
2
+
3
+ Use these pages as the source of truth; the Nodes catalog is large—link out instead of duplicating.
4
+
5
+ - https://threejs.org/docs/#Nodes
6
+ - https://threejs.org/docs/TSL.html
7
+ - https://threejs.org/docs/NodeMaterial.html
8
+ - https://threejs.org/docs/Node.html
@@ -0,0 +1,23 @@
1
+ # TSL / NodeMaterial vs classic materials
2
+
3
+ ## When to prefer classic (`threejs-materials`)
4
+
5
+ - You need widely documented PBR with `MeshStandardMaterial` / `MeshPhysicalMaterial`.
6
+ - Target is WebGL-only deployments without WebGPU.
7
+ - Team maintains GLSL `ShaderMaterial` with known light setups.
8
+
9
+ ## When to prefer TSL / Node path (`threejs-node-tsl`)
10
+
11
+ - You adopt `WebGPURenderer` and node-based materials in examples.
12
+ - You want composable shader pieces without huge GLSL strings.
13
+ - You follow new three.js examples that import from node/TSL modules.
14
+
15
+ ## Migration sanity
16
+
17
+ - Rebuild lighting model expectations: not every classic knob maps 1:1 on day one.
18
+ - Keep references to official migration notes in the three.js repository for your version.
19
+
20
+ ## Links
21
+
22
+ - https://threejs.org/docs/TSL.html
23
+ - https://threejs.org/docs/ShaderMaterial.html
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: threejs-objects
3
+ description: "three.js scene graph objects: Object3D transforms and hierarchy, Group, Mesh, InstancedMesh, SkinnedMesh, BatchedMesh, LOD, Line/LineLoop/LineSegments, Points, Sprite, Bone, Skeleton, ClippingGroup; interaction via Raycaster, Layers masks, and EventDispatcher patterns. Use when building scene hierarchies, picking objects with Raycaster, or configuring instanced/skinned meshes; for pure vector math use threejs-math; for skeletal clips use threejs-animation."
4
+ ---
5
+
6
+ ## When to use this skill
7
+
8
+ **ALWAYS use this skill when the user mentions:**
9
+
10
+ - Parent/child relationships, `position/rotation/scale`, `matrixAutoUpdate`, `updateMatrixWorld`
11
+ - Choosing mesh types: static vs instanced vs skinned vs batched LOD
12
+ - **Picking**: `Raycaster.setFromCamera`, `intersectObjects`, recursive flag, face/uv results
13
+ - **Layers**: selective visibility for cameras/lights/objects
14
+
15
+ **IMPORTANT: objects vs math**
16
+
17
+ | Need | Skill |
18
+ |------|--------|
19
+ | Scene graph + picking | **threejs-objects** |
20
+ | Box/ray math only | **threejs-math** |
21
+
22
+ **Trigger phrases include:**
23
+
24
+ - "Object3D", "InstancedMesh", "SkinnedMesh", "Raycaster", "layers"
25
+ - "父子节点", "射线拾取", "图层"
26
+
27
+ ## How to use this skill
28
+
29
+ 1. **Compose** scenes with `Group` and transforms; minimize deep hierarchies where possible.
30
+ 2. **Instancing** — set per-instance matrices; understand `count` and frustum culling behavior.
31
+ 3. **SkinnedMesh** — bind skeleton; clips in **threejs-animation**; skinning material flags in **threejs-materials**.
32
+ 4. **Picking** — normalize device coords, set ray from camera, filter by layers, validate intersections are sorted by distance before processing.
33
+ 5. **Events** — `EventDispatcher` on custom objects; patterns only, not DOM frameworks.
34
+ 6. **Clipping** — `ClippingGroup` usage per docs when user needs sectional cuts.
35
+ 7. **Dispose** — call `dispose()` on geometries/materials/textures when removing objects permanently.
36
+
37
+ ### Example: Raycaster picking with validation
38
+
39
+ ```javascript
40
+ import * as THREE from 'three';
41
+
42
+ const raycaster = new THREE.Raycaster();
43
+ const pointer = new THREE.Vector2();
44
+
45
+ function onPointerMove(event) {
46
+ // Normalize device coordinates (-1 to +1)
47
+ pointer.x = (event.clientX / window.innerWidth) * 2 - 1;
48
+ pointer.y = -(event.clientY / window.innerHeight) * 2 + 1;
49
+ }
50
+
51
+ function pick(camera, scene) {
52
+ raycaster.setFromCamera(pointer, camera);
53
+ const intersections = raycaster.intersectObjects(scene.children, true);
54
+
55
+ // Validate: intersections are sorted by distance (nearest first)
56
+ if (intersections.length > 0) {
57
+ console.log('Nearest hit:', intersections[0].object.name,
58
+ 'at distance:', intersections[0].distance);
59
+ }
60
+ return intersections;
61
+ }
62
+ ```
63
+
64
+ See [examples/workflow-raycaster-pick.md](examples/workflow-raycaster-pick.md).
65
+
66
+ ## Doc map (official)
67
+
68
+ | Docs section | Representative links |
69
+ |--------------|----------------------|
70
+ | Core | https://threejs.org/docs/Object3D.html |
71
+ | Objects | https://threejs.org/docs/Mesh.html |
72
+ | Objects | https://threejs.org/docs/InstancedMesh.html |
73
+ | Core | https://threejs.org/docs/Raycaster.html |
74
+
75
+ ## Scope
76
+
77
+ - **In scope:** Object3D graph, renderable object types, raycasting, layers, dispatcher basics.
78
+ - **Out of scope:** Physics engines; XR input mapping (**threejs-webxr**).
79
+
80
+ ## Common pitfalls and best practices
81
+
82
+ - Forgetting `updateMatrixWorld` before world-space ray tests on moved objects.
83
+ - Raycaster without `layers` set picks unintended objects—set masks consistently on camera and objects.
84
+ - InstancedMesh raycast hits need per-instance handling—check docs for your version.
85
+
86
+ ## Documentation and version
87
+
88
+ `Object3D`, mesh types, `Raycaster`, and `Layers` are documented under [Objects](https://threejs.org/docs/#Objects) and [Core](https://threejs.org/docs/Raycaster.html) in [three.js docs](https://threejs.org/docs/). Behavior of picking and layers can shift slightly—link the exact page for the user’s three.js line.
89
+
90
+ ## Agent response checklist
91
+
92
+ When answering under this skill, prefer responses that:
93
+
94
+ 1. Link `Object3D`, `Mesh`, `InstancedMesh`, `Raycaster`, or `Layers` as needed.
95
+ 2. Pair skeletal animation with **threejs-animation** and skinned mesh setup.
96
+ 3. Route pure linear-algebra questions without a scene graph to **threejs-math**.
97
+ 4. Route XR input to **threejs-webxr** when sessions/controllers are involved.
98
+ 5. Mention `dispose()` for geometries/materials when removing objects permanently.
99
+
100
+ ## References
101
+
102
+ - https://threejs.org/docs/Object3D.html
103
+ - https://threejs.org/docs/Raycaster.html
104
+ - https://threejs.org/docs/Layers.html
105
+ - https://threejs.org/docs/InstancedMesh.html
106
+
107
+ ## Keywords
108
+
109
+ **English:** object3d, mesh, instancedmesh, skinnedmesh, raycaster, layers, scene graph, three.js
110
+
111
+ **中文:** 场景图、Object3D、Mesh、实例化、骨骼网格、射线拾取、图层、three.js
@@ -0,0 +1,17 @@
1
+ # Workflow: pick mesh with Raycaster
2
+
3
+ ## Steps
4
+
5
+ 1. `const raycaster = new THREE.Raycaster(); const pointer = new THREE.Vector2();`
6
+
7
+ 2. On pointer event: `pointer.x = (x / width) * 2 - 1; pointer.y = -(y / height) * 2 + 1;`
8
+
9
+ 3. `raycaster.setFromCamera(pointer, camera);`
10
+
11
+ 4. `const hits = raycaster.intersectObjects(scene.children, true);` — tune recursive/layers.
12
+
13
+ 5. Read `hits[0].object`, `face`, `uv`, `distance` per application.
14
+
15
+ 6. Throttle on pointermove if needed for performance.
16
+
17
+ Details: https://threejs.org/docs/Raycaster.html
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: threejs-postprocessing
3
+ description: "Addon screen-space post-processing for three.js using EffectComposer, Pass base class, RenderPass, and stock passes such as UnrealBloomPass, SSAOPass, SSRPass, BokehPass, OutlinePass, FXAAPass/SMAAPass, TAARenderPass, and ShaderPass; references the Shaders addon group for underlying shader modules. Use when building composer chains for bloom, SSAO, or other screen-space effects; not for basic renderer tone mapping alone (threejs-renderers)."
4
+ ---
5
+
6
+ ## When to use this skill
7
+
8
+ **ALWAYS use this skill when the user mentions:**
9
+
10
+ - `EffectComposer`, `RenderPass`, stacking passes, resize of composer
11
+ - Bloom, SSAO, SSR, DOF, outline, glitch, film grain, TAA—**addon** pass names
12
+ - `ShaderPass` with shader modules from Addons **Shaders** group
13
+
14
+ **IMPORTANT: postprocessing vs renderers vs node-tsl**
15
+
16
+ | Pipeline | Skill |
17
+ |----------|--------|
18
+ | Classic composer + passes | **threejs-postprocessing** |
19
+ | Renderer output color/tone only | **threejs-renderers** |
20
+ | Node/TSL post nodes | **threejs-node-tsl** |
21
+
22
+ **Trigger phrases include:**
23
+
24
+ - "EffectComposer", "RenderPass", "UnrealBloomPass", "SSAOPass", "后期"
25
+ - "泛光", "环境光遮蔽", "描边"
26
+
27
+ ## How to use this skill
28
+
29
+ 1. **Chain** — `RenderPass` → effect passes → output; ensure size matches renderer and DPR changes.
30
+ 2. **Resize** — call `composer.setSize` alongside renderer resize workflows.
31
+ 3. **Half-float** — many passes expect appropriate render target types; cite docs for your version.
32
+ 4. **Performance** — each pass has cost; profile with `renderer.info` to check draw calls and triangles.
33
+ 5. **Validate output** — render a simple test scene through the composer first to verify passes work before adding complexity.
34
+ 6. **Shader modules** — link Addons **Shaders** list instead of inlining huge GLSL in SKILL.
35
+ 7. **Output** — final pass should align color management with renderer (**threejs-renderers**).
36
+ 8. **Contrast** — mention core `PostProcessing` class separately to avoid name collision confusion.
37
+
38
+ ### Example: EffectComposer with bloom and debugging
39
+
40
+ ```javascript
41
+ import * as THREE from 'three';
42
+ import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
43
+ import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
44
+ import { UnrealBloomPass } from 'three/addons/postprocessing/UnrealBloomPass.js';
45
+
46
+ const composer = new EffectComposer(renderer);
47
+ composer.addPass(new RenderPass(scene, camera));
48
+
49
+ const bloomPass = new UnrealBloomPass(
50
+ new THREE.Vector2(window.innerWidth, window.innerHeight),
51
+ 1.5, // strength
52
+ 0.4, // radius
53
+ 0.85 // threshold
54
+ );
55
+ composer.addPass(bloomPass);
56
+
57
+ // Resize handler — must match renderer size
58
+ window.addEventListener('resize', () => {
59
+ renderer.setSize(window.innerWidth, window.innerHeight);
60
+ composer.setSize(window.innerWidth, window.innerHeight);
61
+ });
62
+
63
+ // Render loop: use composer.render() instead of renderer.render()
64
+ function animate() {
65
+ composer.render();
66
+ }
67
+ renderer.setAnimationLoop(animate);
68
+ ```
69
+
70
+ See [examples/workflow-composer-bloom.md](examples/workflow-composer-bloom.md).
71
+
72
+ ## Doc map (official)
73
+
74
+ | Docs section | Representative links |
75
+ |--------------|----------------------|
76
+ | Postprocessing | https://threejs.org/docs/EffectComposer.html |
77
+ | Postprocessing | https://threejs.org/docs/RenderPass.html |
78
+ | Postprocessing | https://threejs.org/docs/UnrealBloomPass.html |
79
+ | Shaders (addon modules) | https://threejs.org/docs/module-CopyShader.html |
80
+
81
+ ## Scope
82
+
83
+ - **In scope:** Addon postprocessing passes and composer wiring; pointers to shader modules.
84
+ - **Out of scope:** Custom full-screen pipeline design outside three docs; engine-level frame graphs.
85
+
86
+ ## Common pitfalls and best practices
87
+
88
+ - Forgetting composer resize produces smeared or low-res effects.
89
+ - Pass order matters—bloom often after main scene pass, outline may need masks.
90
+ - Some passes need depth—ensure depth buffer availability per pass docs.
91
+
92
+ ## Documentation and version
93
+
94
+ Addon passes live under [Postprocessing](https://threejs.org/docs/#Postprocessing) and **Shaders** modules in [three.js docs](https://threejs.org/docs/). Pass constructors and required buffers change across versions—link the specific pass page (e.g. `UnrealBloomPass`) rather than guessing uniform names.
95
+
96
+ ## Agent response checklist
97
+
98
+ When answering under this skill, prefer responses that:
99
+
100
+ 1. Link `EffectComposer`, `RenderPass`, or the named pass (`SSAOPass`, …).
101
+ 2. Contrast **addon** composer stack with core `PostProcessing` + **threejs-node-tsl** when users mix terms.
102
+ 3. Require `setSize` on composer when **threejs-renderers** resizes.
103
+ 4. Point to **Shaders** group for raw shader modules used by `ShaderPass`.
104
+ 5. Warn about VR frame-time when stacking heavy passes (**threejs-webxr**).
105
+
106
+ ## References
107
+
108
+ - https://threejs.org/docs/#Postprocessing
109
+ - https://threejs.org/docs/EffectComposer.html
110
+ - https://threejs.org/docs/RenderPass.html
111
+
112
+ ## Keywords
113
+
114
+ **English:** effectcomposer, renderpass, bloom, ssao, ssr, outline, postprocessing, three.js
115
+
116
+ **中文:** 后期、EffectComposer、泛光、SSAO、SSR、屏幕空间、three.js
@@ -0,0 +1,15 @@
1
+ # Workflow: minimal composer with bloom
2
+
3
+ ## Steps
4
+
5
+ 1. Create `EffectComposer(renderer)`.
6
+
7
+ 2. Add `RenderPass(scene, camera)`.
8
+
9
+ 3. Add `UnrealBloomPass` with strength/radius/threshold per [UnrealBloomPass](https://threejs.org/docs/UnrealBloomPass.html).
10
+
11
+ 4. In animation loop: `composer.render()` instead of `renderer.render` for the final path—or follow the exact pattern from current examples (some versions use `composer.render()` only).
12
+
13
+ 5. On resize: `composer.setSize(width, height)`.
14
+
15
+ Verify against a known three.js example filename from the official repo for your version—API details shift between releases.