Agent skill

TH08 Semantic Reconstruction

by N0zoM1z0 in N0zoM1z0/th08

Replaces raw offsets and anonymous fields in a TH08 C++ source reconstruction with evidence-backed names and types, without changing accepted bytes or playable behavior.

MITAuto-check passedDevelopment

Install TH08 Semantic Reconstruction

skills CLI
$ npx skills add N0zoM1z0/th08 --skill th08-semantic -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install N0zoM1z0/th08 th08-semantic --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/N0zoM1z0/th08.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/th08-semantic .claude/skills/th08-semantic && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
th08-semantic
GitHub stars
103
Token cost
~2.3k tokens
SKILL.md length
1,226 words
Files
2
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Replaces raw offsets and anonymous fields in a TH08 C++ source reconstruction with evidence-backed names and types, without changing accepted bytes or playable behavior.

  • Works in 4 steps: Inventory every serialized opcode value… → Separate instruction selector bits from… → Name only stable numeric IDs supported… → …
  • Replacing raw field offsets with named C++ members in the TH08 reconstruction
  • SKILL.md covers Preflight, Recover meaning, Close router-invisible… and Reconcile post-port aggregate…, plus 1 more section
  • Calls git

What it does

This skill cleans up an already-written C++ reconstruction of Touhou 08, version 1.00d. It swaps raw object offsets, anonymous fields, protocol numbers and absolute field views for named, typed code backed by evidence, while keeping the accepted VC7 bytes and the playable modern port working. It is not for recovering new functions or for target-linked library work. The agent works only from the verified Japanese target and the current source, and reads the project's AGENTS.md and its architecture, workflow, handoff and semantic reconstruction docs before editing.

A preflight checks target and tracking files, keeps `config/claims.csv` header-only and treats the semantic-debt report script only as a candidate router, never as a completion metric. One structure and one coherent field family are chosen at a time. Meaning is recovered by recording facts, corroboration, inference and unknowns separately and treating storage, semantic, emission and build ownership as separate questions. The agent prefers real fields, enums and bitfields, adds `C_ASSERT` checks for relied-on sizes and offsets, and allows a typed union overlay only for evidenced variant storage.

When your agent uses it

  • Replacing raw field offsets with named C++ members in the TH08 reconstruction
  • Naming enums and bitfields for protocol numbers when the evidence supports it
  • Cleaning up one structure's field family without changing accepted bytes

Example prompts

  • “Pick one structure from the semantic debt report and replace its raw offsets with named fields.”
  • “Add C_ASSERT checks for the sizes this struct relies on, without renaming anything unproven.”
  • “Is a typed union overlay safe for this storage range that several modes share?”

Requirements

  • The TH08 reconstruction repository with its docs and config files
  • The verified Japanese TH08 1.00d target

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Inventory every serialized opcode value and every numeric dispatch site.
  2. Separate instruction selector bits from physical object flag bits. Two
  3. Name only stable numeric IDs supported by a dispatcher/table and production
  4. For representation-compatible views such as Float3 * and

What it can do on your machine

Read from SKILL.md and the folder at commit d2a00f4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

TH08 Semantic Reconstruction loads about 2.3k tokens when it runs. Until then it costs about 85 tokens; SKILL.md has 1,226 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~85
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from N0zoM1z0/th08 at commit d2a00f4, republished under its MIT licence (© N0zoM1z0). 1,226 words, ~2,339 tokens.

Download SKILL.mdSave it as .claude/skills/th08-semantic/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
th08-semantic
description
Replace raw TH08 object offsets, anonymous fields, protocol numbers, and absolute field views with evidence-backed C++ types and names while preserving accepted VC7 bytes and playable modern-port behavior. Use for semantic cleanup of already-authored source; do not use for new function recovery or target-linked library work.

TH08 semantic reconstruction

Work only from the verified Japanese TH08 1.00d target and the current authored source. Read AGENTS.md, docs/ARCHITECTURE.md, docs/RE_WORKFLOW.md, docs/RE_HANDOFF.md, docs/SEMANTIC_RECONSTRUCTION.md, and docs/SEMANTIC_PLAYBOOK.md before editing.

Preflight

Run the target/tracking preflight and keep config/claims.csv header-only. Use scripts/analysis/report-semantic-debt.py as a candidate router, never as a completion metric. Select one structure and one coherent field family.

