Initial Commit
This commit is contained in:
54
openspec/changes/enterprise-gaming-r3f-character/proposal.md
Normal file
54
openspec/changes/enterprise-gaming-r3f-character/proposal.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# OpenSpec Change: enterprise-gaming-r3f-character
|
||||
|
||||
- **Change ID**: enterprise-gaming-r3f-character
|
||||
- **Package**: `@suaveplan/r3f-character`
|
||||
- **Category**: gaming/character
|
||||
- **Target path**: `gaming/character/r3f-character`
|
||||
- **Status**: PROPOSED
|
||||
- **Date**: 2026-04-24
|
||||
- **Reference spec**: `/mnt/s/web/suaveplan/enterprise/r3f-character.md`
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
Deliver `@suaveplan/r3f-character` on the genesis branch from scratch at enterprise quality. The package provides a full character controller for 3D games in React Three Fiber. It wires `@suaveplan/character-physics` (capsule controller) to a Rapier rigid body via the `@suaveplan/r3f-physics-rapier` backend; drives Three.js `AnimationMixer` for locomotion blend tree (idle/walk/run/jump/fall); applies `@suaveplan/animation-events` foot IK and procedural modifiers; and exposes a `Character` component and `useCharacter()` hook. Genesis adds structured errors, OTel frame-time histogram, and 100% coverage.
|
||||
|
||||
---
|
||||
|
||||
## Available workspace deps
|
||||
|
||||
`@suaveplan/error`, `@suaveplan/types`, `@suaveplan/character-physics`, `@suaveplan/animation-events`, `@suaveplan/ik-solver`, `@suaveplan/events`, `@suaveplan/r3f-physics-rapier`, react, `@react-three/fiber`, `@react-three/drei`, three.
|
||||
|
||||
---
|
||||
|
||||
## Public API surface
|
||||
|
||||
```ts
|
||||
function Character(props: CharacterProps): JSX.Element
|
||||
// model, animations, controller, physicsBackend
|
||||
|
||||
function useCharacter(): CharacterContext
|
||||
// position, velocity, isGrounded, activeAnimation, playEmote()
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## File layout
|
||||
|
||||
```text
|
||||
gaming/character/r3f-character/
|
||||
package.json / tsconfig.json / vitest.config.ts
|
||||
src/
|
||||
index.ts / error-codes.ts
|
||||
types/common.ts + md
|
||||
core/
|
||||
locomotion/ (ts + md + types + test + index)
|
||||
animation-mixer-driver/ (ts + md + test + index)
|
||||
context/
|
||||
character-provider.tsx + md + test
|
||||
hooks/use-character.ts + md + test
|
||||
components/
|
||||
Character/ (tsx + md + test + stories + index)
|
||||
tests/integration.test.ts
|
||||
```
|
||||
36
openspec/changes/enterprise-gaming-r3f-character/tasks.md
Normal file
36
openspec/changes/enterprise-gaming-r3f-character/tasks.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# Tasks: enterprise-gaming-r3f-character
|
||||
|
||||
## 0. Pre-flight (non-negotiable)
|
||||
|
||||
- [ ] 0.1 Confirm clean working tree (`git status` reports nothing) and no in-flight worktrees with uncommitted work (`git worktree list` then `git status` in each)
|
||||
- [ ] 0.2 If any worktrees exist under `.claude/worktrees/`, account for each one: still-active agent, work-pending-merge, or stale-and-prune. Stale worktrees MUST be removed (`git worktree remove`) before opening a new one — code that has been lost twice on main is the failure mode this guards against.
|
||||
- [ ] 0.3 Confirm the package set in `MANIFEST.md` matches `find packages -maxdepth 3 -name package.json` count. Drift here means a prior change archived without regenerating the manifest.
|
||||
|
||||
## Phase 1 — Scaffold + types
|
||||
|
||||
- [ ] Create `gaming/character/r3f-character/`
|
||||
|
||||
## Phase 2 — Locomotion state machine
|
||||
|
||||
- [ ] idle/walk/run/jump/fall transitions from speed + isGrounded
|
||||
- [ ] Tests + docs
|
||||
|
||||
## Phase 3 — AnimationMixer driver
|
||||
|
||||
- [ ] Blend weight updates, crossfade, AnimationAction pool
|
||||
- [ ] Tests + docs
|
||||
|
||||
## Phase 4 — Character provider + `useCharacter`
|
||||
|
||||
- [ ] Context bridging physics + animation state
|
||||
- [ ] Tests + docs
|
||||
|
||||
## Phase 5 — `Character` component + story
|
||||
|
||||
- [ ] Wires physics backend, animation mixer, foot IK, procedural modifiers
|
||||
|
||||
## Phase 6 — Pre-publish gate
|
||||
|
||||
- [ ] `bunx turbo lint typecheck test --filter=@suaveplan/r3f-character` green
|
||||
- [ ] 100% coverage
|
||||
- [ ] Publish: `bun scripts/publish.ts --package @suaveplan/r3f-character`
|
||||
Reference in New Issue
Block a user