Skip to content

Commit 6d48807

Browse files
committed
ci: add automated build, test, and evaluation workflow and update README with status badges and project documentation
1 parent b14ce13 commit 6d48807

2 files changed

Lines changed: 118 additions & 75 deletions

File tree

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
name: Build & Test
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Typecheck
26+
run: npm run typecheck
27+
28+
- name: Build playground
29+
run: npm run build
30+
31+
- name: Run unit tests
32+
run: npm test
33+
34+
- name: Run biomechanical evals
35+
run: npm run eval

README.md

Lines changed: 83 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ as a tiny human-readable language that renders to an animated 3D figure in the b
1212
<a href="packages/posecode-mcp">MCP server</a>
1313
</p>
1414

15+
<p align="center">
16+
<a href="https://github.com/posecode-dev/posecode/actions/workflows/ci.yml"><img src="https://github.com/posecode-dev/posecode/actions/workflows/ci.yml/badge.svg" alt="CI Status"/></a>
17+
<a href="https://www.npmjs.com/package/posecode-parser"><img src="https://img.shields.io/npm/v/posecode-parser.svg?color=emerald" alt="npm version"/></a>
18+
<a href="https://github.com/posecode-dev/posecode/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"/></a>
19+
<a href="https://github.com/posecode-dev/posecode/tree/main/packages/posecode-mcp"><img src="https://img.shields.io/badge/MCP-Compatible-orange.svg" alt="MCP Compatible"/></a>
20+
</p>
21+
1522
<table align="center">
1623
<tr>
1724
<td align="center"><img src="docs/media/deadlift.gif" width="230" alt="Deadlift rendered from .posecode text"/><br/><sub><code>pelvis: hinge</code>, deadlift</sub></td>
@@ -22,69 +29,81 @@ as a tiny human-readable language that renders to an animated 3D figure in the b
2229

2330
---
2431

