Skip to content

Commit b8c4f1b

Browse files
graylikemeclaude
andcommitted
docs: document ammo linkage in llms.txt and README
Add ammo linkage bullet to Key Concepts, add ammoFor example query, update ammoTypes example to use AC/20. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8665e19 commit b8c4f1b

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A GraphQL API serving BattleTech unit, equipment, faction, and era data sourced
55
## Stack
66

77
- **API:** Rust · axum 0.8 · async-graphql 7 · sqlx 0.8 · PostgreSQL 16
8-
- **Scraper:** imports from MegaMek unit files (MTF + BLK formats) including per-slot critical hit tables, the Master Unit List (BV, roles, availability, clan names), and equipment stats seed data (including ammo shots-per-ton)
8+
- **Scraper:** imports from MegaMek unit files (MTF + BLK formats) including per-slot critical hit tables, the Master Unit List (BV, roles, availability, clan names), equipment stats seed data (including ammo shots-per-ton), and ammo-to-weapon linkage
99
- **Ops:** Prometheus metrics at `/metrics`, Dockerfile (musl/Alpine), IP rate limiting
1010

1111
## Quick start

crates/api/src/handlers/llms_txt.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ GET {base_url}/schema.graphql
3333
- **Crits**: number of critical hit slots an equipment item occupies
3434
- **Slots**: 1-indexed critical slot positions within a location. For a 5-crit weapon starting at slot 4: `[4, 5, 6, 7, 8]`. Null for non-mech units or legacy data. Slot numbers may have gaps where structural components (actuators, engine, gyro) occupy slots
3535
- **Shots per ton** (`shotsPerTon`): number of rounds of ammunition per ton of ammo. Standard BattleTech values (e.g. AC/20 ammo = 5, SRM-2 ammo = 50). Null for non-ammo equipment
36+
- **Ammo linkage**: ammunition items are linked to their parent weapon via `ammoFor` (ammo → weapon) and `ammoTypes` (weapon → compatible ammo list). Covers ~930 of ~1,290 ammo types (capital ship weapons excluded)
3637
- **Resolved component types**: `mechData` provides both raw MegaMek strings (e.g. `engineTypeRaw`) and resolved references (e.g. `engine`) with full construction properties (weight multipliers, crit slots, etc.)
3738
- **Construction reference**: prescriptive data for unit builders — component types with weights, crit slots, and rules; engine weight table; internal structure table
3839
@@ -311,19 +312,31 @@ To paginate: pass `endCursor` from the previous response as `after` in the next
311312
### Find ammo types for a weapon
312313
```graphql
313314
{{
314-
equipment(slug: "autocannon-10") {{
315+
equipment(slug: "autocannon-20") {{
315316
name
316317
ammoTypes {{
317318
slug
318319
name
319-
tonnage
320-
bv
321320
shotsPerTon
322321
}}
323322
}}
324323
}}
325324
```
326325
326+
### Look up which weapon an ammo type belongs to
327+
```graphql
328+
{{
329+
equipment(slug: "is-ammo-ac-20") {{
330+
name
331+
shotsPerTon
332+
ammoFor {{
333+
slug
334+
name
335+
}}
336+
}}
337+
}}
338+
```
339+
327340
### Construction reference — fetch all data for builder initialization
328341
```graphql
329342
{{

0 commit comments

Comments
 (0)