| name | update-reverie-inventory |
| description | Update the Reverie domain schema inventory when schemas are added or removed. Use when adding new domains, after CI flags inventory mismatches, or periodically to ensure docs match the registry. |
Update Reverie Inventory Skill
When to Activate
Activate this skill when:
- Adding new Reverie domain schemas
- Removing or deprecating domains
- The reverie-inventory CI check fails
- You want to verify inventory matches the schema registry
- After modifying field counts in existing schemas
- Adding or removing atmosphere entries
Files Involved
| File | Purpose |
|---|
.github/reverie-inventory.json | Source of truth for schema counts and metadata |
libs/engine/src/lib/reverie/index.ts | Schema registry and domain catalog |
libs/engine/src/lib/reverie/types.ts | DomainId type union and type definitions |
libs/engine/src/lib/reverie/atmosphere.ts | Atmosphere manifold entries |
libs/engine/src/lib/reverie/schemas/**/*.ts | Individual domain schema files |
docs/specs/reverie-spec.md | Reverie specification |
Inventory Structure
The inventory tracks schemas with full metadata:
{
"schemas": {
"total": 32,
"implemented": 32,
"planned": 0,
"breakdown": {
"identity": 3,
"appearance": 6,
"content": 3,
"social": 4,
"curios": 14,
"infra": 2
},
"byPhase": { "1": 5, "2": 6, "3": 6, "4": 12, "5": 3 }
},
"fields": {
"total": 176,
"byGroup": { ... }
},
"atmospheres": {
"total": 14,
"keywords": ["cozy", "cottagecore", ...]
},
"domains": [
{ "id": "foliage.accent", "group": "appearance", "phase": 1, "fieldCount": 1, "file": "appearance/accent.ts" }
]
}
Step-by-Step Process
1. Count Schema Files
find libs/engine/src/lib/reverie/schemas -name "*.ts" -type f | wc -l
find libs/engine/src/lib/reverie/schemas -name "*.ts" -type f | sort
2. Count Fields in Each Schema
grep -c "type:" libs/engine/src/lib/reverie/schemas/**/*.ts
3. Count Atmospheres
grep -c "keyword:" libs/engine/src/lib/reverie/atmosphere.ts
4. Compare with Inventory
jq '.schemas.total, .schemas.implemented, .fields.total, .atmospheres.total' .github/reverie-inventory.json
5. Identify Discrepancies
Look for:
- New schemas: Schema files that exist but aren't in the inventory
- Removed schemas: Inventory entries without corresponding files
- Field count changes: Schema field counts that don't match inventory
- Missing DomainId: Schema IDs not in the DomainId type union
- Missing registry entries: Schemas not in SCHEMA_REGISTRY
- Missing catalog entries: Schemas not in DOMAIN_CATALOG
6. Update Inventory JSON
Edit .github/reverie-inventory.json:
-
Update schema counts:
"schemas": {
"total": <file count>,
"implemented": <implemented count>,
"planned": <planned count>,
"breakdown": { <group counts> }
}
-
Update field counts:
"fields": {
"total": <sum of all fieldCount>,
"byGroup": { <group field sums> }
}
-
Add/remove domain entries
-
Update atmospheres if changed
-
Update metadata:
"lastUpdated": "YYYY-MM-DD",
"lastAuditedBy": "claude/<context>"
7. Update DomainId Type (if adding new domains)
Edit libs/engine/src/lib/reverie/types.ts:
export type DomainId =
| "identity.profile"
| "identity.newdomain"
8. Update Schema Registry (if adding new domains)
Edit libs/engine/src/lib/reverie/index.ts:
- Add import for the new schema
- Add entry to
SCHEMA_REGISTRY
- Add/update entry in
DOMAIN_CATALOG
9. Commit Changes
git add .github/reverie-inventory.json libs/engine/src/lib/reverie/
git commit -m "docs: update reverie inventory
- Add <domain_id> to inventory
- Update schema total: X -> Y
- Update field total: X -> Y"
Quick Reference Commands
find libs/engine/src/lib/reverie/schemas -name "*.ts" -type f | wc -l
grep -rh "id:" libs/engine/src/lib/reverie/schemas/ | grep -oP '"[a-z]+\.[a-z]+"' | sort -u
grep -c "keyword:" libs/engine/src/lib/reverie/atmosphere.ts
grep -rh "type:" libs/engine/src/lib/reverie/schemas/ | grep -v "import\|export\|DomainSchema\|cursorType\|pollType" | wc -l
jq '{schemas: .schemas.total, implemented: .schemas.implemented, fields: .fields.total, atmospheres: .atmospheres.total}' .github/reverie-inventory.json
jq -r '.domains[] | "\(.group)\t\(.id)\t\(.fieldCount) fields"' .github/reverie-inventory.json | sort
Adding a New Domain (Full Checklist)
When adding a new domain schema:
CI Integration
The .github/workflows/reverie-inventory.yml workflow:
- Runs on PRs touching
libs/engine/src/lib/reverie/**
- Counts schema files and compares to inventory
- Counts field definitions and compares to inventory
- Counts atmosphere entries and compares to inventory
- Comments on PRs when there's a mismatch
- Creates issues for drift on scheduled runs (Fridays)
When CI fails, run this skill to fix the mismatch.
Checklist
Before finishing: