/* Generated from Zero skill data. Run node --experimental-strip-types --disable-warning=ExperimentalWarning scripts/embed-skill-data.mts to refresh. */
#ifndef ZERO_EMBEDDED_SKILLS_INC
#define ZERO_EMBEDDED_SKILLS_INC

typedef struct {
  const char *name;
  const char *description;
  bool hidden;
  const char *const *content;
} ZeroEmbeddedSkill;

static const char *const zero_embedded_skill_agent_chunks[] = {
  "---\nname: agent\ndescription: Graph-first agent workflow for making focused Zero changes with CLI feedback.\n---\n\n# Zero Agent Workflow\n\nUse this when editing Zero code, examples, tests, docs, or a package. The graph interface is the primary authoring surface for agents: inspect and patch source through ProgramGraph commands, and use ProgramGraph artifacts only when you need an interchange/debug file. `.0` files are the canonical source text that gets committed. Zero command text is designed to be readable by agents; use JSON when another tool must parse stable fields or when deeper diagnostics are needed.\n\n## Start\n\nUse the same compiler binary that will run the project:\n\n```sh\nzero --version\nzero skills list\nzero skills get language\nzero skills get graph\nzero skills get diagnostics\n```\n\nInside the Zero repository checkout, prefer `bin/zero` over a global `zero`. For installed user projects, use the `zero` on `PATH` unless the user points at another binary.\n\n## Graph-First Edit Loop\n\n1. Read the nearest `zero.json`, source files, tests, and examples enough to understand the package boundary.\n2. Inspect the current source through the graph:\n\n```sh\nzero graph view <file-or-package>\nzero graph check <file-or-package>\n```\n\n3. Use JSON when you need exact node IDs or graph hashes:\n\n```sh\nzero graph dump --json <file-or-package>\n```\n\n4. For precise mechanical edits on canonical `.0`, prefer a checked graph patch that rewrites the source after validation:\n\n```sh\nzero graph patch <file.0> --expect-graph-hash graph:f76987e99677f1b3 --op 'rename node=\"#ea5ea1ca\" expect=\"main\" value=\"start\"'\nzero graph check <file.0>\nzero check <file.0>\n```\n\n5. When a graph artifact is necessary, write it under `.zero/`, patch the artifact, validate it, and then make the accepted source change. Do not commit derived `.program-graph` files unless the user explicitly asks.\n6. Run a focused source check:\n\n```sh\nzero check <file-or-package>\n```\n\n7. When the compiler reports a diagnostic, explain the code first. If you need stable fields or a repair plan, rerun with JSON:\n\n```sh\nzero explain <diagnostic-code>\nzero check --json <file-or-package>\nzero fix --plan --json <file-or-package>\n```\n\n8. If behavior changes, add or update a `test` block or conformance fixture.\n9. Validate with the narrowest command that covers the changed surface.\n\n## Agent Rules\n\n- Treat effects as capabilities, not ambient globals. Use `World`, `std.fs`, `std.args`, `std.env`, and similar APIs only where the target supports them.\n- Keep examples copyable and runnable from the repository or package root.\n- Prefer explicit types at public boundaries and when inference is unclear.\n- Use `Maybe<T>`, explicit `raises` / `raises [...]`, and `check` instead of hidden failure.\n- Prefer graph inspection and source-backed graph patches for agent planning and mechanical edits.\n- Do not invent syntax. Load `language` when unsure.\n",
  "- Do not invent CLI fields. If you need fields, run the command with `--json` and read the data.\n\n## Useful Focused Commands\n\n```sh\nzero check <input>\nzero graph <input>\nzero graph view <input>\nzero graph check <input>\nzero graph dump --json <input>\nzero test <input>\nzero size <input>\nzero doctor\n```\n\nFor CLI behavior, JSON contracts, or editor/tool integrations in the Zero repo, use `--json` and the repository scripts listed by `AGENTS.md` or the project documentation.\n",
  NULL
};

