Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
othmanadi avatar

Apex Decompose

  • 4 installs
  • 2 repo stars
  • Updated March 14, 2026
  • othmanadi/apex

Analyze legacy code and extract feature behavior, contracts, and edge cases into migration-ready specification documents.

About

Decomposes features from an existing codebase into implementation-ready specification documents for migration or replatforming. A developer uses it to analyze legacy code and capture its behavior before rewriting it in a new architecture.

  • Builds a dependency graph and documents inputs, outputs, and side effects
  • Extracts implicit knowledge like magic values, ordering, and feature flags into a spec

Apex Decompose by the numbers

  • 4 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #1,241 of 1,879 Documentation skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/othmanadi/apex --skill apex-decompose

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs4
repo stars2
Last updatedMarch 14, 2026
Repositoryothmanadi/apex

What it does

Analyze legacy code and extract feature behavior, contracts, and edge cases into migration-ready specification documents.

Files

SKILL.mdMarkdownGitHub ↗

APEX Decompose

Break down features from a source codebase into detailed, implementation-ready specifications that an agent can use to rebuild them in a new architecture.

When to Use

Use this skill when you need to understand what existing code does before rewriting it. This is the first step in any replatforming or migration workflow. The output is a specification document, not code.

Workflow

Decomposing a feature involves these steps:

1. Identify the feature scope (files, modules, entry points) 2. Analyze behavior and contracts (inputs, outputs, side effects) 3. Extract implicit knowledge (edge cases, error handling, config dependencies) 4. Generate the specification document 5. Validate the spec against the source

Step 1: Identify Feature Scope

Collect all relevant source files. Ask the user or scan the directory:

What feature or module do you want to decompose?
Provide the path(s) to the relevant source files or directories.

Read every file in the scope. Build a dependency graph: which files import which, what external services are called, what state is mutated.

Run the dependency scanner to accelerate this step:

Linux/Mac:

bash "${CLAUDE_SKILL_DIR}/scripts/scan-deps.sh" <source-dir>

Windows:

powershell -File "${CLAUDE_SKILL_DIR}/scripts/scan-deps.ps1" <source-dir>

Step 2: Analyze Behavior and Contracts

For each function, class, or module in scope, document:

AspectWhat to Capture
InputsParameters, environment variables, config values, request shapes
OutputsReturn values, response shapes, files written, events emitted
Side effectsDatabase writes, API calls, cache mutations, logging
Error handlingTry/catch patterns, error codes, fallback behavior
DependenciesInternal imports, external packages, services called

Step 3: Extract Implicit Knowledge

This is the critical step most migrations miss. Look for:

  • Magic values — hardcoded strings, numbers, or thresholds with no documentation
  • Ordering dependencies — operations that must happen in a specific sequence
  • Race conditions — concurrent access patterns or timing-sensitive logic
  • Feature flags — conditional behavior based on config or environment
  • Undocumented APIs — internal endpoints or contracts between services

Step 4: Generate the Specification

Write the spec to specs/{feature-name}.md using the template in references/spec-template.md.

Step 5: Validate the Spec

Cross-reference the spec against the source code. For each behavior documented, confirm it matches the actual implementation. Flag any ambiguities with [VERIFY] tags for human review.

Output

The final deliverable is a Markdown specification file in specs/ that another agent (or apex-replatform) can consume to implement the feature in a new architecture without needing access to the original source code.

Example output location: specs/user-authentication.md

# Feature: User Authentication

## Overview
Handles user login, session management, and token refresh for the web application.

## Behavior Contract

### Inputs
| Name | Type | Source | Required |
|------|------|--------|----------|
| email | string | request.body | yes |
| password | string | request.body | yes |

### Outputs
| Name | Type | Destination |
|------|------|-------------|
| accessToken | JWT | response.json |
| refreshToken | string | httpOnly cookie |

### Side Effects
1. Creates session record in `sessions` table
2. Emits `user.logged_in` event

## Edge Cases
1. **Invalid credentials** — Returns 401 with generic message
2. **Account locked** — Returns 403 after 5 failed attempts

## Migration Notes
- [VERIFY] Confirm bcrypt rounds (currently 12)

Related skills

Documentationdocsbackend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.