[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M780DWD84ZYB9HHV69AHAAAZ":3,"skill-same:01M780DWD84ZYB9HHV69AHAAAZ":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M780DWD84ZYB9HHV69AHAAAZ","building-a-format-package",null,"Use when building, scaffolding, or extending an @effected format package — a parse\u002Fedit\u002Fformat library for a text format (jsonc, yaml, toml, markdown, or the next one). Covers the canonical module-per-concept surface (facade\u002FDocument\u002FNode\u002FEdit\u002FFormat\u002FVisitor\u002FDiagnostic), the engine-origin policy (own the engine — vendor+harden or from-scratch, never a runtime parser dependency), the Effect-wrapping and Result-parity policy, the cross-package parity contract (Edit\u002FRange field-identity, the diagnostic five-field core, MAX_NESTING_DEPTH=256), the conformance-corpus harness pattern (vendored fixtures + pin file, empty skip map, differential oracle), and the scaffold gotchas. Trigger phrases — new format package, corpus harness, VENDORED pin, differential oracle, parity contract, parse\u002Fedit\u002Fformat surface.","spencerbeggs\u002Feffected","spencerbeggs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F109114?v=4","01M77ZTHB70K5Y2VVTRCFY50A5","C. Spencer Beggs","01M77ZTHCC41NXBT3X906K6QM1",8,"MIT","https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Fbuilding-a-format-package\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: building-a-format-package\ndescription: Use when building, scaffolding, or extending an @effected format package — a parse\u002Fedit\u002Fformat library for a text format (jsonc, yaml, toml, markdown, or the next one). Covers the canonical module-per-concept surface (facade\u002FDocument\u002FNode\u002FEdit\u002FFormat\u002FVisitor\u002FDiagnostic), the engine-origin policy (own the engine — vendor+harden or from-scratch, never a runtime parser dependency), the Effect-wrapping and Result-parity policy, the cross-package parity contract (Edit\u002FRange field-identity, the diagnostic five-field core, MAX_NESTING_DEPTH=256), the conformance-corpus harness pattern (vendored fixtures + pin file, empty skip map, differential oracle), and the scaffold gotchas. Trigger phrases — new format package, corpus harness, VENDORED pin, differential oracle, parity contract, parse\u002Fedit\u002Fformat surface.\n---\n\n# Building a format package\n\nThe `@effected` kit's format packages — jsonc, yaml, toml, markdown (in\nflight) — share one architecture, deliberately. This skill is that\narchitecture, so the next format starts from the pattern instead of\nre-deriving it from three Module concepts. Authority order when this skill and\na Module concept disagree: the package's Module concept at\n`okf\u002Fmodules\u002F\u003Cname>.md` wins; this skill routes.\n\nFor the hostile-input guard inventory (depth caps, numeric bounds,\nproto-pollution, C0, the typed-error invariant), see\n`hardening-a-parser-port` — this skill covers the package *shape*, that one\ncovers the engine's defenses. Both apply to every format package.\n\n## The canonical surface (module-per-concept)\n\nOne PascalCase file per public concept; `src\u002Findex.ts` is the ONLY barrel\n(re-exports only — the no-barrel rule). The set, with `\u003CFmt>` = the format\nname:\n\n| Module | Owns |\n| --- | --- |\n| `\u003CFmt>.ts` | Value facade: `parse`\u002F`stringify` (Effect, typed E), schema factories, the `\u003CFmt>FromString` codec, parse\u002Fstringify errors and stringify options |\n| `\u003CFmt>Document.ts` | The lossless unit: CST\u002FAST plus recovered `diagnostics`; `parse`, `toValue`, `stringify` |\n| `\u003CFmt>Node.ts` | The node Schema classes, co-located in one file to break the recursive-AST import cycle (`Schema.suspend`, refs typed `Schema.Codec\u003CT>`, no parent pointers) |\n| `\u003CFmt>Edit.ts` | `\u003CFmt>Edit` `{offset,length,content}` + `applyAll`, `\u003CFmt>Range`, path\u002Fsegment aliases |\n| `\u003CFmt>Format.ts` | `format`\u002F`formatToString` (pure, returns edits) + `modify`\u002F`modifyToString` (Effect); formatting options; `\u003CFmt>ModificationError` |\n| `\u003CFmt>Visitor.ts` | `Stream\u003C\u003CFmt>VisitorEvent>` walk — infallible at the type level, errors are in-band events |\n| `\u003CFmt>Diagnostic.ts` | The diagnostic class (`code`\u002F`message`\u002F`offset`\u002F`length`\u002F`line`\u002F`character`) + per-stage error-code unions |\n| `internal\u002F` | The engine and `limits.ts`. Never exported; never imports a public module (the cycle firewall — engine emits raw carriers, the facade materializes typed errors and diagnostics) |\n\nFormats add concept modules where the format demands them (toml's\n`TomlDateTime`, markdown's `Frontmatter`\u002F`Mdast`) — but the core eight are the\nparity skeleton, and a format package missing one of them needs a recorded\nreason in its design doc.\n\n**Alternative implementations that each reach a different dependency get one\nmodule each, exported by name — never a namespace object.** A namespace\nobject is a barrel with worse tree-shaking: referencing it retains every\nmember's module graph, silently. This is the config-file codec rule\n(`JsonCodec`\u002F`JsoncCodec`\u002F`YamlCodec`\u002F`TomlCodec` as free-standing exports)\nand it recurs in every format package that offers per-format variants\n(markdown's frontmatter codecs).\n\n### A format module INSIDE an existing package may collapse the surface\n\nNot every format earns a package. When a format exists only to serve one host\npackage — `@effected\u002Fgit`'s `GitConfig`\u002F`Gitmodules` is the precedent — build it\nas a pure module set inside that package and collapse the canonical modules\nthat no longer pay for themselves. What held and what folded there:\n\n- **Kept, always**: the pure document facade (parse \u002F lossless `stringify`\n  that is byte-for-byte identity on an unmodified document \u002F surgical edits),\n  the typed parse-vs-edit error split, `parse` derived from `parseResult` per\n  Result-parity, and the `internal\u002F` cycle firewall — the engine emits raw\n  records plus diagnostics and never imports the public classes.\n- **Folded**: `Document`, `Edit` and `Diagnostic` collapsed into the one\n  concept module (`GitConfig.ts` owns the document, the splice-based edit\n  statics and `GitConfigDiagnostic` together), with the scanner and splice\n  primitives split out into `internal\u002F`. Nothing is lost because there is no\n  second consumer to parity against, and the parity contract's whole point —\n  a consumer moving between two format packages meets the same field names —\n  does not apply to a module only one package imports.\n- **The typed view rides on top as its own module** (`Gitmodules.ts`), whose\n  mutation statics compile into the document model's surgical edits, so the\n  file's own formatting survives an edit.\n\nPromote it to a package the moment a second package needs it — that is the\ntrigger, not size. Until then, the collapse is the correct shape, not a\nshortcut, and this paragraph exists so the next such build does not re-derive\nit from `@effected\u002Fgit`'s source.\n\n## Engine origin: own it (R1)\n\nPure and boundary packages take **no external runtime dependency**\n(effect-standards R1) — so a format package owns its parser. Two sanctioned\nroutes:\n\n- **Vendor + harden with attribution** (jsonc ← Microsoft jsonc-parser, yaml\n  ← the `yaml` npm engine, glob ← minimatch): port the engine into\n  `src\u002Finternal\u002F`, keep upstream license headers, then harden per\n  `hardening-a-parser-port`.\n- **From scratch** (toml): justified when the grammar is small, stable,\n  precisely specified, and has a first-class compliance corpus — a bounded\n  bet.\n\nNever the third route: wrapping an external parser as a runtime dependency.\nThe rejected upstream often survives anyway — as the **differential-test\noracle** (see Testing below).\n\n**Differential verification starts the port, it doesn't just gate the ship.**\nWhen a reference implementation is executable and vendored (a reference\nparser, a `normalize.py`), run the port against it **over the real corpus as\nthe first verification step** — before trusting any hand-written unit suite.\nDuring the markdown P1 port this took ~10 minutes and caught 3 real bugs that\n59 green hand-written tests had missed entirely (all in edge-case handling\nthe tests never sampled). The exact-pinned oracle devDependency in the\nTesting section is the *shipping-gate* complement to this porting-time tool:\nsame idea, different moment — use both.\n\n**Where a ported extension hooks into an existing pipeline is determined by\ntwo constraints, not by taste.** A pass that must read source text verbatim\n(offset fidelity) cannot run after decoding — entities and escapes have\nalready shortened node values, so offsets computed there are guesses. A pass\nthat must scan backwards over consumed text cannot run before the\ndelimiter\u002Fbracket stacks are spent — unlinking a node a live delimiter still\npoints at corrupts the list. The two constraints can split one upstream\nextension across both moments: cmark-gfm's autolink literals port as an\ninline construct for www\u002Fscheme literals (raw source, offsets intact) and a\npostprocess after `processEmphasis` for email literals (backwards scan, no\nstack left to corrupt). Check the upstream source for this split before\nassuming a single mechanism — and grepping for the construct's name is not\nenough on its own: dispatch branches can live in switch cases that never\nmention it (cmark-gfm's `![^`-never-opens-an-image branch contains no\n\"footnote\"). Grep for the construct name AND read the dispatch switch for\nevery character the construct touches.\n\n**When the upstream extension is a branch inside a construct the base\ndialect already owns, no trigger-table entry can express it — swap a\nparameterized construct instead.** A construct that claims every occurrence\nof its trigger character (cmark-gfm's close-bracket handler emits a literal\n`]` even when nothing matches) makes anything registered after it\nunreachable, and anything registered before it beats the constructs the\nextension must lose to (`[^a](\u002Furl)` is a link, not a footnote). The proven\npattern: export a `makeXConstruct(seam?)` factory from the base construct\nmodule, keep the base dialect's spelling as the no-seam default, and swap\nthe parameterized construct into the extending dialect's table rather than\nappending a new entry — the base dialect stays byte-for-byte unchanged, and\nthe seam sits at exactly the upstream branch point (cmark-gfm's footnotes\nneeded two: the close-bracket no-match branch and the image opener's `![^`\npeek).\n\n## Effect-wrapping policy (and the Result-parity pattern)\n\nVerbatim from the yaml design doc, binding on every format package:\n\n- **Pure synchronous** where nothing can fail: navigation, `toValue`,\n  `applyAll`, the `format` edit computation, equality. An\n  `Effect\u003C_, never>` wrapper on a total function is ceremony.\n- **`Effect`** only where the typed error channel is real: `parse`,\n  `stringify`, `modify`, schema decode.\n- **`Stream`** for the visitor; malformed input surfaces as in-band error\n  events.\n- **`Result`** sync escape hatches for config-time callers that cannot enter\n  the runtime.\n\nThe Result-parity pattern (established by `Jsonc.parseResult`, issue #115\ntracks kit-wide adoption): each parse entry point gets a pure `*Result`\nvariant, and the Effect variant is **defined in terms of it** behind the\nnamed span —\n\n```ts\nstatic parseResult(text: string, options?: Opts): Result.Result\u003Cunknown, ParseError> { ... }\nstatic parse = Effect.fn(\"Fmt.parse\")((text: string, options?: Opts) =>\n  Effect.fromResult(Fmt.parseResult(text, options)))\n```\n\n— so the two can never diverge. The sync variant carries **no span** (it is\nnot an Effect); its TSDoc points Effect consumers at the spanned variant.\n\nThe error posture itself follows the **spec, not the template**: jsonc\u002Fyaml\u002F\ntoml fail parse on malformed input, but markdown's parse is near-total\n(CommonMark has no syntax errors — its E channel carries only hardening\nguards, and warnings ride the diagnostics array). Derive the posture from the\nformat's spec and record it in the design doc.\n\n## The parity contract (binding across siblings)\n\n- `\u003CFmt>Edit` and `\u003CFmt>Range` are **field-identical** across all format\n  packages: `{ offset, length, content }` \u002F `{ offset, length }`. This is\n  what lets codec-generic consumer code work against any of them, and it is\n  the pre-work for a future `@effected\u002Ftext-edit` kernel — do not innovate\n  here without a kit-wide decision.\n- The diagnostic core carries the same five fields everywhere: `code`,\n  `offset`, `length`, `line`, `character`.\n- `MAX_NESTING_DEPTH = 256` is the cross-package parity constant, held in a\n  zero-dependency `internal\u002Flimits.ts` leaf.\n- `FormattingOptions` is the sanctioned parity exception — derivation\n  mechanics legitimately differ per format.\n\n## The conformance-corpus harness\n\nEvery format package gates on its format's official corpus, integrated the\nsame way:\n\n- **Vendor fixtures as committed plain files** — no submodule, no\n  fetch-on-test — under `__test__\u002Ffixtures\u002F\u003Ccorpus>\u002F`, with a pin file\n  alongside (yaml's `VENDORED.md`, toml's `README.md`) recording upstream\n  repo, tag\u002Fcommit, fetch date, subset taken, and the update recipe. Check\n  the corpus license and record it; test-only vendoring with attribution is\n  the ecosystem norm even for CC-BY-SA spec corpora.\n- **One `it.effect` per case** in `__test__\u002Fe2e\u002F`; valid cases assert the\n  expected value\u002Foutput, invalid cases assert the typed error via\n  `Effect.flip`.\n- **Empty skip map is the standing goal** — toml runs 205 valid + 474\n  invalid cases with zero skips; yaml runs 353 case dirs with empty\n  `SKIP`\u002F`SKIP_ASSERTIONS` maps. A skip is a documented exception, not a\n  pressure valve. One qualification: real corpora contain entries with no\n  assertable output (cmark-gfm's `extensions.txt` example 20 expects\n  literally `\u003CIGNORE>` — an upstream crash regression asserting only\n  termination). Run those through an explicit `TERMINATION_ONLY` set with\n  the reason inline — neither a skip nor a fabricated assertion.\n- **Guard the corpus count** (`assert(validCases.length >= N)`) so a\n  silently-empty fixture walk cannot green the suite.\n- **Fixtures are raw bytes.** When cases deliberately embed CR\u002FCRLF, a\n  scoped `.gitattributes` (`* -text`) in the fixture root keeps Git from\n  normalizing them (toml's harness protects ~7 such cases this way).\n- **Control characters in hand-written tests and TS fixtures are ALWAYS\n  escapes (`\\x00`, `\\x7f`), never literal bytes.** File-editing tooling\n  silently mangles literal control characters — an edit round-trip once\n  replaced a NUL with a space, which would have made a preprocessing\n  hardening test pass vacuously. Literal bytes belong only in committed raw\n  fixture files under the scoped `.gitattributes`, which are never\n  hand-edited.\n- **Differential oracle**: the rejected upstream parser, exact-pinned as a\n  devDependency, imported by exactly one property test (toml's `smol-toml`\n  at 250 runs; markdown's plan pins `commonmark`). Corpus wins on\n  disagreement; the oracle catches what the corpus never sampled.\n- **The oracle can be WRONG — and \"corpus wins\" only settles disagreements\n  the corpus actually exercises.** A generated input the corpus never\n  sampled needs root-cause investigation in the *oracle's* source before\n  either side is trusted: a 20k-input hunt during the markdown port found a\n  real commonmark.js defect (a reference-only paragraph before a thematic\n  break renders a phantom empty `\u003Cp>\u003C\u002Fp>` — a flag that does not carry\n  between its two definition-stripping sites in `blocks.js`). When the port\n  is right and the oracle is not: correct the oracle's OUTPUT narrowly on\n  the oracle side of the comparison, AND pin a tripwire test asserting the\n  divergence still exists — a future upstream fix fails the tripwire and\n  forces the correction's deletion. Never a skip entry.\n- **Serializer verification is a corpus-wide re-parse equivalence\n  property.** For every corpus example: parse → stringify → parse, then\n  compare the two parses' rendered output through the harness's own writer\n  and normalizer — render-to-render, never stringified-text-to-original-text\n  and never render-to-spec-HTML. Both sides share the parser, so the\n  comparison isolates serializer bugs from parser bugs, reuses the existing\n  harness machinery at no extra cost, and needs no skip list — any failure\n  is a real serializer defect. Genuinely unrepresentable cases get\n  documented KNOWN LIMITATION tests that fail if the limitation is ever\n  silently fixed (the tripwire pattern again), never skips.\n- **Unit fixtures must land in the layer they claim to test.** In a\n  multi-pass engine, an innocuous-looking input can be claimed by an\n  earlier pass and silently test the wrong thing — a markdown inline\n  fixture starting with `\u003C` opens an HTML *block*, so the \"inline\" test was\n  exercising the block pass. Lead inline fixtures with plain text (or\n  assert the parsed node type first) so a fixture cannot drift between\n  layers unnoticed.\n- Where the format has a **performance corpus** (markdown's pathological\n  suite), it is a separate mandatory family — see the\n  algorithmic-complexity section of `hardening-a-parser-port`.\n\nPlus the hand-written families no corpus covers: CST\u002FAST fidelity,\nedit\u002Fformat\u002Fvisitor behavior, and a hostile-input suite exercising every\nhardening guard.\n\n## A green corpus proves conformance, not reachability — keep a standing real-world fixture\n\nA conformance corpus can be entirely green while a whole production is broken.\n`@effected\u002Fyaml` ran 1226 assertions green while explicit-key entries with a\ncompact mapping value parsed to phantom null-keyed entries: the corpus has\nexplicit-key cases, but none in the *shape* real documents use (#324).\n\n**So every format package carries at least one standing fixture drawn from a\nreal document** — a `pnpm-workspace.yaml`, a `tsconfig.json`, an actual\n`Cargo.toml` — parsed and round-tripped on every run, in addition to the corpus.\nThe corpus proves you match the spec's examples; the standing fixture proves the\nproduction the spec's examples happen not to combine.\n\n**The law generalises past formats, and the kit now has it from two directions.**\nThe `@spencerbeggs\u002Freposets` loop (2026-08-14) produced a duplicate module, a\nsilent name collision, an unreachable export, a truncation in every list read and\na normaliser that silently dropped its own typed input — **every one of them green\nin the suite of whoever wrote that code**, and every one found by a second party\nrunning it for real. Its closing observation is the rule worth carrying into any\npackage, not just a format one:\n\n> Every defect worth finding was green somewhere — specifically, green in the\n> suite of whoever was most confident about that code.\n\nThe practical form: a suite you wrote cannot tell you what you did not think to\nmodel. Budget for one consumer path exercised end to end — a real document, a\nreal API call, a real binary run — and treat its absence as a known gap rather\nthan as coverage.\n\n## Scaffold gotchas (the ones that bite)\n\nFull manifest: `okf\u002Fconventions\u002Fpackage-manifest-and-scaffold.md`,\n`okf\u002Frunbooks\u002Fadd-a-workspace-package.md`. The load-bearing subset:\n\n- **Stub `src\u002Findex.ts` BEFORE the first install.** A manifest with no\n  entrypoint breaks the package's `build` and `types:check`. Unconditional.\n- Copy a pure sibling (toml is the cleanest recent template); fix the\n  per-package fields it is easy to leave stale: `name`,\n  `repository.directory` and `homepage` (the `\u002Ftree\u002Fmain\u002F` segment is\n  load-bearing).\n- Build via `pnpm build --filter @effected\u002F\u003Cname>`, which runs\n  `effected package build` after the typecheck; a direct run skips that gate\n  and the cache. A package needs no `effected.toml` unless it departs from the\n  defaults.\n- The Schema class factories need the narrow\n  `{ messageId: \"ae-forgotten-export\", pattern: \"_base\" }` suppression, which is\n  the build's default `meta.tsdoc.suppressWarnings` — never widen it (see\n  `effect-api-extractor-bases`).\n- After the first install, check the lockfile diff: a plain install has\n  stripped optional platform binaries before.\n- Tests in `__test__\u002F`, `@effect\u002Fvitest`, `assert.*` never `expect`.\n\n## Concept first\n\nNo scaffolding before the package's Module concept exists at\n`okf\u002Fmodules\u002F\u003Cname>.md`. The\nconcept states tier, engine origin, module layout, hardening surfaces, corpus\nplan and parity notes against these standards — the sibling concepts (toml is\nthe tightest) are the template.\n","# Building a format package\n\nThe `@effected` kit's format packages — jsonc, yaml, toml, markdown (in\nflight) — share one architecture, deliberately. This skill is that\narchitecture, so the next format starts from the pattern instead of\nre-deriving it from three Module concepts. Authority order when this skill and\na Module concept disagree: the package's Module concept at\n`okf\u002Fmodules\u002F\u003Cname>.md` wins; this skill routes.\n\nFor the hostile-input guard inventory (depth caps, numeric bounds,\nproto-pollution, C0, the typed-error invariant), see\n`hardening-a-parser-port` — this skill covers the package *shape*, that one\ncovers the engine's defenses. Both apply to every format package.\n\n## The canonical surface (module-per-concept)\n\nOne PascalCase file per public concept; `src\u002Findex.ts` is the ONLY barrel\n(re-exports only — the no-barrel rule). The set, with `\u003CFmt>` = the format\nname:\n\n| Module | Owns |\n| --- | --- |\n| `\u003CFmt>.ts` | Value facade: `parse`\u002F`stringify` (Effect, typed E), schema factories, the `\u003CFmt>FromString` codec, parse\u002Fstringify errors and stringify options |\n| `\u003CFmt>Document.ts` | The lossless unit: CST\u002FAST plus recovered `diagnostics`; `parse`, `toValue`, `stringify` |\n| `\u003CFmt>Node.ts` | The node Schema classes, co-located in one file to break the recursive-AST import cycle (`Schema.suspend`, refs typed `Schema.Codec\u003CT>`, no parent pointers) |\n| `\u003CFmt>Edit.ts` | `\u003CFmt>Edit` `{offset,length,content}` + `applyAll`, `\u003CFmt>Range`, path\u002Fsegment aliases |\n| `\u003CFmt>Format.ts` | `format`\u002F`formatToString` (pure, returns edits) + `modify`\u002F`modifyToString` (Effect); formatting options; `\u003CFmt>ModificationError` |\n| `\u003CFmt>Visitor.ts` | `Stream\u003C\u003CFmt>VisitorEvent>` walk — infallible at the type level, errors are in-band events |\n| `\u003CFmt>Diagnostic.ts` | The diagnostic class (`code`\u002F`message`\u002F`offset`\u002F`length`\u002F`line`\u002F`character`) + per-stage error-code unions |\n| `internal\u002F` | The engine and `limits.ts`. Never exported; never imports a public module (the cycle firewall — engine emits raw carriers, the facade materializes typed errors and diagnostics) |\n\nFormats add concept modules where the format demands them (toml's\n`TomlDateTime`, markdown's `Frontmatter`\u002F`Mdast`) — but the core eight are the\nparity skeleton, and a format package missing one of them needs a recorded\nreason in its design doc.\n\n**Alternative implementations that each reach a different dependency get one\nmodule each, exported by name — never a namespace object.** A namespace\nobject is a barrel with worse tree-shaking: referencing it retains every\nmember's module graph, silently. This is the config-file codec rule\n(`JsonCodec`\u002F`JsoncCodec`\u002F`YamlCodec`\u002F`TomlCodec` as free-standing exports)\nand it recurs in every format package that offers per-format variants\n(markdown's frontmatter codecs).\n\n### A format module INSIDE an existing package may collapse the surface\n\nNot every format earns a package. When a format exists only to serve one host\npackage — `@effected\u002Fgit`'s `GitConfig`\u002F`Gitmodules` is the precedent — build it\nas a pure module set inside that package and collapse the canonical modules\nthat no longer pay for themselves. What held and what folded there:\n\n- **Kept, always**: the pure document facade (parse \u002F lossless `stringify`\n  that is byte-for-byte identity on an unmodified document \u002F surgical edits),\n  the typed parse-vs-edit error split, `parse` derived from `parseResult` per\n  Result-parity, and the `internal\u002F` cycle firewall — the engine emits raw\n  records plus diagnostics and never imports the public classes.\n- **Folded**: `Document`, `Edit` and `Diagnostic` collapsed into the one\n  concept module (`GitConfig.ts` owns the document, the splice-based edit\n  statics and `GitConfigDiagnostic` together), with the scanner and splice\n  primitives split out into `internal\u002F`. Nothing is lost because there is no\n  second consumer to parity against, and the parity contract's whole point —\n  a consumer moving between two format packages meets the same field names —\n  does not apply to a module only one package imports.\n- **The typed view rides on top as its own module** (`Gitmodules.ts`), whose\n  mutation statics compile into the document model's surgical edits, so the\n  file's own formatting survives an edit.\n\nPromote it to a package the moment a second package needs it — that is the\ntrigger, not size. Until then, the collapse is the correct shape, not a\nshortcut, and this paragraph exists so the next such build does not re-derive\nit from `@effected\u002Fgit`'s source.\n\n## Engine origin: own it (R1)\n\nPure and boundary packages take **no external runtime dependency**\n(effect-standards R1) — so a format package owns its parser. Two sanctioned\nroutes:\n\n- **Vendor + harden with attribution** (jsonc ← Microsoft jsonc-parser, yaml\n  ← the `yaml` npm engine, glob ← minimatch): port the engine into\n  `src\u002Finternal\u002F`, keep upstream license headers, then harden per\n  `hardening-a-parser-port`.\n- **From scratch** (toml): justified when the grammar is small, stable,\n  precisely specified, and has a first-class compliance corpus — a bounded\n  bet.\n\nNever the third route: wrapping an external parser as a runtime dependency.\nThe rejected upstream often survives anyway — as the **differential-test\noracle** (see Testing below).\n\n**Differential verification starts the port, it doesn't just gate the ship.**\nWhen a reference implementation is executable and vendored (a reference\nparser, a `normalize.py`), run the port against it **over the real corpus as\nthe first verification step** — before trusting any hand-written unit suite.\nDuring the markdown P1 port this took ~10 minutes and caught 3 real bugs that\n59 green hand-written tests had missed entirely (all in edge-case handling\nthe tests never sampled). The exact-pinned oracle devDependency in the\nTesting section is the *shipping-gate* complement to this porting-time tool:\nsame idea, different moment — use both.\n\n**Where a ported extension hooks into an existing pipeline is determined by\ntwo constraints, not by taste.** A pass that must read source text verbatim\n(offset fidelity) cannot run after decoding — entities and escapes have\nalready shortened node values, so offsets computed there are guesses. A pass\nthat must scan backwards over consumed text cannot run before the\ndelimiter\u002Fbracket stacks are spent — unlinking a node a live delimiter still\npoints at corrupts the list. The two constraints can split one upstream\nextension across both moments: cmark-gfm's autolink literals port as an\ninline construct for www\u002Fscheme literals (raw source, offsets intact) and a\npostprocess after `processEmphasis` for email literals (backwards scan, no\nstack left to corrupt). Check the upstream source for this split before\nassuming a single mechanism — and grepping for the construct's name is not\nenough on its own: dispatch branches can live in switch cases that never\nmention it (cmark-gfm's `![^`-never-opens-an-image branch contains no\n\"footnote\"). Grep for the construct name AND read the dispatch switch for\nevery character the construct touches.\n\n**When the upstream extension is a branch inside a construct the base\ndialect already owns, no trigger-table entry can express it — swap a\nparameterized construct instead.** A construct that claims every occurrence\nof its trigger character (cmark-gfm's close-bracket handler emits a literal\n`]` even when nothing matches) makes anything registered after it\nunreachable, and anything registered before it beats the constructs the\nextension must lose to (`[^a](\u002Furl)` is a link, not a footnote). The proven\npattern: export a `makeXConstruct(seam?)` factory from the base construct\nmodule, keep the base dialect's spelling as the no-seam default, and swap\nthe parameterized construct into the extending dialect's table rather than\nappending a new entry — the base dialect stays byte-for-byte unchanged, and\nthe seam sits at exactly the upstream branch point (cmark-gfm's footnotes\nneeded two: the close-bracket no-match branch and the image opener's `![^`\npeek).\n\n## Effect-wrapping policy (and the Result-parity pattern)\n\nVerbatim from the yaml design doc, binding on every format package:\n\n- **Pure synchronous** where nothing can fail: navigation, `toValue`,\n  `applyAll`, the `format` edit computation, equality. An\n  `Effect\u003C_, never>` wrapper on a total function is ceremony.\n- **`Effect`** only where the typed error channel is real: `parse`,\n  `stringify`, `modify`, schema decode.\n- **`Stream`** for the visitor; malformed input surfaces as in-band error\n  events.\n- **`Result`** sync escape hatches for config-time callers that cannot enter\n  the runtime.\n\nThe Result-parity pattern (established by `Jsonc.parseResult`, issue #115\ntracks kit-wide adoption): each parse entry point gets a pure `*Result`\nvariant, and the Effect variant is **defined in terms of it** behind the\nnamed span —\n\n```ts\nstatic parseResult(text: string, options?: Opts): Result.Result\u003Cunknown, ParseError> { ... }\nstatic parse = Effect.fn(\"Fmt.parse\")((text: string, options?: Opts) =>\n  Effect.fromResult(Fmt.parseResult(text, options)))\n```\n\n— so the two can never diverge. The sync variant carries **no span** (it is\nnot an Effect); its TSDoc points Effect consumers at the spanned variant.\n\nThe error posture itself follows the **spec, not the template**: jsonc\u002Fyaml\u002F\ntoml fail parse on malformed input, but markdown's parse is near-total\n(CommonMark has no syntax errors — its E channel carries only hardening\nguards, and warnings ride the diagnostics array). Derive the posture from the\nformat's spec and record it in the design doc.\n\n## The parity contract (binding across siblings)\n\n- `\u003CFmt>Edit` and `\u003CFmt>Range` are **field-identical** across all format\n  packages: `{ offset, length, content }` \u002F `{ offset, length }`. This is\n  what lets codec-generic consumer code work against any of them, and it is\n  the pre-work for a future `@effected\u002Ftext-edit` kernel — do not innovate\n  here without a kit-wide decision.\n- The diagnostic core carries the same five fields everywhere: `code`,\n  `offset`, `length`, `line`, `character`.\n- `MAX_NESTING_DEPTH = 256` is the cross-package parity constant, held in a\n  zero-dependency `internal\u002Flimits.ts` leaf.\n- `FormattingOptions` is the sanctioned parity exception — derivation\n  mechanics legitimately differ per format.\n\n## The conformance-corpus harness\n\nEvery format package gates on its format's official corpus, integrated the\nsame way:\n\n- **Vendor fixtures as committed plain files** — no submodule, no\n  fetch-on-test — under `__test__\u002Ffixtures\u002F\u003Ccorpus>\u002F`, with a pin file\n  alongside (yaml's `VENDORED.md`, toml's `README.md`) recording upstream\n  repo, tag\u002Fcommit, fetch date, subset taken, and the update recipe. Check\n  the corpus license and record it; test-only vendoring with attribution is\n  the ecosystem norm even for CC-BY-SA spec corpora.\n- **One `it.effect` per case** in `__test__\u002Fe2e\u002F`; valid cases assert the\n  expected value\u002Foutput, invalid cases assert the typed error via\n  `Effect.flip`.\n- **Empty skip map is the standing goal** — toml runs 205 valid + 474\n  invalid cases with zero skips; yaml runs 353 case dirs with empty\n  `SKIP`\u002F`SKIP_ASSERTIONS` maps. A skip is a documented exception, not a\n  pressure valve. One qualification: real corpora contain entries with no\n  assertable output (cmark-gfm's `extensions.txt` example 20 expects\n  literally `\u003CIGNORE>` — an upstream crash regression asserting only\n  termination). Run those through an explicit `TERMINATION_ONLY` set with\n  the reason inline — neither a skip nor a fabricated assertion.\n- **Guard the corpus count** (`assert(validCases.length >= N)`) so a\n  silently-empty fixture walk cannot green the suite.\n- **Fixtures are raw bytes.** When cases deliberately embed CR\u002FCRLF, a\n  scoped `.gitattributes` (`* -text`) in the fixture root keeps Git from\n  normalizing them (toml's harness protects ~7 such cases this way).\n- **Control characters in hand-written tests and TS fixtures are ALWAYS\n  escapes (`\\x00`, `\\x7f`), never literal bytes.** File-editing tooling\n  silently mangles literal control characters — an edit round-trip once\n  replaced a NUL with a space, which would have made a preprocessing\n  hardening test pass vacuously. Literal bytes belong only in committed raw\n  fixture files under the scoped `.gitattributes`, which are never\n  hand-edited.\n- **Differential oracle**: the rejected upstream parser, exact-pinned as a\n  devDependency, imported by exactly one property test (toml's `smol-toml`\n  at 250 runs; markdown's plan pins `commonmark`). Corpus wins on\n  disagreement; the oracle catches what the corpus never sampled.\n- **The oracle can be WRONG — and \"corpus wins\" only settles disagreements\n  the corpus actually exercises.** A generated input the corpus never\n  sampled needs root-cause investigation in the *oracle's* source before\n  either side is trusted: a 20k-input hunt during the markdown port found a\n  real commonmark.js defect (a reference-only paragraph before a thematic\n  break renders a phantom empty `\u003Cp>\u003C\u002Fp>` — a flag that does not carry\n  between its two definition-stripping sites in `blocks.js`). When the port\n  is right and the oracle is not: correct the oracle's OUTPUT narrowly on\n  the oracle side of the comparison, AND pin a tripwire test asserting the\n  divergence still exists — a future upstream fix fails the tripwire and\n  forces the correction's deletion. Never a skip entry.\n- **Serializer verification is a corpus-wide re-parse equivalence\n  property.** For every corpus example: parse → stringify → parse, then\n  compare the two parses' rendered output through the harness's own writer\n  and normalizer — render-to-render, never stringified-text-to-original-text\n  and never render-to-spec-HTML. Both sides share the parser, so the\n  comparison isolates serializer bugs from parser bugs, reuses the existing\n  harness machinery at no extra cost, and needs no skip list — any failure\n  is a real serializer defect. Genuinely unrepresentable cases get\n  documented KNOWN LIMITATION tests that fail if the limitation is ever\n  silently fixed (the tripwire pattern again), never skips.\n- **Unit fixtures must land in the layer they claim to test.** In a\n  multi-pass engine, an innocuous-looking input can be claimed by an\n  earlier pass and silently test the wrong thing — a markdown inline\n  fixture starting with `\u003C` opens an HTML *block*, so the \"inline\" test was\n  exercising the block pass. Lead inline fixtures with plain text (or\n  assert the parsed node type first) so a fixture cannot drift between\n  layers unnoticed.\n- Where the format has a **performance corpus** (markdown's pathological\n  suite), it is a separate mandatory family — see the\n  algorithmic-complexity section of `hardening-a-parser-port`.\n\nPlus the hand-written families no corpus covers: CST\u002FAST fidelity,\nedit\u002Fformat\u002Fvisitor behavior, and a hostile-input suite exercising every\nhardening guard.\n\n## A green corpus proves conformance, not reachability — keep a standing real-world fixture\n\nA conformance corpus can be entirely green while a whole production is broken.\n`@effected\u002Fyaml` ran 1226 assertions green while explicit-key entries with a\ncompact mapping value parsed to phantom null-keyed entries: the corpus has\nexplicit-key cases, but none in the *shape* real documents use (#324).\n\n**So every format package carries at least one standing fixture drawn from a\nreal document** — a `pnpm-workspace.yaml`, a `tsconfig.json`, an actual\n`Cargo.toml` — parsed and round-tripped on every run, in addition to the corpus.\nThe corpus proves you match the spec's examples; the standing fixture proves the\nproduction the spec's examples happen not to combine.\n\n**The law generalises past formats, and the kit now has it from two directions.**\nThe `@spencerbeggs\u002Freposets` loop (2026-08-14) produced a duplicate module, a\nsilent name collision, an unreachable export, a truncation in every list read and\na normaliser that silently dropped its own typed input — **every one of them green\nin the suite of whoever wrote that code**, and every one found by a second party\nrunning it for real. Its closing observation is the rule worth carrying into any\npackage, not just a format one:\n\n> Every defect worth finding was green somewhere — specifically, green in the\n> suite of whoever was most confident about that code.\n\nThe practical form: a suite you wrote cannot tell you what you did not think to\nmodel. Budget for one consumer path exercised end to end — a real document, a\nreal API call, a real binary run — and treat its absence as a known gap rather\nthan as coverage.\n\n## Scaffold gotchas (the ones that bite)\n\nFull manifest: `okf\u002Fconventions\u002Fpackage-manifest-and-scaffold.md`,\n`okf\u002Frunbooks\u002Fadd-a-workspace-package.md`. The load-bearing subset:\n\n- **Stub `src\u002Findex.ts` BEFORE the first install.** A manifest with no\n  entrypoint breaks the package's `build` and `types:check`. Unconditional.\n- Copy a pure sibling (toml is the cleanest recent template); fix the\n  per-package fields it is easy to leave stale: `name`,\n  `repository.directory` and `homepage` (the `\u002Ftree\u002Fmain\u002F` segment is\n  load-bearing).\n- Build via `pnpm build --filter @effected\u002F\u003Cname>`, which runs\n  `effected package build` after the typecheck; a direct run skips that gate\n  and the cache. A package needs no `effected.toml` unless it departs from the\n  defaults.\n- The Schema class factories need the narrow\n  `{ messageId: \"ae-forgotten-export\", pattern: \"_base\" }` suppression, which is\n  the build's default `meta.tsdoc.suppressWarnings` — never widen it (see\n  `effect-api-extractor-bases`).\n- After the first install, check the lockfile diff: a plain install has\n  stripped optional platform binaries before.\n- Tests in `__test__\u002F`, `@effect\u002Fvitest`, `assert.*` never `expect`.\n\n## Concept first\n\nNo scaffolding before the package's Module concept exists at\n`okf\u002Fmodules\u002F\u003Cname>.md`. The\nconcept states tier, engine origin, module layout, hardening surfaces, corpus\nplan and parity notes against these standards — the sibling concepts (toml is\nthe tightest) are the template.\n",{"name":5,"description":7},"main","11d6b3ae59538b0e16ad67c315ecb0c25fcb0125","plugin\u002Fskills\u002Fbuilding-a-format-package",2,"https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected","https:\u002F\u002Fgithub.com\u002Fspencerbeggs","2026-11-14 07:03:25",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add spencerbeggs\u002Feffected --skill building-a-format-package",{"tool":37,"command":38},"bunx","bunx skills add spencerbeggs\u002Feffected --skill building-a-format-package",{"tool":40,"command":41},"pnpm","pnpm dlx skills add spencerbeggs\u002Feffected --skill building-a-format-package","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Fbuilding-a-format-package\u002FSKILL.md",true,[],[46,53,60,67,74,81],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M780NVTD800KMFV869YNZED6","testing-actions","Use when writing or reviewing tests for @effected\u002Fgithub-actions, @effected\u002Fgithub, @effected\u002Fsbom or @effected\u002Fcommands — stubbing the GitHub API, writing a service's layerTest or makeTest double, testing the pre\u002Fmain\u002Fpost lifecycle through Action.run, or debugging why a test hits the real network or hangs.","https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Ftesting-actions\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M780NPDSGFC0FCP7696NW11J","supply-chain-attestation","Use when generating a CycloneDX SBOM, checking NTIA minimum elements, building an in-toto statement or a SLSA provenance predicate, signing into a Sigstore DSSE bundle, or uploading an attestation to GitHub.","https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Fsupply-chain-attestation\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M780NGP4QNZDH8T8Q8WZ18SA","structuring-an-action","Use when laying out a new GitHub Action repository on the @effected suite, deciding where a piece of code belongs (an entry point, a step, a shared service, a shim), or reviewing an existing action's file structure against the canonical shape.","https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Fstructuring-an-action\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M780NCD52H1Y03FS83WJ8BT5","running-commands-and-tools","Use when running a subprocess in Effect v4, spawning a command, capturing stdout\u002Fstderr\u002Fexit code, checking whether a CLI tool is installed or which copy to run, running a package-manager script through the project's launcher, detaching a background process, or redacting a secret from argv or captured output.","https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Frunning-commands-and-tools\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M780N823DWNRMSY5X2NT5MSR","release-and-publish","Use when publishing a package to npm, reading the npm registry from Effect v4, checking whether a version is already published, cutting a release tag or GitHub release from an action, applying a release-age gate, or deriving tracking tags for GitHub Actions distribution.","https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Frelease-and-publish\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M780MXRF6H20KCESTSSFB3HQ","hardening-a-parser-port","Use when porting or writing a recursive-descent parser, lexer, or tree-walker over untrusted text in the @effected monorepo — the class of hardening the cloud reviewer scans for on every migration. Covers stack-overflow depth guards (on EVERY recursion surface, which a facade has N of — not two), numeric bound guards that must reject NaN and non-integers, code-point range checks scoped to formats with wide escapes, prototype-pollution, control-character rejection, and the invariant that malformed input must fail through the typed error channel, never as an unhandled defect.","https:\u002F\u002Fgithub.com\u002Fspencerbeggs\u002Feffected\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Fhardening-a-parser-port\u002FSKILL.md",[],[]]