Comprehensive Code Reviewのロゴ

Comprehensive Code Review

組織
openharmonyinsight
comprehensive-code-review

Code review for ACE Engine (OpenHarmony ArkUI) covering C++/JS/TS/ArkTS. Analyzes 19+ dimensions: stability, performance, threading, security, memory, Modern C++ practices, SOLID principles, design patterns, robustness, testability, maintainability, observability, API design, technical debt, backward compatibility. Reports severity levels, refactoring suggestions, and ACE Engine checks (Pattern/Model/Property, component lifecycle, RefPtr/WeakPtr, four-layer architecture). Use when: reviewing PRs, analyzing code quality, enforcing standards, identifying technical debt, validating architecture, generating quality reports.

概要

公開者openharmonyinsight
リポジトリopenharmony-skills
スキル名comprehensive-code-review
スター
36
フォーク
7
同梱ファイル
9
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 9個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    openharmonyinsightがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルComprehensive Code ReviewをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/openharmonyinsight/openharmony-skills/tree/main/skills/comprehensive-code-review
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/openharmonyinsight/openharmony-skills.git /tmp/openharmony-skills
mkdir -p .claude/skills
cp -r /tmp/openharmony-skills/skills/comprehensive-code-review .claude/skills/comprehensive-code-review
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでComprehensive Code Reviewを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にComprehensive Code Reviewを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Comprehensive Code Reviewは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Comprehensive Code Review for ACE Engine

Quick Start

Perform comprehensive code review analysis directly with AI:

"Review the code in frameworks/core/components_ng for memory management issues"

"Analyze this pull request focusing on security vulnerabilities"

"Check path/to/code.cpp for ACE Engine architecture compliance"

Review Workflow

Phase 1: Code Analysis

AI will analyze code across all relevant dimensions based on:

  1. Reading the code files - Understanding implementation details
  2. Applying reference standards - Using criteria from references/ directory
  3. Checking against ACE Engine patterns - Validating project-specific conventions

Phase 2: Dimension-Based Review

Review code across 19+ dimensions. See DIMENSIONS.md for complete coverage.

High-Priority Dimensions:

  • Security (CRITICAL) - Input validation, command injection, buffer overflows
  • Memory (CRITICAL) - Smart pointers, leaks, ownership semantics
  • Threading (HIGH) - Data races, deadlocks, callback safety
  • Stability (HIGH) - Error handling, boundary conditions

Medium-Priority Dimensions:

  • Performance - Algorithm complexity, optimization opportunities
  • SOLID Principles - Single responsibility, Open/Closed, etc.
  • Code Smells - Long methods, large classes, duplicate code
  • Testability - Dependency injection, decoupling

Phase 3: Report Generation

AI generates comprehensive review report including:

  • Executive Summary - Issue counts by severity
  • Critical Issues (🔴) - Must fix before merge
  • High Priority Issues (🟠) - Should fix before merge
  • Medium Priority Issues (🟡) - Fix soon
  • Low Priority Issues (🟢) - Nice to have
  • Dimension Breakdown - Issues grouped by category
  • File-by-File Details - Specific line numbers and code snippets
  • Recommendations - Prioritized action items with before/after examples
  • Review Checklist - Pre-merge verification

Dimension Reference

Quick reference to all dimensions:

