Communitygithub.com

cdcoonce/Portfolio_Website

Python生产级编码标准,支持自动检测Python版本 (3.10-3.13)。在编写、审查或重构Python代码时使用,确保遵循现代类型语法、LBYL异常处理、pathlib操作、基于抽象类的接口以及生产验证模式。适用于任何Python项目(非Dagster专属)。

Portfolio_Website 是什么?

这个技能为AI助手(如Claude Code)提供了生产级Python编码标准,涵盖Python 3.10至3.13版本。它自动检测项目的Python最低版本,并加载对应的版本特定规则。技能的核心知识(如LBYL异常处理、pathlib操作、类型注解基础)始终加载,而高级主题(如接口设计、异常处理、高级类型注解)则根据任务模式按需加载。它还包含CLI模式、子进程操作等参考文档。这有助于开发者编写干净、可维护且现代的Python代码,适用于任何Python项目。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/cdcoonce/Portfolio_Website/tree/HEAD/.claude/skills/dignified-python

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

严谨的Python编码标准技能

生产级Python编码标准,用于编写干净、可维护、现代的Python代码(版本3.10-3.13)。

何时使用本技能

当用户询问以下问题时自动调用:

  • "让这个更Pythonic" / "这段Python写得好吗"
  • "类型提示" / "类型注解" / "typing"
  • "LBYL与EAFP" / "异常处理"
  • "pathlib与os.path" / "路径操作"
  • "CLI模式" / "click用法"
  • "代码审查" / "改进这段代码"
  • 任何Python代码质量或标准相关问题

注意:本技能是通用Python标准,而非Dagster专属。Dagster模式请使用/dagster-expert。

何时使用本技能 vs. 其他

用户需求使用本技能替代技能
"让这个更Pythonic"✅ 是 - Python标准
"这段Python写得好吗"✅ 是 - 代码质量
"类型提示"✅ 是 - 类型指导
"LBYL与EAFP"✅ 是 - 异常模式
"pathlib与os.path"✅ 是 - 路径处理
"Dagster专属模式"❌ 否/dagster-expert
"CLI参数解析"✅ 是 - CLI模式

核心知识(始终加载)

dignified-python-core.md

版本检测

识别项目的最低Python版本,通过以下顺序检查:

  1. pyproject.toml - 查找requires-python字段(例如requires-python = ">=3.12")
  2. setup.py或setup.cfg - 查找python_requires
  3. .python-version文件 - 包含版本号,如3.12或3.12.0
  4. 如果未找到版本说明,默认使用Python 3.12

一旦识别,加载对应的版本特定文件:

  • Python 3.10:加载versions/python-3.10.md
  • Python 3.11:加载versions/python-3.11.md
  • Python 3.12:加载versions/python-3.12.md
  • Python 3.13:加载versions/python-3.13.md

条件加载(根据任务模式加载)

核心文件覆盖了80%以上的Python代码模式。仅在检测到特定模式时加载以下附加文件:

模式检测示例:

  • 如果任务提及"click"或"CLI" -> 加载cli-patterns.md
  • 如果任务提及"subprocess" -> 加载subprocess.md

参考文档结构

参考文档分布在顶层文件和子目录中:

核心参考(与SKILL.md同目录)

  • dignified-python-core.md - 基本标准(始终加载)
  • cli-patterns.md - 命令行界面模式(click、argparse)
  • subprocess.md - 子进程操作

版本特定参考(versions/)

  • versions/python-3.10.md - Python 3.10+可用的特性
  • versions/python-3.11.md - Python 3.11+可用的特性
  • versions/python-3.12.md - Python 3.12+可用的特性
  • versions/python-3.13.md - Python 3.13+可用的特性

高级主题(references/advanced/)

  • exception-handling.md - LBYL模式、错误边界
  • interfaces.md - ABC和Protocol模式
  • typing-advanced.md - 高级类型模式
  • api-design.md - API设计原则

何时阅读每个参考文档

references/advanced/exception-handling.md

在以下情况阅读:

  • 编写try/except块
  • 包装可能引发异常的第三方API
  • 看到或编写from e或from None
  • 不确定LBYL替代方案是否存在

references/advanced/interfaces.md

在以下情况阅读:

  • 创建ABC或Protocol类
  • 编写@abstractmethod装饰器
  • 设计网关层接口
  • 在ABC和Protocol之间做选择

references/advanced/typing-advanced.md

在以下情况阅读:

  • 使用typing.cast()
  • 创建Literal类型别名
  • 在条件块中缩小类型

references/module-design.md

在以下情况阅读:

  • 创建新的Python模块
  • 添加模块级代码(超出简单常量)
  • 在模块级使用@cache装饰器
  • 在模块级看到Path()或计算
  • 考虑内联导入

references/api-design.md

在以下情况阅读:

  • 为函数添加默认参数值
  • 定义具有5个或更多参数的函数
  • 使用ThreadPoolExecutor.submit()
  • 审查函数签名

references/checklists.md

在以下情况阅读:

  • 提交Python代码前的最终审查
  • 不确定是否已遵循所有规则
  • 需要快速查看要求