static const char *const zero_embedded_skill_builds_chunks[] = {
  "---\nname: builds\ndescription: Build, run, ship, target, and profile Zero programs.\n---\n\n# Zero Builds\n\nUse this when an agent needs to run, build, cross-build, inspect artifacts, or explain target support for a Zero program.\n\n## Inputs\n\nMost build commands accept one of these:\n\n- a single `.0` file\n- a package directory containing `zero.json`\n- a direct path to `zero.json`\n\n## Run\n\nUse `zero run` for the host development loop:\n\n```sh\nzero run examples/hello.0\nzero run examples/cli-file.0 -- input.txt\n```\n\nArguments after `--` are passed to the Zero program.\n\n## Build\n\nUse direct emitters. The removed generated-C backend is not a fallback path.\n\n```sh\nzero build --emit exe examples/hello.0 --out .zero/out/hello\nzero build --emit obj examples/hello.0 --out .zero/out/hello.o\n```\n\nUse `--json` when a tool will read exact build fields:\n\n```sh\nzero build --json --target linux-musl-x64 examples/memory-package\n```\n\nUseful JSON fields include `artifact`, `sizeBytes`, `toolchain`, `releaseTargetContract`, selected target facts, linker flavor, and sysroot status.\n\n## Graph Inputs\n\nWhen an agent is authoring through ProgramGraph, inspect and patch the canonical `.0` source directly. Use graph build and run only when you intentionally need to validate a derived interchange artifact:\n\n```sh\nzero graph build --out .zero/out/app .zero/agent/app.program-graph\nzero graph run .zero/agent/app.program-graph\n```\n\nUse normal `zero build` and `zero run` after persisting the accepted change to canonical `.0` source text.\n\n## Targets\n\nInspect target names and capability facts before cross-building:\n\n```sh\nzero targets\nzero check --target linux-musl-x64 examples/memory-package\nzero graph --target linux-musl-x64 examples/memory-package\n```\n\nHosted APIs such as process args, environment, filesystem, net, and proc are target-gated. A non-host target may reject code that checks on the host.\n\n## Profiles\n\nCommon profile names are `debug`, `dev`, `release-fast`, `release-small`, `tiny`, and `audit`.\n\n```sh\nzero build --profile release-small examples/hello.0\nzero size --profile tiny examples/hello.0\n```\n\nUse `zero size` to explain retained functions, sections, literals, runtime shims, imports, debug metadata, and optimization hints. Add `--json` when a tool needs exact fields.\n\n## Ship\n\n`zero ship` produces a release preview:\n\n```sh\nzero ship --target linux-musl-x64 examples/hello.0 \\\n  --out .zero/ship/hello\n```\n\nThe preview includes artifact names, sizes, hashes, checksum file metadata, size report data, debug-symbol metadata, and target contract facts.\n\n## Troubleshooting\n\n- `zero doctor` checks host and target readiness.\n- `BLD003` means an old backend flag was requested; remove it.\n- Missing sysroot facts identify the required `ZERO_SYSROOT_*` variable.\n- Unsupported targets fail explicitly instead of silently choosing another backend.\n",
  NULL
};

static const char *const zero_embedded_skill_diagnostics_chunks[] = {
  "---\nname: diagnostics\ndescription: Read Zero diagnostics, explanations, and typed fix plans.\n---\n\n# Zero Diagnostics\n\nUse this when Zero code fails to parse, typecheck, build, test, or target-check. Zero diagnostics are intended for agents: start with the readable command output, then use JSON when you need stable fields, spans, or repair metadata.\n\n## Commands\n\n```sh\nzero check <input>\nzero explain <diagnostic-code>\n```\n\nUse machine-readable output when you need exact fields:\n\n```sh\nzero check --json <input>\nzero explain --json <diagnostic-code>\nzero fix --plan --json <input>\n```\n\n`zero fix` is plan-only in this compiler. It reports candidate repairs but does not edit files.\n\n## Diagnostic Shape\n\nImportant fields from `zero check --json`:\n\n- `code`: stable diagnostic code such as `NAM003` or `TAR002`\n- `message`: short human summary\n- `path`, `line`, `column`, `length`: source span\n- `expected` and `actual`: structured mismatch facts when available\n- `help`: concise next action\n- `fixSafety`: safety label for an agent repair\n- `repair`: optional repair id and summary\n- `related`: extra spans or facts\n\nDo not scrape terminal prose for automation. Use JSON when a script or tool needs stable fields.\n\n## Fix Safety\n\n`zero fix --plan --json` reports `safetyLevels` and per-fix `safety`:\n\n- `format-only`: formatting or trivia only\n- `behavior-preserving`: intended not to change runtime behavior\n- `api-changing`: signatures, exports, or call sites may change\n- `target-changing`: target support or capability use may change\n- `requires-human-review`: the compiler cannot prove the edit is safe\n\nApply only the edit you can justify from the source and fix plan. Treat `requires-human-review` as a planning hint, not an automatic patch.\n\n## Common Codes\n\n- `NAM003`: unknown name; declare it, import it, or fix spelling.\n- `IMP001`: unknown package-local import.\n- `IMP002`: package-local import cycle.\n- `PKG001`: local dependency path lacks `zero.json`.\n- `PKG002`: package dependency cycle.\n- `PKG003`: one package name resolves to conflicting versions.\n- `PKG004`: selected target is not supported by a dependency.\n- `TAR001`: unknown target; inspect `zero targets`.\n- `TAR002`: capability unavailable for selected target.\n- `BLD003`: removed backend flag; use direct emitters.\n\n## Agent Triage\n\n1. Run the failing command normally first.\n2. If the readable output is not enough, rerun with `--json` and use the span to inspect only the relevant source.\n3. Run `zero explain <code>` before broad refactors.\n4. If multiple diagnostics share a root cause, fix the earliest source issue.\n5. Re-run the same command after the patch.\n",
  NULL
};

