Agent Skill Kit

System Architect Prime

A comprehensive repository analysis tool that acts as a Principal Software Architect. It audits codebases for architectural integrity, cyclomatic complexity, security vulnerabilities, and test coverage gaps.

Purpose

This skill enables AI agents to perform enterprise-grade code audits, generating detailed, actionable reports with code-level refactoring suggestions. It combines static analysis with architectural best practices to identify:

Usage

Audit an Entire Repository

Audit this repository for architectural flaws.

Investigate Performance Issues

Why is the backend module performance degrading?

Check Test Coverage

Check the test coverage of the payment gateway.

Generate a Full Report

Generate an ARCHITECTURAL_AUDIT.md for this codebase.

Execution Workflow

Phase 1: Reconnaissance (The Map)

  1. Ingest the file structure and identify entry points
  2. Identify the core technology stack (Node.js, Python, Rust, etc.)
  3. Locate configuration sources (package.json, pyproject.toml, .env.example)
  4. Determine the architectural pattern (Monolith, Microservices, Serverless, Clean Architecture)

Phase 2: Deep Analysis (The Audit)

  1. Complexity Analysis: Analyze top 10 largest files
    • Threshold: Cyclomatic Complexity > 15 = “Critical Risk”
  2. Security Scan: Ensure no secrets are exposed in source
  3. Coverage Mapping: Map source files to test suites
    • Heuristic: If User.ts exists but User.test.ts does not = “Untested”

Phase 3: Synthesis (The Report)

Generate ARCHITECTURAL_AUDIT.md containing:

Analysis Guidelines

Architecture & Design

Readability & Style

Performance

Test Coverage

Output Format

System Health Score

| Grade | Meaning | |——-|———| | A+ | Exemplary architecture, comprehensive tests, minimal complexity | | A-B | Good overall, minor improvements needed | | C | Acceptable but requires attention | | D-F | Critical issues, immediate refactoring required |

The Burn List

Top 3 files by priority:

  1. File path with complexity score and specific issues
  2. File path with identified vulnerabilities
  3. File path with missing test coverage

Safety Protocols

Best Practices

Do

Don’t

Example Report Structure

# ARCHITECTURAL_AUDIT.md

## Executive Summary
**System Health Score**: B+
**Stack**: Node.js + TypeScript + PostgreSQL
**Pattern**: Layered Monolith

## The Burn List 🔥
1. `src/services/PaymentService.ts` (CC: 32, CRITICAL)
2. `src/utils/helpers.ts` (CC: 18, HIGH)
3. `src/controllers/UserController.ts` (Untested, MEDIUM)

## Architecture Diagram
(mermaid diagram here)

## Detailed Findings
### Architecture
- ⚠️ Circular dependency: auth ↔ user modules

### Readability
- ❌ Magic numbers in `pricing.ts` line 45

### Performance
- ⚠️ N+1 query pattern in `OrderRepository.ts`

### Testing
- ❌ 0% coverage: payment, notification modules

Notes

This skill pairs well with: