Kotlin is a slightly nicer formatter
Document the image field type and the generated CSS class reference
Fields.md: add the `image` field (system-stored images + `primary: true` portrait binding that makes the token img placeable and auto-hides the drawer portrait). Theming.md: exhaustive, source-derived CSS class reference for sidecar/custom styling, with a cross-link from Fields.md.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Correct where:/choice docs -- choice filtering works
Previous commit was wrong: where: DOES filter choice<string> and
choice<damageType> fields -- the compiler auto-resolves them to .value
(method-generator.ts ItemAccess). Restore the choice<string> example,
replace the false 'cannot filter choices' caveat with an accurate note,
and keep the fields:-takes-unquoted-identifiers note.
Fix table where: example filtering a choice field
The Item List example defined Type as choice<string> then filtered it
with where: item.Type equals "Armor", which never matches -- choice
fields store a {value,...} object, not a bare value. Switch the example
to a plain string field so the where: clauses actually work, and add a
caveat noting where: only filters plain string/number/boolean fields.
Also note fields: takes unquoted identifiers.
rollVisualizer wiki: input.X supports number/die/dice inputs
Update the prompt section to note input.X works with number, die, and
dice inputs (not just numeric), with a RollBuilder example.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Document rollVisualizer input.X live prompt reactivity (Phase 2)
Replace the Phase 1 "static preview on prompts" note with input.X usage
and the live-update behavior.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Document the rollVisualizer field
Add Fields.md section + summary row: value: expression, exact convolution
vs simulation (≈), live sheet reactivity, and the prompt static-preview note.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Document calling functions from calculated values
- Advanced-Logic: new "Functions in Calculated Values" section covering
value:/min:/max:/initial:/mod: usage and the purity requirement (no rolls,
chat, document writes incl. ++/+=, or prompts; purity is transitive)
- Fields: cross-link the number value: docs to the purity rule
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Document attribute function: and table imageAction: params
- attribute function: — run a no-arg function on click for full control
(alternative to roll:, mutually exclusive, must be on the same document)
- table imageAction: — click a row's image to run a named action on that
item, scoped to the image cell with a hover affordance
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Document computed `initial:` on number fields
`initial:` now accepts a computed expression (applied once at creation, can
reference derived values), in addition to a literal default. Update the param
description and add an example.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fix table `fields:` syntax: bare identifiers, not quoted strings
The `fields:` table param takes bare field identifiers (e.g. [Name, Type,
Weight]), not quoted strings -- the quoted form is a parse error. Update the
example and clarify the parameter description.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Document table image param and table/column visibility
Add the `image:` table param, clarify that Image/Name are configurable
columns, and document table-level + per-column visibility behavior (including
the method-block limitation). Add a visibility note to the Pinned Field
section.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
docs: add damageTrack field documentation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
docs: add 'Reference Fields' section answering 'what does self.X substitute?'
The fresh audit's #1 forward-looking pick was a real reference for
self<X> / parent<X> picker fields, with the answer to 'what does
self.MyRef substitute in an expression?' in the first paragraph.
Added a new top-level subsection above Parent Property Reference and
Self Property Reference (kept as subsections under it) that:
- States the picker concept up front - these fields let the user
choose which underlying field a reference points at, so action code
can stay agnostic to the choice.
- Provides a per-type substitution table answering the headline
question: self<attribute> substitutes the chosen attribute's mod;
self<resource>/<tracker> substitute the current value; self<die>
substitutes the die expression; etc.
- Confirms that the substitution rules match direct-access rules (so
if 'self.Strength' gives the mod, 'self.MyAttrRef' for an
attribute-typed picker gives the chosen attribute's mod too).
- Notes that parent<type> works identically, scoped to the owning
actor's fields.
- Documents the drill-in pattern: 'self.MyRef.max' / 'self.MyRef.temp'
to reach the underlying field's subproperties.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
docs: address fresh-audit findings + grammar-verified bug fixes
Audit-driven cleanup pass plus two real grammar bugs the auditor surfaced
indirectly. Verified each finding against the langium grammar before
fixing.
Grammar bugs fixed:
- 'choice<attribute>' is not in the grammar (the only choice<X> forms
are choice<string>, choice<damageType>, choice<DocumentType>). The
Your-first-System tutorial's Roller example used 'choice<attribute>
Attribute', which would fail to parse. Replaced with the real form
'self<attribute> Attribute', which is what the user actually wants
(picker over attributes on the same document).
- Ternary '?:' is not in the grammar - confirmed by grepping the
langium for any conditional/ternary expression rule. Interactivity.md
used ternary visibility throughout ('visibility: cond ? Visibility.X
: Visibility.Y'), which would not parse. Rewrote all six examples to
use the method-block form. The 'falling through with no return uses
default' pattern produces shorter code than the ternary anyway.
Wiki bugs fixed:
- Pinned Field example had two redundant 'string name' lines that were
also lowercase against PascalCase convention. Removed - documents
already have a built-in Name field.
- Document.md HP example referenced 'self.Endure', a field never
defined in the example. Changed to 'self.Fight' which is.
- Fields.md 'where:' filter examples used 'spell.X' for the iteration
alias when the alias is always 'item'. Fixed to 'item.X'.
- Home.md's 'Start with the Getting Started Guide' link was a hand-typed
full URL; switched to wiki-relative '[Getting Started](Getting-Started)'.
- Removed three suspicious-looking GitHub user-attachment URLs in the
money section (one is verifiably fake, the others are placeholder-
shaped) and the 'placeholder-inventory-image.png' 404'ing inventory
example image.
Documentation gaps closed:
- Visibility.default definition was inconsistent: Fields.md said
'displayed for all, only editable in Edit Mode' (correct per the
table); Interactivity.md said 'same as unlocked' (wrong - unlocked
always allows write). Reconciled to the Fields.md definition and
added a cross-link.
- Math.floor and Math.ceil added to Basic-Logic's common-math list
with a short note that floor is what you usually want for 'half
damage' patterns.
- Boolean field calculated values now show a method-block example
(computed boolean from another field's state), parallel to how
string and number already document calculated values.
- Getting-Started.md heal action uses bare 'amount' (matching the
bare-roll preference now established) and 'roll(d8)' for syntactic
consistency with Your-first-System.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
docs: correct stale features after grammar / codegen verification
After confirming behaviour against the codegen, several wiki claims were
either half-implemented or never wired up. These changes bring the docs
in line with what the generator actually does today.
Interactivity / Logic-Reference: action modifiers
- 'quick action' has no codegen support beyond grammar parsing - the
modifier is parsed but the generated sheet treats it identically to
a plain action. Removed the dedicated 'Quick and Macro Actions'
example, kept 'macro action' (which is wired up to the Foundry macro
hotbar), and added a note that 'quick' / 'secondary' modifiers are
grammar-only until further notice.
Interactivity / Logic-Reference: hooks
- Replaced the misleading 'on buffApplied(...)' / 'on levelUpEvent'
examples - ISDL has no way to *fire* custom hooks, only listen.
Replaced with a working 'on createActor(...)' example.
- Added a 'Listening to Foundry Hooks' section explaining that any
identifier maps to Hooks.on(<name>, ...) for any Foundry- or module-
emitted hook, alongside ISDL's own helper hooks (combat*, round*,
turn*, preApply*, applied*, death).
- Health-event hook parameters corrected to match the codegen: every
applied/preApply hook receives (amount, damageType, damageMetadata).
Interactivity / Logic-Reference: document updates
- Replaced 'update self' / 'update parent' with the canonical
'self.update()' and 'self.delete()'. The 'update Self' grammar form
is half-implemented in codegen (broken syntax in generated JS) and
shouldn't be in the docs.
- Reframed the Update section to explain that ISDL queues assignments
inside an action and flushes at end-of-body; self.update() is only
needed for in-action read-after-write.
Fields: wounds resource
- Tightened the wounds tag's documentation: it currently affects only
the visual presentation of the resource bar (blue/teal gradient,
reversed direction). The damage applicator does NOT auto-route to a
wounds resource - users wanting damage to fill a wounds pool need to
wire that up themselves (or use a preApplyDamage hook).
Fields: pinned field
- Clarified the pinning UX: items get pinned via a Pin toggle that
appears on every item row in the table/inventory display. The
'pinned' field on the actor only controls *where* the pinned-items
list renders. Users do not need to wire up the Pin toggle.
Fields: measuredTemplate
- Noted that a measuredTemplate field's value is a configuration object,
not a number/string. It renders as a friendly summary in chat blocks
but won't resolve usefully in numeric or string expressions outside
that context.
Logic-Reference: @js{...}
- Added a warning callout that @js{...} is an escape hatch with no
stable contract - what variables are in scope depends on where in the
generated code the block lands, and may change as codegen evolves.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
docs: address grammar-vs-wiki audit findings
Fixes broken examples and adds documentation for features that exist in
the langium grammar but were absent or misrepresented in the wiki.
Broken examples now corrected:
- Action params (Fields.md, Document.md): the wiki claimed
'action Heal(hidden: ...)' / 'action LevelUp(disabled: ...)' /
'action LevelUp(when: ...)' worked as conditional shorthands. They
do not - the grammar's ActionParam rule only accepts visibility,
icon, color, and label. Replaced with the two valid forms: static
visibility prefix and visibility: method block returning a
Visibility.X value.
- Status syntax (Keywords-and-Journals, Keywords-Quick-Reference): the
wiki used 'status X when: ... img: ...' (no parens, wrong key 'img:'
vs grammar's 'svg:', and 'death' as a trailing modifier). Per the
StatusProperty rule, params live in (...) parens, the icon param is
'svg:', and 'death' is a *prefix* on the declaration.
- Tracker style (Fields, Recipes): grammar accepts 'segmented'
(singular). Wiki used 'segments' (plural), which would not parse.
- Paperdoll size: (Fields): grammar takes a PX literal, not named
sizes. Wiki claimed small/medium/large.
New documentation for previously undocumented features:
- 'wounds resource' - the inverse-color sibling of 'health resource',
for damage-pool style tracking.
- Document-level parameters - actor and item declarations accept
icon:, svg:, background:, description:, creatable:, default:.
- chat (template: "...") - custom Handlebars template override for
chat cards.
- parent<type> supported types - mirrored the 14-type list from
self<type> with examples beyond just parent<attribute>.
- attribute style: and roll: parameters - both appear in grammar but
only roll: was glimpsed in the tutorial.
- choices<string> multi-select field - distinct from singular
choice<string>; supports max: and initial:.
- damage(roll:, type:) function - now has a Logic-Reference entry
alongside roll().
- Visibility prefix shorthand subsection - the nine prefix keywords
(gmOnly, secret, hidden, etc.) and what each enables.
- 'item.X' iteration alias inside where: clauses - the rule that lets
filters reference each item under test.
- 'pips' deprecation note pointing users to tracker(style: segmented).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
docs: address non-dev audit findings
Fixes raised by an audit conducted from a non-developer perspective.
Fields.md - self<type> section
- Replaced the stale 'roll: \"d20 + @primaryStat\" / chat: [ @primaryStat ]'
example syntax (which appears nowhere else and looks like an older
grammar) with modern action / fleeting / roll(...) / chat form.
- Switched the section's identifiers from camelCase (strength,
primaryAttribute) to PascalCase, matching the convention now stated
in Document.md and used everywhere else in the wiki.
- Cleaned up two inventory 'where:' filter examples that used raw
Foundry syntax ('where: {item.system.equipped == false}') to the
ISDL 'where: item.Equipped equals false' form.
Plain-English glosses
- Document.md intro reworded so 'Document' is introduced with a
plain-English explanation; 'datamodel' replaced with 'underlying data
fields Foundry needs to store its values'.
- Resource auto-clamping passage in Fields.md reworded to drop
're-derives' / 'derive' jargon; now reads as 'right after your action
runs and again every time the sheet refreshes'.
Operator consistency sweep
- Replaced '++' / '--' with '+= 1' / '-= 1' across active examples in
Document, Fields, Recipes, Advanced-Logic, and Interactivity. The
word forms ('equals', '!equals') and the readable assignment forms
are now used consistently in instructional code throughout the wiki.
- Reference tables on Basic-Logic, Logic-Reference, and Keywords-Quick-
Reference legitimately show both forms and were left as-is.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
docs: clarify scope, conventions, and undocumented behaviors
Driven by an outside review that exercised the wiki to build a small
PbtA-style system. Findings addressed:
Basic-Logic
- New 'Accessing Character Data' subsections for self / parent / target /
User, with one example each. Closes the biggest implicit-knowledge gap:
what those words actually mean inside an action.
- Chat block grammar formalized (flavor / tag / wide / plain expressions
/ roll variables, with a table of valid line forms).
- Comparison operators reorganized: word forms (equals, !equals) marked
as preferred; symbolic forms kept as alternatives.
- Roll properties: .total marked as the recommended idiom; bare-roll
shorthand documented as still valid.
- Assignment shortcuts: += 1 promoted as the readable form; ++ kept as
shorthand. Math examples updated to use .total consistently.
- roll(...) now links out to Foundry's dice modifier docs; ISDL field
substitution noted as the only ISDL-specific addition.
- Healing examples corrected: removed the misleading manual clamp now
that resource auto-clamping is documented properly.
- Forward-links to function (Advanced-Logic) and prompt (Interactivity)
added to 'Next Steps' so beginners discover them.
Fields
- Resource: clarified that auto-clamping happens on derive outside Edit
mode, with examples of when explicit clamping is still needed.
- Attribute: documented that mod: is optional and defaults to value -
PbtA-style 'attribute Bold(min: -1, max: 3)' works without a no-op
mod block.
Document
- Added a Naming Conventions section: PascalCase IDs, lowercase generated
system paths, and the role of label: for display strings.
Recipes
- New 'Class adds fields (Rage, Bloodlust, etc.)' recipe showing the
visibility-conditional pattern for class-injected fields and actions,
with a pointer to the Class-as-item variant.
Your-first-System
- 'What's next?' linked to the new class-recipe, the action-scope
reference, function, and prompt.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add inventory field
Documents the new inventory field type, including its grid configuration, drag-and-drop features, and available parameters for managing item storage.
Updated Fields (markdown)
Updated Fields (markdown)
Updated Fields (markdown)