跳到正文
Skillpedia
测试15k · #11028

trellis-check

它能做什么

该技能使用项目的规则和工具,对你刚编写的代码进行质量检查。适合希望在提交前进行最终审阅的开发者。

适用场景

  • ✓当代码已经编写完成,需要在提交之前进行质量检查的时候。
  • ✓当你想确认测试、代码检查和类型检查都已通过的时候。
  • ✓当一次较长的会话可能已经偏离项目规则的时候。

技能链接

https://github.com/mindfold-ai/Trellis/blob/main/.agents/skills/trellis-check/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/mindfold-ai/Trellis/blob/main/.agents/skills/trellis-check/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“在我提交之前,请对照我们的项目规则检查我刚写的代码,并运行测试。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会列出改动的文件,阅读任务需求和相关的规格检查,运行项目的代码检查、类型检查和测试命令,然后逐项完成质量检查清单。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Code Quality Check

Comprehensive quality verification for recently written code. Combines spec compliance, cross-layer safety, and pre-commit checks.


Step 1: Identify What Changed

git diff --name-only HEAD
git status

Step 2: Read Task Artifacts and Applicable Specs

Read the current task artifacts in order:

  • prd.md
  • design.md if present
  • implement.md if present
python3 ./.trellis/scripts/get_context.py --mode packages

For each changed package/layer, read the spec index and follow its Quality Check section:

cat .trellis/spec/<package>/<layer>/index.md

Read the specific guideline files referenced — the index is a pointer, not the goal.

Step 3: Run Project Checks

Run the project's lint, type-check, and test commands. Fix any failures before proceeding.

Step 4: Review Against Checklist

Code Quality

  • Linter passes?
  • Type checker passes (if applicable)?
  • Tests pass?
  • No debug logging left in?
  • No suppressed warnings or type-safety bypasses?

Test Coverage

  • New function → unit test added?
  • Bug fix → regression test added?
  • Changed behavior → existing tests updated?

Spec Sync

  • Does .trellis/spec/ need updates? (new patterns, conventions, lessons learned)

"If I fixed a bug or discovered something non-obvious, should I document it so future me won't hit the same issue?" → If YES, update the relevant spec doc.

Scope Discipline

  • Any tidying of code the task did not require?
  • Any abstraction, config or extension point added for a case that does not exist yet?
  • Any speculative fallback for a state that cannot occur?
  • Any file changed that the acceptance criteria do not mention?
  • Any workaround added at the caller instead of a fix where the behavior actually lives?

Step 5: Cross-Layer Dimensions (if applicable)

Skip this step if your change is confined to a single layer.

A. Data Flow (changes touch 3+ layers)

  • Read flow traces correctly: Storage → Service → API → UI
  • Write flow traces correctly: UI → API → Service → Storage
  • Types/schemas correctly passed between layers?
  • Errors properly propagated to caller?

B. Code Reuse (modifying constants, creating utilities)

  • Searched for existing similar code before creating new?
    grep -r "pattern" src/
    
  • If the same value repeats, does it represent one stable concept whose callers must change together? Extract only then — two literals that merely happen to match today should stay separate.
  • After batch modification, all occurrences updated?

C. Import/Dependency (creating new files)

  • Correct import paths (relative vs absolute)?
  • No circular dependencies?

D. Same-Layer Consistency

  • Other places using the same concept are consistent?

Step 6: Report and Fix

Report every violation you find. Then:

  • Mechanical and local (lint nit, missing type, wrong import, dead branch, failing assertion) → fix in place, then re-run project checks.
  • Design or judgment (naming a shared concept, moving a module boundary, changing a public interface, reassigning where behavior lives) → record the evidence and your recommendation, and stop. Do not rewrite it silently.

If a fix would touch files outside the current task's scope, say so and stop instead of widening the change.

常见问题

它会修复未通过的检查吗?

该技能要求在继续之前修复任何未通过的代码检查、类型或测试结果。

它会检查缺少的测试吗?

会。它会检查新函数是否有单元测试,错误修复是否有回归测试,以及改动的行为是否更新了测试。

什么是规格同步检查?

它会询问项目的规格文件是否需要为新模式或已吸取的经验进行更新。

详情

作者的原始描述

Comprehensive quality verification: spec compliance, lint, type-check, tests, cross-layer data flow, code reuse, and consistency checks. Use when code is written and needs quality verification, before committing changes, or to catch context drift during long sessions.

repo: mindfold-ai/Trellis

热度

GitHub 星标
15k
排名
#11028
许可证
AGPL-3.0
更新时间
2026/9/29

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能