Agent Skillstruecourse-ai/truecourse › truecourse-analyze

truecourse-analyze

GitHub

执行仓库架构分析,支持全量或增量检查模式,并可选启用LLM规则。通过npx运行工具,提示用户选择模式及是否消耗token,最后汇总违规数量与变更情况。

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

Trigger Scenarios

需要分析代码库架构规范 检查新增代码的架构违规 刷新架构分析基线

Install

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

Non-standard path

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

Use without installing

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

指定 Agent (Claude Code)

npx skills add truecourse-ai/truecourse --skill truecourse-analyze -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-analyze",
    "triggers": [
        "analyze this repo",
        "run analysis",
        "check my code",
        "run a diff check"
    ],
    "description": "Run TrueCourse architecture analysis on this repository",
    "user_invocable": true
}

TrueCourse Analyze

Run architecture analysis on the current repository using TrueCourse.

Important

  • Full analysis stashes any uncommitted changes, analyzes the clean working tree, then unstashes. The user's uncommitted work is preserved.
  • Diff check analyzes the full working tree (including uncommitted changes — it does NOT stash) and compares the result against the last full analysis baseline. The report lists violations newly introduced and violations resolved since that baseline. Prefer diff for in-progress work where the user is iterating on changes.
  • 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 (which happens every time we publish a new release).
  • LLM rules cost tokens. Never pass --llm without first relaying the token estimate to the user and getting approval. See the LLM flow below.

Instructions

1. Pick mode

Ask the user whether they want a full analysis or a diff check. If they said "diff" in their request, default to diff.

  • Full: npx -y truecourse analyze
  • Diff: npx -y truecourse analyze --diff

2. Decide on LLM rules

LLM rules add higher-value insights but cost tokens per run. Ask the user one question: "Run LLM-powered rules this time?" If the user is unsure, offer to run deterministic-only first (no tokens, fast) and add LLM later.

  • If user approves LLM: append --llm to the command.
  • If user declines LLM or wants a free run: append --no-llm.

You MUST pass either --llm or --no-llm — running without either in a non-interactive shell will exit with an error naming the flags.

3. Run the command

Use the Bash tool. This is long-running (minutes, especially with --llm) — use a timeout of at least 600000ms (10 minutes).

4. Summarize

When the command finishes, read the printed summary and relay the key numbers:

  • Full analyze: one line with the total violation count and per-severity breakdown, e.g. 15 violations (2 critical, 5 high, 8 medium).
  • Diff analyze: Changed files: N (X modified, Y new, Z deleted) and Summary: N new issues, N resolved. If you see ⚠ Results may be stale — baseline analysis has changed., surface that warning to the user and suggest running a full npx -y truecourse analyze to refresh the baseline.
  • If the command errored, relay the error message.

5. Next steps

Tell the user they can:

  • Run /truecourse-list to see the full violation list.
  • Run /truecourse-fix to apply suggested fixes.

If the run was a full analyze on main (not a feature branch, not --diff), also suggest committing .truecourse/LATEST.json:

git add .truecourse/LATEST.json && git commit -m "refresh truecourse baseline"

That's the baseline --diff and the pre-commit hook read. Committing it on main lets fresh clones and git worktree add checkouts use the hook without re-running analyze. Don't suggest this on feature branches — LATEST.json updates from multiple PRs will conflict on a large generated JSON.

Version History

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

Same Skill Collection

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

Metadata

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

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