技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
technical-debt【数据与研究】Technical debt inventory, prioritization, and audit for PHP/Laravel (MySQL) and Node/TypeScript/React projects. Use when assessing code health, identifying refactoring candidates, planning debt paydown, or auditing a codebase for accumulated debt. Triggers on "audit technical debt", "find tech debt", "debt inventory", "what should we refactor first",…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Technical debt audit and prioritization framework for PHP/Laravel (MySQL) and Node/TypeScript/React projects. Contains 42 rules across 10 categories covering code, security, design, dependency, test, performance, data, documentation, infrastructure, and process debt. Produces a ranked ledger (effort × impact) so teams know what to fix first, not just what's broken. Supports both coding reference and audit mode with PASS/FAIL/N/A output.
When the user asks to "audit technical debt", "find tech debt", or "what should we refactor first" — run the checklist below against their codebase and produce a ranked debt ledger.
$ARGUMENTS): audit only those paths or modulesInspect composer.json and package.json to determine which of the supported stacks (PHP/Laravel, Node/TypeScript/React, or both) is in use. Tooling commands (composer outdated, npm outdated, phpstan, eslint, knip, etc.) are chosen based on this detection.
Work through every item below. For each, output:
file:line (or command output), description of the debt, effort estimate (S/M/L), and impact (LOW/MED/HIGH/CRITICAL)npm audit / composer audit at HIGH or CRITICALpackage.json / composer.jsonRoute::get() deprecations)TODO/FIXME/HACK comments older than 6 months without owner or ticket@deprecated markers without a removal date or replacementEnd the audit with a prioritized table:
## Technical Debt Ledger
| # | Category | Item | File / Location | Effort | Impact | Priority |
|---|----------|------|-----------------|--------|--------|----------|
| 1 | deps | jQuery 1.12 (8y old, 3 CVEs) | package.json:14 | L | CRITICAL | P0 |
| 2 | code | OrderService god class (820 lines) | app/Services/OrderService.php | M | HIGH | P1 |
| 3 | test | 12 disabled tests in auth/ | tests/Feature/Auth/* | S | HIGH | P1 |
...
## Summary
- **PASS:** X checks
- **FAIL:** Y checks
- **N/A:** Z checks
- **Top 3 to pay down first:** (list highest-priority items with rationale)
Priority formula: P0 = CRITICAL impact, P1 = HIGH impact, P2 = MED, P3 = LOW. Within a priority, sort by ascending effort (cheap wins first).
Effort scale:
Reference these guidelines when:
Always detect the stack before running tooling. This skill targets PHP / Laravel (with MySQL) and Node / TypeScript / React projects; detection commands below assume one or both are present.
| Signal | Stack | Tooling |
|---|---|---|
composer.json present | PHP / Laravel | composer outdated, composer audit, phpstan, phpcs, phpmd, deptrac |
package.json present | Node / JS / TS / React | npm outdated, npm audit, eslint, tsc --noEmit, knip, madge |
| MySQL connection available | Database | EXPLAIN, sys.schema_tables_with_full_table_scans, sys.schema_unused_indexes, sys.statement_analysis |
| any repo | Secrets scan | gitleaks git, trufflehog |
If both stacks are present (e.g., Laravel + Inertia + React), run audits for each.
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Code Debt | CRITICAL | code- |
| 2 | Security Debt | CRITICAL | security- |
| 3 | Design Debt | HIGH | design- |
| 4 | Dependency Debt | HIGH | deps- |
| 5 | Test Debt | HIGH | test- |
| 6 | Performance Debt | HIGH | perf- |
| 7 | Data Debt | HIGH | data- |
| 8 | Documentation Debt | MEDIUM | docs- |
| 9 | Infrastructure Debt | MEDIUM | infra- |
| 10 | Process Debt | MEDIUM | process- |
code-duplication — Detect and consolidate duplicated logiccode-complexity — Cyclomatic and cognitive complexity thresholdscode-long-functions — Function and method length limitscode-god-classes — Class size and responsibility limitscode-dead-code — Unused code, unreachable branches, commented blockscode-magic-numbers — Hardcoded literals in business logiccode-long-parameter-lists — Functions with too many positional paramssecurity-secrets-in-code — API keys, passwords, tokens in source / historysecurity-input-validation — Endpoints accepting untrusted input without schemassecurity-auth-hardening — Outdated auth, missing MFA, missing security headersdesign-tight-coupling — Excessive direct dependencies between modulesdesign-circular-deps — Cyclic imports / requiresdesign-leaky-abstractions — Framework types crossing layer boundariesdesign-shotgun-surgery — Changes that touch many files at oncedeps-outdated-versions — Major versions behind on dependenciesdeps-abandoned-packages — Unmaintained / abandoned librariesdeps-security-advisories — Known CVEs in installed dependenciesdeps-unused-deps — Declared but unused packagestest-coverage-gaps — Critical paths without teststest-flaky-tests — Tests with non-deterministic outcomestest-disabled-tests — Skipped tests left in the suitetest-slow-tests — Tests blocking fast feedbackperf-n-plus-one — Linear request → quadratic database loadperf-missing-pagination — Unbounded result setsperf-bundle-bloat — Heavy / unsplit frontend bundlesperf-no-caching — Missing cache layers on read-heavy pathsdata-schema-drift — Production schema diverges from migrationsdata-missing-indexes — Hot queries doing sequential scansdata-orphaned-records — Referential integrity gapsdocs-stale-comments — Comments contradicting current behaviordocs-outdated-architecture — README/architecture docs out of datedocs-undocumented-api — Public APIs without docblocks or typesinfra-runtime-versions — EOL or near-EOL language/runtime versionsinfra-deprecated-apis — Framework deprecations still in useinfra-build-warnings — Build/compile warnings ignoredinfra-secrets-management — Long-lived credentials, plain env files, leaked logsinfra-monitoring-gaps — Missing logs, metrics, traces, alerts, or SLOsprocess-todo-fixme-aging — Aging TODO/FIXME/HACK commentsprocess-deprecated-markers — @deprecated without removal planprocess-debt-tracking — Debt visible in a register / backlogprocess-ownership-gaps — Code without an owning team (CODEOWNERS)process-feature-flags-lingering — Stale feature flags polluting code paths| # | Category | Item | Location | Effort | Impact | Priority |
|---|----------|-------------------------------|-----------------------|--------|----------|----------|
| 1 | deps | guzzle 6.x (5y behind) | composer.json:18 | M | HIGH | P1 |
| 2 | code | InvoiceService dup logic | app/Services/Invoice* | S | MEDIUM | P2 |
| 3 | test | 8 skipped tests in checkout/ | tests/Feature/Checkout| S | HIGH | P1 |
LOW MEDIUM HIGH CRITICAL
S (<1d) → P3 P2 P1 P0
M (1-5d) → P3 P2 P1 P0
L (>1w) → P3 P3 P2 P1 (break down)
Cheap + high-impact items go first. Expensive items always get broken down before scheduling.
# PHP / Laravel
composer outdated --direct # list outdated direct deps
composer audit # known CVEs
vendor/bin/phpstan analyse # static analysis
vendor/bin/phpmd app text cleancode # mess detector
# Node / TS
npm outdated # list outdated deps
npm audit # known CVEs
npx depcheck # unused deps
npx tsc --noEmit # type errors
npx eslint . --max-warnings 0 # lint warnings
# Cross-language
git log --since="6 months ago" --diff-filter=A -p | grep -E "TODO|FIXME|HACK"
cloc . # lines of code per language
Read individual rule files for detailed explanations and code examples:
rules/code-duplication.md
rules/design-circular-deps.md
rules/deps-outdated-versions.md
rules/test-flaky-tests.md
rules/process-todo-fixme-aging.md
Each rule file contains:
For the complete guide with all rules expanded: AGENTS.md