static const char *const zero_embedded_skill_graph_chunks[] = {
  "---\nname: graph\ndescription: Use ProgramGraph commands as the primary agent authoring and inspection surface.\n---\n\n# Zero Graph Authoring\n\nUse this when an agent needs to inspect, plan, patch, or validate Zero changes through the graph interface. The graph interface is the primary agent authoring surface. `.0` files are canonical source text; `.program-graph` artifacts are derived debug and interchange files.\n\n## Source Boundary\n\n- Commit `.0` source text for durable program changes.\n- Use `zero graph view <input>` to render canonical source text from a source file or ProgramGraph artifact.\n- Use `zero graph patch <file.0> ...` for source-backed graph edits that rewrite the canonical source after validation.\n- Write explicit graph artifacts only when you need an interchange/debug file, using non-source paths such as `.zero/agent/app.program-graph`.\n\n## Graph-First Loop\n\nInspect the source through the graph interface:\n\n```sh\nzero graph view <file-or-package>\nzero graph check <file-or-package>\nzero graph dump --json <file-or-package>\n```\n\nCreate a derived graph artifact when you need to carry a graph between tools:\n\n```sh\nzero graph dump --out .zero/agent/app.program-graph <file-or-package>\n```\n\nInspect it with normal readable output:\n\n```sh\nzero graph view .zero/agent/app.program-graph\nzero graph check .zero/agent/app.program-graph\nzero graph roundtrip .zero/agent/app.program-graph\n```\n\nUse JSON when you need exact node IDs, graph hashes, spans, or operation fields:\n\n```sh\nzero graph dump --json <file-or-package>\nzero graph inspect --json <file-or-package>\nzero graph patch --json <file.0> --expect-graph-hash graph:f76987e99677f1b3 --op 'rename node=\"#ea5ea1ca\" expect=\"main\" value=\"start\"'\n```\n\n## Patches\n\nGraph patches are checked against the input graph hash and node facts:\n\n```sh\nzero graph patch \\\n  <file.0> \\\n  --expect-graph-hash graph:f76987e99677f1b3 \\\n  --op 'set node=\"#610c78bf\" field=\"value\" expect=\"hello\\n\" value=\"hello agent\\n\"'\n```\n\nFor larger edits, use a patch file:\n\n```text\nzero-program-graph-patch v1\nexpect graphHash \"graph:f76987e99677f1b3\"\nset node=\"#610c78bf\" field=\"value\" expect=\"hello\\n\" value=\"hello agent\\n\"\nrename node=\"#ea5ea1ca\" expect=\"main\" value=\"start\"\ndelete node=\"#patch001\"\n```\n\nPrefer `set`, `rename`, `insert`, and `delete` patches over editing graph artifact text by hand. Always include `expect graphHash` when you are carrying a patch across tool calls.\n\n## Validate Before Persisting\n\nAfter a source-backed patch, validate the source:\n\n```sh\nzero graph check <file.0>\nzero check <file.0>\n```\n\nFor derived graph artifacts, validate the artifact before applying the accepted change to source:\n\n```sh\nzero graph validate .zero/agent/app.patched.program-graph\nzero graph check .zero/agent/app.patched.program-graph\nzero graph view .zero/agent/app.patched.program-graph\n```\n\n",
  "Do not commit `.program-graph` files unless the user explicitly asks for derived artifacts.\n\n## Packages\n\nFor packages, inspect the graph from the package root or manifest. Only write an artifact when another tool needs a file handoff:\n\n```sh\nzero graph view <package-dir>\nzero graph check <package-dir>\nzero graph import --out .zero/agent/package.program-graph <package-dir>\n```\n\nNormal build, run, test, and ship commands use canonical source unless the command is explicitly `zero graph ...`.\n",
  NULL
};

