SillyTavern Card Pipeline
Shared communication
Apply TW plain-language and guidance rules to user-facing work. Explain terms in context; preserve the user's chosen 新人/入门/熟练/老手 level without inferred changes. 新人 and 入门 receive detailed explanations; every level receives needed and bug explanations unless the user explicitly waives that scope. Soul and prose modes never disable this baseline. Load the shared reference for task entry, level management, or explanation decisions.
Drive the target repository's workflow without pretending this skill ships a build
engine. Discover and verify the project's own tools, map them to a small adapter
contract, and keep configuration, source, and artifacts in distinct layers.
Before a write, build, or package action, use $consult-tavernweave-library with the sillytavern-card-pipeline route. Read A0 and the returned build/deployment guides, then keep the route receipt beside the preflight evidence.
Record capability-specific evidence with acceptance-ledger.md. Keep source, automated, offline artifact, browser, real SillyTavern, human, and release gates separate; automation never writes driver-accepted.
Confirm the requested gate
Classify the request before running any mutating command:
- live iteration: run the project's verified watcher and rebuild development
output after source edits;
- iteration: change source and run impact-based checks;
- checkpoint package: create JSON or PNG required by the next stage;
- release candidate: compose, package, embed, and run the full offline gate;
- accepted release: complete remaining host checks and approve delivery.
Package only when the user explicitly requests packing, re-packing, PNG generation,
final artifacts, full workflow, delivery, release, or a checkpoint that requires a
packed artifact. Do not package after every component edit.
Discover the project adapter
Read tool-adapter-contract.md before invoking
project tools.
- Read repository instructions and current build documentation.
- Detect the repository root, active configuration entrypoint, executable runtime,
and available workflow capabilities.
- Verify each capability from help output, schemas, tests, or source inspection; do
not infer behavior from a filename alone.
- Record commands, working directory, explicit inputs, explicit outputs, dry-run
support, side effects, and success criteria.
- Run a read-only information or validation capability first.
If a required capability is absent, report the missing adapter boundary. Do not claim
that a bundled engine or fallback command exists.
Drive a live development loop
Use live iteration only when the user asks for real-time compilation, watch mode, hot
reload, or an equivalent development loop.
- Inspect the target project's package scripts, build configuration, and development
documentation. Do not assume the command is
pnpm watch or that every watcher uses
the same output layout.
- Record the watcher command, working directory, source roots, exact outputs, initial
build-ready signal, rebuild success and failure signals, and stop procedure in the
adapter record.
- Confirm the output path is the one consumed by the card, regex, local server, or
Tavern Helper binding. A running process without a successful initial build is not
ready.
- Start one watcher, keep its output observable, and after each source edit wait for a
successful rebuild before asking
sillytavern-runtime-debug to verify the listener
reload and new behavior in SillyTavern.
- Treat listener disconnects, compiler errors, and stale output as failed iterations.
Do not diagnose runtime behavior against the previous successful artifact as though
the new source were loaded.
Watch output is a development candidate, even when the project writes it under
dist/. Before checkpoint or release packaging, run the verified production build and
artifact checks. Stop or isolate the watcher first when both commands can write the
same targets.
Resolve configuration truth
Read configuration-contracts.md when creating,
editing, or reconciling workflow data.
Resolve the active files together:
- profile: card-family identity, defaults, protocol, variable roots, recipe, and
configuration links, including declared card type/capability defaults;
- manifest: exact version paths, component mapping, packaging policy,
deliverables, field chains, card-bound worldbook identities, runtime dependency
ledger, and release-specific behavior;
- plan: a reviewable sequence of intended changes between known states;
- contract: stable required and forbidden invariants.
Re-probe the exact active profile and manifest instead of trusting a remembered
version. Keep differences in data, not in copied card-name or version-specific tools.
Make generated artifacts consume these declarations rather than duplicating protocol
or version rules.
Detect the primary card type and capability flags from maintained source and reconcile
them with the declared profile/manifest. Do not accept a declaration that contradicts
the packed extension surfaces without an explicit compatibility explanation.
Prepare the change
- Inventory current source and existing artifacts without modifying them.
- Inventory regexes, Tavern Helper scripts, schemas, host capabilities, remote
imports, and regional-alternative groups. Classify them as host-required,
embedded-required, remote-runtime, regional-alternative, optional, or
development-only.
- Present a preflight notice that separates content already embedded from host setup,
remote runtime loads, regional selection, and development-only tools. For an MVU
Zod card, list its packaged schema and domestic/global scripts as already embedded,
then list their Git/CDN targets separately. Do not replace that loading path with a
local Zod installation instruction.
- Define the exact write scope and new artifact paths. Preserve earlier releases;
default to a new version or staging directory.
- Anchor a regression checklist for every already-working consumer in scope.
- Create or review a plan with precise operations, guarded replacements, collision
policy, and validation attached to each step.
- Validate profile, manifest, plan, contract, and runtime dependency structure.
- Run the plan's dry-run and inspect the predicted writes before applying it.
Do not copy an entire historical release when only source components should be
derived. Do not extract an older JSON or PNG over components that are being edited.
Validate by impact
Use the impact matrix in release-gate.md. Run the smallest
check set that proves the changed contract, then widen only when the change crosses a
boundary.
Always validate a coupled variable field across initial data, schema, update rules,
output format, context, groups, runtime readers, and examples. Keep model-visible text
free of developer commentary. Validate runtime layers independently instead of
assuming a worldbook, regex, helper script, or iframe shares APIs with another layer.
At component_assembly and release, a missing embedded_required dependency or an
invalid regional-alternative selection is a blocking defect, not a reminder.
Treat an incorrect check as a defect: contracts must lock stable behavior and include
forbidden regressions, not encode a temporary implementation preference.
Compose and package
- Confirm source edits and targeted checks are complete.
- Re-run card-type and runtime-dependency detection against maintained source.
Reconcile detected and declared ledgers before writing staging output.
- Compose only when the active profile selects generated components and the recipe
matches the current target. Do not overwrite manual component snapshots to make a
build pass.
- Compose into staging and verify required outputs, dependency resolution, syntax,
and component parity.
- Verify every required embedded regex, schema, helper script, loader, and binding is
present in its declared packed field with the expected stable identity and enabled
state. For regional groups, require every script promised by the card and enforce
the manifest's enabled-state policy; a common domestic/global pair keeps both
scripts packaged and enables only its declared default.
- Resolve every card-bound or co-delivered worldbook by stable ID from the active
manifest. Verify its maintained source and declared version match the card release;
do not select a worldbook by display name, timestamp, or newest-looking filename.
- Pack JSON from component sources into the manifest's staged target. Never inject a
fix after packing; first update the maintained source, then pack again.
- Re-open the packed JSON and verify the runtime dependency ledger, extension
surfaces, attached worldbook identity, version surface,
and semantic content match the resolved maintained source. If a standalone
worldbook is also delivered, require it to be the same declared version and content.
- Validate the packed JSON before embedding it.
- Embed JSON into a copied or explicitly declared PNG shell according to manifest
policy. Preserve unrelated chunks and verify every emitted card payload decodes to
the packed JSON.
- Keep reverse extraction disabled by default. Use it only as a sandboxed round-trip
check after packing and embedding.
If re-packing an existing target is explicitly required, snapshot and hash the current
artifact first and report the replacement. Never silently replace an older release.
Pass the release gate
Follow release-gate.md for checkpoint, candidate, and
acceptance criteria.
At minimum, prove:
- configuration and version alignment;
- card type/capability evidence and complete runtime dependency classification;
- required embedded runtime assets and regional selection;
- card-to-worldbook stable-ID, version, attachment, and source parity;
- contract and forbidden-regression checks;
- complete declared component and deliverable sets;
- packed JSON validity and source parity;
- PNG structure, payload cardinality, and semantic equality with JSON;
- artifact paths, sizes, and hashes;
- no unexpected writes outside the declared scope.
Run the project's release audit only for a release candidate or when explicitly
requested. Offline success does not close host-dependent UI, regex, bridge, import,
new-chat, remote-loader execution, or interaction checks; record those as pending
until real SillyTavern acceptance is complete.
Report the handoff
State:
- the adapter capabilities and exact commands used;
- for live iteration, the watcher readiness signal, output path, latest successful
rebuild, and whether real-SillyTavern reload was verified;
- active profile, manifest, plan, and contract;
- detected primary card type and capability flags;
- dependencies already embedded, host installation/enablement still required, remote
Git/CDN loads, selected regional alternative, optional features, and
development-only exclusions;
- resolved card/worldbook version pair and attachment verification;
- files written and preserved artifacts;
- targeted, standard, and release checks with pass or fail results;
- JSON and PNG hashes plus payload-parity result;
- skipped gates and remaining real-host acceptance.
1---2name: sillytavern-card-pipeline3description: Orchestrate data-driven SillyTavern rolecard live development, iteration, validation, JSON packaging, PNG payload embedding, release auditing, and delivery by adapting to tools already present in the target project. Use when discovering or running a project-provided watch build for Tavern Helper real-time editing; creating or checking a profile, manifest, operation plan, or contract; choosing validation from changed-file impact; detecting a card type and runtime dependency inventory; enforcing required embedded regex/schema/helper assets and regional loader policy; composing version components; packing or re-packing a card; synchronizing card-bound worldbook versions; generating final JSON or PNG artifacts; verifying embedded payload parity; or preparing an explicit checkpoint or public release. Do not use for exploratory card disassembly or shared component-library design; use sillytavern-card-components instead.4---56# SillyTavern Card Pipeline78<!-- tw-guidance-entry:begin -->9## Shared communication1011Apply [TW plain-language and guidance rules](../consult-tavernweave-library/references/communication-and-guidance.md) to user-facing work. Explain terms in context; preserve the user's chosen 新人/入门/熟练/老手 level without inferred changes. 新人 and 入门 receive detailed explanations; every level receives needed and bug explanations unless the user explicitly waives that scope. Soul and prose modes never disable this baseline. Load the shared reference for task entry, level management, or explanation decisions.12<!-- tw-guidance-entry:end -->1314Drive the target repository's workflow without pretending this skill ships a build15engine. Discover and verify the project's own tools, map them to a small adapter16contract, and keep configuration, source, and artifacts in distinct layers.1718Before a write, build, or package action, use `$consult-tavernweave-library` with the `sillytavern-card-pipeline` route. Read A0 and the returned build/deployment guides, then keep the route receipt beside the preflight evidence.1920Record capability-specific evidence with [acceptance-ledger.md](references/acceptance-ledger.md). Keep source, automated, offline artifact, browser, real SillyTavern, human, and release gates separate; automation never writes `driver-accepted`.2122## Confirm the requested gate2324Classify the request before running any mutating command:2526- **live iteration**: run the project's verified watcher and rebuild development27 output after source edits;28- **iteration**: change source and run impact-based checks;29- **checkpoint package**: create JSON or PNG required by the next stage;30- **release candidate**: compose, package, embed, and run the full offline gate;31- **accepted release**: complete remaining host checks and approve delivery.3233Package only when the user explicitly requests packing, re-packing, PNG generation,34final artifacts, full workflow, delivery, release, or a checkpoint that requires a35packed artifact. Do not package after every component edit.3637## Discover the project adapter3839Read [tool-adapter-contract.md](references/tool-adapter-contract.md) before invoking40project tools.41421. Read repository instructions and current build documentation.432. Detect the repository root, active configuration entrypoint, executable runtime,44 and available workflow capabilities.453. Verify each capability from help output, schemas, tests, or source inspection; do46 not infer behavior from a filename alone.474. Record commands, working directory, explicit inputs, explicit outputs, dry-run48 support, side effects, and success criteria.495. Run a read-only information or validation capability first.5051If a required capability is absent, report the missing adapter boundary. Do not claim52that a bundled engine or fallback command exists.5354## Drive a live development loop5556Use live iteration only when the user asks for real-time compilation, watch mode, hot57reload, or an equivalent development loop.58591. Inspect the target project's package scripts, build configuration, and development60 documentation. Do not assume the command is `pnpm watch` or that every watcher uses61 the same output layout.622. Record the watcher command, working directory, source roots, exact outputs, initial63 build-ready signal, rebuild success and failure signals, and stop procedure in the64 adapter record.653. Confirm the output path is the one consumed by the card, regex, local server, or66 Tavern Helper binding. A running process without a successful initial build is not67 ready.684. Start one watcher, keep its output observable, and after each source edit wait for a69 successful rebuild before asking `sillytavern-runtime-debug` to verify the listener70 reload and new behavior in SillyTavern.715. Treat listener disconnects, compiler errors, and stale output as failed iterations.72 Do not diagnose runtime behavior against the previous successful artifact as though73 the new source were loaded.7475Watch output is a development candidate, even when the project writes it under76`dist/`. Before checkpoint or release packaging, run the verified production build and77artifact checks. Stop or isolate the watcher first when both commands can write the78same targets.7980## Resolve configuration truth8182Read [configuration-contracts.md](references/configuration-contracts.md) when creating,83editing, or reconciling workflow data.8485Resolve the active files together:8687- **profile**: card-family identity, defaults, protocol, variable roots, recipe, and88 configuration links, including declared card type/capability defaults;89- **manifest**: exact version paths, component mapping, packaging policy,90 deliverables, field chains, card-bound worldbook identities, runtime dependency91 ledger, and release-specific behavior;92- **plan**: a reviewable sequence of intended changes between known states;93- **contract**: stable required and forbidden invariants.9495Re-probe the exact active profile and manifest instead of trusting a remembered96version. Keep differences in data, not in copied card-name or version-specific tools.97Make generated artifacts consume these declarations rather than duplicating protocol98or version rules.99100Detect the primary card type and capability flags from maintained source and reconcile101them with the declared profile/manifest. Do not accept a declaration that contradicts102the packed extension surfaces without an explicit compatibility explanation.103104## Prepare the change1051061. Inventory current source and existing artifacts without modifying them.1072. Inventory regexes, Tavern Helper scripts, schemas, host capabilities, remote108 imports, and regional-alternative groups. Classify them as host-required,109 embedded-required, remote-runtime, regional-alternative, optional, or110 development-only.1113. Present a preflight notice that separates content already embedded from host setup,112 remote runtime loads, regional selection, and development-only tools. For an MVU113 Zod card, list its packaged schema and domestic/global scripts as already embedded,114 then list their Git/CDN targets separately. Do not replace that loading path with a115 local Zod installation instruction.1164. Define the exact write scope and new artifact paths. Preserve earlier releases;117 default to a new version or staging directory.1185. Anchor a regression checklist for every already-working consumer in scope.1196. Create or review a plan with precise operations, guarded replacements, collision120 policy, and validation attached to each step.1217. Validate profile, manifest, plan, contract, and runtime dependency structure.1228. Run the plan's dry-run and inspect the predicted writes before applying it.123124Do not copy an entire historical release when only source components should be125derived. Do not extract an older JSON or PNG over components that are being edited.126127## Validate by impact128129Use the impact matrix in [release-gate.md](references/release-gate.md). Run the smallest130check set that proves the changed contract, then widen only when the change crosses a131boundary.132133Always validate a coupled variable field across initial data, schema, update rules,134output format, context, groups, runtime readers, and examples. Keep model-visible text135free of developer commentary. Validate runtime layers independently instead of136assuming a worldbook, regex, helper script, or iframe shares APIs with another layer.137At `component_assembly` and `release`, a missing `embedded_required` dependency or an138invalid regional-alternative selection is a blocking defect, not a reminder.139140Treat an incorrect check as a defect: contracts must lock stable behavior and include141forbidden regressions, not encode a temporary implementation preference.142143## Compose and package1441451. Confirm source edits and targeted checks are complete.1462. Re-run card-type and runtime-dependency detection against maintained source.147 Reconcile detected and declared ledgers before writing staging output.1483. Compose only when the active profile selects generated components and the recipe149 matches the current target. Do not overwrite manual component snapshots to make a150 build pass.1514. Compose into staging and verify required outputs, dependency resolution, syntax,152 and component parity.1535. Verify every required embedded regex, schema, helper script, loader, and binding is154 present in its declared packed field with the expected stable identity and enabled155 state. For regional groups, require every script promised by the card and enforce156 the manifest's enabled-state policy; a common domestic/global pair keeps both157 scripts packaged and enables only its declared default.1586. Resolve every card-bound or co-delivered worldbook by stable ID from the active159 manifest. Verify its maintained source and declared version match the card release;160 do not select a worldbook by display name, timestamp, or newest-looking filename.1617. Pack JSON from component sources into the manifest's staged target. Never inject a162 fix after packing; first update the maintained source, then pack again.1638. Re-open the packed JSON and verify the runtime dependency ledger, extension164 surfaces, attached worldbook identity, version surface,165 and semantic content match the resolved maintained source. If a standalone166 worldbook is also delivered, require it to be the same declared version and content.1679. Validate the packed JSON before embedding it.16810. Embed JSON into a copied or explicitly declared PNG shell according to manifest169 policy. Preserve unrelated chunks and verify every emitted card payload decodes to170 the packed JSON.17111. Keep reverse extraction disabled by default. Use it only as a sandboxed round-trip172 check after packing and embedding.173174If re-packing an existing target is explicitly required, snapshot and hash the current175artifact first and report the replacement. Never silently replace an older release.176177## Pass the release gate178179Follow [release-gate.md](references/release-gate.md) for checkpoint, candidate, and180acceptance criteria.181182At minimum, prove:183184- configuration and version alignment;185- card type/capability evidence and complete runtime dependency classification;186- required embedded runtime assets and regional selection;187- card-to-worldbook stable-ID, version, attachment, and source parity;188- contract and forbidden-regression checks;189- complete declared component and deliverable sets;190- packed JSON validity and source parity;191- PNG structure, payload cardinality, and semantic equality with JSON;192- artifact paths, sizes, and hashes;193- no unexpected writes outside the declared scope.194195Run the project's release audit only for a release candidate or when explicitly196requested. Offline success does not close host-dependent UI, regex, bridge, import,197new-chat, remote-loader execution, or interaction checks; record those as pending198until real SillyTavern acceptance is complete.199200## Report the handoff201202State:203204- the adapter capabilities and exact commands used;205- for live iteration, the watcher readiness signal, output path, latest successful206 rebuild, and whether real-SillyTavern reload was verified;207- active profile, manifest, plan, and contract;208- detected primary card type and capability flags;209- dependencies already embedded, host installation/enablement still required, remote210 Git/CDN loads, selected regional alternative, optional features, and211 development-only exclusions;212- resolved card/worldbook version pair and attachment verification;213- files written and preserved artifacts;214- targeted, standard, and release checks with pass or fail results;215- JSON and PNG hashes plus payload-parity result;216- skipped gates and remaining real-host acceptance.