Agent Skillstruecourse-ai/truecourse › truecourse-fix

truecourse-fix

GitHub

自动修复 TrueCourse 代码违规,支持按当前变更或全量分析筛选。仅应用含 Fix 块的自动修复,人工决策项需提示用户。

tools/cli/skills/truecourse/truecourse-fix/SKILL.md truecourse-ai/truecourse

Trigger Scenarios

用户请求修复代码违规 用户希望自动处理静态分析工具报告的错误

Install

npx skills add truecourse-ai/truecourse --skill truecourse-fix -g -y
More Options

Non-standard path

npx skills add https://github.com/truecourse-ai/truecourse/tree/main/tools/cli/skills/truecourse/truecourse-fix -g -y

Use without installing

npx skills use truecourse-ai/truecourse@truecourse-fix

指定 Agent (Claude Code)

npx skills add truecourse-ai/truecourse --skill truecourse-fix -a claude-code -g -y

安装 repo 全部 skill

npx skills add truecourse-ai/truecourse --all -g -y

预览 repo 内 skill

npx skills add truecourse-ai/truecourse --list

SKILL.md

Frontmatter
{
    "name": "truecourse-fix",
    "triggers": [
        "fix violations",
        "apply fixes",
        "fix my code",
        "fix diff violations"
    ],
    "description": "Fix TrueCourse violations that have suggested fixes",
    "user_invocable": true
}

TrueCourse Fix

Apply fixes for TrueCourse violations that have fix suggestions.

Important

  • Always invoke via npx -y — without -y, npx will hang on the "Ok to proceed?" prompt whenever the user hasn't cached the latest truecourse version.
  • Default to the diff flow. Users usually want to fix the violations introduced by the changes they're currently iterating on — not the whole repo. Start by asking which set to fix.
  • Only violations with a Fix: block can be auto-fixed. Violations without one require human design decisions; mention them but don't attempt them.

Instructions

1. Pick the violation set

Ask: "Do you want to fix violations from the latest full analysis, or just the changes you're working on right now (diff)?"

  • Diff mode (recommended default): npx -y truecourse list --diff — small set, usually fine to load in one call.

  • Full mode: start with a paged view, npx -y truecourse list (first 20). If the summary line shows a large total and the user hasn't narrowed scope, ask them to narrow before pulling more pages:

    • by severity — use --severity <list>, e.g. npx -y truecourse list --severity critical,high. Valid values: critical,high,medium,low,info.
    • by a specific file / module / service they care about — no server-side filter yet, so page through and keep only matches.

    Avoid --all on large repos — it dumps every violation into context even though most won't be fixable.

If list --diff returns "no diff results yet" or "stale diff", suggest the user first run /truecourse-analyze in diff mode.

2. Identify fixable violations

From the output in hand, keep only violations that contain a Fix: block — those are the ones with actionable fix suggestions. If you loaded only one page in full mode, tell the user how many were fixable on this page and offer to continue to the next page (--offset 20, --offset 40, …) if they want more.

If none on the loaded page(s) are fixable, tell the user and stop (or offer to page further).

3. Present and select

Show the fixable violations as a numbered list with title, severity, and target location. Ask which ones to fix (they can pick numbers or say "all").

4. Apply

For each selected violation:

  • Read the Fix: text.
  • Use the Read tool to load the relevant source file(s).
  • Use the Edit tool to apply the change.
  • Briefly describe what you changed.

5. Re-verify

After fixes, suggest the user re-run the appropriate analysis to confirm the violations are resolved:

  • If you worked in diff mode: run npx -y truecourse analyze --diff --no-llm (fast, free). If they want LLM rules re-checked too, use --llm and relay the cost estimate first.
  • If you worked in full mode: suggest /truecourse-analyze so the user picks the LLM/no-LLM decision fresh.

Version History

  • 656fd57 Current 2026-07-24 22:39

Same Skill Collection

tools/cli/skills/truecourse/truecourse-analyze/SKILL.md
tools/cli/skills/truecourse/truecourse-hooks/SKILL.md
tools/cli/skills/truecourse/truecourse-list/SKILL.md

Metadata

Files
0
Version
9e885cb
Hash
a28d5294
Indexed
2026-07-24 22:39

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-21 04:13
浙ICP备14020137号-1 $Гость$