{"data":{"slug":"discovered-d2856b55192e69f447fe9bae2b996c4dbaf70e688e65fd0d","title":"Structure","summary":"Check a repo against the code quality standards defined in its `structure.hstruct` file \u2014 report on counts, explain what they represent, attempt fixes for regressions, and draft standards for a repo that has none.","url":"https:\/\/skillshunter.net\/skills\/discovered-d2856b55192e69f447fe9bae2b996c4dbaf70e688e65fd0d","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-d2856b55192e69f447fe9bae2b996c4dbaf70e688e65fd0d","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-d2856b55192e69f447fe9bae2b996c4dbaf70e688e65fd0d.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-d2856b55192e69f447fe9bae2b996c4dbaf70e688e65fd0d\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before running, ensure the repo has a `structure.hstruct` file at the root or in each crate root for a workspace. If no file exists, use `--draft` to propose standards based on the project's layout and documentation, not from the metric list.","instructions":"---\ndescription: Check a repo against the code quality standards its structure.hstruct states \u2014 explain what a count is made of, attempt the fix when one regressed, ratchet a budget the code has moved below, and draft standards for a repo that has none\nargument-hint: '[<repo>] [--draft | --explain <standard>]'\nallowed-tools: Bash(hobby-struct-parser:*), Bash(git diff:*), Bash(git status:*), Bash(git -C:*), Bash(pwd:*), Bash(ls:*), Bash(wc:*), Read, Grep, Glob, Edit, Write\n---\n\nHold a repo to the standards it states about itself. The file is\n`structure.hstruct` at the repo root \u2014 or at each crate root in a workspace \u2014 and\n`lsps\/hobby-struct-lsp\/grammar.md` is the language.\n\n**A standard is durable; the count is not.** The file stores a rule, the argument\nfor it, and a budget saying how many offenders exist today. Nothing in it names a\nmodule, a file or a type \u2014 an enumeration is what goes stale as an implementation\ngrows. So this skill never writes an instance into the file, only a number.\n\n## Stage 0 \u2014 Scope\n\nDefault is the repo the working directory sits in. A `<repo>` argument names one\nunder `~\/fun_repos` instead. In a workspace, every crate root with a file is\nchecked.\n\n```bash\nhobby-struct-parser <repo>\n```\n\n**A repo with no `structure.hstruct` is not a finding.** Most have none. Say so in\none line and stop, unless `--draft` was passed.\n\n## Stage 1 \u2014 Report\n\nPrint the table as the checker gives it: each standard, its count, its budget, and\nwhether the count is at, under, or over. Then read it out loud in one line \u2014\nwhich standards hold, which the code has moved toward, which it has moved away\nfrom.\n\nReviewed standards are listed separately with their audit date. **An old date is\ninformation, not a defect.** Do not treat it as something to fix; say when it was\nlast looked at and move on unless the work at hand touches what it covers.\n\n## Stage 2 \u2014 Explain a count\n\nOn `--explain <standard>`, or whenever a number is surprising:\n\n```bash\nhobby-struct-parser --detail <repo>\n```\n\nThis lists what each count is made of. **Read it, report what it says, and do not\nput any of it in the file.** The offenders are output, never state \u2014 writing them\ndown is exactly the mistake the format exists to avoid.\n\nTwo of the metrics are deliberately rough. `unfiltered queries` over-counts a\nquery that legitimately matches two entities; `allocating systems` matches names\nrather than types, so it counts a `Vec` built once at startup and misses one\nbehind a helper. When explaining either, say which offenders look like noise. Do\nnot \"fix\" noise \u2014 the budget absorbs it, and the count only has to be monotone.\n\n## Stage 3 \u2014 A budget that is exceeded\n\nThe code moved further from a standard. In order:\n\n1. **Read what it is made of** (`--detail`) and find what this change added.\n2. **Try to fix it.** A new cycle usually wants an event or a read-only query\n   rather than a module import; a file crossing the line usually wants the split\n   its own responsibility already implies. Fix the code, then re-run.\n3. **If the fix does not work, stop and report it as a regression.** Name the\n   standard, the count before and after, and what you tried. This is a decision,\n   not a failure to route around.\n\n**Never raise a budget.** `--ratchet` only tightens, and loosening is a hand edit\nthe person doing the work makes deliberately \u2014 it appears in the diff as a line\nsaying this project got further from its own standard, and the PR body has to say\nwhy. A machine widening a standard so its own change fits is the one move this\nwhole format exists to prevent.\n\n## Stage 4 \u2014 A budget with slack\n\nThe code improved. Record it:\n\n```bash\nhobby-struct-parser --ratchet <repo>\n```\n\nOnly tightens, never raises, so this is always safe to run. The tightened number\njoins the current diff, which is how an improvement gets recorded in the same\nchange that made it.\n\n## Stage 5 \u2014 Drafting standards (`--draft`)\n\nFor a repo with no file. **Do not generate the standards from the metric list** \u2014\nthat produces a file nobody believes, stating rules the project never agreed to.\n\n1. Read the repo: its `CLAUDE.md`, its module layout, what it is for.\n2. Propose the standards *this* project actually holds, prose first, and say for\n   each what goes wrong without it. A rule you cannot argue for is a rule to drop.\n3. Only then pick a `check:` from the grammar's metric list for the ones that are\n   countable, and a `review:` with today's date for the ones that are not.\n   Reviewed standards are first-class \u2014 the rules that matter most are often the\n   ones no parser can settle.\n4. Write every budget as `999`, then run `--ratchet` once. The file now records\n   exactly how far the code is from each rule, on the repo's worst day.\n5. Show me the file. It is a statement about the project, so it is mine to edit.\n\n## What this skill does not do\n\n- **It does not write instances.** No file, module or type name enters the file.\n- **It does not raise a budget.**\n- **It does not add standards during a task.** A task is short and a standard is\n  long-lived; deciding a new one is its own conversation, not a side effect.\n","use_cases":["Verify that a repo complies with its own defined code quality standards.","Investigate and explain what a count in `structure.hstruct` represents.","Fix regressions in code quality metrics and update the budget accordingly.","Draft initial code quality standards for a repo that lacks a `structure.hstruct` file."],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/julianbieber\/hobby-tooling\/blob\/420f1f68d0f92201d2a7a51a0c463784e1e49405\/skills\/structure\/skill.md","source_commit":"420f1f68d0f92201d2a7a51a0c463784e1e49405","license":null,"version":null,"listing_approved_at":"2026-11-30","created_at":"2026-11-29T11:13:30.000000Z","updated_at":"2026-11-30T06:52:26.000000Z","seo_title":"Check Code Quality Standards with Structure","seo_description":"Use Structure to verify a repo against its defined code quality standards, explain counts, fix regressions, and draft standards for repos without a `structure.hstruct`.","seo_keywords":["code quality standards","structure.hstruct","repo audit","code quality check","code quality regression","code quality improvement","draft code standards"]}}