Communitygithub.com

daa-code-review(コードレビュースキル)

Python、Markdown、Mermaid図のコード品質をAIで分析します。コードレビューや品質チェックの際に、PEP8違反、未使用コード、型ヒント欠落、ドキュメント文字列の問題、複雑性、リンク切れ、図の構文などを検出・修正提案します。

daa-code-review(コードレビュースキル) とは?

このスキルは、Pythonコード、Markdownドキュメント、Mermaid図の品質分析をAIで行うための強力なツールです。外部リンター(ruff)とClaudeの分析を組み合わせ、単なる構文チェックを超えて、SOLID原則、DRY、YAGNIなどの優れたソフトウェア工学的実践への準拠、セキュリティ脆弱性、可変名の適切性などをチェックします。主要な機能には、PythonのPEP8違反・未使用コード・型ヒント欠落・複雑性の検出、Markdownのリンク切れ・見出し構造・フォーマット問題の検証、Mermaidダイアグラムの構文検証が含まれます。結果はカラーコード化されたコンソール出力と詳細なMarkdownレポートとして提供され、修正は一括適用から個別承認まで柔軟な承認モードをサポートします。Claude Code、Codex、CursorなどのAIエージェントプラットフォームに対応し、ファイルパスまたはペーストされたスニペットから解析を実行できます。

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

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

DAA コードレビュースキル

Pythonコード、Markdownドキュメント、Mermaid図を解析し、品質問題を検出します。外部リンター(ruff)とClaudeの分析を組み合わせ、修正提案を含む包括的なコードレビューを提供します。 ruffや他のリンターを単に実行するだけではなく、コードが優れたソフトウェア工学的実践(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の理解と最新の構文に関するWeb検索を組み合わせて使用します。詳細は mermaid-checks.md を参照してください。

ワークフロー

  1. コードを受け取る - ファイルパスまたはペーストされたスニペットから
  2. ファイルタイプを検出する - Python (.py)、Markdown (.md)、または Mermaid (.mmd、コードブロック)
  3. 分析を実行する - 外部リンターを最初に実行し、次に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
ドキュメント文字列欠落または不適切なnumpy形式のドキュメント文字列INFO
複雑性サイクロマティック複雑性が高い関数INFO
実行時エラー未定義の名前、構文エラーERROR
インポート未ソートのインポート、禁止されたインポートINFO

Markdown

チェック説明重大度
見出し構造適切なh1→h2→h3の並びWARNING
リンク切れ存在しないファイルリンクERROR
代替テキスト欠落アクセシビリティテキストのない画像WARNING
フォーマット末尾の空白、空行INFO
コードブロック言語識別子の欠落INFO
エンコーディング破損UTF-8文字が×、âœ"などとして表示されるERROR

Mermaid

検証前に、最新のMermaid.jsドキュメントをWeb検索します。以下をチェック:

  • 図のタイプ宣言
  • ノード/エッジの構文
  • 構造の正しさ
  • 関係定義

出力形式

コンソール(対話型)

重大度インジケータ付きの色付き出力:

  • ✗ ERROR(赤) - 修正必須
  • ⚠ WARNING(黄) - 修正推奨
  • ℹ INFO(青) - 修正を検討

Markdownレポート

docs/code_reviews/{YYYY-MM-DD}_{file_name}.md に保存されます。複数ファイルのレビューの場合は、説明的な名前を使用します(例:2026-03-02_full_repo_review.md)。

構造化レポートの内容:

  • サマリー統計
  • ステータスバッジ(合格/不合格)
  • ファイルごとの問題テーブル
  • 展開可能な問題詳細
  • カテゴリ別内訳

修正適用

修正は次の方法で承認できます:

  • すべて一度に - 自動修正可能なすべての問題を適用
  • カテゴリ別 - PEP8修正はすべて適用、ドキュメント文字列はスキップ
  • 重大度別 - エラーを最初に修正、次に警告
  • ファイル別 - 特定のファイルのみ修正
  • 個別に - 各修正を確認

詳細なワークフローについては 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.pyruffを使ったPython分析
markdown_analyzer.pyMarkdown品質チェック
report_generator.pyコンソールおよびMarkdownレポート生成

要件

  • Python 3.10以上
  • ruff(pipでインストール)
  • Mermaidドキュメント検索用のWebアクセス

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.

関連スキル