static const char *const zero_embedded_skill_language_chunks[] = {
  "---\nname: language\ndescription: Compact zerolang syntax and semantics guide for agents.\n---\n\n# zerolang Language\n\nUse this when writing or reviewing `.0` source, especially if the model has no prior zerolang training. `.0` source is canonical text: regular declarations, typed bindings, braces, infix operators, and explicit calls.\n\n## Minimal Program\n\n```zero\npub fn main(world: World) -> Void raises {\n    check world.out.write(\"hello from zerolang\\n\")\n}\n```\n\n`pub fn` exports a function. `World` carries runtime capabilities. `raises` marks a fallible function. `check` calls a fallible operation and propagates failure.\n\n## Declarations\n\nTop-level declarations include:\n\n- `use std.mem` or `use helpers`\n- `const answer: i32 = 42`\n- `const inferred = 42`\n- `type Point { x: i32, y: i32, }`\n- `enum Mode { fast, small, }`\n- `choice Result { ok: i32, err: String, }`\n- `fn answer() -> i32 { return 42 }`\n- `pub fn main(world: World) -> Void raises { ... }`\n- `test \"name\" { expect true }`\n\nUse `.0` for source files.\n\n## Values, Mutation, And Control Flow\n\n```zero\nfn answer() -> i32 {\n    return 40 + 2\n}\n\npub fn main(world: World) -> Void raises {\n    let value: i32 = answer()\n    if value == 42 {\n        check world.out.write(\"math works\\n\")\n    } else {\n        check world.out.write(\"math broke\\n\")\n    }\n}\n```\n\nUse `let` by default and `var` only when a binding changes. Conditions are `Bool`; do not rely on truthy integers or strings.\n\n```zero\nfn count(n: usize) -> usize {\n    var i: usize = 0\n    while i < n {\n        i = i + 1\n    }\n    return i\n}\n```\n\nOperators are normal infix expressions: `a + b`, `a - b`, `a * b`, `a % b`, `a == b`, `a < b`, `a && b`. Use parentheses for grouping. Comments start with `//`.\n\n## Types\n\nCommon primitive types:\n\n```text\nBool Void String char\ni8 i16 i32 i64 isize\nu8 u16 u32 u64 usize\nf32 f64\n```\n\nInteger literals are checked against context. Use suffixes such as `_u8` or `_usize` when needed. Use `as` for intentional integer casts.\n\n## Shapes, Enums, And Choices\n\n```zero\ntype Point {\n    x: i32,\n    y: i32,\n}\n\nenum Mode {\n    fast,\n    small,\n}\n\nchoice Result {\n    ok: i32,\n    err: String,\n}\n```\n\nConstruct a shape with field names:\n\n```zero\nlet point: Point = Point { x: 1, y: 2 }\n```\n\nChoice payload cases use the choice name:\n\n```zero\nlet result: Result = Result.ok(42)\n```\n\nMatches must be exhaustive unless they use the fallback arm `_`:\n\n```zero\nmatch result {\n    .ok(value) {\n        expect value == 42\n    }\n    .err(message) {\n        expect true\n    }\n}\n```\n\n## Errors\n\n```zero\nfn value(i: i32) -> i32 raises [Odd] {\n    if i % 2 == 0 {\n        return i\n    }\n    raise Odd\n}\n\npub fn main(world: World) -> Void raises {\n    let item: i32 = rescue value(3) err 1\n    if item == 1 {\n        check world.out.write(\"fallible ok\\n\")\n    }\n}\n```\n\n",
  "`raises [Error]` restricts the error set. Plain `raises` is open. Calling a fallible function requires `check` or `rescue`.\n\n## Borrowing And Memory Views\n\n- `ref<T>` is a read-only borrow, passed with `&value`.\n- `mutref<T>` is a mutable borrow, passed with `&mut value`.\n- `[N]T` is a fixed array.\n- `Span<T>` is a read-only contiguous view.\n- `MutSpan<T>` is a writable contiguous view.\n- Returning a span backed by local fixed-array storage is rejected; return an owned value or keep the view local.\n- `Maybe<T>` represents absence; read `.value` only inside a visible `.has` guard, or use `check` / `rescue`.\n- `owned<T>` marks explicit resource ownership.\n\n```zero\nfn bump(point: mutref<Point>) -> Void {\n    point.x = point.x + 1\n}\n```\n\nArrays and views:\n\n```zero\npub fn main() -> Void {\n    var storage: [4]u8 = [1, 2, 3, 4]\n    let view: MutSpan<u8> = storage\n    let first: u8 = storage[0]\n    storage[0] = 9\n}\n```\n\n## Generics\n\n```zero\ntype Box<T: Type> {\n    value: T,\n}\n\nfn id<T: Type>(value: T) -> T {\n    return value\n}\n```\n\nStatic generic values are declared with `static`:\n\n```zero\ntype FixedVec<T: Type, static N: usize> {\n    len: usize,\n    items: [N]T,\n}\n```\n\n## Standard Library Call Shapes\n\nCommon target-neutral helpers:\n\n```zero\npub fn main() -> Void {\n    let bytes: Span<u8> = std.mem.span(\"zero\")\n    let n: usize = std.mem.len(bytes)\n    let same: Bool = std.mem.eql(\"zero\", \"zero\")\n\n    var dst: [8]u8 = [0, 0, 0, 0, 0, 0, 0, 0]\n    let writable: MutSpan<u8> = dst\n    let copied: usize = std.mem.copy(writable, bytes)\n\n    let parsed: Maybe<u16> = std.parse.parseU16(\"8080\")\n    if parsed.has {\n        expect parsed.value == 8080\n    }\n\n    let checksum: u32 = std.codec.crc32(\"zero\")\n    let crc: u32 = std.codec.crc32Bytes(bytes)\n    let hash: u32 = std.crypto.hash32(bytes)\n    let hmac: u32 = std.crypto.hmac32(std.mem.span(\"key\"), std.mem.span(\"message\"))\n\n    var reversed: [4]u8 = [0, 0, 0, 0]\n    let reversed_text: Maybe<Span<u8>> = std.str.reverse(reversed, \"zero\")\n    if reversed_text.has {\n        expect std.mem.eql(reversed_text.value, \"orez\")\n    }\n\n    var rng: RandSource = std.rand.seed(7_u32)\n    let random: u32 = std.rand.nextU32(&mut rng)\n\n    let duration: Duration = std.time.add(std.time.ms(250), std.time.seconds(1))\n    expect std.time.asMsFloor(duration) == 1250\n}\n```\n\nHosted helpers are capability-gated by target:\n\n```zero\npub fn main(world: World) -> Void raises {\n    let count: usize = std.args.len()\n    let first: Maybe<String> = std.args.get(1)\n    if first.has {\n        check world.out.write(first.value)\n    }\n\n    var path_storage: [16]u8 = [0; 16]\n    let path: String = check std.path.join(path_storage, \".zero\", \"x\")\n\n    let fs: Fs = std.fs.host()\n    var file: owned<File> = check std.fs.createOrRaise(fs, path)\n    check std.fs.writeAllOrRaise(&mut file, std.mem.span(\"hello\\n\"))\n\n",
  "    let status: ProcStatus = std.proc.spawn(\"zero-noop\")\n    if std.proc.exitCode(status) == 0 {\n        check world.out.write(\"proc ok\\n\")\n    }\n}\n```\n\n## Compact Examples\n\nUse these as small pattern anchors when generating code:\n\n```zero\ntype Point {\n    x: i32,\n    y: i32,\n}\n\nfn one() -> i32 {\n    return 1\n}\n\nfn two() -> i32 {\n    return 1 + 1\n}\n\nfn sub(a: i32, b: i32) -> i32 {\n    return a - b\n}\n\nfn even(n: i32) -> Bool {\n    return n % 2 == 0\n}\n\nfn max(a: i32, b: i32) -> i32 {\n    if a > b {\n        return a\n    }\n    return b\n}\n\nfn sum_to(n: i32) -> i32 {\n    var i: i32 = 0\n    var total: i32 = 0\n    while i <= n {\n        total = total + i\n        i = i + 1\n    }\n    return total\n}\n\nfn fib(n: u32) -> u32 {\n    var i: u32 = 0\n    var a: u32 = 0\n    var b: u32 = 1\n    while i < n {\n        let next: u32 = a + b\n        a = b\n        b = next\n        i = i + 1\n    }\n    return a\n}\n\nfn factorial(n: u32) -> u32 {\n    var i: u32 = 2\n    var total: u32 = 1\n    while i <= n {\n        total = total * i\n        i = i + 1\n    }\n    return total\n}\n\nfn point_sum(point: Point) -> i32 {\n    return point.x + point.y\n}\n\ntest \"shape\" {\n    let point: Point = Point { x: 40, y: 2 }\n    expect point_sum(point) == 42\n}\n```\n\nIf unsure, run `zero check <file>` instead of inventing syntax. Add `--json` only when you need the exact diagnostic span or structured fields.\n",
  NULL
};

