Skip to content
Skills Library
Programming · Building & coding

python-extract-template

/python-extract-template

Use when template-law refuses Python code, when scan lists repeated Python, or when copying a Python file, class or block to change it.

Licence
MIT
Last repository change
11.11.2026

Assessment and security

96/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content31 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 11.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when template-law refuses Python code, when scan lists repeated Python, or when copying a Python file, class or block to change it.

Original author description

Use when template-law refuses Python code, when scan lists repeated Python, or when copying a Python file, class or block to change it.

How it works

SKILL.md has no level-two headings · 32 lines, 168 words

SKILL.md preview
---
name: python-extract-template
description: Use when template-law refuses Python code, when scan lists repeated Python, or when copying a Python file, class or block to change it.
---

# Extract a Python repeat into one template (one job: pick the Python form, and move every copy to it)

Follow `make-it-a-template`. This skill is its Python forms.

<constraints>
Always do:
1. A repeated block: one function, what differs as parameters, keyword-only where a call would read badly.
2. The same set-up and tear-down: a context manager.
   ```python
   @contextmanager
   def timed(label):
       start = perf_counter()
       yield
       log.info("%s took %.2fs", label, perf_counter() - start)
   ```
3. The same wrapping around many functions: a decorator, with `functools.wraps`.
4. One call with other arguments: rows and one loop.
   ```python
   ROWS = [("--host", "localhost"), ("--port", 8080)]
   for flag, default in ROWS:
       parser.add_argument(flag, default=default)
   ```
5. Fields that travel together: a `dataclass(frozen=True)`.
6. A whole file duplicated (a script beside a package): keep the package, and make the script import it.
7. Run what the change reaches. Then search for the old names: none is left.

Never do:
- Share through a module-level mutable value.
- Hide two different behaviours behind one flag.
</constraints>

Versions

The database has no other skills named python-extract-template.

Database snapshot: 13.11.2026 · package version cef23ba16bd8 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 96shell-extract-template
    Use when template-law refuses shell code, when scan lists repeated shell, or when copying a script to start another.
  • 96rust-extract-template
    Use when template-law refuses Rust code, when scan lists repeated Rust, or when copying a Rust function, impl or module to change it.
  • 90Python Code Review with Modern Typing
    Review Python code ensuring strict type safety with Python 3.12+ conventions. Use when reviewing Python code, writing new Python code, or refactoring existing Python code.
  • 90testing-python
    Stratégie de Tests Python 3.14+. Use when writing tests, reviewing test coverage, or setting up testing.
  • 90python-development
    Workflow guidance for developing Python code in the Agent Framework repository. Use this when writing or modifying Python source files under python/.
  • 100wf-template
    Create a new weft workflow template or edit an existing one interactively. Use only when user types /wf-template.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.