[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78F7FFQKX8PTME7XH3074JB":3,"skill-same:01M78F7FFQKX8PTME7XH3074JB":69},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":28,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M78F7FFQKX8PTME7XH3074JB","code-quality",null,"poppyTM\u002Foride","poppyTM","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F339400917?v=4","01M78F6YNKFR5S5JQR27X9F09Z","Poppy Team","01M78F6YP8ZZTRES9X8Q2ZAD21",1,"MIT","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcode-quality\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"# Code Quality Auditing, Complexity & Maintainability\n\n## Purpose\nAudit cyclomatic and cognitive complexity, code duplication, and maintainability metrics across polyglot codebases using deterministic static analysis gates (ruff, eslint, golangci-lint, clippy), enforce complexity ceilings and duplication thresholds, and produce prioritized remediation plans with before\u002Fafter evidence.\n\n## Use when\n- Auditing a module, package, or repository for complexity hotspots, cloned logic, or maintainability decay before a release or refactoring Goal.\n- Enforcing quality gates in review or audit mode: cyclomatic complexity ceilings, duplication ratios, lint-clean baselines.\n- Planning a refactoring Goal by ranking hotspots on risk times churn and sizing remediation slices.\n- Investigating maintainability regressions flagged by coverage drops or rising defect counts.\n\n## Do not use when\n- Fixing a single known bug with an obvious minimal patch (apply the patch directly; no audit needed).\n- Designing runtime caching topologies or eviction policies (use `caching`).\n- Tuning CI pipeline speed, runner caching, or container image size (use `ci-cd` or `containers`).\n- Measuring wall-clock performance or tail latency (use `benchmarking`).\n\n## Required context\n- Repository checkout at a pinned commit plus language toolchain versions (Go 1.24.3, Python 3.12.4, Node 22.6.0).\n- Lint and analysis configuration in force: `.golangci.yaml`, ruff section of `pyproject.toml`, `eslint.config.js`, clippy lints in `Cargo.toml`.\n- Complexity ceilings and duplication thresholds from the Goal or team policy (defaults: cyclomatic complexity at most 10 per function, duplication at most 3 percent of lines).\n- Hotspot history: per-module churn from `git log --stat` and defect counts from the tracker for risk ranking.\n\n## Procedure\n1. **Establish the measurement baseline**:\n   - Run the full lint and analysis suite from a clean state and record counts: `golangci-lint run .\u002F...`, `ruff check .`, `npx eslint .`, `cargo clippy --all-targets -- -D warnings`.\n   - Capture complexity metrics per function with `gocyclo -over 10 .`, `ruff` C901 rules, `eslint` complexity rule, or `cargo clippy::cognitive_complexity`.\n   - Capture duplication ratios with `jscpd --min-lines 15 --min-tokens 80 src\u002F` and record the percentage of duplicated lines.\n2. **Rank hotspots by risk times churn**:\n   - Compute risk score per module as `risk = max_complexity * log(1 + churn_commits_90d) * (1 + defects_90d)`.\n   - Sort modules descending by risk score; the top 5 modules become the remediation backlog.\n   - Discard hotspots in generated code, vendored dependencies, and migration snapshots; document each exclusion with its path pattern.\n3. **Verify each hotspot manually**:\n   - Open each flagged function and confirm the metric reflects real branching (nested conditionals, switch arms, boolean chains), not tool miscounts on match expressions or JSX conditionals.\n   - Confirm duplication findings are semantic clones (same logic, renamed identifiers), not coincidental structural similarity under 15 lines.\n4. **Remediate in smallest sufficient slices**:\n   - Apply Extract Function, Replace Conditional with Polymorphism, or Extract Shared Helper; keep each slice under 200 changed lines.\n   - Re-run the exact baseline commands after every slice; complexity and duplication numbers must monotonically decrease.\n5. **Close the loop with evidence**:\n   - Record before\u002Fafter metric pairs per hotspot in `templates\u002Fcode-quality-spec.md`.\n   - Run the affected package test suite (`go test .\u002Finternal\u002Fbilling\u002F`, `pytest tests\u002Fbilling -q`) and the verification script `scripts\u002Fverify.sh`; both must exit 0.\n\n## Decision rules\n- **Ceilings Are Hard Gates**: No function ships with cyclomatic complexity above 10; no module ships with duplication above 3 percent. Exceeding either blocks merge.\n- **Never Bulk-Reformat**: Remediation slices must stay under 200 changed lines; repository-wide reformatting in the same change is prohibited.\n- **Generated Code Is Excluded, Never Edited**: Findings inside generated, vendored, or snapshot files must be suppressed via config, never hand-edited.\n- **Metrics Must Monotonically Improve**: Every remediation slice must lower or hold steady the hotspot numbers; a slice that raises complexity is rejected.\n- **Tool Counts Are Advisory Until Confirmed**: No hotspot enters the backlog until a human confirms the flagged code is genuinely complex or duplicated.\n\n## Evidence required\n- Quality audit report adhering to `templates\u002Fcode-quality-spec.md` with before\u002Fafter metric pairs.\n- Raw linter and analyzer logs (golangci-lint, ruff, eslint, clippy, jscpd) captured at baseline and after remediation.\n- Test logs for affected packages showing green suites after each remediation slice.\n- Passing execution log from `scripts\u002Fverify.sh`.\n\n## Output contract\n- Ranked hotspot backlog with risk scores, metric values, and file-level locations.\n- Remediation slices as small reviewable changes, each with before\u002Fafter complexity and duplication deltas.\n- Updated lint suppression config only where generated-code exclusions were missing.\n- Audit report with totals: functions over ceiling, duplication percentage, lint findings by severity.\n\n## Stop conditions\n- All functions at or below cyclomatic complexity 10 and duplication at or below 3 percent, verified by a clean analyzer run.\n- Remaining hotspots formally accepted as tech-debt items with owner and revisit date recorded in the audit report.\n- Token budget exhausted.\n- Blocked on external dependency.\n\n## Escalation rules\n- Escalate to Lead Architect if a hotspot above complexity 25 cannot be decomposed without changing a public API or locked Goal acceptance criteria.\n- Escalate to the owning team if duplication spans service boundaries and requires a shared-library extraction decision.\n- Escalate immediately upon discovering hardcoded secrets, private keys, or credentials during the audit.\n",{},"main","1cd515630b8ceb57777d466bee4970fe7c2e30e0",".agents\u002Fskills\u002Fcode-quality",0,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride","https:\u002F\u002Fgithub.com\u002FpoppyTM","https:\u002F\u002Fpoppy.lat","Construímos linguagens de programação e ferramentas para quem lê código com o mesmo cuidado com que escreve.","2026-09-30 10:15:52",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add poppyTM\u002Foride --skill code-quality",{"tool":37,"command":38},"bunx","bunx skills add poppyTM\u002Foride --skill code-quality",{"tool":40,"command":41},"pnpm","pnpm dlx skills add poppyTM\u002Foride --skill code-quality","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcode-quality\u002FSKILL.md",true,[45,51,55,59,65],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"checks\u002Fcode-quality-checklist.md","REFERENCE","参考文档",2367,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcode-quality\u002Fchecks\u002Fcode-quality-checklist.md",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"manifest.json",2195,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcode-quality\u002Fmanifest.json",{"path":56,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fcode-quality-guide.md",3414,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcode-quality\u002Freferences\u002Fcode-quality-guide.md",{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"scripts\u002Fverify.sh","SCRIPT","脚本",3889,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcode-quality\u002Fscripts\u002Fverify.sh",{"path":66,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":67,"sourceHtmlUrl":68},"templates\u002Fcode-quality-spec.md",2908,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcode-quality\u002Ftemplates\u002Fcode-quality-spec.md",[70,76,82,89,96,103],{"skillNo":71,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M78FHQN254KEH0DETXT5JM29","zoom-reflow","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fzoom-reflow\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M78FHP1880S695V8GQEE0RXK","wireframe-styleguide","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fwireframe-styleguide\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M78FHHYM6AN2H819FABW01DZ","visual-regression","Pixel-by-pixel snapshot testing, Playwright integration, dynamic content masking, deterministic font rendering, and cross-browser CI gates","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fvisual-regression\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":18},"01M78FHE53D8DD0QVRY5C37DA4","ui-implementation","Component-driven UI implementation, multi-state matrix (default, hover, focus-visible, active, disabled, loading, empty, error), DTCG design tokens, responsive layout contracts, and accessibility tree mapping.","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fui-implementation\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":18},"01M78FHBJ1KXFF734GFE509TBJ","tui-editor-engine","Text buffer and editing semantics for a terminal code editor — index conversion, transaction-first editing, multi-cursor invariants, undo grouping, and large-file behaviour.","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftui-editor-engine\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":18},"01M78FH9X6CPJX1H61ZDWTTVW8","tree-sitter-context-indexing","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftree-sitter-context-indexing\u002FSKILL.md",[],[]]