static const char *const zero_embedded_skill_packages_chunks[] = {
  "---\nname: packages\ndescription: Create, inspect, and repair Zero packages and manifests.\n---\n\n# Zero Packages\n\nUse this when working with `zero.json`, package-local modules, package tests, or multi-file Zero projects.\n\n## Create\n\n```sh\nzero new cli hello\nzero new lib math-tools\nzero new package app\n```\n\nCheck the generated files before changing structure.\n\n## Manifest\n\nMinimal executable package:\n\n```json\n{\n  \"package\": { \"name\": \"hello\", \"version\": \"0.1.0\" },\n  \"targets\": { \"cli\": { \"kind\": \"exe\", \"main\": \"src/main.0\" } }\n}\n```\n\nPass either the package directory or manifest to commands:\n\n```sh\nzero check .\nzero check zero.json\nzero run examples/systems-package\n```\n\n## Module Imports\n\nPackage-local imports resolve from `src/`:\n\n- `use helpers` resolves `src/helpers.0`\n- `use config.parser` resolves `src/config/parser.0`\n- `use config.parser` may also resolve `src/config/parser/mod.0`\n\nStandard library imports use the same `use` form:\n\n```zero\nuse std.mem\nuse std.parse\n```\n\nAvoid implicit files. If an import is unknown, run:\n\n```sh\nzero check <package>\nzero graph <package>\n```\n\n## Dependencies\n\nCurrent packages support local path dependencies and registry metadata. Local dependencies must point at a directory containing `zero.json`.\n\n```json\n{\n  \"dependencies\": {\n    \"local-tools\": { \"path\": \"../local-tools\", \"version\": \"0.1.0\" }\n  }\n}\n```\n\nThe resolver is declarative; it records deterministic lock facts under `.zero/package-locks/` and does not fetch remote package code.\n\n## Inspect\n\n```sh\nzero graph <package>\nzero doc <package>\nzero dev <package>\n```\n\nUse `--json` when a tool needs exact graph, doc, or dev fields. Useful `graph` facts include modules, source paths, import edges, public and private symbol counts, function effects, required capabilities, target facts, dependency facts, and package cache key inputs.\n\n## Graph Authoring\n\nFor agent edits, inspect the package through the graph. Create an artifact under `.zero/` only when another tool needs a file handoff:\n\n```sh\nzero graph view <package>\nzero graph check <package>\nzero graph import --out .zero/agent/package.program-graph <package>\n```\n\nSource-backed graph patches rewrite canonical `.0` files directly after validation. Keep derived graph artifacts out of the package source unless the user explicitly asks for them.\n\n## Common Repairs\n\n- `IMP001`: create the imported module, fix its path, or adjust `use`.\n- `IMP002`: break a direct import cycle.\n- `PKG001`: fix a local dependency path so it contains `zero.json`.\n- `PKG002`: break a package dependency cycle.\n- `PKG003`: avoid resolving one package name to multiple versions.\n- `PKG004`: update target metadata or choose a supported target.\n\nPrefer a package-local fix over moving unrelated files.\n",
  NULL
};

