agentleFS
e-reitbauere-reitbauer/habits/skills/new-unit/SKILL.md

new-unit

Skill1 starsChanged 6 days agoMITView on GitHub

Use when creating or improving a habits unit: the user asks for guidance on a language, tool, framework, platform, testing practice or workflow that has no unit yet, habits suggested creating one, or an existing unit needs work. Covers choosing triggers, what to write, and registering and validating the unit.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check the root is a git working copy (git -C <root> rev-parse --show-toplevel).

    line 17
  2. Very specific:

    Run habits units to see what exists.

    line 18
  3. Distinctive:

    Write for a strong developer who already knows the language but not the conventions.

    line 38
  4. Very specific:

    Commit with the commit skill (feat(units): add <id> unit).

    line 75

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Creating a habits unit

A unit is one small file of professional guidance for one technology, which habits injects only when a project uses that technology. Getting the triggers and the content right is what makes it useful.

1. Find where units live

Units are the units/<category>/<id>.md files in the habits plugin. The plugin root was given at session start, and habits on the PATH runs the CLI.

  • Check the root is a git working copy (git -C <root> rev-parse --show-toplevel). If it's an installed copy under ~/.claude/plugins/cache/, an update would overwrite your edit. Tell the user to clone the habits repo and install from that folder (claude plugin marketplace add <folder>), then work there.
  • Run habits units to see what exists. Improve an existing unit rather than adding a near-duplicate.

2. Scope it

  • One technology per unit, named in one or two lowercase words joined by a hyphen: swift, gradle, spring-boot, docker-compose. Never a combination like kotlin-gradle; those are two units that load together.
  • Categories: languages, tools (build tools, CLIs, package managers), frameworks, platforms, testing, workflows (processes like OpenSpec). Add a category folder only when none fits.
  • The file name is the id.

3. Choose the triggers

A unit should load in every session that needs it, and in no other. Use as many triggers as fit:

  • paths: globs of the technology's own files: its source extension (**/*.swift) and its config files (**/Package.swift, **/docker-compose.y{a,}ml). Avoid globs another unit already owns: check habits units.
  • commands: the CLI names someone runs when using it (docker compose, xcodebuild). Command prefixes match word by word, after stripping cd …&&, env assignments and sudo.
  • markers: only for project-level workflows that should load at session start (openspec/specs). Relative globs without {}; add */… variants for monorepos.
  • lsp: the language server plugin id, if an official one exists (<name>-lsp@claude-plugins-official).
  • script: only when the guidance must be computed from the project, like the OpenSpec spec index. A Python script next to the unit; it gets {"cwd", "root"} as JSON on stdin and prints text.

4. Write the content

Write for a strong developer who already knows the language but not the conventions. Every line is read in every session that loads the unit, so each must earn its place.

Include:

  • The official style guide or conventions, linked in the first line, and the points from it that are most often gotten wrong.
  • Idioms that separate professional code from merely working code.
  • Concrete pitfalls, with the correct alternative.
  • How to build, test and verify narrowly (exact commands), and what to gitignore.

Leave out:

  • General programming advice, and anything already covered by the hygiene, secrets, dependencies or errors skills.
  • Facts about a single project; those belong in that project's CLAUDE.md or OpenSpec config.
  • Tutorials and explanations of basics.

Format: a first line naming the technology and its style guide, then short sections (Style, Idioms, Pitfalls, Verify, or whatever fits) of terse imperative bullets. Aim for 20 to 45 lines.

---
id: swift
title: Swift
paths: ["**/*.swift"]
lsp: swift-lsp@claude-plugins-official
---
Swift. Follow the Swift API Design Guidelines (swift.org/documentation/api-design-guidelines).

Style
- …

5. Register and check it

There is no registry to edit: the file's location registers it. Then:

  1. habits validate: fix every error and warning.
  2. habits units: confirm the triggers read as intended.
  3. habits status <a project that uses the technology>: the unit should be listed with matching files, and nothing unrelated should match.
  4. habits load <id>: read it the way Claude will receive it.

Commit with the commit skill (feat(units): add <id> unit). Don't push unless the user asks.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.