Techniques for analyzing existing codebases to reverse-engineer requirements and understand business logic. Use when conducting brownfield analysis or understanding existing system capabilities.
npx playbooks add skill doubleslashse/claude-marketplace --skill codebase-analysis
This skill provides techniques for extracting business requirements, domain knowledge, and technical specifications from existing codebases.
When analyzing a codebase, seek to understand:
Look for these patterns:
// C# Entity
public class Order { ... }
// Java Entity
@Entity
public class Order { ... }
// TypeScript Interface
interface Order { ... }
// Database Schema
CREATE TABLE orders ( ... )
Watch for these keywords and patterns:
Validate, Check, Ensure, Must, ShouldCalculate, Compute, Total, SumIf, When, Unless, OnlyMax, Min, Required, LimitIdentify business logic in:
// Service classes
public class OrderService { ... }
// Use cases / Application services
public class CreateOrderUseCase { ... }
// Command/Query handlers
public class CreateOrderHandler { ... }
Look for:
// REST Controllers
[Route("api/orders")]
[HttpPost]
public async Task<Order> Create(...)
// Express routes
app.post('/api/orders', ...)
// GraphQL resolvers
Mutation: { createOrder: ... }
class, interface, type definitionsModels, Entities, Domainthrow statements (business exceptions)## Entity: Order
### Attributes
| Name | Type | Description | Constraints |
|------|------|-------------|-------------|
| id | UUID | Unique identifier | Required |
| status | Enum | Order status | Required |
| total | Decimal | Order total | >= 0 |
### Relationships
- Order has many OrderItems (1:N)
- Order belongs to Customer (N:1)
### Business Rules
- Order total must equal sum of item totals
- Status can only transition: Draft -> Submitted -> Approved -> Completed
## Rule: Order Validation
### Description
Orders must meet these criteria before submission
### Conditions
1. Order must have at least one item
2. All items must have valid product references
3. Customer must have valid payment method
4. Total must be greater than $0
### Implementation
- File: src/Services/OrderService.cs
- Method: ValidateForSubmission()
- Line: 145-180
## Integration: Payment Gateway
### Type
REST API (Synchronous)
### Endpoint
POST https://api.payments.com/v1/charges
### Data Flow
- Input: Order total, Customer payment token
- Output: Transaction ID, Status
### Error Handling
- Timeout: Retry 3 times with exponential backoff
- Failure: Mark order as payment pending, notify support
### Implementation
- File: src/Integrations/PaymentGateway.cs
# C# / .NET
grep -r "public class.*Entity" --include="*.cs"
grep -r "\[Table\(" --include="*.cs"
# Java
grep -r "@Entity" --include="*.java"
# TypeScript
grep -r "interface.*{" --include="*.ts"
# C# Attributes
grep -r "\[Required\]|\[Range\]|\[StringLength\]" --include="*.cs"
# Java Annotations
grep -r "@NotNull|@Size|@Valid" --include="*.java"
# Custom validation
grep -r "Validate|throw.*Exception" --include="*.cs"
# .NET Controllers
grep -r "\[Http.*\]|\[Route\(" --include="*.cs"
# Express.js
grep -r "app\.(get|post|put|delete)\(" --include="*.js"
After analysis, you should be able to answer:
See [patterns.md](patterns.md) for common architectural patterns to identify.
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.