static const char *const zero_embedded_skill_stdlib_chunks[] = {
  "---\nname: stdlib\ndescription: Use Zero standard library modules and target-gated capabilities.\n---\n\n# Zero Standard Library\n\nUse this when an agent needs common library calls, memory helpers, hosted I/O, or target-capability guidance.\n\n## Import\n\n```zero\nuse std.mem\n\nuse std.parse\n```\n\nCall functions with their module path, such as `std.mem.len(value)`.\n\n## Target-Neutral Helpers\n\n- `std.mem`: spans, copy, fill, length, safe indexed `get`, fixed-buffer allocation, byte buffers, and caller-owned vectors.\n- `std.math`: pure `u32` integer helpers, GCD/LCM, powers, modular power, primality, and divisor routines.\n- `std.path`: target-neutral lexical path basename, dirname, extension, join, normalize, and relative helpers.\n- `std.codec`: byte reads, varint sizing, CRC helpers, and byte checksums.\n- `std.parse`: ASCII predicates and decimal integer parsers returning `Maybe<T>`.\n- `std.time`: duration construction and conversion helpers.\n- `std.rand`: explicit deterministic random sources.\n- `std.crypto`: small hash and byte-oriented crypto helpers.\n- `std.json`: explicit-buffer JSON parsing and string writing helpers.\n- `std.str`: byte-span string helpers, including non-overlapping reverse, prefix/suffix, substring, trim, and word counts.\n- `std.io`: buffered reader/writer surfaces over caller-owned storage.\n\nPrefer `Maybe<T>` return checks over assuming an operation succeeded.\n\n## Hosted Capabilities\n\nThese modules depend on host or runtime capabilities:\n\n- `std.args`: process arguments\n- `std.env`: process environment\n- `std.fs`: hosted filesystem and explicit `Fs` or `owned<File>` handles\n- `std.net`: bootstrap network handles\n- `std.http`: HTTP request/response helpers\n- `std.proc`: process execution helpers\n- `World.out` and `World.err`: program output capabilities\n\nNon-host targets may reject these APIs with target diagnostics. Inspect target facts before cross-building:\n\n```sh\nzero targets\nzero check --target linux-musl-x64 <input>\nzero graph --target linux-musl-x64 <input>\n```\n\nAdd `--json` only when a tool needs exact target facts or diagnostics.\n\n## Memory Pattern\n\n```zero\nuse std.mem\n\npub fn main(world: World) -> Void raises {\n    let bytes: Span<u8> = std.mem.span(\"zero\")\n    if std.mem.len(bytes) == 4 {\n        check world.out.write(\"memory ok\\n\")\n    }\n}\n```\n\nFor writable buffers, use caller-owned fixed arrays and `MutSpan<T>`:\n\n```zero\npub fn main() -> Void {\n    var storage: [8]u8 = [0, 0, 0, 0, 0, 0, 0, 0]\n    let writable: MutSpan<u8> = storage\n    let copied: usize = std.mem.copy(writable, std.mem.span(\"zero\"))\n}\n```\n\nString helpers are byte-oriented and allocation-free. `std.str.reverse` writes\ninto caller storage and requires that destination storage does not overlap the\ninput text:\n\n```zero\npub fn main() -> Void {\n    var reversed: [4]u8 = [0, 0, 0, 0]\n    let out: Maybe<Span<u8>> = std.str.reverse(reversed, \"zero\")\n    if out.has {\n",
  "        expect std.mem.eql(out.value, \"orez\")\n    }\n}\n```\n\n## Maybe Pattern\n\n```zero\npub fn main(world: World) -> Void raises {\n    let first: Maybe<String> = std.args.get(1)\n    if first.has {\n        check world.out.write(first.value)\n    }\n}\n```\n\nUse `check maybeValue` only when absence should propagate as a failure in a fallible function.\nRead `maybeValue.value` only inside a visible `if maybeValue.has { ... }` guard.\n\n## Resource Pattern\n\nHosted file APIs can use explicit handles:\n\n```zero\npub fn main() -> Void raises {\n    let fs: Fs = std.fs.host()\n    var file: owned<File> = check std.fs.createOrRaise(fs, \".zero/out/log.txt\")\n    check std.fs.writeAllOrRaise(&mut file, std.mem.span(\"hello\\n\"))\n}\n```\n\nOwned resources are deterministic. Do not invent hidden heap, global logger, or ambient filesystem APIs.\n",
  NULL
};

