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.
In this repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- code-checkSkill
- code-genSkill
- code-integrateSkill
- code-restackSkill
- code-reviewSkill
- code-syncSkill
- code-testSkill
- commitSkill
- feat-discoverySkill
- feat-statusSkill
- feat-validateSkill
- releaseSkill
- code-rules-checkSkill
- code-rulesSkill
- docs-rules-checkSkill
- docs-rules-creatorSkill
- docs-rulesSkill
- skills-checkSkill
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
- Distinctive: line 14
Use this skill when you need to:
- Distinctive: line 16
Check whether code meets the formatting standard without rewriting it
- Distinctive: line 17
Ensure formatting compliance before checks or commits
- Very specific: line 67
Run just fmt once — it covers the repository, so there is no per-package variant to choose.
- Very specific: line 82
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 …
≈ “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.
Files
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 fmtFormats the repository with ruff format. This is the primary formatting command.
Check formatting without writing
just fmt-checkReports 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", soruff formatrewrites 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
- Edit one module under
src/lorecraft/. - Run
just fmt. - Move on to
/code-check.
Several files across packages
- Edit files in more than one package under
src/lorecraft/. - Run
just fmtonce — it covers the repository, so there is no per-package variant to choose. - Move on to
/code-check.
Common Mistakes to Avoid
Anti-patterns
- Never run
ruff formatdirectly — usejust 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 fmtis a no-op, which is the expected result.
Best practices
- Format before checks, tests, or a commit.
- Use
just fmt-checkwhen 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 fmtafter/code-checkapplies--fixrewrites, since those can change line lengths.
Next Steps
After formatting:
- Lint the code → use
/code-check - Run targeted tests when warranted → use
/code-test
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
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.

