一键导入
technical-debt-manager
Analyze repo for technical debt, research language-specific best practices, create umbrella tracker issue with one subissue per finding
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyze repo for technical debt, research language-specific best practices, create umbrella tracker issue with one subissue per finding
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Search multiple job sources for new listings, spawn parallel triage agents, and update tracking state. Use when running /job-discover or searching for new job opportunities.
Staff-engineer-level ADR helper — interactive multi-round exploration that helps you deeply understand architecture decisions through codebase research, ASCII diagrams, and Socratic dialogue. Use when you want to understand an ADR ("explain this ADR", "help me understand this decision", "what does this mean", "walk me through this"), review it ("is this ADR good enough", "poke holes", "review this ADR"), or when sharing ADR file paths (docs/decisions/, docs/adr/, numbered files like 0014-*.md). Every round produces diagrams and ends with user-directed next steps.
Curate weekly newsletter from checked stories in daily AI digests. Extracts [x] marked items, groups into narrative themes, generates editorial newsletter.
Comprehensive grounded research with rigorous source verification. Use when user needs thorough research with verbatim citations, fact-checking verification, or academic-level source grounding on complex topics.
Interactive KubeCon CFP submission writer. Guides through topic selection, title crafting, abstract writing, and benefits section using acceptance data from 1,100+ talks across 7 KubeCon events (2024-2025). Use when preparing a conference talk proposal for KubeCon/CloudNativeCon, writing a CFP, or asking about KubeCon submission strategy.
Critique a Claude implementation plan before approving execution. Spawns parallel persona subagents (Skeptic, Architect, Verifier) to evaluate the plan against the codebase and return an Approve/Reject/Refine verdict with concrete refinements. Use when a plan has been generated (Plan Mode output, ExitPlanMode, pasted plan text, or plan file path) and needs review before code is written. Triggers on "critique this plan", "review this plan", "is this plan good", "poke holes in this plan", "should I approve this plan", or sharing a plan for evaluation.
| name | technical-debt-manager |
| description | Analyze repo for technical debt, research language-specific best practices, create umbrella tracker issue with one subissue per finding |
| argument-hint | [--focus area] [--label label-name] |
| allowed-tools | Bash, Read, Glob, Grep, WebSearch, WebFetch |
| user-invocable | true |
| context | fork |
| agent | Explore |
Analyze current repo for technical debt by exploring codebase and researching version-specific best practices. Produce an umbrella ☂️ tracker issue plus one subissue per finding, all rated across 4 axes (impact, effort, contagion, business alignment) with concrete, actionable fix descriptions. Subissues are linked to the umbrella via gh-add-subissue.
Parse from $ARGUMENTS:
error-handling, tests, dependencies, architecture). Default: full scan.tech-debtAnalyze technical debt in software repositories with a GitHub remote. Not designed for non-code repos (docs-only, design assets) or repos without version control.
1a. Detect language & framework:
package.json, tsconfig.json → TypeScript/JavaScript + frameworkgo.mod → Gopyproject.toml, setup.py, requirements.txt → Python + frameworkCargo.toml → RustGemfile → Rubypom.xml, build.gradle → Java/Kotlinmise.toml, .tool-versions → Additional tool hints1b. Codebase overview:
.github/workflows/, Makefile, etc.)1c. Check existing debt items:
tech-debt labeled issues: gh issue list --label tech-debt --state open2a. Detect specific versions:
"engines": {"node": ">=20"}, go 1.22 in go.mod)"react": "^18.2", "next": "14.1")2b. Monorepo handling:
package.json, workspace config, apps/ + packages/), research separately per app/package2c. Search for current best practices.
Search queries (adapt to detected stack — include detected version):
"{language} {version} best practices {year}" maintainable code"{framework} {version} common anti-patterns {year}""{language} {version} migration guide" breaking changes (if version is behind latest)"{language} technical debt indicators checklist"Use the available web search capability, then fetch the result pages to extract specific recommendations. Save research summary internally for Phase 3 comparison.
Re-read the priority axes (Phase 4) before starting — record ratings as findings are discovered, not retroactively.
Read references/grep-patterns.md before starting this phase.
Run analysis across these categories. For each finding, record: file:line, description, why it matters, fix approach.
3a. Self-Admitted Debt (SATD markers) & Complexity
TODO, FIXME, HACK, XXX, WORKAROUND comments with Grep
TODO (low) → FIXME (medium) → HACK (high) → XXX (critical)git blame on flagged lines — older = higher priority3b. Architecture
3c. Dependencies
gh api repos/{owner}/{repo}/dependabot/alerts or manual check3d. Testing
3e. DevOps & Tooling
3f. Documentation Debt
3g. Security Debt
gh api repos/{owner}/{repo}/dependabot/alertsIf --focus specified: Only run the matching sub-phase (3a-3g).
Rate each finding on 4 axes:
| Rating | Impact | Effort | Contagion | Business Alignment |
|---|---|---|---|---|
| High | Causes bugs, security risk, blocks features | >1 day, architectural change | Foundational — touches architecture, affects many modules | Blocks product goals, compliance, or release velocity |
| Medium | Degrades developer experience, slows development | Hours, localized change | Spreads — affects 2-5 modules or shared patterns | Slows feature delivery but doesn't block |
| Low | Style, minor inconsistency, nice-to-have | Minutes, simple fix | Isolated — contained to 1 module | No direct business impact |
Contagion (from Riot Games tech debt taxonomy): How much does this debt propagate? Isolated debt in a single module is less urgent than foundational debt baked into architecture that every new feature inherits.
Priority matrix:
Recall the actionability standard and quality checklist (end of this file) before composing issues.
Output structure: one ☂️ umbrella tracker issue + one child subissue per finding, linked via gh-add-subissue.
5a. Verify repo has GitHub remote:
gh repo view --json nameWithOwner -q .nameWithOwner${XDG_DATA_HOME:-$HOME/.local/share}/sai/technical-debt-manager/debt-report-{date}.md (skip rest of Phase 5)5b. Check for existing label:
gh label list --search tech-debtgh label create tech-debt --description "Technical debt items" --color "D93F0B"5c. Create umbrella issue first (so children can reference it).
Read references/issue-template.md for both umbrella and child body structures. Use the Umbrella Tracker template. Initially create with placeholder subissue list (or empty) — it will be rewritten in 5e.
PARENT_URL=$(gh issue create --title "☂️ Tech Debt Audit: {repo} ({date})" --label tech-debt --body-file umbrella.md)
PARENT=$(echo "$PARENT_URL" | grep -oE '[0-9]+$')
5d. Create one child issue per finding, link to umbrella.
For each finding, write a body using the Child Issue template from references/issue-template.md. Title format: conventional commits (type(scope): description), max 70 chars. Map priority → type:
fix, build, choreperftestrefactordocsfeatfor finding in findings; do
CHILD_URL=$(gh issue create --title "$TITLE" --label tech-debt --body-file "$body")
CHILD=$(echo "$CHILD_URL" | grep -oE '[0-9]+$')
gh-add-subissue "$PARENT" "$CHILD" # script in ~/.local/bin/
done
gh-add-subissue uses the GraphQL addSubIssue mutation with the sub_issues feature header. If the script is unavailable, fall back to inline GraphQL:
# Resolve node IDs, then link
PID=$(gh api graphql -f query='query($o:String!,$r:String!,$n:Int!){repository(owner:$o,name:$r){issue(number:$n){id}}}' -f o=OWNER -f r=REPO -F n=$PARENT --jq .data.repository.issue.id)
CID=$(gh api graphql -f query='query($o:String!,$r:String!,$n:Int!){repository(owner:$o,name:$r){issue(number:$n){id}}}' -f o=OWNER -f r=REPO -F n=$CHILD --jq .data.repository.issue.id)
gh api graphql -H "GraphQL-Features: sub_issues" -f query='mutation($p:ID!,$c:ID!){addSubIssue(input:{issueId:$p,subIssueId:$c}){issue{number}}}' -f p=$PID -f c=$CID
5e. Rewrite umbrella body as tracker (now that all child numbers exist).
Replace umbrella body using the Umbrella Tracker template, listing each child as - [ ] #N — title grouped by priority bucket.
gh issue edit "$PARENT" --body-file tracker.md
Read references/measurement-template.md and append its content to the umbrella issue body (after the Summary table). Do not duplicate into child issues.
Display in chat:
Tech debt audit complete
Umbrella: {parent-issue-url}
Subissues: {child-issue-numbers, comma-separated}
Findings: {total-count}
Critical + Quick wins: {count}
Strategic: {count}
Velocity improvers: {count}
Backlog: {count}
Top recommendation: {single most impactful action — reference child #}
${XDG_DATA_HOME:-$HOME/.local/share}/sai/technical-debt-manager/debt-report-{date}.md--focus area not applicable: Inform user, suggest valid areas for this repoDo not:
Every finding's "Fix" field must pass this litmus test: can a developer start work within 2 days without architectural redesign? If no, break into smaller items.
Input: A bare exception handler found at `src/api.py:42` Finding entry: - [ ] **Bare exception swallows errors** — `src/api.py:42` Impact: Silent failures mask bugs in production Contagion: Low — isolated to one handler Fix: Replace `except:` with `except ValueError as e: logger.error(f'Invalid input: {e}')` Effort: Minutes Input: A 65-line function with 4 nested ifs at `main.go:120-185` Finding entry: - [ ] **God function in main.go** — `main.go:120-185` Impact: Untestable, hard to modify without regressions Contagion: Medium — called from 3 handlers Fix: Extract `parseConfig()` into `pkg/config/parser.go`, flatten nested ifs with early returns Effort: Hours Input: Wildcard dependency pin `"lodash": "*"` in `package.json:15` Finding entry: - [ ] **Wildcard dependency pin** — `package.json:15` Impact: Allows breaking changes on install Contagion: Low — single dependency Fix: Pin `lodash` from `*` to `^4.17.21` Effort: MinutesBefore creating issues, verify:
After creating issues, verify:
type(scope): description)**Parent:** #N)gh-add-subissue (parent shows correct subissue count)