SKILL · tooling-foundation

SKILL.md template: team convention reference

A background skill that auto-activates on Java files and carries the team's conventions: invisible in the slash menu, free until a Java file is in play.

✓ verified 2026-06-10 · stack: claude-code, java · source

A skeleton for encoding a team convention as a background skill instead of a permanent CLAUDE.md section. user-invocable: false hides it from the / menu (it is knowledge, not a command) and paths scopes auto-activation to Java files, so the body costs tokens only when Claude is actually working in Java. The reasoning for this split is in skills versus prompts.

.claude/skills/java-conventions/SKILL.md
---
name: Java conventions
description: >
Java coding conventions for this repository. Use when writing, refactoring,
or reviewing Java code: naming, error handling, logging, and test structure.
user-invocable: false
paths: "**/*.java"
allowed-tools: Read, Grep
---
# Java conventions
Follow these conventions for all Java code in this repository. Where a
convention conflicts with existing code in the file being edited, match the
file and flag the inconsistency rather than mixing styles.
## Naming
- [REPLACE: package layout, e.g. com.acme.<service>.<layer>]
- [REPLACE: class suffix rules, e.g. *Controller, *Service, *Repository only]
- [REPLACE: test naming, e.g. methodName_condition_expectedResult]
## Error handling
- [REPLACE: exception policy, e.g. no checked exceptions across module
boundaries; wrap in DomainException with an error code]
- [REPLACE: what is never swallowed, what is logged at which level]
## Logging
- [REPLACE: logger and format, e.g. SLF4J, structured key=value, no PII]
## Tests
- [REPLACE: framework and structure, e.g. JUnit 5 + AssertJ; given/when/then]
- [REPLACE: what must be tested, e.g. every public service method; no
Mockito for value objects]
## Checking before you finish
Before completing any Java change, verify it against each section above.
Use Grep to confirm naming patterns match existing usage in the same module.

Commit the directory; everyone has the skill on next pull, and edits take effect within a running session via live change detection.

What it does

  • Loads in two stages. At startup only the name and description register (roughly 30–50 tokens); the body loads when Claude works on files matching paths. A 200-line convention document costs nothing in a TypeScript or Terraform session.
  • user-invocable: false keeps it out of the slash menu: there is nothing for a human to “run”. Claude pulls it in as background knowledge when the description and paths match.
  • allowed-tools: Read, Grep pre-approves the verification step at the end, so checking conventions against existing code never stalls on a permission prompt.
  • Portable format. The directory layout and SKILL.md format follow the Agent Skills open standard, so the same skill works in the 35+ adopting products; the invocation-control frontmatter is the Claude-specific part.

Failure modes

  • The description is the trigger. If it is vague (“Java stuff”), the skill silently never activates and the conventions silently never apply. Write it as the matching condition: what work, in what language, in this repository.
  • Conventions are advice, not enforcement. A skill can be skipped under pressure like any prompt-space content. Anything that must always hold (formatting, forbidden imports, protected paths) belongs in a hook or permission rule; see the deterministic policy pillar.
  • Placeholders left in. A committed [REPLACE: ...] block teaches Claude to emit placeholder text. Fill or delete every bracket before merging.
  • Description budget. Skill name-plus-description listings share a budget defaulting to 1% of the context window; on skill-heavy installs run /doctor to confirm this description is not truncated, and keep it under a few hundred characters.
  • Shadowing. Personal skills take precedence over project skills of the same name; a developer’s own java-conventions would silently win. Prefer a repo-distinctive directory name if that risk is real for your team.

Verified against the SKILL.md frontmatter reference (user-invocable, paths, allowed-tools), progressive disclosure, and skill location precedence at code.claude.com/docs/en/skills, 2026-06-10.