Confirm every touched function in config/mapping.csv, config/reccmp-functions.csv, and config/match-units.toml. Establish the current accepted-unit baseline for every affected object before changing a shared declaration.

Recover meaning

Record target facts, corroboration, inference, and unknowns separately. Inspect all reads and writes, widths, signedness, bit operations, callers, strings, and canonical object ownership. TH06/TH07 and upstream names are corroboration only when TH08 evidence agrees. IDA evidence remains blocked until the active database passes docs/IDA_MCP.md.

Treat ownership as four separate questions: storage owner, semantic owner, translation-unit/COMDAT emission owner, and production/probe/portable build owner. Evidence for one does not establish the others. Close the relevant producer, consumer, and state-transition set before changing any of them.

Prefer real fields, aggregates, enums, bitfields, and member/index expressions. Preserve opaque storage when only its extent is known. Add focused C_ASSERT checks for relied-on sizes and offsets, remembering that layout assertions do not prove names.

When one fixed storage range has several target-proven roles selected by a discriminator, a translation-unit-local typed union overlay may be safer than changing a widely included VC7 header. Anchor the single cast boundary to a real member with offsetof/sizeof assertions, keep generic initialization explicit, and use role-specific members everywhere else. This exception is for evidenced variant storage, not a way to assign meaning to unknown bytes.

Do not create a new global for a view inside an existing aggregate, change field width/signedness, hide uncertainty behind a union/accessor, or combine a typed cleanup with unrelated control-flow refactoring. Serialization, instruction decoding, and platform ABI glue may be correctly byte-oriented.

Close router-invisible protocol debt

The structural debt report does not find numeric interpreter cases, stable resource/sound/effect IDs, repeated flag masks, or ABI-compatible vector casts. Audit those surfaces explicitly after field/layout cleanup:

  1. Inventory every serialized opcode value and every numeric dispatch site. Include comparisons, range arithmetic, and out-of-order handlers, not only case labels. Give every observed value an explicit enum initializer. Preserve the handler's physical order because VC7 switch emission can depend on lexical placement. Use a neutral protocol name when the handler proves storage or control flow but not a narrower gameplay term. Do not stop after the primary opcode table: inventory operand selectors, timeline opcodes, stage/background streams, curve/mode selectors, replay synchronization flags, and other sibling dispatch tables. TH08's primary ECL opcodes were readable while all 101 operand selectors and both secondary script streams were still raw; the structural debt router did not report any of them.
  2. Separate instruction selector bits from physical object flag bits. Two masks with the same numeric value are not interchangeable namespaces. Name shifts and whole-word masks when target code requires a shift/test or raw dword update; do not rewrite them as prettier bitfield access if that changes emission.
  3. Name only stable numeric IDs supported by a dispatcher/table and production call roles. Resource slots may be named from load/get/release ownership; sound/effect names need target call-site behavior, with adjacent games used only as corroboration. Leave stage-script data and visually ambiguous entries numeric or neutrally named rather than guessing from one animation.
  4. For representation-compatible views such as Float3 * and D3DXVECTOR3 *, prefer a macro whose expansion is the already accepted cast. A normal inline accessor can introduce a call under /Ob0. Keep the cast at a named boundary and validate both VC7 and the modern compiler.

Once a protocol surface is complete, add a source guard that checks its exact value set, rejects numeric dispatch labels/writers on that surface, and proves that every enum member is referenced by the decoder. Keep this scoped: array indices, numeric quantities, and visually ambiguous per-file ANM script IDs are not automatically protocols and should not receive invented names merely to drive a literal count to zero.

At typed call boundaries, guard every spelling of a fixed literal: a direct integer, a C-style enum cast, and static_cast<Enum>(integer). Match the call surface rather than banning casts globally, because casts from runtime packet fields and calculated indices remain legitimate. Cover the accepted and rejected spellings with a small regression test; otherwise a narrow regex can report zero while a different cast form remains in production source.

For serialized operand families, introduce typed wire schemas only after the opcode names are stable. Pin size, offset, width, padding, and signedness with C_ASSERT. In a large /Ob0 interpreter, a compile-time field-index macro is often safer than adding an args pointer or an accessor: derive the existing resolver's numeric index with offsetof(Type, member) / 4, but keep the exact resolver and bit-cast expression tree intact.