static const char *const zero_embedded_skill_testing_chunks[] = {
  "---\nname: testing\ndescription: Write and run Zero test blocks.\n---\n\n# Zero Testing\n\nUse this when adding tests, debugging failing tests, or wiring Zero checks into CI and editor workflows.\n\n## Test Blocks\n\nZero test blocks live beside source:\n\n```zero\nfn add(left: i32, right: i32) -> i32 {\n    return left + right\n}\n\ntest \"addition works\" {\n    expect add(2, 3) == 5\n}\n```\n\n`expect` requires a `Bool`. A false expectation fails the test.\n\n## Run\n\n```sh\nzero test conformance/native/pass/test-blocks.0\nzero test --filter addition conformance/native/pass/test-blocks.0\nzero test conformance/packages/test-app\n```\n\nUse `--filter` for a narrow loop. The filter matches test names by substring.\n\nFor normal agent edits, patch the backing `.0` source and run `zero test`. When an agent is explicitly validating a derived ProgramGraph artifact, use the graph test surface:\n\n```sh\nzero graph test .zero/agent/app.program-graph\nzero graph test --filter addition .zero/agent/app.program-graph\n```\n\nRun normal `zero test` after persisting the accepted change to source text.\n\n## JSON Fields\n\nUse `zero test --json` when a tool or CI job needs exact fields. Useful fields:\n\n- `testDiscovery`: how files and tests were found\n- `fixtures`: fixture inputs and snapshot metadata\n- `snapshotKey`: stable test snapshot contract\n- `discoveredTests`, `selectedTests`, `passedTests`, `failedTests`\n- `expectedFailures`, `unexpectedPasses`\n- `targetFacts`: selected target and capability facts\n- `results`: per-test name, status, duration, source location, and failure span\n- `stdout`, `stderr`, `durationMs`\n\nUse JSON for machines and CI contracts. Normal test output is the default agent loop.\n\n## Expected Failures\n\nExpected-fail tests use one of these name markers:\n\n- `xfail:`\n- `expected fail:`\n- `[xfail]`\n\nExample:\n\n```zero\ntest \"xfail: pending parser edge case\" {\n    expect false\n}\n```\n\nAn expected-fail test passes the command only when it fails as expected. If it starts passing, the command fails with `unexpectedPasses`.\n\n## Agent Workflow\n\n1. Add the smallest test that owns the behavior.\n2. Run a filtered test while editing.\n3. Run the containing package or fixture before finishing.\n4. Do not leave an expected-fail marker on a fixed bug.\n5. Use `zero check` first when the failure is a compile error; rerun with `--json` only if you need exact diagnostic fields.\n",
  NULL
};

