๐ŸŽฏ

phase-8-review

๐ŸŽฏSkill

from popup-studio-ai/bkit-claude-code

VibeIndex|
What it does

Verifies overall codebase quality through comprehensive architecture, convention, and implementation gap analysis before deployment.

๐Ÿ“ฆ

Part of

popup-studio-ai/bkit-claude-code(17 items)

phase-8-review

Installation

Add MarketplaceAdd marketplace to Claude Code
/plugin marketplace add popup-studio-ai/bkit-claude-code
Install PluginInstall plugin from marketplace
/plugin install bkit
๐Ÿ“– Extracted from docs: popup-studio-ai/bkit-claude-code
4Installs
-
AddedFeb 4, 2026

Skill Details

SKILL.md

|

Overview

# Phase 8: Architecture/Convention Review

> Overall codebase quality verification

Purpose

Review the entire codebase before deployment. Identify architecture consistency, convention compliance, and potential issues.

What to Do in This Phase

  1. Architecture Review: Review structural consistency
  2. Convention Review: Verify rule compliance
  3. Code Quality Review: Duplication, complexity, potential bugs
  4. Refactoring: Fix discovered issues

Deliverables

```

docs/03-analysis/

โ”œโ”€โ”€ architecture-review.md # Architecture review

โ”œโ”€โ”€ convention-review.md # Convention review

โ””โ”€โ”€ refactoring-plan.md # Refactoring plan

```

PDCA Application

  • Plan: Define review scope/criteria
  • Design: Design checklist
  • Do: Execute code review
  • Check: Analyze issues
  • Act: Refactor and proceed to Phase 9

Level-wise Application

| Level | Application Method |

|-------|-------------------|

| Starter | Can be skipped (simple projects) |

| Dynamic | Required |

| Enterprise | Required + security review |

---

Full Phase Verification Matrix

Cross-Phase Consistency Verification

Phase 8 verifies that all Phase outputs and rules are consistently applied.

```

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”

โ”‚ Cross-Phase Dependency Flow โ”‚

โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค

โ”‚ โ”‚

โ”‚ Phase 1 (Schema/Terminology) โ”‚

โ”‚ โ†“ Glossary, entity definitions โ”‚

โ”‚ Phase 2 (Coding Convention) โ”‚

โ”‚ โ†“ Naming rules, environment variable conventions โ”‚

โ”‚ Phase 3 (Mockup) โ”‚

โ”‚ โ†“ Component structure, Props design โ”‚

โ”‚ Phase 4 (API) โ”‚

โ”‚ โ†“ RESTful principles, response format, error codes โ”‚

โ”‚ Phase 5 (Design System) โ”‚

โ”‚ โ†“ Design tokens, component variants โ”‚

โ”‚ Phase 6 (UI Implementation) โ”‚

โ”‚ โ†“ API client, type sharing, error handling โ”‚

โ”‚ Phase 7 (SEO/Security) โ”‚

โ”‚ โ†“ Security rules, metadata โ”‚

โ”‚ Phase 8 (Review) โ† Current stage: Full verification โ”‚

โ”‚ โ†“ โ”‚

โ”‚ Phase 9 (Deployment) โ”‚

โ”‚ โ”‚

โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

```

Phase-specific Verification Checklist

#### Phase 1 โ†’ Verify: Terminology/Schema Consistency

```

โ–ก Are glossary.md terms consistently used in code?

- Business terms โ†’ Code naming matching

- Global standard terms โ†’ API response field names matching

โ–ก Do entity definitions match actual types?

โ–ก Do relationship definitions match actual implementation?

```

#### Phase 2 โ†’ Verify: Convention Compliance

```

โ–ก Naming rule compliance (PascalCase, camelCase, UPPER_SNAKE_CASE)

โ–ก Folder structure rule compliance

โ–ก Environment variable naming rule compliance (NEXT_PUBLIC_, DB_, API_*, etc.)

โ–ก .env.example template completion

โ–ก Environment variable validation logic (lib/env.ts) exists

```

#### Phase 4 โ†’ Verify: API Consistency

```

โ–ก RESTful principle compliance

- Resource-based URLs (nouns, plural)

- Correct HTTP method usage

- Status code consistency

โ–ก Response format consistency

- Success: { data, meta? }

- Error: { error: { code, message, details? } }

- Pagination: { data, pagination }

โ–ก Error code standardization (matches ERROR_CODES constant)

```

#### Phase 5 โ†’ Verify: Design System Consistency

```

โ–ก Are design tokens defined? (CSS Variables / ThemeData)

โ–ก Do components use tokens? (no hardcoded colors)

โ–ก Are component variants consistent?

โ–ก Dark mode support (if defined)

```

#### Phase 6 โ†’ Verify: UI-API Integration Consistency

