go-trait-fit
Match a Go role's `dev::go-*` traits to what the module actually requires, read from `go.mod`. Use when picking or customizing a role in a repository whose root carries a `go.mod`.
- License 许可
- MIT
- 所属仓库
- muratovv/ai-hats
- 最近更新
- 2026-11-05
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- go-trait-fit
- license
- MIT
- description
- Match a Go role's `dev::go-*` traits to what the module actually requires, read from `go.mod`. Use when picking or customizing a role in a repository whose root carries a `go.mod`.
02 资源文件 1
- 脚本scripts/suggest.py4.7 KB
03 SKILL.md 正文
go-trait-fit
go-dev composes every Go domain, so the default is never under-equipped — a
project with migrations/ and pgx can no longer end up with no database trait.
The price of that default is paid per project: a pure CLI tool still carries the
database, gRPC and samber descriptions in every turn.
go.mod is the one machine-readable statement of which domains a repository
actually touches. This skill turns it into a concrete config customize line.
When to Use
- A role has just been chosen or is being customized, and the project root has a
go.mod. - Not for deciding which role to wear — that decision is made before this skill runs.
- No
go.modin the root: there is no evidence either way. Say nothing, keep the full role.
Procedure
Run the script from the project root, naming the role the line should target:
python <this skill's directory>/scripts/suggest.py --role go-dev
It reads ./go.mod (override with --go-mod), writes nothing, and prints one
ready-to-paste command. Show the output to the user verbatim and let them
decide — the removal is theirs to make, not yours.
The evidence rule the script applies, so you can explain a surprising result:
- Only direct requires count. A
// indirectline means some dependency of a dependency pulled it in, which says nothing about this repository. - A
replacewith norequirebehind it changes nothing in a Go build, so it is not evidence either. - Module paths are prefix-matched, so
github.com/jackc/pgx/v5satisfiespgx.
What it deliberately does not judge
Four traits are checked: dev::go-database, dev::go-grpc, dev::go-cli,
dev::go-samber. The rest are never suggested for removal because go.mod
carries no honest signal for them — log/slog and benchmarks are stdlib, and
manual constructor injection is the recommended default for a small graph. An
absent dependency there would not mean an absent domain, and a wrong "drop this"
costs more than the tokens it saves.
Completion
- The script's output has been shown to the user, unedited.
- Any removal was applied by the user's decision, through
ai-hats config customize. - No
go.mod: the full role stands and nothing was asked.
Anti-Patterns
- Running
config customize --remove-traiton the user's behalf — the script prints, the human applies. - Reading
go.modyourself and reasoning about the dependencies in prose — that is what the script exists to replace. - Suggesting a trait outside the four checked ones because the module "looks like" it does not need it.
04 同仓库更多 Skills
tool-evaluation-protocol
Time-bounded protocol for evaluating new tools, libraries, or methodologies before adoption. Use when evaluating a candidate dependency for the project, researching a methodology (e.g. ML/LLM frameworks, testing approaches), or following up on a hype-driven recommendation.
systematic-debugging
4-phase bug-fix protocol (evidence, pattern, hypothesis, verify). Use when investigating any error, failure, or unexpected behavior, handling bug reports from users or monitoring, or diagnosing test failures with non-obvious causes.
skill-template
Canonical template and validation guide for ai-hats skills. Use when creating a new skill, reviewing an existing one for structural compliance, or deciding which pattern fits a new behavior.
skill-optimization
Audit and refactor library components to eliminate redundancy and staleness. Use during periodic library maintenance, after adding multiple new skills or rules, when a role's token budget is too high, or after retrospectives identify component issues.
silent-fallback-gate
PreToolUse hook — refuses an Edit or Write that adds an inert broad except. Use when a Python edit was blocked for a silent fallback.
retro-to-framework
Convert an observation about agent behavior — from a retrospective or from a single incident — into a framework-level change (hook, rule, skill, skill update). Use after a retrospective identifies problems that are not project-specific, after an incident where an agent misapplied a component it had read, when CLAUDE.md band-aids accumulate (more than 3 per-project rules that could be generic), or when the same problem recurs across multiple projects.