DimensionFocusSeverity LevelsReference
StabilityError handling, boundaries🔴🟠🟡🟢STABILITY.md
PerformanceAlgorithms, optimization🔴🟠🟡🟢DIMENSIONS.md
ThreadingConcurrency, synchronization🔴🟠🟡DIMENSIONS.md
SecurityInput validation, vulnerabilities🔴🟠🟡SECURITY.md
MemorySmart pointers, leaks🔴🟠🟡MEMORY.md
Modern C++C++11/14/17/20 features🟠🟡DIMENSIONS.md
Effective C++RAII, Rule of Five🟠🟡DIMENSIONS.md
Code Smells22 types of smells🟠🟡CODE_SMELLS.md
SOLIDDesign principles🟠🟡SOLID.md
Design PatternsPattern usage🟡🟢DIMENSIONS.md
RobustnessFault tolerance🟠🟡DIMENSIONS.md
TestabilityDependency injection🟠🟡DIMENSIONS.md
MaintainabilityCode complexity🟡🟢DIMENSIONS.md
ObservabilityLogging, monitoring🟡🟢DIMENSIONS.md
API DesignInterface quality🟠🟡DIMENSIONS.md
Technical DebtTODO/FIXME tracking🟡🟢DIMENSIONS.md
Backward CompatibilityAPI stability🟠🟡DIMENSIONS.md
ArchitectureACE Engine compliance🔴🟠🟡ACE_ENGINE_SPECIFIC.md

ACE Engine Specific Checks

Architecture Validation

Four-Layer Architecture:

Frontend Bridge Layer
    ↓
Component Framework Layer (Pattern/Model/Property)
    ↓
Layout/Render Layer
    ↓
Platform Adapter Layer (OHOS/Preview)

Check:

  • No violations of layer boundaries
  • Proper use of Pattern/Model/Property separation
  • No direct platform calls from framework layer

Component Structure

components_ng/pattern/<component>/
├── *_pattern.h/cpp         # Business logic & lifecycle
├── *_model.h/cpp           # Data model interface
├── *_layout_property.h/cpp # Layout properties
├── *_paint_property.h/cpp  # Render properties
└── *_event_hub.h/cpp       # Event handling

RefPtr Usage

cpp
// ✅ Creation
auto node = AceType::MakeRefPtr<FrameNode>();

// ✅ Type-safe casting
auto pattern = AceType::DynamicCast<MenuPattern>(node->GetPattern());
if (!pattern) {
    LOGE("Failed to get pattern");
    return false;
}

// ✅ Breaking cycles with WeakPtr
class Child {
    WeakPtr<Parent> parent_;  // Use weak, not strong
};

// ✅ Safe callbacks
auto weak = AceType::WeakClaim(this);
PostTask([weak]() {
    auto pattern = AceType::DynamicCast<MenuPattern>(weak.Upgrade());
    if (pattern) pattern->Update();
});

Naming Conventions

cpp
class MenuPattern {           // PascalCase
public:
    void OnModifyDone();      // PascalCase
    int GetWidth() const;     // Get prefix

private:
    int width_;               // snake_case_ with trailing underscore
    std::string component_id_;  // Abbreviations lowercase
};

constexpr int MAX_MENU_ITEMS = 100;  // UPPER_CASE

Severity Levels

🔴 CRITICAL - Must fix before merge

  • Security vulnerabilities (command injection, buffer overflow)
  • Memory leaks in long-running processes
  • Use-after-free, double-free
  • Data races
  • Crashes / undefined behavior
  • Architecture violations

🟠 HIGH - Should fix before merge

  • Performance degradation
  • API violations
  • SOLID principle violations
  • Major code smells (Large Class, Shotgun Surgery)
  • Improper RefPtr usage
  • Unsafe callback captures

🟡 MEDIUM - Fix soon

  • Minor performance issues
  • Code smells (Long Method, Duplicate Code)
  • Style violations
  • Missing error handling in non-critical paths

🟢 LOW - Nice to have

  • Missing comments
  • Minor style issues
  • Optimization opportunities
  • Code documentation improvements

Common Issue Patterns

PatternDimensionSeverityDetection
Raw pointer instead of RefPtrMemoryHIGHnew T() without RefPtr
Command injectionSecurityCRITICALsystem(user_input)
Buffer overflowSecurityCRITICALstrcpy(), sprintf()
Unsafe this captureThreadingHIGH[this] in PostTask
Long method (>50 lines)Code SmellMEDIUMFunction length
Large class (>500 lines)Code SmellHIGHClass size
Missing null checkStabilityHIGHPointer use without validation
static_cast instead of DynamicCastMemoryMEDIUMstatic_cast<T*>

