Create or update rules reference entries for game concepts. Use this skill to understand game concepts and terminology.
Use this skill in two scenarios:
/update-rules-reference.The rules reference (/[locale]/rules-reference/) is an alphabetical, searchable glossary of game concepts. Each entry explains a single concept and can cross-link to related entries.
Architecture:
.svelte.svximport.meta.glob@songsofdoom/gamepackages/web/src/lib/rules-reference/entries/{slug}/{slug}-{locale}.svelte — one directory per concept, one .svelte file per locale (ca, es, en). Legacy .svx files are also supported.packages/web/src/lib/components/rules-reference/
RuleEntry.svelte — displays a single entry on the rules reference pageRuleLink.svelte — cross-reference link component (auto-resolves localised titles)RuleSearch.svelte — search/filter UIThere are two types of rules reference entries:
Title comes from an existing model instance's title or name field. The model-sources.ts module auto-derives these from @songsofdoom/game:
stats record): strength, agility, intelligence, charisma, will, health, sanityentityTypes record): creature types, item types, etc.focuses record, excluding attribute-based duplicates)propertyData export, filtered by instanceof Rule)For model-sourced entries:
packages/web/src/lib/rules-reference/entries/{slug}/{slug}-{locale}.svelte where slug matches the model's keyUsed for game concepts without a dedicated model class (e.g., "capability", "opportunity", "obligation"). These entries require a title exported via <script module>.
For ad-hoc entries:
metadata with a title field via <script module lang="ts">packages/web/src/lib/rules-reference/entries/{slug}/{slug}-{locale}.svelte where slug is your chosen URL-friendly identifierFollow these steps:
packages/web/src/lib/rules-reference/model-sources.ts to see if it's already mapped. If it is, the entry is model-sourced and you should use that model's key as the slug.Create packages/web/src/lib/rules-reference/entries/{slug}/ with three .svelte files:
{slug}-ca.svelte (Catalan){slug}-es.svelte (Spanish){slug}-en.svelte (English)For model-sourced entries:
<script lang="ts">
import RuleLink from '$lib/components/rules-reference/RuleLink.svelte';
</script>
<p>[Explanation of the concept in the target language]</p>
For ad-hoc entries — provide title via module export:
<script module lang="ts">
export const metadata = { title: '[Title in the target language]' };
</script>
<script lang="ts">
import RuleLink from '$lib/components/rules-reference/RuleLink.svelte';
</script>
<p>[Explanation of the concept in the target language]</p>
Use the Example component to illustrate concepts with concrete examples:
<script lang="ts">
import Example from '$lib/components/Example.svelte';
</script>
<p>An action is one of the things a character can do during their turn.</p>
<Example>A warrior uses their action to attack an adjacent enemy.</Example>
Use the RuleLink component for cross-references between entries:
See <RuleLink slug="capability" label="Capabilities" /> for details.
<RuleLink slug="stat" transform="lowercase" /> values range from 1 to 5.
The RuleLink component auto-resolves the localised title from the slug. You can override with label or transform with transform="lowercase".
After creating the new entry, search all other rules reference entries for plain text mentions of the new concept that should become RuleLink components. For example, if you just created a toughness entry, search for the word "toughness" (and its translations) across all existing entry files in packages/web/src/lib/rules-reference/entries/.
.svelte entry files<RuleLink slug="{slug}" />, using label or transform="lowercase" as needed to preserve the original text's grammar and casingRuleLink import to any file that doesn't already have itRun npm run dev and navigate to /ca/rules-reference (or /es/rules-reference, /en/rules-reference) to verify your new entry appears and renders correctly.
packages/web/src/lib/rules-reference/entries/{slug}/.svelte)@songsofdoom/game instead of the front matterIf you're unsure about a game concept:
packages/web/src/lib/rules-reference/entries/ to understand the game's terminology and mechanicspackages/game/src/models/ for type definitions and structurepackages/game/src/data/ for concrete examples of how concepts are used in game contentEntries use .svelte files. Standard Svelte component conventions apply:
<script lang="ts"> for imports<script module lang="ts">export const metadata = { title: '...' };</script>Legacy .svx (mdsvex) files are also supported by the loader but should not be used for new entries.
ca, es, en (Catalan first, English last)RuleLink component over markdown links for better maintainability and auto-resolution of titles