truecourse-analyze
GitHub执行仓库架构分析,支持全量或增量检查模式,并可选启用LLM规则。通过npx运行工具,提示用户选择模式及是否消耗token,最后汇总违规数量与变更情况。
Trigger Scenarios
Install
npx skills add truecourse-ai/truecourse --skill truecourse-analyze -g -y
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 latesttruecourseversion (which happens every time we publish a new release). - LLM rules cost tokens. Never pass
--llmwithout 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
--llmto 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)andSummary: 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 fullnpx -y truecourse analyzeto refresh the baseline. - If the command errored, relay the error message.
5. Next steps
Tell the user they can:
- Run
/truecourse-listto see the full violation list. - Run
/truecourse-fixto 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


