dylanebert commited on
Commit
712a0e0
Β·
1 Parent(s): bc7e9cd

better agents.md

Browse files
Files changed (1) hide show
  1. agents.md +42 -109
agents.md CHANGED
@@ -1,18 +1,18 @@
1
- VibeGame is a 3D game engine with declarative XML syntax and ECS architecture. This file provides essential context for AI agents working with the engine.
2
 
3
- ## Core Concepts
4
 
5
- **ECS Architecture**: Entity-Component-System pattern where entities are IDs, components are data containers, and systems contain logic.
6
 
7
- **Declarative XML**: Game entities defined in HTML-like syntax within `<world>` tags.
8
-
9
- **Auto-Creation**: Engine automatically creates player, camera, and lighting if not explicitly defined.
10
 
11
  ## Essential Syntax
12
 
13
  ```xml
14
  <world canvas="#game-canvas" sky="#87ceeb">
15
- <!-- Ground (REQUIRED to prevent player falling) -->
16
  <static-part pos="0 -0.5 0" shape="box" size="20 1 20" color="#90ee90"></static-part>
17
 
18
  <!-- Physics objects -->
@@ -23,133 +23,66 @@ VibeGame is a 3D game engine with declarative XML syntax and ECS architecture. T
23
  </world>
24
  ```
25
 
26
- ## Key Recipes
27
 
28
- - `<static-part>` - Immovable objects (grounds, walls, platforms)
29
- - `<dynamic-part>` - Gravity-affected objects (balls, crates, debris)
30
- - `<kinematic-part>` - Script-controlled physics (moving platforms, doors)
31
- - `<player>` - Player character (auto-created if missing)
32
- - `<camera>` - Orbital camera (auto-created if missing)
33
- - `<entity>` - Base entity with any components via attributes
34
 
35
- ## Critical Physics Rule
36
 
37
- ⚠️ **Physics bodies override transform positions!** Always set position on the body, not the transform, for physics entities.
38
 
39
  ```xml
40
- <!-- βœ… BEST: Use recipe with pos shorthand -->
41
- <dynamic-part pos="0 5 0" shape="sphere" size="1"></dynamic-part>
42
 
43
- <!-- ❌ WRONG: Transform position ignored if body exists -->
44
  <entity transform="pos: 0 5 0" body collider></entity>
45
  ```
46
 
47
- ## Component System
48
-
49
- Components declared as bare attributes (defaults) or with values:
50
 
51
  ```xml
52
- <!-- Bare attributes use defaults -->
53
  <entity transform body collider renderer></entity>
54
 
55
- <!-- Override specific properties -->
56
  <entity transform="pos: 0 5 0" body="type: dynamic; mass: 10" collider renderer></entity>
57
  ```
58
 
59
- Shorthands automatically expand to matching component properties:
60
-
61
- - `pos="x y z"` β†’ applies to transform.pos* AND body.pos*
62
- - `color="#ff0000"` β†’ applies to renderer.color
63
- - `size="2"` β†’ broadcasts to sizeX, sizeY, sizeZ
64
-
65
- ## TypeScript API
66
-
67
- ```typescript
68
- import * as GAME from "vibegame";
69
-
70
- // Component definition
71
- const Health = GAME.defineComponent({
72
- current: GAME.Types.f32,
73
- max: GAME.Types.f32,
74
- });
75
-
76
- // System with query
77
- const healthQuery = GAME.defineQuery([Health]);
78
- const HealthSystem: GAME.System = {
79
- update: (state) => {
80
- const entities = healthQuery(state.world);
81
- for (const entity of entities) {
82
- Health.current[entity] -= 1 * state.time.deltaTime;
83
- }
84
- },
85
- };
86
-
87
- // Plugin registration
88
- GAME.withComponent("health", Health).withSystem(HealthSystem).run();
89
- ```
90
-
91
- ## Available Features
92
-
93
- βœ… **Core Systems**: Physics (Rapier 3D), rendering (Three.js), input (keyboard/mouse/gamepad), tweening, transforms
94
-
95
- βœ… **Game Elements**: Player controller, orbital camera, collision detection, respawn system, post-processing effects
96
-
97
- ❌ **Not Built-In**: Audio, multiplayer, save/load, inventory, AI/pathfinding, particles, custom shaders
98
 
99
  ## Development Commands
100
 
101
- ```bash
102
- # Project creation
103
- npm create vibegame@latest my-game
104
- cd my-game
105
-
106
- # Development
107
- bun dev # Start dev server
108
- bun run build # Production build
109
- bun run check # TypeScript validation
110
- bun run lint --fix # ESLint analysis
111
- bun test # Run tests
112
- ```
113
-
114
- ## Getting More Information
115
-
116
- **Comprehensive Documentation**: Use Context7 to fetch detailed documentation with examples:
117
-
118
- ```typescript
119
- // For AI agents with Context7 access:
120
- // Use mcp__context7__resolve-library-id to find "vibegame"
121
- // Then use mcp__context7__get-library-docs with the resolved ID
122
- // This provides the full 2000+ line documentation with detailed examples
123
- ```
124
 
125
- **Quick References**:
126
 
127
- - Shapes: `box`, `sphere`, `cylinder`, `capsule`
128
- - Physics Types: `static` (fixed), `dynamic` (gravity), `kinematic` (scripted)
129
- - Easing: `linear`, `sine-in-out`, `quad-out`, `bounce-in`, etc.
130
- - Loop Modes: `once`, `loop`, `ping-pong`
131
 