如何使用本技能

  1. 核心知识自动加载(LBYL、pathlib、基础导入、反模式)
  2. 版本检测只进行一次 - 识别最低Python版本并加载对应的版本文件
  3. 参考文档根据上述触发条件按需加载
  4. 附加模式可能需要额外加载(CLI模式、子进程)
  5. 每个文件自成体系,包含其领域的完整指导

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cdcoonce/Portfolio_Website

Git commit workflow with enforced conventional commit style. Use when Claude needs to stage and commit changes, craft commit messages, or the user asks to commit, make a commit, or save their work. Ensures consistent commit message format, proper scoping, and atomic commits across the project.

cdcoonce/Portfolio_Website

AI-powered code quality analysis for Python, Markdown, and Mermaid diagrams. Use this skill when: (1) reviewing code for quality issues, (2) checking Python files for PEP8 violations, unused code, missing type hints, docstring problems, complexity issues, or potential runtime errors, (3) validating Markdown documentation for broken links, heading structure, or formatting issues, (4) validating Mermaid diagram syntax, (5) the user asks for a "code review" or "quality check", (6) analyzing code snippets pasted in conversation, or (7) suggesting and applying fixes for code quality issues.

cdcoonce/Portfolio_Website

Deploy the portfolio chat agent Lambda function to AWS. Use when the user asks to deploy, redeploy, push to Lambda, update the chat agent, or after updating context files or lambda_function.py. Rebuilds the knowledge base, packages dependencies, and deploys to AWS Lambda.

cdcoonce/Portfolio_Website

Generate multiple radically different interface designs for a module using parallel sub-agents. Use when user wants to design an API, explore interface options, compare module shapes, or mentions "design it twice".

cdcoonce/Portfolio_Website

Orchestrate the full GitHub-issues-driven development lifecycle. 7-phase pipeline from brainstorm through PR with state tracking and cross-conversation resume. Use when user says "dev cycle", "development workflow", "full development pipeline", or invokes /dev-cycle.

cdcoonce/Portfolio_Website

Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.

cdcoonce/Portfolio_Website

GitHub CLI (gh) integration for managing issues, pull requests, branches,

cdcoonce/Portfolio_Website

Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".

cdcoonce/Portfolio_Website

Explore a codebase to find opportunities for architectural improvement, focusing on making the codebase more testable by deepening shallow modules. Use when user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more AI-navigable.

cdcoonce/Portfolio_Website

CEO/founder-mode plan review. Rethink the problem, find the 10-star product, challenge premises, expand scope when it creates a better product. Three modes: SCOPE EXPANSION (dream big), HOLD SCOPE (maximum rigor), SCOPE REDUCTION (strip to essentials). Use when the user asks for a plan review, CEO review, mega review, or wants a plan challenged/stress-tested before implementation.

cdcoonce/Portfolio_Website

Break a PRD into independently-grabbable GitHub issues using tracer-bullet vertical slices. Use when user wants to convert a PRD to issues, create implementation tickets, or break down a PRD into work items.

cdcoonce/Portfolio_Website

Turn a PRD into a multi-phase implementation plan using tracer-bullet vertical slices, saved as a local Markdown file in docs/plans/. Use when user wants to break down a PRD, create an implementation plan, plan phases from a PRD, or mentions "tracer bullets".

cdcoonce/Portfolio_Website

Generate or update the `.claude/docs/project.md` file that gives Claude project-specific context. Use this skill when the user asks to create, update, regenerate, or refresh project context, or says things like "update project.md", "generate project context", "this repo needs a project.md", or "Claude doesn't know about this project". Also trigger when onboarding Claude to a new repository for the first time.

cdcoonce/Portfolio_Website

Generate comprehensive, high-quality README.md files for code repositories. Use this skill whenever the user asks to create, write, generate, update, or improve a README for any project or repository. Also trigger when the user says things like "document this project", "write docs for this repo", "this repo needs a README", "help me onboard developers to this codebase", or asks for project documentation in markdown. Even if the user just says "README" or "readme" in the context of a codebase, use this skill.

cdcoonce/Portfolio_Website

Create a detailed refactor plan with tiny commits via user interview, then file it as a GitHub issue. Use when user wants to plan a refactor, create a refactoring RFC, or break a refactor into safe incremental steps.

cdcoonce/Portfolio_Website

Set up pre-commit hooks for the current repo. Use when user wants to add pre-commit hooks, configure commit-time linting, formatting, type checking, or testing. Triggers on "pre-commit", "git hooks", "linting hooks", or /setup-pre-commit.

cdcoonce/Portfolio_Website

Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.

cdcoonce/Portfolio_Website

Triage a bug or issue by exploring the codebase to find root cause, then create a GitHub issue with a TDD-based fix plan. Use when user reports a bug, wants to file an issue, mentions "triage", or wants to investigate and plan a fix for a problem.

cdcoonce/Portfolio_Website

Rewrites the prose sections of wiki pages in-place. Reads source files to understand current context, then updates only the content inside <!-- claude:prose --> ... <!-- claude:prose:end --> markers. Never touches <!-- generated:start --> ... <!-- generated:end --> blocks. Supports targeting a single page with /update-wiki {PageName}.

cdcoonce/Portfolio_Website

Create a PRD through user interview, codebase exploration, and module design, then submit as a GitHub issue. Use when user wants to write a PRD, create a product requirements document, or plan a new feature.

相关技能