Do not assume two equivalent-looking float reads emit identically. In the TH08 RunEcl readability pass, replacing *reinterpret_cast<f32 *>(&raw_i) with a generic raw-float macro shortened the function by one byte (0x6B06 to 0x6B05). Restoring that precise bit-cast tree inside the typed field macro recovered exact output. Enable one operand family at a time, rebuild EclRun.obj, and compare the complete function before moving to the next schema.

Show full SKILL.md (368 more words)Show less

Reconcile post-port aggregate drift

When a portable-owner change breaks a previously accepted cold aggregate, classify every failure before editing source: function extent, non-relocation bytes, or relocation metadata. For relocation failures, mask the relocation fields on both sides and require zero remaining byte differences before migrating the manifest. Infer each target symbol base independently from the target field value and COFF addend, then reject the migration if it conflicts with an existing accepted base or lacks mapping/global-ledger evidence. Keep intentional nonzero addends; do not normalize them merely because a modern owner provides a more convenient spelling.

An unoptimized VC7 translation unit may need a direct logical target symbol even when the portable build stores that state inside a canonical aggregate. In that case, keep the direct target declaration/storage and use a TU-local TH08_MODERN_PORT macro bridge so the function body has one semantic spelling. Do not replace a target-observed direct access with a non-inlined accessor.

Likewise, target-adjacent globals may support one typed contiguous operation without promising adjacency in the portable linker. Use the target operation only in the VC7 build and explicit per-object operations in the portable build. Both forms must describe the same initialized state and pass their respective oracles.

Validate and record

Use $th08-matching for the smallest VC7 object build and replay every accepted unit in affected objects. A shared header, PCH, inline-body, layout, or object- owner change requires cold aggregate replay.

If a cold aggregate replay contradicts the accepted ledger, record the exact command and generated failure set as a branch-baseline blocker. Do not publish the ledger total as a fresh exact result, broaden the semantic batch to repair unrelated units, or weaken the focused oracle that covers the edited object.

Compile and link the modern target for shared-source changes. Run the Linux layout verifier and a relevant state-transition smoke when the batch changes global identity, initialization, callback state, persistence, rendering, or fixed-address ownership. VC7 exactness and Linux behavior are complementary; neither proves the English field name without the evidence record.

Append an accepted batch to docs/SEMANTIC_HISTORY.md with addresses, evidence classes, layout assertions, exact replay results, portable result, and retained unknowns. Update docs/RE_HANDOFF.md only for a phase/focus/blocker change. End with tracking validation, scripts/ci.py, and git diff --check.

© N0zoM1z0, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .agents/skills/th08-semantic of N0zoM1z0/th08.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit d2a00f4

Compare with similar skills

TH08 Semantic Reconstruction next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

TH08 Semantic Reconstruction compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
TH08 Semantic Reconstruction this skillN0zoM1z0/th08103—~2.3kAutomated safety check: PassMIT
Icsme Topic Selectionbrycewang-stanford/Awesome-Journal-Skills1.2k—~1.7kAutomated safety check: PassMIT
RTK Rust Design Patternsrtk-ai/rtk83k—~1.9kAutomated safety check: PassApache-2.0
Dignified Python Standardsdocling-project/docling69k—~1.5kAutomated safety check: PassApache-2.0
Nuqstrycompai/crm11k1 repos~1.7kAutomated safety check: PassMIT
AST Visitor Pattern for Unionsprisma/orm48k—~830Automated safety check: PassApache-2.0

