coding-python
When python, flask, or jinja are being written or edited.
When & Why to Use This Skill
This Claude skill streamlines Python, Flask, and Jinja development by enforcing strict coding standards and best practices. It automates metadata tracking, ensures consistent syntax styling (such as double-quote enforcement and multi-line SQL formatting), and prioritizes code readability and documentation preservation. By integrating safety features like file collision prevention and optimized web tooling preferences, it helps developers maintain high-quality, maintainable codebases for web applications.
Use Cases
- Standardizing Python web development workflows by enforcing consistent Flask and Jinja2 syntax and style guides.
- Automating the inclusion of mandatory metadata and audit trails (creator, date, iteration) for every function and class modified by AI.
- Improving database code maintainability by mandating multi-line string formatting for all embedded SQL queries.
- Enhancing collaborative coding projects by preserving existing comments and ensuring vertical spacing remains compact and readable.
- Preventing data loss during automated file operations by implementing timestamp-based file collision handling logic.
| name | coding-python |
|---|---|
| description | When python, flask, or jinja are being written or edited. |
Python coding standards
Mandatory Metadata
Every function or class you touch MUST have this comment header:
# [Created-or-Modified] by [Model_Name] | YYYY-MM-DD_[Iteration]
# Example: # Modified by Claude-3.5-Sonnet | 2024-10-27_01
Syntax & Style
Quotes: Enforce Double Quotes (") over Single Quotes ('). Good: x += "." Bad: x += '.' SQL: Always use Multi-line strings (""") for SQL queries. Templates: Set language mode to jinja-html. Spacing: Keep vertical spacing compact (no excessive blank lines). Readability: Prioritize Readable Code over "clever"/compact [pythonic] one-liners.
Comments
Preserve comments: Do NOT delete existing, still relevant comments. Comment liberally: Explain why, not just what.
Logic & Operations
File Collisions: If a file exists, append _[timestamp] to the new filename. Simplicity: Choose the simplest working solution.
Tooling Preference (Web)
Primary: browser_action (ALWAYS try this first). Fallback: Other browser tools (Only if browser_action fails).