[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71E0ZBJ3J06FHPRESABG27B":3,"skill-same:01M71E0ZBJ3J06FHPRESABG27B":74},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":52,"updatedAt":53,"install":54,"resources":67},"01M71E0ZBJ3J06FHPRESABG27B","quality-gate",null,"Universal pre-commit quality checks (typecheck, lint, test, coverage, dead code) with auto-detection and --fix support","indigoai-us\u002Fhq-core","indigoai-us","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F122242446?v=4","01M71DTQ5NGD10GT1Z7E6XKWC5","HQ","01M71DTQ6BKSYYBNC9RAKT3YDK",95,"MIT","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fquality-gate\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"quality","gate","quality gate","grep","test","with","lint","pre-commit","dead code","edit","write","read","support","typecheck","commit","code","Bash","auto","fix","coverage","2026-11-10 10:12:30",false,"---\nname: quality-gate\ndescription: Universal pre-commit quality checks (typecheck, lint, test, coverage, dead code) with auto-detection and --fix support\nallowed-tools: Read, Write, Edit, Bash, Glob, Grep\n---\n\n# \u002Fquality-gate - Pre-Commit Quality Checks\n\nRun universal quality checks (typecheck, lint, test, coverage) before committing. Auto-detects project type and available tools, including HQ Core script and skill repositories.\n\n**Arguments:** Optional flags: `--fix` (auto-fix lint issues), `--coverage-min=80` (coverage threshold percentage), `--deadcode` (run dead code detection)\n\n## Quality Gate Process\n\n```\nDETECT → CHECK → REPORT → BLOCK or APPROVE\n```\n\n1. **DETECT**: Auto-identify project type and available tools\n2. **CHECK**: Run applicable typecheck, lint, test, and coverage checks\n3. **REPORT**: Display pass\u002Ffail per check with summary\n4. **BLOCK\u002FAPPROVE**: Block commit if any check fails; suggest fixes\n\n---\n\n## Process\n\n### Step 1: Project Type Detection\n\nAuto-detect the project type by checking for manifest files in priority order:\n\n**Detection Priority (check in this order):**\n1. `package.json` → Node.js project (npm, bun, yarn, pnpm)\n2. `pyproject.toml` or `requirements.txt` → Python project\n3. `go.mod` → Go project\n4. `Cargo.toml` → Rust project\n\n**If multiple detected:** Run checks for ALL project types (e.g., monorepo with Node + Python)\n\nAlso detect an **HQ Core script\u002Fskill repository** when the repository contains\nboth `\u003Crepo>\u002Fcore\u002Fscripts\u002Fskill-inventory.mjs` and `\u003Crepo>\u002Fcore\u002Fdocs\u002Fhq\u002Fcommands.json`.\nThis applies alongside any detected language manifests and also works when\nthere is no language manifest. Resolve paths from this repository's root;\ndo not use a different HQ checkout for the check.\n\nFor this repository type, run the existing cheap, read-only freshness check\n**before slower checks and before committing or pushing**:\n\n```bash\nrepo_root=\"$(git rev-parse --show-toplevel)\"\nnode \"$repo_root\u002Fcore\u002Fscripts\u002Fskill-inventory.mjs\" --root \"$repo_root\" --check --scope shipped\n```\n\nA stale inventory is a source failure, not an infrastructure retry. If the\nchange intentionally edits shipped skills or commands, regenerate the affected\ninventory with the existing generator, inspect its diff, and rerun the check.\nCommit the intended source and generated inventory together. A missing Node\nruntime or failed check is not a pass; report it and resolve it before push.\nThis local preflight does not replace the repository's CI or review gates.\n\n**If none of these repository types is detected:** Stop and ask the user which project type to use.\n\n**Report detected project type(s) before proceeding.**\n\n### Step 2: Determine Available Tools\n\nFor each detected project type, identify which tools are available:\n\n#### Node.js Project\n\n| Check | Tools to Try (in priority order) | Fallback |\n|-------|----------------------------------|----------|\n| **Typecheck** | `bun check`, `tsc` (if tsconfig.json exists) | Skip if no tools available |\n| **Lint** | `bun lint` (if oxlint available), `eslint`, `oxlint`, `biome lint` | Skip if no tools available |\n| **Test** | `bun test`, `npm test`, `pnpm test`, `yarn test` | Skip if no test script |\n| **Coverage** | `bun test --coverage`, `npm test -- --coverage`, Vitest coverage | Skip if no coverage tool |\n\n**Custom scripts in package.json:** Prefer these over direct tool invocations:\n- If `package.json` has `\"typecheck\"` script → use `npm run typecheck` (or bun\u002Fpnpm\u002Fyarn equivalent)\n- If `package.json` has `\"check\"` script → use `npm run check`\n- If `package.json` has `\"lint\"` script → use `npm run lint`\n- If `package.json` has `\"test\"` script → use `npm test`\n\n#### Python Project\n\n| Check | Tools to Try (in priority order) | Fallback |\n|-------|----------------------------------|----------|\n| **Typecheck** | `mypy`, `pyright` | Skip if not installed |\n| **Lint** | `ruff check`, `flake8` | Skip if not installed |\n| **Test** | `pytest` | Skip if not installed |\n| **Coverage** | `pytest --cov` | Skip if pytest-cov not installed |\n\n**Directory to scan:** `src\u002F` if exists, else `.\u002F`\n\n#### Go Project\n\n| Check | Tools to Try (in priority order) | Fallback |\n|-------|----------------------------------|----------|\n| **Typecheck** | `go vet .\u002F...` | Built-in, always available |\n| **Lint** | `golangci-lint run`, `go fmt -l` | Skip if golangci-lint not installed |\n| **Test** | `go test .\u002F...` | Built-in, always available |\n| **Coverage** | `go test -cover .\u002F...` | Built-in, always available |\n\n#### Rust Project\n\n| Check | Tools to Try (in priority order) | Fallback |\n|-------|----------------------------------|----------|\n| **Typecheck** | `cargo check` | Built-in, always available |\n| **Lint** | `cargo clippy -- -D warnings` | Built-in, always available |\n| **Test** | `cargo test` | Built-in, always available |\n| **Coverage** | `cargo tarpaulin --out Html` | Skip if tarpaulin not installed |\n\n### Step 3: Run Quality Checks\n\nFor each detected project type, run all available checks in this order:\n\n1. **Typecheck first** — catches type errors early\n2. **Lint second** — style and code quality\n3. **Test third** — functional correctness\n4. **Coverage fourth** — test comprehensiveness\n\n**Key behaviors:**\n- Run each check independently (don't skip subsequent checks if one fails)\n- Capture exit codes and output for reporting\n- If `--fix` flag provided, run lint with auto-fix flags:\n  - Node: `eslint --fix`, `oxlint --fix`, `biome lint --write`\n  - Python: `ruff check --fix`, `ruff format`\n  - Go: `gofmt -w`, `golangci-lint run --fix`\n  - Rust: `cargo clippy --fix` (requires nightly)\n- For coverage checks, compare against threshold (default 80%, configurable with `--coverage-min=NN`)\n\n### Step 4: Report Results\n\nDisplay results in a clear table format:\n\n```\nQUALITY GATE REPORT\n═══════════════════════════════════════════════════════════\n\nProject Type: Node.js\nPackage Manager: bun\n\nCheck         Status    Details\n─────────────────────────────────────────────────────────\nTypecheck     ✓ PASS    (0 errors, 0 warnings)\nLint          ✓ PASS    (0 issues)\nTest          ✓ PASS    (42 passed, 2 skipped)\nCoverage      ✓ PASS    (92% statements, 88% branches)\n─────────────────────────────────────────────────────────\n\nOVERALL: ✓ ALL CHECKS PASSED\n═══════════════════════════════════════════════════════════\n\nSafe to commit. Run: git commit -m \"your message\"\n```\n\n**If any check fails:**\n\n```\nQUALITY GATE REPORT\n═══════════════════════════════════════════════════════════\n\nProject Type: Node.js\nPackage Manager: bun\n\nCheck         Status    Details\n─────────────────────────────────────────────────────────\nTypecheck     ✗ FAIL    (3 errors)\nLint          ✓ PASS    (0 issues)\nTest          ✗ FAIL    (1 failed, 41 passed)\nCoverage      ⊘ SKIP    (Test failures prevent coverage)\n─────────────────────────────────────────────────────────\n\nOVERALL: ✗ QUALITY GATE BLOCKED\n═══════════════════════════════════════════════════════════\n\nBlockers:\n  • Fix 3 TypeScript errors\n    → Error at src\u002Futils.ts:15: Type 'string' is not assignable to type 'number'\n    → Error at src\u002Fapi.ts:8: Property 'id' does not exist on type 'User'\n    → Error at src\u002Fapi.ts:20: Missing return type annotation\n\n  • Fix 1 test failure\n    → Test: parseDate should parse ISO dates\n      Expected: '2025-01-01', Got: '2025-01-01T00:00:00Z'\n\nTo auto-fix linting issues, run: \u002Fquality-gate --fix\n```\n\n### Step 5: Block or Approve\n\n**If all checks pass:** Recommend running `git commit`\n\n**If any check fails:**\n1. List blocking issues clearly\n2. Suggest fixes (e.g., \"run: eslint --fix\", \"fix TypeScript errors before committing\")\n3. Do NOT allow commit to proceed\n4. If `--fix` flag was provided, re-run after auto-fixes to validate\n\n---\n\n## Worked Example: Node.js Project (Complete Walkthrough)\n\n### Detection Phase\n\n```\n$ \u002Fquality-gate\n\n🔍 Detecting project type...\n  ✓ Found package.json\n  ✓ Found bun.lockb (using Bun package manager)\n  ✓ Found tsconfig.json (TypeScript project)\n  ✓ Found .eslintrc.json (ESLint configured)\n  ✓ Found jest.config.js (Jest test runner)\n\nDetected: Node.js (Bun) with TypeScript\nAvailable checks: typecheck, lint, test, coverage\n```\n\n### Check Phase (All Pass)\n\n```\nRunning checks...\n\n✓ Typecheck (bun check)\n  0 errors, 0 warnings\n  Completed in 2.3s\n\n✓ Lint (eslint)\n  0 issues\n  Completed in 1.8s\n\n✓ Test (bun test)\n  42 passed, 0 failed, 2 skipped\n  Completed in 8.5s\n\n✓ Coverage (bun test --coverage)\n  Statements: 92%\n  Branches: 88%\n  Functions: 94%\n  Lines: 92%\n  Completed in 9.1s\n```\n\n### Report Phase (Success)\n\n```\nQUALITY GATE REPORT\n═══════════════════════════════════════════════════════════\n\nProject Type: Node.js (Bun)\nTypeScript: enabled\nTest Framework: Jest\n\nCheck         Status    Details\n─────────────────────────────────────────────────────────\nTypecheck     ✓ PASS    (0 errors, 0 warnings)\nLint          ✓ PASS    (0 issues)\nTest          ✓ PASS    (42 passed, 0 failed)\nCoverage      ✓ PASS    (92% statements, meets 80% threshold)\n─────────────────────────────────────────────────────────\n\nOVERALL: ✓ ALL CHECKS PASSED\n═══════════════════════════════════════════════════════════\n\n✅ Safe to commit. Run: git commit -m \"your message\"\n```\n\n### Check Phase (With Failures)\n\n```\nRunning checks...\n\n✗ Typecheck (bun check)\n  3 errors\n    src\u002Fapi.ts:8 - Property 'id' does not exist on type 'User'\n    src\u002Fapi.ts:15 - Type 'string' is not assignable to type 'number'\n    src\u002Futils.ts:22 - Missing return type annotation\n  Completed in 2.3s\n\n✓ Lint (eslint)\n  0 issues\n  Completed in 1.8s\n\n✗ Test (bun test)\n  39 passed, 2 failed, 1 skipped\n  FAIL src\u002Femail.test.ts\n    ✕ validateEmail should reject empty string\n      Expected: false\n      Received: true\n  FAIL src\u002Fmath.test.ts\n    ✕ add should sum two numbers\n      Expected: 3\n      Received: 4\n  Completed in 8.5s\n\n⊘ Coverage (skipped due to test failures)\n```\n\n### Report Phase (With Failures)\n\n```\nQUALITY GATE REPORT\n═══════════════════════════════════════════════════════════\n\nProject Type: Node.js (Bun)\nTypeScript: enabled\nTest Framework: Jest\n\nCheck         Status    Details\n─────────────────────────────────────────────────────────\nTypecheck     ✗ FAIL    (3 errors)\nLint          ✓ PASS    (0 issues)\nTest          ✗ FAIL    (2 failed, 39 passed)\nCoverage      ⊘ SKIP    (Test failures prevent coverage check)\n─────────────────────────────────────────────────────────\n\nOVERALL: ✗ QUALITY GATE BLOCKED\n═══════════════════════════════════════════════════════════\n\nFix the following blockers before committing:\n\n1. TypeScript Errors (3 total):\n   src\u002Fapi.ts:8 - Property 'id' does not exist on type 'User'\n   src\u002Fapi.ts:15 - Type 'string' is not assignable to type 'number'\n   src\u002Futils.ts:22 - Missing return type annotation\n\n2. Test Failures (2 total):\n   src\u002Femail.test.ts - validateEmail should reject empty string\n   src\u002Fmath.test.ts - add should sum two numbers\n\nNext steps:\n  1. Fix TypeScript errors in src\u002Fapi.ts and src\u002Futils.ts\n  2. Update tests in src\u002Femail.test.ts and src\u002Fmath.test.ts\n  3. Run: \u002Fquality-gate (to re-check)\n  4. Commit: git commit -m \"your message\"\n```\n\n---\n\n## Python Project Example\n\n### Detection & Checks\n\n```\n$ \u002Fquality-gate\n\n🔍 Detecting project type...\n  ✓ Found pyproject.toml\n  ✓ Found pytest.ini\n  ✓ Found ruff.toml\n\nDetected: Python project\nAvailable checks: typecheck (mypy), lint (ruff), test (pytest), coverage\n\nRunning checks...\n\n✓ Typecheck (mypy)\n  No errors\n  Completed in 3.2s\n\n✓ Lint (ruff check)\n  0 issues\n  Completed in 1.1s\n\n✓ Test (pytest)\n  24 passed, 0 failed\n  Completed in 5.8s\n\n✓ Coverage (pytest --cov)\n  Statements: 85%\n  Branches: 79%\n  Completed in 6.2s\n```\n\n---\n\n## --fix Flag Example\n\n```\n$ \u002Fquality-gate --fix\n\n🔍 Detecting project type...\n  ✓ Found package.json (Node.js)\n  ✓ Found tsconfig.json (TypeScript)\n\nRunning checks...\n\n✓ Typecheck (bun check)\n  0 errors, 0 warnings\n\n🔧 Lint (eslint --fix)\n  Found 5 issues, fixed 5 issues\n  Completed in 1.8s\n\n✓ Test (bun test)\n  42 passed, 0 failed\n\n✓ Coverage (bun test --coverage)\n  92% statements\n\nQUALITY GATE REPORT\n═══════════════════════════════════════════════════════════\n\nCheck         Status    Details\n─────────────────────────────────────────────────────────\nTypecheck     ✓ PASS    (no errors)\nLint          ✓ PASS    (5 issues auto-fixed)\nTest          ✓ PASS    (42 passed)\nCoverage      ✓ PASS    (92% statements, meets 80%)\n─────────────────────────────────────────────────────────\n\nOVERALL: ✓ ALL CHECKS PASSED\n═══════════════════════════════════════════════════════════\n\n✅ Safe to commit. Run: git commit -m \"your message\"\n```\n\n---\n\n## Framework-Specific Commands\n\n### Node.js \u002F Bun\n\n```bash\n# Detect and run all checks\n\u002Fquality-gate\n\n# Auto-fix linting issues\n\u002Fquality-gate --fix\n\n# Custom coverage threshold\n\u002Fquality-gate --coverage-min=90\n\n# Combine flags\n\u002Fquality-gate --fix --coverage-min=85\n```\n\n### Python\n\n```bash\n# Detect and run all checks\n\u002Fquality-gate\n\n# Auto-fix with ruff\n\u002Fquality-gate --fix\n\n# Set custom threshold\n\u002Fquality-gate --coverage-min=75\n```\n\n### Go\n\n```bash\n# Run all checks\n\u002Fquality-gate\n\n# Auto-format code\n\u002Fquality-gate --fix\n```\n\n### Rust\n\n```bash\n# Run all checks\n\u002Fquality-gate\n\n# Auto-fix with clippy\n\u002Fquality-gate --fix\n```\n\n---\n\n## Dead Code Detection (--deadcode flag)\n\nWhen the `--deadcode` flag is provided, run dead code detection **after** lint passes:\n\n### Node.js Projects\n\n| Tool | Detection | Install Check |\n|------|-----------|---------------|\n| **ts-unused-exports** | Unused exports | `package.json` has `ts-unused-exports` in devDependencies |\n| **knip** | Unused exports, files, deps, types | `package.json` has `knip` in devDependencies |\n| **ts-prune** | Unused exports only | `package.json` has `ts-prune` in devDependencies |\n\n**Preferred tool:** ts-unused-exports (lightweight, no dependency conflicts in monorepos). Use knip for comprehensive scans if zod version is compatible.\n\n**If project has a `deadcode` script in package.json:** Use that (`bun run deadcode`, `npm run deadcode`, etc.)\n\n**If no dead code tool is installed:** Report: \"No dead code tool configured. Consider adding ts-unused-exports: `bun add -d ts-unused-exports`\"\n\n### Report Format\n\n```\nDead Code Analysis\n─────────────────────────────────────────────────\nUnused exports:     12 found\nUnused files:        3 found\nUnused dependencies: 2 found\nUnused types:        5 found\n─────────────────────────────────────────────────\n\nTop unused exports:\n  src\u002Futils\u002Flegacy.ts: formatOldDate, parseOldFormat\n  src\u002Fapi\u002Fdeprecated.ts: oldEndpoint\n  libs\u002Fcore\u002Fauth\u002Fsrc\u002Findex.ts: AuthV1Client\n\n⚠️  Dead code scan is INFORMATIONAL — does not block commit.\n    Review findings and clean up in a separate commit.\n```\n\n**Key behaviors:**\n- Dead code results do NOT block commit (informational only)\n- Always recommend cleaning dead code in a separate commit\n- If knip returns errors (config issues), report the error and suggest checking `knip.config.ts`\n\n---\n\n## Success Checklist\n\nAfter running \u002Fquality-gate, verify:\n\n- [ ] Project type detected correctly\n- [ ] All available checks identified\n- [ ] Typecheck passes (or skipped if not applicable)\n- [ ] Lint passes (or auto-fixed with --fix flag)\n- [ ] Tests pass (or blockers clearly listed)\n- [ ] Coverage meets threshold (80% by default, or custom value)\n- [ ] Dead code report shown (if --deadcode flag provided)\n- [ ] Report clearly shows pass\u002Ffail per check\n- [ ] If any check fails, blockers are clearly documented\n- [ ] Ready to commit (if all checks pass)\n","# \u002Fquality-gate - Pre-Commit Quality Checks\n\nRun universal quality checks (typecheck, lint, test, coverage) before committing. Auto-detects project type and available tools, including HQ Core script and skill repositories.\n\n**Arguments:** Optional flags: `--fix` (auto-fix lint issues), `--coverage-min=80` (coverage threshold percentage), `--deadcode` (run dead code detection)\n\n## Quality Gate Process\n\n```\nDETECT → CHECK → REPORT → BLOCK or APPROVE\n```\n\n1. **DETECT**: Auto-identify project type and available tools\n2. **CHECK**: Run applicable typecheck, lint, test, and coverage checks\n3. **REPORT**: Display pass\u002Ffail per check with summary\n4. **BLOCK\u002FAPPROVE**: Block commit if any check fails; suggest fixes\n\n---\n\n## Process\n\n### Step 1: Project Type Detection\n\nAuto-detect the project type by checking for manifest files in priority order:\n\n**Detection Priority (check in this order):**\n1. `package.json` → Node.js project (npm, bun, yarn, pnpm)\n2. `pyproject.toml` or `requirements.txt` → Python project\n3. `go.mod` → Go project\n4. `Cargo.toml` → Rust project\n\n**If multiple detected:** Run checks for ALL project types (e.g., monorepo with Node + Python)\n\nAlso detect an **HQ Core script\u002Fskill repository** when the repository contains\nboth `\u003Crepo>\u002Fcore\u002Fscripts\u002Fskill-inventory.mjs` and `\u003Crepo>\u002Fcore\u002Fdocs\u002Fhq\u002Fcommands.json`.\nThis applies alongside any detected language manifests and also works when\nthere is no language manifest. Resolve paths from this repository's root;\ndo not use a different HQ checkout for the check.\n\nFor this repository type, run the existing cheap, read-only freshness check\n**before slower checks and before committing or pushing**:\n\n```bash\nrepo_root=\"$(git rev-parse --show-toplevel)\"\nnode \"$repo_root\u002Fcore\u002Fscripts\u002Fskill-inventory.mjs\" --root \"$repo_root\" --check --scope shipped\n```\n\nA stale inventory is a source failure, not an infrastructure retry. If the\nchange intentionally edits shipped skills or commands, regenerate the affected\ninventory with the existing generator, inspect its diff, and rerun the check.\nCommit the intended source and generated inventory together. A missing Node\nruntime or failed check is not a pass; report it and resolve it before push.\nThis local preflight does not replace the repository's CI or review gates.\n\n**If none of these repository types is detected:** Stop and ask the user which project type to use.\n\n**Report detected project type(s) before proceeding.**\n\n### Step 2: Determine Available Tools\n\nFor each detected project type, identify which tools are available:\n\n#### Node.js Project\n\n| Check | Tools to Try (in priority order) | Fallback |\n|-------|----------------------------------|----------|\n| **Typecheck** | `bun check`, `tsc` (if tsconfig.json exists) | Skip if no tools available |\n| **Lint** | `bun lint` (if oxlint available), `eslint`, `oxlint`, `biome lint` | Skip if no tools available |\n| **Test** | `bun test`, `npm test`, `pnpm test`, `yarn test` | Skip if no test script |\n| **Coverage** | `bun test --coverage`, `npm test -- --coverage`, Vitest coverage | Skip if no coverage tool |\n\n**Custom scripts in package.json:** Prefer these over direct tool invocations:\n- If `package.json` has `\"typecheck\"` script → use `npm run typecheck` (or bun\u002Fpnpm\u002Fyarn equivalent)\n- If `package.json` has `\"check\"` script → use `npm run check`\n- If `package.json` has `\"lint\"` script → use `npm run lint`\n- If `package.json` has `\"test\"` script → use `npm test`\n\n#### Python Project\n\n| Check | Tools to Try (in priority order) | Fallback |\n|-------|----------------------------------|----------|\n| **Typecheck** | `mypy`, `pyright` | Skip if not installed |\n| **Lint** | `ruff check`, `flake8` | Skip if not installed |\n| **Test** | `pytest` | Skip if not installed |\n| **Coverage** | `pytest --cov` | Skip if pytest-cov not installed |\n\n**Directory to scan:** `src\u002F` if exists, else `.\u002F`\n\n#### Go Project\n\n| Check | Tools to Try (in priority order) | Fallback |\n|-------|----------------------------------|----------|\n| **Typecheck** | `go vet .\u002F...` | Built-in, always available |\n| **Lint** | `golangci-lint run`, `go fmt -l` | Skip if golangci-lint not installed |\n| **Test** | `go test .\u002F...` | Built-in, always available |\n| **Coverage** | `go test -cover .\u002F...` | Built-in, always available |\n\n#### Rust Project\n\n| Check | Tools to Try (in priority order) | Fallback |\n|-------|----------------------------------|----------|\n| **Typecheck** | `cargo check` | Built-in, always available |\n| **Lint** | `cargo clippy -- -D warnings` | Built-in, always available |\n| **Test** | `cargo test` | Built-in, always available |\n| **Coverage** | `cargo tarpaulin --out Html` | Skip if tarpaulin not installed |\n\n### Step 3: Run Quality Checks\n\nFor each detected project type, run all available checks in this order:\n\n1. **Typecheck first** — catches type errors early\n2. **Lint second** — style and code quality\n3. **Test third** — functional correctness\n4. **Coverage fourth** — test comprehensiveness\n\n**Key behaviors:**\n- Run each check independently (don't skip subsequent checks if one fails)\n- Capture exit codes and output for reporting\n- If `--fix` flag provided, run lint with auto-fix flags:\n  - Node: `eslint --fix`, `oxlint --fix`, `biome lint --write`\n  - Python: `ruff check --fix`, `ruff format`\n  - Go: `gofmt -w`, `golangci-lint run --fix`\n  - Rust: `cargo clippy --fix` (requires nightly)\n- For coverage checks, compare against threshold (default 80%, configurable with `--coverage-min=NN`)\n\n### Step 4: Report Results\n\nDisplay results in a clear table format:\n\n```\nQUALITY GATE REPORT\n═══════════════════════════════════════════════════════════\n\nProject Type: Node.js\nPackage Manager: bun\n\nCheck         Status    Details\n─────────────────────────────────────────────────────────\nTypecheck     ✓ PASS    (0 errors, 0 warnings)\nLint          ✓ PASS    (0 issues)\nTest          ✓ PASS    (42 passed, 2 skipped)\nCoverage      ✓ PASS    (92% statements, 88% branches)\n─────────────────────────────────────────────────────────\n\nOVERALL: ✓ ALL CHECKS PASSED\n═══════════════════════════════════════════════════════════\n\nSafe to commit. Run: git commit -m \"your message\"\n```\n\n**If any check fails:**\n\n```\nQUALITY GATE REPORT\n═══════════════════════════════════════════════════════════\n\nProject Type: Node.js\nPackage Manager: bun\n\nCheck         Status    Details\n─────────────────────────────────────────────────────────\nTypecheck     ✗ FAIL    (3 errors)\nLint          ✓ PASS    (0 issues)\nTest          ✗ FAIL    (1 failed, 41 passed)\nCoverage      ⊘ SKIP    (Test failures prevent coverage)\n─────────────────────────────────────────────────────────\n\nOVERALL: ✗ QUALITY GATE BLOCKED\n═══════════════════════════════════════════════════════════\n\nBlockers:\n  • Fix 3 TypeScript errors\n    → Error at src\u002Futils.ts:15: Type 'string' is not assignable to type 'number'\n    → Error at src\u002Fapi.ts:8: Property 'id' does not exist on type 'User'\n    → Error at src\u002Fapi.ts:20: Missing return type annotation\n\n  • Fix 1 test failure\n    → Test: parseDate should parse ISO dates\n      Expected: '2025-01-01', Got: '2025-01-01T00:00:00Z'\n\nTo auto-fix linting issues, run: \u002Fquality-gate --fix\n```\n\n### Step 5: Block or Approve\n\n**If all checks pass:** Recommend running `git commit`\n\n**If any check fails:**\n1. List blocking issues clearly\n2. Suggest fixes (e.g., \"run: eslint --fix\", \"fix TypeScript errors before committing\")\n3. Do NOT allow commit to proceed\n4. If `--fix` flag was provided, re-run after auto-fixes to validate\n\n---\n\n## Worked Example: Node.js Project (Complete Walkthrough)\n\n### Detection Phase\n\n```\n$ \u002Fquality-gate\n\n🔍 Detecting project type...\n  ✓ Found package.json\n  ✓ Found bun.lockb (using Bun package manager)\n  ✓ Found tsconfig.json (TypeScript project)\n  ✓ Found .eslintrc.json (ESLint configured)\n  ✓ Found jest.config.js (Jest test runner)\n\nDetected: Node.js (Bun) with TypeScript\nAvailable checks: typecheck, lint, test, coverage\n```\n\n### Check Phase (All Pass)\n\n```\nRunning checks...\n\n✓ Typecheck (bun check)\n  0 errors, 0 warnings\n  Completed in 2.3s\n\n✓ Lint (eslint)\n  0 issues\n  Completed in 1.8s\n\n✓ Test (bun test)\n  42 passed, 0 failed, 2 skipped\n  Completed in 8.5s\n\n✓ Coverage (bun test --coverage)\n  Statements: 92%\n  Branches: 88%\n  Functions: 94%\n  Lines: 92%\n  Completed in 9.1s\n```\n\n### Report Phase (Success)\n\n```\nQUALITY GATE REPORT\n═══════════════════════════════════════════════════════════\n\nProject Type: Node.js (Bun)\nTypeScript: enabled\nTest Framework: Jest\n\nCheck         Status    Details\n─────────────────────────────────────────────────────────\nTypecheck     ✓ PASS    (0 errors, 0 warnings)\nLint          ✓ PASS    (0 issues)\nTest          ✓ PASS    (42 passed, 0 failed)\nCoverage      ✓ PASS    (92% statements, meets 80% threshold)\n─────────────────────────────────────────────────────────\n\nOVERALL: ✓ ALL CHECKS PASSED\n═══════════════════════════════════════════════════════════\n\n✅ Safe to commit. Run: git commit -m \"your message\"\n```\n\n### Check Phase (With Failures)\n\n```\nRunning checks...\n\n✗ Typecheck (bun check)\n  3 errors\n    src\u002Fapi.ts:8 - Property 'id' does not exist on type 'User'\n    src\u002Fapi.ts:15 - Type 'string' is not assignable to type 'number'\n    src\u002Futils.ts:22 - Missing return type annotation\n  Completed in 2.3s\n\n✓ Lint (eslint)\n  0 issues\n  Completed in 1.8s\n\n✗ Test (bun test)\n  39 passed, 2 failed, 1 skipped\n  FAIL src\u002Femail.test.ts\n    ✕ validateEmail should reject empty string\n      Expected: false\n      Received: true\n  FAIL src\u002Fmath.test.ts\n    ✕ add should sum two numbers\n      Expected: 3\n      Received: 4\n  Completed in 8.5s\n\n⊘ Coverage (skipped due to test failures)\n```\n\n### Report Phase (With Failures)\n\n```\nQUALITY GATE REPORT\n═══════════════════════════════════════════════════════════\n\nProject Type: Node.js (Bun)\nTypeScript: enabled\nTest Framework: Jest\n\nCheck         Status    Details\n─────────────────────────────────────────────────────────\nTypecheck     ✗ FAIL    (3 errors)\nLint          ✓ PASS    (0 issues)\nTest          ✗ FAIL    (2 failed, 39 passed)\nCoverage      ⊘ SKIP    (Test failures prevent coverage check)\n─────────────────────────────────────────────────────────\n\nOVERALL: ✗ QUALITY GATE BLOCKED\n═══════════════════════════════════════════════════════════\n\nFix the following blockers before committing:\n\n1. TypeScript Errors (3 total):\n   src\u002Fapi.ts:8 - Property 'id' does not exist on type 'User'\n   src\u002Fapi.ts:15 - Type 'string' is not assignable to type 'number'\n   src\u002Futils.ts:22 - Missing return type annotation\n\n2. Test Failures (2 total):\n   src\u002Femail.test.ts - validateEmail should reject empty string\n   src\u002Fmath.test.ts - add should sum two numbers\n\nNext steps:\n  1. Fix TypeScript errors in src\u002Fapi.ts and src\u002Futils.ts\n  2. Update tests in src\u002Femail.test.ts and src\u002Fmath.test.ts\n  3. Run: \u002Fquality-gate (to re-check)\n  4. Commit: git commit -m \"your message\"\n```\n\n---\n\n## Python Project Example\n\n### Detection & Checks\n\n```\n$ \u002Fquality-gate\n\n🔍 Detecting project type...\n  ✓ Found pyproject.toml\n  ✓ Found pytest.ini\n  ✓ Found ruff.toml\n\nDetected: Python project\nAvailable checks: typecheck (mypy), lint (ruff), test (pytest), coverage\n\nRunning checks...\n\n✓ Typecheck (mypy)\n  No errors\n  Completed in 3.2s\n\n✓ Lint (ruff check)\n  0 issues\n  Completed in 1.1s\n\n✓ Test (pytest)\n  24 passed, 0 failed\n  Completed in 5.8s\n\n✓ Coverage (pytest --cov)\n  Statements: 85%\n  Branches: 79%\n  Completed in 6.2s\n```\n\n---\n\n## --fix Flag Example\n\n```\n$ \u002Fquality-gate --fix\n\n🔍 Detecting project type...\n  ✓ Found package.json (Node.js)\n  ✓ Found tsconfig.json (TypeScript)\n\nRunning checks...\n\n✓ Typecheck (bun check)\n  0 errors, 0 warnings\n\n🔧 Lint (eslint --fix)\n  Found 5 issues, fixed 5 issues\n  Completed in 1.8s\n\n✓ Test (bun test)\n  42 passed, 0 failed\n\n✓ Coverage (bun test --coverage)\n  92% statements\n\nQUALITY GATE REPORT\n═══════════════════════════════════════════════════════════\n\nCheck         Status    Details\n─────────────────────────────────────────────────────────\nTypecheck     ✓ PASS    (no errors)\nLint          ✓ PASS    (5 issues auto-fixed)\nTest          ✓ PASS    (42 passed)\nCoverage      ✓ PASS    (92% statements, meets 80%)\n─────────────────────────────────────────────────────────\n\nOVERALL: ✓ ALL CHECKS PASSED\n═══════════════════════════════════════════════════════════\n\n✅ Safe to commit. Run: git commit -m \"your message\"\n```\n\n---\n\n## Framework-Specific Commands\n\n### Node.js \u002F Bun\n\n```bash\n# Detect and run all checks\n\u002Fquality-gate\n\n# Auto-fix linting issues\n\u002Fquality-gate --fix\n\n# Custom coverage threshold\n\u002Fquality-gate --coverage-min=90\n\n# Combine flags\n\u002Fquality-gate --fix --coverage-min=85\n```\n\n### Python\n\n```bash\n# Detect and run all checks\n\u002Fquality-gate\n\n# Auto-fix with ruff\n\u002Fquality-gate --fix\n\n# Set custom threshold\n\u002Fquality-gate --coverage-min=75\n```\n\n### Go\n\n```bash\n# Run all checks\n\u002Fquality-gate\n\n# Auto-format code\n\u002Fquality-gate --fix\n```\n\n### Rust\n\n```bash\n# Run all checks\n\u002Fquality-gate\n\n# Auto-fix with clippy\n\u002Fquality-gate --fix\n```\n\n---\n\n## Dead Code Detection (--deadcode flag)\n\nWhen the `--deadcode` flag is provided, run dead code detection **after** lint passes:\n\n### Node.js Projects\n\n| Tool | Detection | Install Check |\n|------|-----------|---------------|\n| **ts-unused-exports** | Unused exports | `package.json` has `ts-unused-exports` in devDependencies |\n| **knip** | Unused exports, files, deps, types | `package.json` has `knip` in devDependencies |\n| **ts-prune** | Unused exports only | `package.json` has `ts-prune` in devDependencies |\n\n**Preferred tool:** ts-unused-exports (lightweight, no dependency conflicts in monorepos). Use knip for comprehensive scans if zod version is compatible.\n\n**If project has a `deadcode` script in package.json:** Use that (`bun run deadcode`, `npm run deadcode`, etc.)\n\n**If no dead code tool is installed:** Report: \"No dead code tool configured. Consider adding ts-unused-exports: `bun add -d ts-unused-exports`\"\n\n### Report Format\n\n```\nDead Code Analysis\n─────────────────────────────────────────────────\nUnused exports:     12 found\nUnused files:        3 found\nUnused dependencies: 2 found\nUnused types:        5 found\n─────────────────────────────────────────────────\n\nTop unused exports:\n  src\u002Futils\u002Flegacy.ts: formatOldDate, parseOldFormat\n  src\u002Fapi\u002Fdeprecated.ts: oldEndpoint\n  libs\u002Fcore\u002Fauth\u002Fsrc\u002Findex.ts: AuthV1Client\n\n⚠️  Dead code scan is INFORMATIONAL — does not block commit.\n    Review findings and clean up in a separate commit.\n```\n\n**Key behaviors:**\n- Dead code results do NOT block commit (informational only)\n- Always recommend cleaning dead code in a separate commit\n- If knip returns errors (config issues), report the error and suggest checking `knip.config.ts`\n\n---\n\n## Success Checklist\n\nAfter running \u002Fquality-gate, verify:\n\n- [ ] Project type detected correctly\n- [ ] All available checks identified\n- [ ] Typecheck passes (or skipped if not applicable)\n- [ ] Lint passes (or auto-fixed with --fix flag)\n- [ ] Tests pass (or blockers clearly listed)\n- [ ] Coverage meets threshold (80% by default, or custom value)\n- [ ] Dead code report shown (if --deadcode flag provided)\n- [ ] Report clearly shows pass\u002Ffail per check\n- [ ] If any check fails, blockers are clearly documented\n- [ ] Ready to commit (if all checks pass)\n",{"name":5,"description":7,"allowed-tools":44},"Read, Write, Edit, Bash, Glob, Grep","main","205cf61728a27ef15e9153aa38df5856fc8d82f5",".claude\u002Fskills\u002Fquality-gate",18,"https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core","https:\u002F\u002Fgithub.com\u002Findigoai-us","https:\u002F\u002Fhqforwork.com\u002F","The AI Context Layer for Teams","2026-11-12 06:53:38",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add indigoai-us\u002Fhq-core --skill quality-gate",{"tool":60,"command":61},"bunx","bunx skills add indigoai-us\u002Fhq-core --skill quality-gate",{"tool":63,"command":64},"pnpm","pnpm dlx skills add indigoai-us\u002Fhq-core --skill quality-gate","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fquality-gate\u002FSKILL.md",true,[68],{"path":69,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":73},"agents\u002Fopenai.yaml","REFERENCE","参考文档",124,"https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fquality-gate\u002Fagents\u002Fopenai.yaml",[75,83,90,97,104,111],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":82},"01M73NTNKZ3T2KJNDP2ZF23645","job","Deprecated alias for \u002Fschedule — Outpost recurring agent jobs. Prefer \u002Fschedule.","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fjob\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":82},"01M73NTE0H9DQTT6DNHDKRWTXW","import-claude","Deprecated alias for \u002Fimport-context — bootstrap HQ from your prior AI footprint (Claude Code, Codex, Grok, claude.ai history plus on-disk artifacts).","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimport-claude\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":82},"01M73NT67433KKX96CCJWDQQ0X","hq-whoami","Show current HQ Cognito identity and session expiry.","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fhq-whoami\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":82},"01M73NT17SVXZV2QPT14C2RPJP","hq-share","Share HQ vault paths through single-use links or direct ACL grants.","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fhq-share\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":82},"01M73NSXYFMD7EHGT8TFDZA3C8","hq-secrets","Use HQ CLI secrets safely through env injection or one-off exec.","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fhq-secrets\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":82},"01M73NSWCXJK29Q8CNG8AS3ZZQ","hq-logout","Sign out of HQ Cognito and clear local tokens.","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fhq-logout\u002FSKILL.md",[],[]]