[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72CHYXD666BK85AM6SH97QV":3,"skill-same:01M72CHYXD666BK85AM6SH97QV":48},{"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":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M72CHYXD666BK85AM6SH97QV","quality-gates",null,"Resolve project quality commands, scoped checks, gate failures and validation fallbacks from workflow config.","1aGh\u002Fmaude","1aGh","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F17166964?v=4","01M72CAQDBB0YG724KFT7WEYRF","Michal Dovrtel","01M72CAQDXC32AWQRZYNJXXDC4",3,"MIT","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fquality-gates\u002FSKILL.md",[],[],"2026-11-10 18:39:20",false,"---\nname: quality-gates\ncategory: shared\ndescription: \"Resolve project quality commands, scoped checks, gate failures and validation fallbacks from workflow config.\"\nuser-invocable: false\n---\n\n# Quality Gates\n\nFollow [host conventions](..\u002F..\u002FHARNESS.md) for Claude Code or Codex.\n\nReference for the `quality` block in `.ai\u002Fworkflows.config.json`. This skill documents a **data shape and a read pattern** — it is not an execution contract and defines no output format. The data IS a plain shell-command string; `eval` is the runner.\n\n## 1. Shape — a flat map\n\n`quality` is a flat map of gate name → shell-command string. No nesting, no per-gate object, no `order` array, no `scope`\u002F`blocking` fields.\n\n```jsonc\n\"quality\": {\n  \"lint\":      \"pnpm lint\",\n  \"format\":    \"pnpm biome format .\",\n  \"typecheck\": \"pnpm exec tsc --noEmit -p apps\u002Fstudio\",\n  \"tests\":     \"pnpm test && pnpm test:dev-server\",\n  \"build\":     \"pnpm --filter @maude\u002Fsite build\"\n}\n```\n\nThe block is **optional**. Populate it via `maude doctor --fix` (additive — never overwrites an existing user value).\n\n## 2. Gate names\n\nConventional names: `lint`, `format`, `typecheck`, `tests`, `build`. These are conventions, not an enum — projects may add free-form gates (`accessibility`, `i18n`, …). Schema only enforces *value is a non-empty string*.\n\n## 3. Read pattern (every consumer uses this)\n\n```bash\nLINT_CMD=$(jq -r '.quality.lint \u002F\u002F empty' .ai\u002Fworkflows.config.json)\nif [[ -n \"$LINT_CMD\" ]]; then\n  eval \"$LINT_CMD\" || { echo \"::error::lint gate failed (\\`$LINT_CMD\\`)\"; exit 1; }\nelse\n  echo \"⚠ quality.lint not declared — run \\`maude doctor --fix\\`\"\nfi\n```\n\n## 4. Missing gate → warn + skip, NEVER fabricate\n\nIf a gate key is absent, print a one-line warning pointing at `maude doctor --fix` and move on. Do not infer or invent a command. A declared gate that fails IS a blocker; an *undeclared* gate is not.\n\n## 5. Inner loop vs outer gate — the posture split\n\nImplementation commands (`\u002Fflow:validate --fast`, per-task `\u002Fflow:execute`, `\u002Fflow:bug-fix`, `\u002Fflow:execute --quick`) **never run a repo-wide gate in the foreground**. The full `quality.*` pipeline runs exactly once, at the outer gate (`\u002Fflow:validate` \u002F `\u002Fflow:done`). Rationale, measured (AI-StudyMate wiki-adoption-telemetry execution report, 2026-09-01): a repo-wide `typecheck` fanned out to 37 turbo projects, ran 16m15s, and was force-killed **without producing a verdict** — pure loss; the same gates then ran again at `\u002Fflow:done`. A repo-wide check mid-implementation can only slow the user down; it cannot make the merge safer than the outer gate already does.\n\nDuring implementation the inner loop runs, per gate:\n\n1. **`qualityScoped.\u003Cgate>` declared** → run it (blocker on fail).\n2. **Not declared, gate is `format`\u002F`lint`** → the command MAY run the `quality.\u003Cgate>` command constrained to changed files (`eval \"$CMD -- $FILES\"` — the same trick `\u002Fflow:execute --quick` uses on staged files). If the tool ignores file args or `quality.\u003Cgate>` is absent → defer.\n3. **Otherwise** → **defer**: print one line (`→ \u003Cgate>: no scoped gate declared — deferred to \u002Fflow:validate`) and move on. Never fall back to the repo-wide command; never fabricate a filter the user didn't declare.\n\n## 6. `qualityScoped` — scoped gate variants\n\nTop-level block, same flat shape as `quality` (gate name → shell command string, keys mirror `quality`). It exists **only** for the inner loop; `\u002Fflow:validate` ignores it entirely.\n\n```jsonc\n\"qualityScoped\": {\n  \"lint\":      \"turbo run lint --filter='[origin\u002Fmain]'\",\n  \"typecheck\": \"turbo run check-types --filter='[origin\u002Fmain]'\"\n}\n```\n\n> **Why a separate block, not `lintScoped` keys inside `quality`:** `\u002Fflow:validate` Step 3.5 runs every non-conventional `quality.*` key as a blocking custom gate — a scoped key inside `quality` would run twice (inner loop + validate).\n\nRead pattern is identical to §3 (`jq -r '.qualityScoped.\u003Cgate> \u002F\u002F empty'` + `eval`). Missing key → defer per §5, not warn-and-run-something-else.\n\n**Monorepo fan-out trap (document-worthy because the obvious fix is wrong):** Turborepo's `--filter='...[base]'` (changed **+ dependents**) looks like the correct scoping answer, but whenever a shared package is touched it selects nearly the whole monorepo (measured: 37 of 37 packages) — i.e. no speed-up for exactly the changes that need one. Scoped gates use changed-only `[base]`; dependent breakage is `\u002Fflow:validate`'s job before merge.\n\n## 7. Affected tests — filter-sanity rule\n\nWhen the inner loop runs \"affected tests\", verify the filter actually filtered: if the runner reports a file count near the full suite despite a pattern being passed, the pattern was swallowed — a common trap is a pattern landing after a bare `--` in a package script (e.g. `pnpm --filter X test -- \u003Cpattern>` with a `vitest run` script ignores it and runs everything; ~55 s instead of 1.2 s, measured). Switch to the runner's exec form (`pnpm --filter X exec vitest run \u003Cpattern>` or the project equivalent) and keep using it. A \"full suite passed\" line during a scoped run is a bug signal, not reassurance.\n\n## 8. Which command reads which gate\n\n| Command | Gates read | Posture |\n| ------- | ---------- | ------- |\n| `\u002Fflow:validate --fast` | `qualityScoped.{format,lint,typecheck}` (declared-only) + affected tests; undeclared `format`\u002F`lint` may run `quality.*` on changed files via file args | Blocker when run; undeclared → defer to `\u002Fflow:validate` (§5) |\n| `\u002Fflow:execute --quick` | `qualityScoped.{format,lint}` if declared, else `quality.{format,lint}` staged-files-only | Blocker |\n| `\u002Fflow:execute` (per task) \u002F `\u002Fflow:bug-fix` | — delegate to `\u002Fflow:validate --fast` | — |\n| `\u002Fflow:validate` | `format` → `lint` → `typecheck` → `tests` → `build` (in order, fail-fast) + custom `quality.*` gates; ignores `qualityScoped` | All blocker |\n| `\u002Fflow:done` | — delegates to `\u002Fflow:validate` | — |\n| `.ai\u002Frelease-guide.md` pre-flight | every entry in `config.quality` | Blocker |\n\nConfig never enforces ordering or blocking — that is the calling command's opinion. Schema health for the `quality`\u002F`qualityScoped` blocks (e.g. a non-string value) surfaces under `maude doctor`, not here.\n","# Quality Gates\n\nFollow [host conventions](..\u002F..\u002FHARNESS.md) for Claude Code or Codex.\n\nReference for the `quality` block in `.ai\u002Fworkflows.config.json`. This skill documents a **data shape and a read pattern** — it is not an execution contract and defines no output format. The data IS a plain shell-command string; `eval` is the runner.\n\n## 1. Shape — a flat map\n\n`quality` is a flat map of gate name → shell-command string. No nesting, no per-gate object, no `order` array, no `scope`\u002F`blocking` fields.\n\n```jsonc\n\"quality\": {\n  \"lint\":      \"pnpm lint\",\n  \"format\":    \"pnpm biome format .\",\n  \"typecheck\": \"pnpm exec tsc --noEmit -p apps\u002Fstudio\",\n  \"tests\":     \"pnpm test && pnpm test:dev-server\",\n  \"build\":     \"pnpm --filter @maude\u002Fsite build\"\n}\n```\n\nThe block is **optional**. Populate it via `maude doctor --fix` (additive — never overwrites an existing user value).\n\n## 2. Gate names\n\nConventional names: `lint`, `format`, `typecheck`, `tests`, `build`. These are conventions, not an enum — projects may add free-form gates (`accessibility`, `i18n`, …). Schema only enforces *value is a non-empty string*.\n\n## 3. Read pattern (every consumer uses this)\n\n```bash\nLINT_CMD=$(jq -r '.quality.lint \u002F\u002F empty' .ai\u002Fworkflows.config.json)\nif [[ -n \"$LINT_CMD\" ]]; then\n  eval \"$LINT_CMD\" || { echo \"::error::lint gate failed (\\`$LINT_CMD\\`)\"; exit 1; }\nelse\n  echo \"⚠ quality.lint not declared — run \\`maude doctor --fix\\`\"\nfi\n```\n\n## 4. Missing gate → warn + skip, NEVER fabricate\n\nIf a gate key is absent, print a one-line warning pointing at `maude doctor --fix` and move on. Do not infer or invent a command. A declared gate that fails IS a blocker; an *undeclared* gate is not.\n\n## 5. Inner loop vs outer gate — the posture split\n\nImplementation commands (`\u002Fflow:validate --fast`, per-task `\u002Fflow:execute`, `\u002Fflow:bug-fix`, `\u002Fflow:execute --quick`) **never run a repo-wide gate in the foreground**. The full `quality.*` pipeline runs exactly once, at the outer gate (`\u002Fflow:validate` \u002F `\u002Fflow:done`). Rationale, measured (AI-StudyMate wiki-adoption-telemetry execution report, 2026-09-01): a repo-wide `typecheck` fanned out to 37 turbo projects, ran 16m15s, and was force-killed **without producing a verdict** — pure loss; the same gates then ran again at `\u002Fflow:done`. A repo-wide check mid-implementation can only slow the user down; it cannot make the merge safer than the outer gate already does.\n\nDuring implementation the inner loop runs, per gate:\n\n1. **`qualityScoped.\u003Cgate>` declared** → run it (blocker on fail).\n2. **Not declared, gate is `format`\u002F`lint`** → the command MAY run the `quality.\u003Cgate>` command constrained to changed files (`eval \"$CMD -- $FILES\"` — the same trick `\u002Fflow:execute --quick` uses on staged files). If the tool ignores file args or `quality.\u003Cgate>` is absent → defer.\n3. **Otherwise** → **defer**: print one line (`→ \u003Cgate>: no scoped gate declared — deferred to \u002Fflow:validate`) and move on. Never fall back to the repo-wide command; never fabricate a filter the user didn't declare.\n\n## 6. `qualityScoped` — scoped gate variants\n\nTop-level block, same flat shape as `quality` (gate name → shell command string, keys mirror `quality`). It exists **only** for the inner loop; `\u002Fflow:validate` ignores it entirely.\n\n```jsonc\n\"qualityScoped\": {\n  \"lint\":      \"turbo run lint --filter='[origin\u002Fmain]'\",\n  \"typecheck\": \"turbo run check-types --filter='[origin\u002Fmain]'\"\n}\n```\n\n> **Why a separate block, not `lintScoped` keys inside `quality`:** `\u002Fflow:validate` Step 3.5 runs every non-conventional `quality.*` key as a blocking custom gate — a scoped key inside `quality` would run twice (inner loop + validate).\n\nRead pattern is identical to §3 (`jq -r '.qualityScoped.\u003Cgate> \u002F\u002F empty'` + `eval`). Missing key → defer per §5, not warn-and-run-something-else.\n\n**Monorepo fan-out trap (document-worthy because the obvious fix is wrong):** Turborepo's `--filter='...[base]'` (changed **+ dependents**) looks like the correct scoping answer, but whenever a shared package is touched it selects nearly the whole monorepo (measured: 37 of 37 packages) — i.e. no speed-up for exactly the changes that need one. Scoped gates use changed-only `[base]`; dependent breakage is `\u002Fflow:validate`'s job before merge.\n\n## 7. Affected tests — filter-sanity rule\n\nWhen the inner loop runs \"affected tests\", verify the filter actually filtered: if the runner reports a file count near the full suite despite a pattern being passed, the pattern was swallowed — a common trap is a pattern landing after a bare `--` in a package script (e.g. `pnpm --filter X test -- \u003Cpattern>` with a `vitest run` script ignores it and runs everything; ~55 s instead of 1.2 s, measured). Switch to the runner's exec form (`pnpm --filter X exec vitest run \u003Cpattern>` or the project equivalent) and keep using it. A \"full suite passed\" line during a scoped run is a bug signal, not reassurance.\n\n## 8. Which command reads which gate\n\n| Command | Gates read | Posture |\n| ------- | ---------- | ------- |\n| `\u002Fflow:validate --fast` | `qualityScoped.{format,lint,typecheck}` (declared-only) + affected tests; undeclared `format`\u002F`lint` may run `quality.*` on changed files via file args | Blocker when run; undeclared → defer to `\u002Fflow:validate` (§5) |\n| `\u002Fflow:execute --quick` | `qualityScoped.{format,lint}` if declared, else `quality.{format,lint}` staged-files-only | Blocker |\n| `\u002Fflow:execute` (per task) \u002F `\u002Fflow:bug-fix` | — delegate to `\u002Fflow:validate --fast` | — |\n| `\u002Fflow:validate` | `format` → `lint` → `typecheck` → `tests` → `build` (in order, fail-fast) + custom `quality.*` gates; ignores `qualityScoped` | All blocker |\n| `\u002Fflow:done` | — delegates to `\u002Fflow:validate` | — |\n| `.ai\u002Frelease-guide.md` pre-flight | every entry in `config.quality` | Blocker |\n\nConfig never enforces ordering or blocking — that is the calling command's opinion. Schema health for the `quality`\u002F`qualityScoped` blocks (e.g. a non-string value) surfaces under `maude doctor`, not here.\n",{"name":5,"category":24,"description":7,"user-invocable":20},"shared","main","cfde9d2b169e4b418a5c5efb35297cc575dc764c","plugins\u002Fflow\u002Fskills\u002Fquality-gates",0,"https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude","https:\u002F\u002Fmaude.sh","https:\u002F\u002Fgithub.com\u002F1aGh","www.iagh.cz","2026-11-13 20:38:15",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add 1aGh\u002Fmaude --skill quality-gates",{"tool":40,"command":41},"bunx","bunx skills add 1aGh\u002Fmaude --skill quality-gates",{"tool":43,"command":44},"pnpm","pnpm dlx skills add 1aGh\u002Fmaude --skill quality-gates","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fquality-gates\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M72CJCVNC5JB3M36ES649CTY","workflow-state","Read and update workflow state when planning, executing, completing, pausing or resuming project work.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fworkflow-state\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M72CJAJBZT2RHE97ND8EFTA3","ui-rules","UI hard-stop rules and audit method: WCAG 2.1 AA accessibility, responsive layout and motion.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fui-rules\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M72CJ857314HCC8A99T4K0D2","testing-rules","Apply test quality rules during implementation and review: meaningful assertions, isolation and coverage.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Ftesting-rules\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M72CJ6N80HW2WRS8BV4QSS4V","security-rules","Apply application and AI security checks to code reviews, implementation and threat-driven validation.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fsecurity-rules\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M72CJ4C41Q4E1WDTFMKYFX3Q","scenario","Author or run cross-platform UI scenarios with selectors, screenshots, platform coverage and result reports.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fscenario\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M72CJ1QYX752BM7G12250YJR","question-protocol","Batch necessary questions from workflow participants, collect user answers and route them to the requester.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fquestion-protocol\u002FSKILL.md",[],[]]