agentleFS
LNSDLNSD/lorecraft/.agents/skills/code-format/SKILL.md

code-format

Skill0 starsChanged 15 days agoApache-2.0View on GitHub

Format Python code automatically. Use immediately after editing .py files, when the user mentions formatting or code style, or before checks and commits. Applies the project's ruff format configuration.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when you need to:

    line 14
  2. Distinctive:

    Check whether code meets the formatting standard without rewriting it

    line 16
  3. Distinctive:

    Ensure formatting compliance before checks or commits

    line 17
  4. Very specific:

    Run just fmt once — it covers the repository, so there is no per-package variant to choose.

    line 67
  5. Very specific:

    Use just fmt-check when you want to know whether formatting is clean without modifying files — in a review, or when deciding whether a diff …

    line 82

≈ “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

Code Formatting Skill

Formatting operations for this repository, a Python package built with uv.

When to Use This Skill

Use this skill when you need to:

  • Format code after editing Python files
  • Check whether code meets the formatting standard without rewriting it
  • Ensure formatting compliance before checks or commits

Available Commands

Format Python code

just fmt

Formats the repository with ruff format. This is the primary formatting command.

Check formatting without writing

just fmt-check

Reports what would change using ruff format --check, and exits non-zero if anything would.

Both recipes accept extra flags, which are passed straight through to ruff. The target is always the repository, so a flag changes how it formats, not what it formats.

Notes

What the configuration decides

Formatting is not a matter of taste here; pyproject.toml settles it. Two settings surprise people most often, and neither is negotiable in a diff:

  • Single quotes. quote-style = "single", so ruff format rewrites double-quoted strings. Docstrings keep """.
  • A 120-column line length, not the ruff default of 88.

just fmt covers every Python file in the repository. The one exclusion is Markdown: ruff also formats Python code blocks inside Markdown, and the documents under docs/ are written to illustrate a convention — bad examples included — so extend-exclude = ["*.md"] keeps the formatter off them.

Format before checks and commits

Format when you finish a coherent chunk of work, and always before running checks or committing. Formatting after linting wastes a lint pass, because a reformat can move code across line boundaries that the linter already reported on.

Example workflows

Single file edit

  1. Edit one module under src/lorecraft/.
  2. Run just fmt.
  3. Move on to /code-check.

Several files across packages

  1. Edit files in more than one package under src/lorecraft/.
  2. Run just fmt once — it covers the repository, so there is no per-package variant to choose.
  3. Move on to /code-check.

Common Mistakes to Avoid

Anti-patterns

  • Never run ruff format directly — use just fmt, which applies the project's env handling.
  • Never hand-format to match the style — the formatter is the authority, and hand-formatting produces a diff it will simply undo.
  • Never skip formatting because an edit was small — a one-line change still lands in the diff.
  • Never reformat files your change does not touch — an unrelated formatting sweep buries the real change. If the repository is already clean, just fmt is a no-op, which is the expected result.

Best practices

  • Format before checks, tests, or a commit.
  • Use just fmt-check when you want to know whether formatting is clean without modifying files — in a review, or when deciding whether a diff is yours.
  • Re-run just fmt after /code-check applies --fix rewrites, since those can change line lengths.

Next Steps

After formatting:

  1. Lint the code → use /code-check
  2. Run targeted tests when warranted → use /code-test

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.