Communitygithub.com

cdcoonce/Portfolio_Website

AI 驅動的程式碼品質分析工具,支援 Python、Markdown 和 Mermaid 圖表。

Portfolio_Website 是什麼?

這是一個專為開發者設計的 AI 技能,用於自動化程式碼品質分析。它結合了外部 lint 工具(ruff)和 Claude 的深度分析,支援 Python、Markdown 和 Mermaid 圖表。對於 Python,它能檢查 PEP8 違規、未使用的程式碼、型別提示、docstring 問題、複雜度以及潛在的執行時期錯誤。對於 Markdown,它驗證標題結構、損壞的連結、替代文字和格式化。Mermaid 驗證則透過網路搜尋最新文件來確保圖表語法正確。使用者可以透過五種彈性模式(全部、依類別、依嚴重性、依檔案、逐一)批准並套用自動修復。它會產生化主控台和 Markdown 兩種格式的報告,並將報告儲存到 `docs/code_reviews/` 目錄。此技能特別適合程式碼審查、持續整合流程、提交前檢查以及快速程式碼片段分析。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/cdcoonce/Portfolio_Website/tree/HEAD/.claude/skills/daa-code-review

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

DAA 程式碼審查技能

分析 Python 程式碼、Markdown 文件與 Mermaid 圖表,找出品質問題。結合外部 lint 工具 (ruff) 與 Claude 的分析,提供全面的程式碼審查與建議修正。 不僅是執行 ruff 與其他 lint 工具,而是檢查程式碼是否符合良好的軟體工程實踐 (SOLID、DRY、YAGNI、簡潔而非複雜)、安全性漏洞,以及具描述性的變數命名,例如:

請避免這樣做:

pkb = p_key.private_bytes(
            encoding=serialization.Encoding.DER,
            format=serialization.PrivateFormat.PKCS8,
            encryption_algorithm=serialization.NoEncryption(),
        )

請改這樣做:

private_key_bytes = p_key.private_bytes(
            encoding=serialization.Encoding.DER,
            format=serialization.PrivateFormat.PKCS8,
            encryption_algorithm=serialization.NoEncryption(),
        )

快速入門

分析 Python 程式碼

from python_analyzer import analyze_python, analyze_python_file
from report_generator import generate_console_report, generate_markdown_report
from models import ReviewReport

# 分析程式碼片段
result = analyze_python(code_string)

# 分析檔案
result = analyze_python_file(Path("src/module.py"))

# 產生報告
report = ReviewReport(results=[result], title="Code Review")
generate_console_report(report)  # 主控台輸出
markdown = generate_markdown_report(report)  # Markdown 字串

分析 Markdown

from markdown_analyzer import analyze_markdown, analyze_markdown_file

result = analyze_markdown(content)
# 或
result = analyze_markdown_file(Path("README.md"))

分析 Mermaid 圖表

對於 Mermaid 驗證,請使用 Claude 的理解能力,並結合網路搜尋最新語法。請參閱 mermaid-checks.md。

工作流程

  1. 接收程式碼 - 來自檔案路徑或貼上的片段
  2. 偵測檔案類型 - Python (.py)、Markdown (.md) 或 Mermaid (.mmd, 程式碼區塊)
  3. 執行分析 - 先執行外部 lint 工具,再進行 Claude 分析
  4. 產生報告 - 主控台與 Markdown 兩種格式
  5. 儲存報告 - 將 Markdown 報告寫入 docs/code_reviews/{YYYY-MM-DD}_{file_name}.md (必要時建立目錄)
  6. 審查修正 - 向使用者呈現建議的修正
  7. 套用修正 - 經使用者核准 (彈性核准模式)
  8. 檢查 README - 在推送前,驗證 README.md 是否反映當前變更 (新功能、修改的 API、更新的依賴項、變更的設定)

分析能力

Python (透過 ruff + Claude)

類別範例嚴重性
PEP8行長度、縮排、空白WARNING/INFO
未使用的程式碼未使用的匯入、變數、引數WARNING
型別提示函式缺少型別註解INFO
Docstring缺少或格式錯誤的 numpy 風格 docstringINFO
複雜度循環複雜度過高的函式INFO
執行時期錯誤未定義的名稱、語法錯誤ERROR
匯入未排序的匯入、禁止的匯入INFO

Markdown

檢查項目描述嚴重性
標題結構正確的 h1→h2→h3 順序WARNING
損壞的連結不存在的檔案連結ERROR
缺少替代文字缺少無障礙存取文字的圖片WARNING
格式化結尾空白、空白行INFO
程式碼區塊缺少語言識別碼INFO
編碼損毀出現 ×、âœ" 等 UTF-8 字元ERROR

Mermaid

在驗證前,請先搜尋網路以取得最新的 Mermaid.js 文件。檢查項目:

  • 圖表類型宣告
  • 節點/邊的語法
  • 結構正確性
  • 關係定義

輸出格式

主控台 (互動式)

彩色輸出,附帶嚴重性指示:

  • ✗ ERROR (紅色) - 必須修正
  • ⚠ WARNING (黃色) - 應該修正
  • ℹ INFO (藍色) - 考慮修正

Markdown 報告

儲存至 docs/code_reviews/{YYYY-MM-DD}_{file_name}.md。針對多檔案審查,請使用具描述性的名稱 (例如,2026-03-02_full_repo_review.md)。

結構化報告包含:

  • 摘要統計
  • 狀態徽章 (通過/失敗)
  • 每個檔案的問題表格
  • 可展開的問題詳細資訊
  • 依類別劃分的統計

修正套用

修正可透過以下方式核准:

  • 全部套用 - 套用所有可自動修正的問題
  • 依類別 - 套用所有 PEP8 修正,跳過 docstring
  • 依嚴重性 - 先修正錯誤,再修正警告
  • 依檔案 - 僅修正特定檔案
  • 逐一審查 - 逐一檢視每個修正

請參閱 fix-workflow.md 以了解詳細的工作流程。

參考文件

使用範例

完整儲存庫審查

使用者:「請審查我專案中的程式碼品質」

1. 列出 Python 和 Markdown 檔案
2. 分析每個檔案
3. 匯整成 ReviewReport
4. 呈現主控台摘要
5. 將報告儲存至 docs/code_reviews/{YYYY-MM-DD}_full_repo_review.md
6. 提供套用修正的選項

快速程式碼檢查

使用者:[貼上程式碼片段]
      「這段程式碼有問題嗎?」

1. 直接分析程式碼片段
2. 內嵌回報問題
3. 建議具體修正

提交前審查

使用者:「請在提交前檢查這些檔案」

1. 分析指定的檔案
2. 專注於錯誤與警告
3. 若發現錯誤則阻止提交
4. 若經核准則套用快速修正
5. 根據變更檢查 README 是否需要更新
6. 若新增功能、API 或依賴項有所變更,則更新 README

腳本

腳本用途
models.py資料結構 (Issue, Severity, AnalysisResult)
python_analyzer.py使用 ruff 進行 Python 分析
markdown_analyzer.pyMarkdown 品質檢查
report_generator.py主控台與 Markdown 報告產生

需求

  • Python 3.10+
  • ruff (透過 pip 安裝)
  • 查閱 Mermaid 文件所需的網路存取權限

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

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

Production Python coding standards with automatic version detection (3.10-3.13). Use when writing, reviewing, or refactoring Python to ensure adherence to modern type syntax, LBYL exception handling, pathlib operations, ABC-based interfaces, and production-tested patterns. Not Dagster-specific - applies to any Python project.

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.

相關技能