```

โ–ก API client layer structure compliance

- Components โ†’ hooks โ†’ services โ†’ apiClient

- No direct fetch calls

โ–ก Type consistency

- Phase 4 API spec types = Phase 6 client types

โ–ก Error handling consistency

- Global error handler usage

- Error code-specific handling logic

โ–ก State management pattern consistency

```

#### Phase 7 โ†’ Verify: Security/SEO Application

```

โ–ก Authentication/authorization middleware applied

โ–ก Input validation (server-side)

โ–ก XSS, CSRF defense

โ–ก No sensitive info exposed to client

โ–ก SEO meta tags applied

```

#### Phase 9 โ†’ Verify: Deployment Readiness

```

โ–ก Environment variable Secrets registered (based on Phase 2 list)

โ–ก Environment separation (dev/staging/prod)

โ–ก Build successful

โ–ก Environment variable validation script passes

```

---

Clean Architecture Verification

Layer Separation Principles

```

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”

โ”‚ Presentation Layer โ”‚

โ”‚ (pages, components, hooks - UI concerns) โ”‚

โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค

โ”‚ Application Layer โ”‚

โ”‚ (services, use-cases - business logic) โ”‚

โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค

โ”‚ Domain Layer โ”‚

โ”‚ (entities, types - core domain models) โ”‚

โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค

โ”‚ Infrastructure Layer โ”‚

โ”‚ (api client, db, external services) โ”‚

โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Dependency direction: Outside โ†’ Inside (Presentation โ†’ Domain)

Inner layers must not know about outer layers

```

Layer-specific Verification Checklist

#### Presentation Layer (UI)

```

โ–ก Is there business logic in components?

โ–ก Are there direct API calls? (should go through hooks)

โ–ก Is state management properly separated?

โ–ก Do components have single responsibility?

```

#### Application Layer (Services)

```

โ–ก Are domain logic and infrastructure logic separated?

โ–ก Are external dependencies abstracted?

โ–ก Is the structure testable?

โ–ก Are use cases clearly defined?

```

#### Domain Layer (Types/Entities)

```

โ–ก Are there no external library dependencies?

โ–ก Does it contain only pure business rules?

โ–ก Do types match Phase 1 schema?

```

#### Infrastructure Layer (API Client)

```

โ–ก Are external service calls abstracted?

โ–ก Is error handling consistent?

โ–ก Is configuration managed via environment variables?

```

---

Architecture Review Checklist

Structure

  • [ ] Does folder structure match conventions
  • [ ] Is separation of concerns well done
  • [ ] Is dependency direction correct (outside โ†’ inside)

Patterns

  • [ ] Are consistent patterns used
  • [ ] Is there unnecessary abstraction
  • [ ] Is proper encapsulation done

Convention Review Checklist

Naming

  • [ ] Does it follow Phase 2 defined rules
  • [ ] Are meaningful names used
  • [ ] Is there consistency

Code Style

  • [ ] Unified indentation, quotes, etc.
  • [ ] Is file length appropriate
  • [ ] Is function length appropriate

Code Quality Checklist

  • [ ] Is there duplicate code
  • [ ] Are there highly complex functions
  • [ ] Is error handling appropriate
  • [ ] Is type safety ensured

AI-Assisted Review

```

Request code review from Claude:

"Review this project's code.

  • Does it follow CONVENTIONS.md rules
  • Is there architecture consistency
  • Are there potential bugs or improvements"

```

Template

See templates/pipeline/phase-8-review.template.md

Next Phase

Phase 9: Deployment โ†’ After review completion, deploy to production

---

6. In-Depth Code Quality Review

6.1 Duplicate Code Detection

#### Detection Methods

```bash

# 1. Search for similar function names

grep -r "function.*format" src/

grep -r "function.*calculate" src/

grep -r "function.get.By" src/

# 2. Search for similar patterns

grep -rn "reduce.*sum" src/

grep -rn "filter.*map" src/

grep -rn "useState.*useEffect" src/

```

#### Handling by Duplication Type

| Type | Example | Solution |

|------|---------|----------|

| Exact duplicate | Same code copy-paste | Extract to function |

| Structural similarity | Same logic, different data | Parameterize |

| Conceptual similarity | Different implementations for similar purpose | Integrate or interface |

#### Duplicate Code Checklist

```

โ–ก Is the same logic in 2+ places?

โ–ก Are there multiple functions with similar names?

โ–ก Is the same data transformation repeated?

โ–ก Are similar UI patterns repeated?

โ–ก Is the same API call pattern repeated?

โ–ก Is similar error handling repeated?

```

6.2 Reusability Assessment

#### Assessment Criteria

| Score | Criteria | Description |

|-------|----------|-------------|

| โญโญโญ | High | Can be used in other projects |

| โญโญ | Medium | Can be used in multiple places within same project |

| โญ | Low | Used only for specific feature |

#### Reusability Checklist

