techdebt
Find and safely remove duplicated or redundant code in current context or a provided scope, e.g. `scope:git diff main..HEAD`.
- License 许可
- MIT
- 所属仓库
- japurcell/skills
- 最近更新
- 2026-11-11
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- techdebt
- description
- Find and safely remove duplicated or redundant code in current context or a provided scope, e.g. `scope:git diff main..HEAD`.
- argument-hint
- [scope:<path or git diff range>]
- disable-model-invocation
- true
02 资源文件 2
- 参考文档agents/openai.yaml210 B
- 参考文档evals/evals.json2.1 KB
03 SKILL.md 正文
/techdebt
Remove duplicated code while preserving behavior. Prefer small, safe, validated changes over broad cleanup.
1. Route
Before starting, activate or load the delegate-to-subagents skill so that you delegate tasks to the most suitable subagents for each task type when useful.
2. Scope
If candidates are already provided, use them and skip discovery.
Otherwise, use a fast-tier subagent to resolve scope:
- If input contains
scope:..., inspect that scope. - Else inspect
git statusandgit diff HEAD. - If no meaningful changes are found, report that and stop. Do not broaden scope unless the user asks.
Build a shortlist of changed functions, classes, modules, tests, configs, scripts, handlers, or UI units.
3. Find duplication
Dispatch 1-3 code-explorer subagents scaled to scope size, or inspect the relevant code directly for a narrow scope.
Search shortlist items against relevant nearby/codebase patterns for:
- exact duplicates
- near duplicates
- reimplemented helpers/utilities
- repeated validation, parsing, SQL, HTTP, error handling, config, shell, UI, or test setup logic
Classify each finding as:
exactnearreimplementation
If no meaningful duplication is found, report that and stop.
4. Prioritize
Process safe, in-scope candidates in this order:
- same file/module
- same layer/service area
- same abstraction level across modules
- broader architecture or UI/CSS only if explicitly requested
Prefer:
- exact duplicates over near duplicates
- existing helpers over new abstractions
- minimal behavior-preserving diffs
- backend/test refactors over cosmetic churn
Default to the top 1–3 safest candidates unless the user requested broader cleanup.
5. Refactor and validate
For each selected candidate:
- Dispatch one refactoring subagent.
- Refactoring subagent must:
- make the smallest behavior-preserving change
- reuse existing structure and conventions
- avoid new top-level patterns if equivalent ones exist
- activate or load the
tddskill only when tests must be added or changed
- Dispatch one validation subagent.
- Validation subagent runs relevant checks: tests, lint, type-check, build, or targeted commands.
- If validation fails, fix and revalidate; otherwise revert that candidate.
Continue to the next safe candidate. Stop only when remaining candidates are unsafe, ambiguous, out of scope, or require a user choice.
Ask the user before changes involving:
- public API changes
- architectural choices
- visual/UI behavior risk
- broad convention or naming changes
- unrelated refactors
6. Report
Return a concise summary:
- scope used
- duplicates removed
- shared helpers/abstractions introduced
- validation commands and results
- candidates kept, fixed, reverted, skipped, or blocked
- recommended next dedupe targets, if any
04 同仓库更多 Skills
spec-create
Create or revise a portable behavioral SPEC for a feature or whole product. Use when specifying a new idea, documenting an existing system for reimplementation, or defining a change while preserving compatibility. Implementation planning is a separate task.
prd-ralph
Complete at most one eligible unfinished PRD task, verify it, log progress, and optionally create one scoped commit.
fsdp-style-guide
Mandatory for all UI/UX design, implementation, review, audit, or visual regression tasks. Always use for any work that affects user-facing appearance, behavior, accessibility, branding, layout, navigation, forms, dialogs, alerts, tables, or visual design.
agency-priorities
Provide self-contained USDA strategic goals and Forest Service priorities for agency briefings, proposals, and work-plan alignment. Use when explaining agency direction or evaluating how a project contributes to USDA and Forest Service priorities.
accomplishment-report
Create a concise Forest Service executive accomplishment report when all work in an ExecPlan is completed, or update its existing report. Use at ExecPlan closeout and when asked to report completed work, agency alignment, and estimated AI-assisted versus human-only time and cost savings.
writing-for-agents
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.