Similar skills

  • Icsme Topic Selection

    brycewang-stanford/Awesome-Journal-Skills

    A skill your agent uses when deciding whether a software-engineering project belongs at IEEE ICSME (maintenance, evolution, reverse engineering, program comprehension, technical debt, refactoring…

    1.2k GitHub stars~1.7k tokensUpdated 13 days ago
    DevelopmentAuto-check passed
  • Describes seven Rust design patterns for the RTK CLI filter modules, with when to use each, RTK examples, and notes on when a pattern is overkill.

    83k GitHub stars~1.9k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Dignified Python Standards

    docling-project/docling

    Applies opinionated production Python conventions chosen by the project's Python version: modern type syntax, pathlib, explicit checks and interface guidance.

    69k GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Nuqs

    trycompai/crm

    nuqs (type-safe URL query state) best practices for Next.js and other React frameworks.

    11k GitHub starsUsed in 1 repo~1.7k tokens
    DevelopmentAuto-check passed
  • Official

    Replaces a plain TypeScript union plus switch statements with frozen subclasses and a visitor interface when several places dispatch on the same variants.

    48k GitHub stars~830 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Valgo

    cohesivestack/valgo

    Add, refactor, debug, review, explain, or migrate type-safe validation in consumer Go applications using github.com/cohesivestack/valgo.

    508 GitHub stars~2.4k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed

More from N0zoM1z0/th08

  • Covers recovering and verifying the VC7 C runtime, compiler-runtime and D3DX library functions in the TH08 decompilation, with hash-pinned evidence.

    103 GitHub stars~877 tokensUpdated 22 days ago
    Auto-check passed
  • Reconstructs bounded functions from the original Japanese TH08 1.00d executable for a source decompilation project, using hash-verified target evidence and labeled corroboration.

    103 GitHub stars~1.3k tokensUpdated 22 days ago
    Auto-check passed
  • Generates and reads target-pinned instruction and ABI fact packets for a source reconstruction project, to guide source shaping before a strict comparison.

    103 GitHub stars~2.8k tokensUpdated 22 days ago
    Auto-check passed
  • Builds TH08 functions with the repository's VC7 toolchain and compares each against the hash-attested 1.00d binary to tune code generation and verify exact matches.

    103 GitHub stars~8.7k tokensUpdated 22 days ago
    Auto-check passed

Works with

Questions about TH08 Semantic Reconstruction

What does TH08 Semantic Reconstruction do?

Replaces raw offsets and anonymous fields in a TH08 C++ source reconstruction with evidence-backed names and types, without changing accepted bytes or playable behavior. 00d. It swaps raw object offsets, anonymous fields, protocol numbers and absolute field views for named, typed code backed by evidence, while keeping the accepted VC7 bytes and the playable modern port working.

When should I use TH08 Semantic Reconstruction?

TH08 Semantic Reconstruction fits situations like: replacing raw field offsets with named C++ members in the TH08 reconstruction; naming enums and bitfields for protocol numbers when the evidence supports it; cleaning up one structure's field family without changing accepted bytes.

How do I install TH08 Semantic Reconstruction in Claude Code?

Run `npx skills add N0zoM1z0/th08 --skill th08-semantic -a claude-code`. Or copy the skill folder (.agents/skills/th08-semantic in N0zoM1z0/th08) into .claude/skills/th08-semantic in your project. Claude Code loads it when a task matches its description.

How do I install TH08 Semantic Reconstruction in Codex?

Run `npx skills add N0zoM1z0/th08 --skill th08-semantic -a codex`. Or copy the skill folder (.agents/skills/th08-semantic in N0zoM1z0/th08) into .agents/skills/th08-semantic in your project. Codex loads it when a task matches its description.

Can I use TH08 Semantic Reconstruction in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add N0zoM1z0/th08 --skill th08-semantic -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/th08-semantic, .gemini/skills/th08-semantic, .github/skills/th08-semantic and .opencode/skills/th08-semantic in your project.

What does TH08 Semantic Reconstruction need to run?

Going by SKILL.md and its folder, TH08 Semantic Reconstruction needs the command-line tools its instructions call (git). Our summary lists: The TH08 reconstruction repository with its docs and config files; The verified Japanese TH08 1.00d target.

Does TH08 Semantic Reconstruction access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is TH08 Semantic Reconstruction safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does TH08 Semantic Reconstruction use?

TH08 Semantic Reconstruction is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does TH08 Semantic Reconstruction use?

About 2.3k tokens (SKILL.md is roughly 9.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to TH08 Semantic Reconstruction?

Skills that share tags, products or a category with TH08 Semantic Reconstruction: Icsme Topic Selection (brycewang-stanford/Awesome-Journal-Skills, 1.2k stars), RTK Rust Design Patterns (rtk-ai/rtk, 83k stars), Dignified Python Standards (docling-project/docling, 69k stars) and Nuqs (trycompai/crm, 11k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains TH08 Semantic Reconstruction?

N0zoM1z0 (a GitHub user) maintains it in N0zoM1z0/th08, which has 103 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on September 19, 2026.

Source: N0zoM1z0/th08 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.