static const char *const zero_embedded_skill_zero_chunks[] = {
  "---\nname: zero\ndescription: Install Zero and load version-matched workflows with zero skills.\n---\n\n# Zero\n\nZero is the programming language for agents.\n\nInstall this skill once in an agent's skill manager. Keep it thin; Zero's own CLI serves the version-matched workflow for each installed compiler.\n\nInstall the latest release:\n\n```sh\ncurl -fsSL https://zerolang.ai/install.sh | bash\nexport PATH=\"$HOME/.zero/bin:$PATH\"\nzero --version\n```\n\n## Version-Matched Skills\n\nThis file is a discovery stub. Do not treat it as the full Zero workflow.\n\nBefore editing, checking, testing, or repairing Zero code, ask the installed compiler for the skill content that matches that exact binary:\n\n```sh\nzero skills list\nzero skills get zero\nzero skills get zero --full\n```\n\nIf the user has multiple Zero binaries, use the same binary that will run the project:\n\n```sh\n/path/to/zero skills list\n/path/to/zero skills get zero --full\n```\n\nUse `zero skills list` to discover additional skills bundled with that Zero version. Use `zero skills get <name>` to load the one relevant to the task. Common inner skills include `agent`, `graph`, `language`, `diagnostics`, `packages`, `builds`, `testing`, and `stdlib`.\n\n## Common Entry Points\n\n```sh\nzero check <file-or-package>\nzero graph <file-or-package>\nzero graph view <file-or-package>\nzero graph check <file-or-package>\nzero graph dump --json <file-or-package>\nzero size <file-or-package>\nzero explain <diagnostic-code>\n```\n\nUse `--json` when another tool must parse stable fields, compare contracts, or inspect deeper diagnostic and repair metadata. `zero fix --plan --json` is intentionally machine-readable.\n\nIn a Zero repository checkout, prefer `bin/zero` when the task is about that checkout rather than the globally installed compiler.\n",
  NULL
};

static const ZeroEmbeddedSkill zero_embedded_skills[] = {
  {"agent", "Graph-first agent workflow for making focused Zero changes with CLI feedback.", false, zero_embedded_skill_agent_chunks},
  {"builds", "Build, run, ship, target, and profile Zero programs.", false, zero_embedded_skill_builds_chunks},
  {"diagnostics", "Read Zero diagnostics, explanations, and typed fix plans.", false, zero_embedded_skill_diagnostics_chunks},
  {"graph", "Use ProgramGraph commands as the primary agent authoring and inspection surface.", false, zero_embedded_skill_graph_chunks},
  {"language", "Compact zerolang syntax and semantics guide for agents.", false, zero_embedded_skill_language_chunks},
  {"packages", "Create, inspect, and repair Zero packages and manifests.", false, zero_embedded_skill_packages_chunks},
  {"stdlib", "Use Zero standard library modules and target-gated capabilities.", false, zero_embedded_skill_stdlib_chunks},
  {"testing", "Write and run Zero test blocks.", false, zero_embedded_skill_testing_chunks},
  {"zero", "Install Zero and load version-matched workflows with zero skills.", false, zero_embedded_skill_zero_chunks},
};
static const size_t zero_embedded_skill_count = sizeof(zero_embedded_skills) / sizeof(zero_embedded_skills[0]);

#endif