132
- ## Common Patterns
133
 
134
- **Basic Platformer**: Ground + static platforms + player (auto-created)
135
- **Physics Playground**: Ground + walls + dynamic objects with collision
136
- **Moving Platforms**: Kinematic bodies + position tweening
137
- **Collectibles**: Kinematic objects + rotation tweening + collision detection
138
 
139
- ## Best Practices for AI Development
 
 
140
 
141
- 1. **Always include ground** - Player falls without platforms
142
- 2. **Use recipes over raw entities** - Cleaner and more reliable
143
- 3. **Leverage auto-creation** - Engine handles player/camera/lighting defaults
144
- 4. **Physics position priority** - Set positions on bodies, not transforms
145
- 5. **Query Context7 for details** - This file is overview only, get specifics via Context7
146
- 6. **Test incrementally** - Start simple, add complexity progressively
147
 
148
- ## Architecture Notes
149
 
150
- - **Plugin System**: Bevy-inspired modular architecture
151
- - **Update Phases**: SetupBatch β†’ FixedBatch β†’ DrawBatch
152
- - **Context Management**: Use /clear frequently in Claude Code sessions
153
- - **Parallel Operations**: Invoke multiple tools simultaneously for efficiency
 
 
154
 
155
- This context enables basic VibeGame development. For detailed API references, extensive examples, or advanced features, fetch comprehensive documentation via Context7.
 
1
+ # VibeGame Engine Context
2
 
3
+ You are a VibeGame specialist. VibeGame is a 3D game engine with declarative XML syntax and ECS architecture. Your role is to help users create games efficiently using VibeGame's declarative approach.
4
 
5
+ ## Core Architecture
6
 
7
+ **ECS Pattern**: Entities (IDs) + Components (data) + Systems (logic)
8
+ **Declarative XML**: Game entities defined in `<world>` tags
9
+ **Auto-Creation**: Engine provides player, camera, lighting by default
10
 
11
  ## Essential Syntax
12
 
13
  ```xml
14
  <world canvas="#game-canvas" sky="#87ceeb">
15
+ <!-- REQUIRED: Ground to prevent falling -->
16
  <static-part pos="0 -0.5 0" shape="box" size="20 1 20" color="#90ee90"></static-part>
17
 
18
  <!-- Physics objects -->
 
23
  </world>
24
  ```
25
 
26
+ ## Key Recipes & Components
27
 
28
+ - `<static-part>` - Immovable (grounds, walls)
29
+ - `<dynamic-part>` - Gravity-affected (balls, crates)
30
+ - `<kinematic-part>` - Script-controlled (moving platforms)
31
+ - `<player>`, `<camera>` - Auto-created if missing
32
+ - `<entity>` - Base with custom components
 
33
 
34
+ ## Critical Rules
35
 
36
+ ⚠️ **Physics Override**: Body position overrides transform position. Always use `pos` on physics entities.
37
 
38
  ```xml
39
+ <!-- βœ… CORRECT -->
40
+ <dynamic-part pos="0 5 0" shape="sphere"></dynamic-part>
41
 
42
+ <!-- ❌ WRONG: Transform ignored -->
43
  <entity transform="pos: 0 5 0" body collider></entity>
44
  ```
45
 
46
+ ## Component Syntax
 
 
47
 
48
  ```xml
49
+ <!-- Bare attributes = defaults -->
50
  <entity transform body collider renderer></entity>
51
 
52
+ <!-- Override properties -->
53
  <entity transform="pos: 0 5 0" body="type: dynamic; mass: 10" collider renderer></entity>
54
  ```
55
 
56
+ **Shorthands**: `pos`, `color`, `size` auto-expand to matching component properties.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  ## Development Commands
59
 
60
+ - `bun dev` - Start development server
61
+ - `bun run build` - Production build
62
+ - `bun run check` - TypeScript validation
63
+ - `bun test` - Run tests
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
 
65
+ ## Features Available
66
 
67
+ βœ… Physics (Rapier), rendering (Three.js), input, tweening, player controller, orbital camera, collision detection, respawn, post-processing
 
 
 
68
 
69
+ ❌ Audio, multiplayer, save/load, inventory, AI, particles, custom shaders
70
 
71
+ ## Documentation Access
 
 
 
72
 
73
+ **For detailed information**: Use Context7 to fetch comprehensive docs:
74
+ 1. `mcp__context7__resolve-library-id` with "/dylanebert/vibegame"
75
+ 2. `mcp__context7__get-library-docs` with resolved ID
76
 
77
+ **Quick Reference**: Shapes (`box`, `sphere`, `cylinder`, `capsule`), Physics (`static`, `dynamic`, `kinematic`), Easing functions, Loop modes (`once`, `loop`, `ping-pong`)
 
 
 
 
 
78
 
79
+ ## Best Practices
80
 
81
+ 1. Always include ground platforms
82
+ 2. Use recipes over raw entities
83
+ 3. Leverage auto-creation defaults
84
+ 4. Set positions on physics bodies, not transforms
85
+ 5. Query Context7 for detailed API references
86
+ 6. Test incrementally
87
 
88
+ This provides foundational VibeGame knowledge. Use Context7 for comprehensive documentation and examples.