Usage Examples

Review a Pull Request

"Review the changes in this PR with focus on memory management and threading safety"

AI will:

  • Analyze all changed files
  • Check memory management (RefPtr, WeakPtr, raw pointers)
  • Verify threading safety (callback captures, PostTask usage)
  • Report issues with line numbers and severity

Security Audit

"Perform a security audit of path/to/code, focusing on input validation and potential vulnerabilities"

AI will check for:

  • Command injection risks (system() calls)
  • Buffer overflow vulnerabilities (strcpy, sprintf)
  • Unvalidated user input
  • Unsafe type casts

Memory Leak Detection

"Analyze frameworks/core/components for potential memory leaks and improper RefPtr usage"

AI will identify:

  • Raw new/delete without smart pointers
  • Circular references without WeakPtr
  • Missing null checks after DynamicCast
  • Improper ownership semantics

Architecture Compliance Check

"Verify that components_ng/menu follows the four-layer architecture and Pattern/Model/Property separation"

AI will validate:

  • Four-layer architecture compliance
  • Pattern/Model/Property separation
  • No layer boundary violations
  • Component lifecycle methods (OnModifyDone, etc.)

Integration Examples

Pre-commit Hook

For pre-commit hooks, consider using traditional static analysis tools:

bash
#!/bin/bash
# .git/hooks/pre-commit

CHANGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(cpp|cc|cxx|h|hpp|ts|tsx)$')

if [ -n "$CHANGED_FILES" ]; then
    echo "Running basic static analysis..."
    # Use clang-tidy, cppcheck, eslint, etc.
    for file in $CHANGED_FILES; do
        if [[ $file == *.cpp || $file == *.h ]]; then
            clang-tidy $file --checks='*' || true
        elif [[ $file == *.ts ]]; then
            eslint $file || true
        fi
    done
fi

Manual Review Workflow

For comprehensive AI-powered review:

  1. Identify code to review (PR, specific files, directory)
  2. Request review with specific focus areas
  3. AI analyzes code using reference standards
  4. Review results with severity-tagged issues
  5. Address critical and high-priority issues
  6. Re-request review for verification

References

Detailed documentation for all dimensions in references/:

Assets

Review Checklist

Before merging code:

Code Quality:

  • No CRITICAL issues
  • HIGH priority issues addressed or documented
  • No compiler warnings
  • Static analysis clean

Architecture:

  • Four-layer architecture respected
  • Proper Pattern/Model/Property separation
  • No layer boundary violations

Memory:

  • No memory leaks
  • RefPtr used correctly
  • WeakPtr used to break cycles
  • Callbacks use WeakClaim

Security:

  • All input validated
  • No command injection
  • No buffer overflows
  • Sensitive data protected

Testing:

  • Unit tests added
  • Edge cases covered
  • Error scenarios tested

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Comprehensive Code Review」では何ができますか?

Code review for ACE Engine (OpenHarmony ArkUI) covering C++/JS/TS/ArkTS. Analyzes 19+ dimensions: stability, performance, threading, security, memory, Modern C++ practices, SOLID principles, design patterns, robustness, testability, maintainability, observability, API design, technical debt, backward compatibility. Reports severity levels, refactoring suggestions, and ACE Engine checks (Pattern/Model/Property, component lifecycle, RefPtr/WeakPtr, four-layer architecture). Use when: reviewing PRs, analyzing code quality, enforcing standards, identifying technical debt, validating architectur...

TypingMindでComprehensive Code Reviewを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Comprehensive Code Reviewはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにComprehensive Code Reviewをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/openharmonyinsight/openharmony-skills/tree/main/skills/comprehensive-code-reviewを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Comprehensive Code Reviewを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Comprehensive Code Reviewは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもComprehensive Code Reviewを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Comprehensive Code Review」は無料ですか?

openharmonyinsightがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