<< All versions

Skill v1.0.1

currentAutomated scan100/100
pixelastic/oroshi/python-writer

+5 new

──Details
PublishedAugust 21, 2026 at 10:17 AM
Content Hashsha256:6777108c60b11869...
Git SHA79692245fa39
Bump Typepatch
Compare with v1.0.0
──Files
Files (1 file, 2.9 KB)
SKILL.md2.9 KBactive
SKILL.md · 107 lines · 2.9 KB

version: "1.0.1" name: python-writer description: Use when writing or modifying Python code. Apply when adding functions, fixing bugs, or implementing features.


Python Writer

Overview

Write Python code consistent with my conventions.

Core Workflow

Step 1 — Do you really need Python?

Goal: Confirm Python is the right choice.

Exit criterion: Python is unavoidable for this task.

I prefer zsh (through /zsh-writer) for simple scripts or JavaScript (through /js-writer) for more complex modules.

Python is warranted only when a library or runtime has no ZSH/JS equivalent (e.g. kitty config)

If you can solve the problem in ZSH or JS — do that instead, and stop here.

Step 2 — Place the file

Goal: Correct structure around the file.

Exit criterion: Source file, __tests__/, and conftest.py are colocated.

  • Place the source file wherever it belongs for the project.
  • Put tests in a __tests__/ sibling directory, named test_<module>.py.
  • Place conftest.py and pyproject.toml at the project root.

Step 3 — TDD: Write a failing test

Goal: Ensure the bug/feature has a failing test first.

Exit criterion: Test fails.

Write a failing test for the bug or missing feature you want to implement.

  • Test file: test_<module>.py in a __tests__/ sibling directory
  • Run python-test <filepath> to run the tests
  • See Testing for full examples and best practices
python
def test_returns_slugified_name():
result = slugify("Hello World")
assert result == "hello-world"

Step 4 — Make it work

Goal: Minimal code that makes the test pass.

Exit criterion: Test passes.

Write the simplest code that makes the test pass. No patterns yet — just correct behavior.

Run python-test <filepath> to confirm.

Step 5 — Refactor

Goal: Clean code that still passes.

Exit criterion: Tests still pass, patterns applied.

Apply patterns from Style:

PatternRule
Return earlyNo avoidable nesting

Run python-test <filepath> to confirm tests still pass.

Step 6 — Lint

Goal: Automated style gate.

Exit criterion: Lint passes.

  • Run python-lint --fix <file> on any modified .py files
  • Fix every violation, including pre-existing ones.

Common Rationalizations

RationalizationReality
"Python is fine for this, it's just a small script."Prefer ZSH or JS first. Python only when a library or runtime forces it.
"It's only two levels of if/else, it's ok."No it's not. Return early, always.

Checklist

  • [ ] Ensure python is the only choice
  • [ ] Test file named test_<module>.py in __tests__/ sibling directory
  • [ ] Tests pass after step 4
  • [ ] Return early — no avoidable nesting (step 5)
  • [ ] Tests still pass after refactor
  • [ ] python-lint --fix <file> run, all violations fixed
← v1.0.0All versions