[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EKJK3TAWP2PC6X5FHR797P":3,"skill-same:01M7EKJK3TAWP2PC6X5FHR797P":68},{"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":13,"repositoryHtmlUrl":25,"repositoryHomepageUrl":6,"ownerHtmlUrl":26,"ownerBlogUrl":27,"ownerDescription":28,"updatedAt":29,"install":30,"resources":43},"01M7EKJK3TAWP2PC6X5FHR797P","code-quality",null,"raillen\u002Fdaisy-code-editor","raillen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F50306048?v=4","01M7EKBDVVBSPF21PBPVJYMNYR","Raillen Santos","01M7EKBDWD12A1K9N9Y638FGX9",0,"MIT","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\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","2e465213b972294984c8c9515a47f811e4b358da",".ai\u002Fskills\u002Fcode-quality","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor","https:\u002F\u002Fgithub.com\u002Fraillen","https:\u002F\u002Fraillen.com","\u003C\u003CMarketing & IT>>\r\n\r\n@poppy-team\r\n@wasd-lat ","2026-10-16 09:17:52",{"source":7,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add raillen\u002Fdaisy-code-editor --skill code-quality",{"tool":36,"command":37},"bunx","bunx skills add raillen\u002Fdaisy-code-editor --skill code-quality",{"tool":39,"command":40},"pnpm","pnpm dlx skills add raillen\u002Fdaisy-code-editor --skill code-quality","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fcode-quality\u002FSKILL.md",true,[44,50,54,58,64],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"checks\u002Fcode-quality-checklist.md","REFERENCE","参考文档",2367,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fcode-quality\u002Fchecks\u002Fcode-quality-checklist.md",{"path":51,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":52,"sourceHtmlUrl":53},"manifest.json",2195,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fcode-quality\u002Fmanifest.json",{"path":55,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Fcode-quality-guide.md",3414,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fcode-quality\u002Freferences\u002Fcode-quality-guide.md",{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},"scripts\u002Fverify.sh","SCRIPT","脚本",3889,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fcode-quality\u002Fscripts\u002Fverify.sh",{"path":65,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":66,"sourceHtmlUrl":67},"templates\u002Fcode-quality-spec.md",2908,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fcode-quality\u002Ftemplates\u002Fcode-quality-spec.md",[69,75,81,88,95,102],{"skillNo":70,"name":71,"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":72,"categories":73,"keywords":74,"publishedAt":18},"01M7EKQYSDAX3SGSCRF873Z8E2","zoom-reflow","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fzoom-reflow\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"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":78,"categories":79,"keywords":80,"publishedAt":18},"01M7EKQX0MWJNQD482GGZPGES4","wireframe-styleguide","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fwireframe-styleguide\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M7EKQS57FS6JYE6KWW6X5ADJ","visual-regression","Pixel-by-pixel snapshot testing, Playwright integration, dynamic content masking, deterministic font rendering, and cross-browser CI gates","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fvisual-regression\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":18},"01M7EKQMFR7651NVH100P5781Z","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\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fui-implementation\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":18},"01M7EKQG3NVX6DPCYS6Q4PA71V","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\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftui-editor-engine\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"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":105,"categories":106,"keywords":107,"publishedAt":18},"01M7EKQEJ993JGC72FE2KFY3ZZ","tree-sitter-context-indexing","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftree-sitter-context-indexing\u002FSKILL.md",[],[]]