```

Check for each function/component:

โ–ก Is it tied to a specific domain?

โ–ก Does it depend on external state?

โ–ก Are parameters generic?

โ–ก Is the return value predictable?

โ–ก Are there side effects?

```

6.3 Extensibility Assessment

#### Extensibility Check

```

When new requirements come:

โ–ก Can it be added without modifying existing code?

โ–ก Can behavior be changed by configuration only?

โ–ก Is adding new types/cases easy?

โ–ก Can it be extended without adding conditionals?

```

#### Extensibility Anti-patterns

```typescript

// โŒ Requires modification for each extension

function process(type: string) {

if (type === 'a') { / ... / }

else if (type === 'b') { / ... / }

// Add else if for each new type...

}

// โŒ Hardcoded list

const ALLOWED_TYPES = ['a', 'b', 'c']

// โŒ Enumerated switch statements

switch (action.type) {

case 'ADD': // ...

case 'REMOVE': // ...

// Add case for each new action...

}

```

#### Good Extensibility Patterns

```typescript

// โœ… Registry pattern

const handlers: Record = {}

function register(type: string, handler: Handler) {

handlers[type] = handler

}

function process(type: string, data: unknown) {

return handlers[type]?.(data)

}

// โœ… Configuration-based

const CONFIG = {

types: ['a', 'b', 'c'],

handlers: { ... }

}

// โœ… Plugin structure

interface Plugin { execute(data): Result }

const plugins: Plugin[] = []

```

6.4 Object-Oriented Principles Check

#### SOLID Principles Checklist

S - Single Responsibility (SRP)

```

โ–ก Does the class/function change for only one reason?

โ–ก Does the name clearly explain the role?

โ–ก Is "and" in the name? โ†’ Needs separation

```

O - Open/Closed (OCP)

```

โ–ก Is it open for extension? (new features can be added)

โ–ก Is it closed for modification? (no existing code changes needed)

โ–ก Are interfaces/abstractions used?

```

L - Liskov Substitution (LSP)

```

โ–ก Can subtypes replace parent types?

โ–ก Do overridden methods keep the contract?

```

I - Interface Segregation (ISP)

```

โ–ก Is the interface too large?

โ–ก Must unused methods be implemented?

โ–ก Can the interface be split smaller?

```

D - Dependency Inversion (DIP)

```

โ–ก Does it depend on abstractions instead of concrete classes?

โ–ก Are dependencies injected? (DI)

โ–ก Is the structure testable?

```

6.5 Refactoring Priority

```

Urgent (Required before deployment):

  1. Duplication that can cause bugs
  2. Security vulnerabilities
  3. Performance bottlenecks

High (As soon as possible):

  1. Same logic duplicated in 3+ places
  2. Files over 200 lines
  3. Nesting deeper than 5 levels

Medium (Next sprint):

  1. Structure lacking extensibility
  2. Naming inconsistencies
  3. Structure difficult to test

Low (Backlog):

  1. Style inconsistencies
  2. Excessive comments
  3. Unused code

```

---

7. AI Code Review Request Template

```markdown

Please review the code from these perspectives:

  1. Duplicate Code

- Are there similar functions/components?

- Is there common logic that can be extracted?

  1. Reusability

- Can it be used generically?

- Is it tied to a specific domain?

  1. Extensibility

- Can it flexibly respond to new requirements?

- Are there hardcoded parts?

  1. SOLID Principles

- Does it follow single responsibility?

- Is it open for extension and closed for modification?

  1. Convention Compliance

- Does it follow CONVENTIONS.md rules?

- Is naming consistent?

Please identify parts that need refactoring and their priority.

```

---

8. Gap Analysis (Design vs Implementation)

Gap Analysis Report Template

```markdown

# Gap Analysis Report

Analysis Target

  • Design document: docs/02-design/{feature}.design.md
  • Implementation path: src/features/{feature}/

Results by Category

API Endpoints

| Design | Implementation | Status |

|--------|----------------|--------|

| POST /api/users | POST /api/users | โœ… Match |

| GET /api/users/:id | - | โŒ Not implemented |

| - | DELETE /api/users/:id | โš ๏ธ Missing from design |

Data Model

| Design Entity | Implementation | Status |

|---------------|----------------|--------|

| User | types/user.ts | โœ… Match |

| UserRole | - | โŒ Not implemented |

Match Rate

  • Total items: 10
  • Matches: 7
  • Not implemented: 2
  • Missing from design: 1
  • Match Rate: 70%

```

Gap Types and Actions

| Gap Type | Meaning | Action |

|----------|---------|--------|

| โœ… Match | Design = Implementation | None |

| โŒ Not implemented | In design, not in code | Implement or update design |

| โš ๏ธ Missing from design | In code, not in design | Add to design document |

| ๐Ÿ”„ Different | Exists but different | Align (code is truth) |

When to Run Gap Analysis

  • After completing feature implementation
  • Before deployment
  • When design document is updated
  • During code review