把自然语言描述转为结构化 JSON,并由 mcp-diagram-generator MCP 服务生成 Draw.io、Mermaid 或 Excalidraw 图表文件。
数据分析
Piglet Python Craftsman
试用Practical Python craftsmanship guidance based on One Python Craftsman. Use when writing, refactoring, or reviewing Python code for naming, branching, data st...
它能做什么
Concise guidance for writing and reviewing Python code using patterns from One Python Craftsman.
技能文档
piglet
Concise guidance for writing and reviewing Python code using patterns from One Python Craftsman.
Purpose and Triggers
- Use for Python (.py) code creation, refactoring, or code review.
- Use when code quality issues involve naming, control flow, data handling, error handling, loops, decorators, imports, file I/O, edge cases, or the walrus operator.
- Prefer clarity and maintainability. Optimize performance only when it is a real constraint.
- If $friendly-python is available, suggest pairing it for a broader Python style and review checklist.
Decision Order
- Correctness and explicit behavior
- Readability and maintainability
- Extension cost and change isolation
- Performance and micro-optimizations
Workflow
- Identify the topic in the table below.
- Apply the guidance and compare against Bad and Good examples.
- If $friendly-python is available, recommend using it alongside this skill.
- Re-check for new edge cases and readability regressions.
Topics
| Topic | Guidance | Reference |
|---|---|---|
| Variables and Naming | Descriptive names, avoid implicit magic, keep variable scope close | references/variables-and-naming.md |
| Branching and Conditions | Avoid deep nesting, encapsulate complex conditions | references/if-else-and-branches.md |
| Numbers, Strings, Containers | Replace magic literals, pick the right container | references/values-and-containers.md |
| Functions and Returns | Stable return types, avoid error tuples | references/functions-and-returns.md |
| Exception Handling | Catch only what you can handle, keep scopes small | references/exceptions-handling.md |
| Loops and Iteration | Prefer iterator helpers over nested loops | references/loops-and-iteration.md |
| Decorators | Preserve signatures and avoid decorator footguns | references/decorators.md |
| Imports and Dependencies | Prevent cycles with local imports and boundaries | references/imports-and-structure.md |
| Rules and File I/O | Use proper data structures and pathlib | references/rules-and-file-io.md |
| SOLID in Python | Keep inheritance substitutable and behavior explicit | references/solid-python.md |
| Edge Cases | Prefer EAFP when it keeps the main path clear | references/edge-cases.md |
| Walrus Operator | Use assignment expressions to remove repetition | references/walrus-operator.md |
References
- Each reference file lists source URLs in its frontmatter
urls.
相关技能
作者 nssa.io1.0k 次安装47 星标
执行 Git 操作(提交、分支、合并、变基、冲突解决与恢复)时强制套用安全规则。
作者 Iván535 次安装31 星标
在本地磁盘以分类纯 Markdown 文件保存需要长期留存的事实,与智能体内置记忆并存。
作者 Iván559 次安装18 星标
诊断生产力系统反复失效的根因,给出最小干预——容量测算、瓶颈定位、可靠的本地记录。
作者 Iván855 次安装69 星标
编写、调试与调优 Playwright 测试,涵盖定位器策略、追踪诊断与 CI 友好的超时配置。
作者 ivangdavila1.3k 次安装130 星标
以 AI 机器人身份加入视频会议,提供语音、虚拟形象与屏幕共享四种模式。
作者 johnpatternai22 次安装8 星标
psiace 的更多技能
浏览全部技能Practical guidance for writing, refactoring, and reviewing friendly Python code with a Pythonic, readable, and maintainable style. If the skills set includes...
作者 psiace40 次安装