25-
## Why
26-
27-
Ask an LLM to explain a push-up and it can only give you prose or a flat image.
28-
The model *knows* the biomechanics ("elbows flex, shoulders abduct on the
29-
descent"), it just has no syntax to express it that a renderer can read.
30-
Diffusion-based text-to-motion models exist, but they're heavy, expensive, and
31-
give you no fine control over the anatomical phases.
32-
33-
Posecode takes the opposite, lightweight approach (see [the research](#background)):
34-
35-
- The LLM writes a small **`.posecode`** document: semantic phases, not 3D matrices.
36-
- A **client-side** parser + Three.js renderer animates it. Generation is a
37-
fraction of a cent of text; rendering runs at 60fps on a phone.
38-
- Every angle is **hard-clamped to a healthy range of motion**, so a model
39-
hallucinating "knee flex 200°" can't produce an anatomically impossible joint.
40-
41-
```posecode
42-
posecode exercise "Body-weight squat"
43-
rig humanoid
44-
pose start = standing
45-
46-
step "Descend" 1.6s ease-in-out:
47-
hips: flex 80
48-
knees: flex 95
49-
ankles: dorsiflex 14
50-
ground-lock: feet
51-
cue "Sit the hips back, chest proud, knees track over the toes"
52-
53-
step "Drive up" 1.2s ease-out:
54-
hips: flex 0
55-
knees: flex 0
56-
ankles: dorsiflex 0
57-
ground-lock: feet
58-
cue "Drive through the heels to stand tall"
59-
60-
repeat 8
32+
## Why Posecode?
33+
34+
Ask an LLM to explain a physical movement, and it will give you unstructured prose or a static, flat diagram. But large language models already *understand* the biomechanics of movement (e.g., "elbows flex, shoulders abduct on the descent of a push-up"). They just lack a standardized syntax to express it in a way that a computer can render dynamically.
35+
36+
### Why not diffusion text-to-motion models?
37+
38+
While neural network-based text-to-motion models exist, they are impractical for consumer web applications:
39+
- **Resource Intensive**: They require heavy, expensive GPU hosting, making real-time generation and scaling cost-prohibitive.
40+
- **No Fine Control**: They output black-box 3D coordinate trajectories, making it impossible to adjust anatomical phases, joint limits, or speed programmatically.
41+
- **Safety Hazards**: There are no safety boundaries, meaning the model can easily render joint extensions that are anatomically impossible or physically dangerous.
42+
43+
### The Posecode Approach
44+
45+
Posecode takes the opposite, lightweight approach:
46+
- **Text-Driven**: The LLM writes a tiny **`.posecode`** text document specifying semantic joint angles and phase times—generation costs a fraction of a cent.
47+
- **Unbelievably Fast**: A client-side parser and WebGL renderer animate the figure at 60 FPS directly in the browser—even on low-end mobile devices.
48+
- **Anatomically Safe**: Every joint rotation is **clamped to clinical range-of-motion limits** from standard physiotherapy tables. Hallucinations like `knee: flex 200` are safely capped with warnings.
49+
50+
---
51+
52+
## The Idea in 30 Seconds
53+
54+
A `.posecode` file describes human movements as a sequence of timed steps with targeted joint movements and range-of-motion rules:
55+
56+
| 1. Write `.posecode` | 2. Render 3D Animation |
57+
| :--- | :--- |
58+
| **`posecode`** `exercise "Body-weight squat"`<br/>&nbsp;&nbsp;**`rig`** `humanoid`<br/>&nbsp;&nbsp;**`pose`** `start = standing`<br/><br/>&nbsp;&nbsp;**`step`** `"Descend" 1.6s ease-in-out`:<br/>&nbsp;&nbsp;&nbsp;&nbsp;`hips: flex 80`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`knees: flex 95`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`ankles: dorsiflex 14`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`ground-lock: feet`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`cue "Sit the hips back..."`<br/><br/>&nbsp;&nbsp;**`step`** `"Drive up" 1.2s ease-out`:<br/>&nbsp;&nbsp;&nbsp;&nbsp;`hips: flex 0`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`knees: flex 0`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`ankles: dorsiflex 0`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`ground-lock: feet`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`cue "Drive through the heels..."`<br/><br/>&nbsp;&nbsp;**`repeat`** `8` | <img src="docs/media/squat.gif" width="340" alt="Squat animation"/> |
59+
60+
---
61+
62+
## Installation & Usage
63+
64+
Choose the integration path that fits your use case:
65+
66+
### 🌐 Live Playground (No installation)
67+
Instantly preview, edit, and share movements in the browser:
68+
👉 **[posecode.org/play](https://posecode.org/play)**
69+
70+
### 🤖 MCP Server (For AI Agents)
71+
Teach your AI agent (in Claude Desktop, Cursor, etc.) to read, write, and render Posecode natively using our Model Context Protocol server:
72+
```bash
73+
# Add to your MCP client config (e.g. claude_desktop_config.json):
74+
npx posecode-mcp
6175
```
76+
*See the [MCP Package README](packages/posecode-mcp/README.md) for full configuration options.*
77+
78+
### 📦 Web Component Embed (For Blogs & Docs)
79+
Embed an interactive, low-poly 3D player on any page using a single `<script>` tag:
80+
```html
81+
<script src="https://unpkg.com/posecode-embed/dist/posecode-embed.js"></script>
6282

63-
## Try it
83+
<posecode-player src="/movements/squat.posecode"></posecode-player>
84+
```
85+
*See the [Embed Package README](packages/posecode-embed/README.md) for customizing autoplay, controls, speed, and styling.*
6486

87+
### 💻 Core Libraries (For custom JS/TS apps)
88+
Build custom rendering or parsing logic directly in your own applications:
6589
```bash
66-
npm install
67-
npm run dev # opens the playground (Vite) at http://localhost:5173
68-
npm test # parser + renderer + eval test suites
69-
npm run eval # fidelity scorecard: geometric invariants over every example
90+
# Parser only (converts text to range-of-motion clamped IR)
91+
npm install posecode-parser
92+
93+
# WebGL 3D Renderer (built on Three.js)
94+
npm install posecode-render
7095
```
7196

72-
In the playground: pick an example, watch it animate, edit the text live, and
73-
hit **Copy LLM prompt** to get a system prompt that teaches ChatGPT/Claude to
74-
write Posecode for you, or wire up the [MCP server](packages/posecode-mcp) so
75-
your agent authors, validates, and renders movements natively.
97+
---
7698

7799
## How Posecode stays honest
78100

79101
Two safety layers ship with the language:
80102

81-
- **ROM clamping**: every angle is hard-clamped to healthy range-of-motion
82-
tables before rendering; a hallucinated `knee: flex 200` renders at its
83-
ceiling with a warning, never an impossible joint.
84-
- **Fidelity evals**: [`posecode-eval`](packages/posecode-eval) re-runs the
85-
real parser → FK → ground-lock pipeline headlessly and scores geometric
86-
invariants ("a deadlift pitches the torso ≥ 50° with vertical shins"). Every
87-
example must pass every invariant in CI.
103+
- **ROM clamping**: every angle is hard-clamped to healthy range-of-motion tables before rendering; a hallucinated `knee: flex 200` renders at its ceiling with a warning, never an impossible joint.
104+
- **Fidelity evals**: [`posecode-eval`](packages/posecode-eval) re-runs the real parser → FK → ground-lock pipeline headlessly and scores geometric invariants ("a deadlift pitches the torso ≥ 50° with vertical shins"). Every example must pass every invariant in CI.
105+
106+
---
88107

89108
## Packages
90109

@@ -97,40 +116,29 @@ Two safety layers ship with the language:
97116
| [`posecode-eval`](packages/posecode-eval) | Fidelity harness: headless kinematic probing + biomechanical invariant scoring. |
98117
| [`playground`](playground) | Live editor + 3D viewport + warnings + the LLM prompt + shareable links. |
99118

100-
The protocol and both libraries are **MIT-licensed**: the open core. See
101-
[`spec/SPEC.md`](spec/SPEC.md) for the full language and
102-
[`spec/llm-authoring.md`](spec/llm-authoring.md) for the authoring prompt.
103-
For where Posecode spreads fastest and the per-domain go-to-market plan, see
104-
[`docs/market-research.md`](docs/market-research.md); for the engine roadmap,
105-
[`ROADMAP.md`](ROADMAP.md).
119+
The protocol and both libraries are **MIT-licensed**: the open core. See [`spec/SPEC.md`](spec/SPEC.md) for the full language and [`spec/llm-authoring.md`](spec/llm-authoring.md) for the authoring prompt.
120+
For where Posecode spreads fastest and the per-domain go-to-market plan, see [`docs/market-research.md`](docs/market-research.md); for the engine roadmap, [`ROADMAP.md`](ROADMAP.md).
121+
122+
---
106123

107124
## Scope (v0.1)
108125

109-
✅ Single-person movement across fitness, physio, desk, dance, education & rehab ·
110-
Mermaid-style DSL · ROM safety clamping (authored **and IK-solved** angles) ·
111-
forward kinematics · ground-lock **and ROM-constrained reach-to-target IK** ·
112-
hip-hinge · lying/seated poses · scene props (chair/wall/bar) · a single-DOF
113-
hand rig · live playground.
126+
✅ Single-person movement across fitness, physio, desk, dance, education & rehab · Mermaid-style DSL · ROM safety clamping (authored **and IK-solved** angles) · forward kinematics · ground-lock **and ROM-constrained reach-to-target IK** · hip-hinge · lying/seated poses · scene props (chair/wall/bar) · a single-DOF hand rig · live playground.
127+
128+
⏳ Deferred: two-person / partner movements + collision detection, deeper props (load, bands, rings), multi-joint fingers, FBX/GLB export, hosted SaaS editor and the expert-verified motion marketplace.
114129

115-
⏳ Deferred: two-person / partner movements + collision detection, deeper props
116-
(load, bands, rings), multi-joint fingers, FBX/GLB export, hosted SaaS editor and
117-
the expert-verified motion marketplace.
130+
---
118131

119132
## Background
120133

121-
This project follows a design study, *"Kinematic Motion Definition Protocols for
122-
Large Language Models"*, which argues for a semantic DSL over diffusion models,
123-
specifies ROM-based safety constraints from clinical normative data, and lays
124-
out the open-core commercialization path. The spec cross-references its
125-
sections (§4 DSL, §5 biomechanics, §6 client rendering, §7 strategy).
134+
This project follows a design study, *"Kinematic Motion Definition Protocols for Large Language Models"*, which argues for a semantic DSL over diffusion models, specifies ROM-based safety constraints from clinical normative data, and lays out the open-core commercialization path. The spec cross-references its sections (§4 DSL, §5 biomechanics, §6 client rendering, §7 strategy).
135+
136+
> ⚠️ Posecode's range-of-motion values are general literature data, not medical advice. Consult a qualified professional for physiotherapy or exercise prescription.
126137
127-
> ⚠️ Posecode's range-of-motion values are general literature data, not medical
128-
> advice. Consult a qualified professional for physiotherapy or exercise
129-
> prescription.
138+
---
130139

131140
## Feedback & Support
132141

133142
We'd love to hear your feedback! You can reach us in two ways:
134143
- **Email**: Send us an email at [hello@posecode.org](mailto:hello@posecode.org?subject=Posecode%20Feedback).
135144
- **GitHub Issues**: If you found a bug or have a feature request, please [open a GitHub Issue](https://github.com/posecode-dev/posecode/issues).
136-

0 commit comments

Comments
 (0)