create-codebase-analysis

An analysis of the existing code and architecture that a planned feature may change, extend, or replace. It assesses whether each relevant part should be reused, extended, refactored, or replaced.

In plain words
What is it for?
Use it to map affected components, evaluate how safely they can be changed, and prepare migration considerations for an approved feature plan.
Why use it?
It reveals dependencies, coupling, risks, and the likely impact of a change before implementation begins.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/tomzx/agents/create-codebase-analysis
Any agent
npx skills add tomzx/agents --skill create-codebase-analysis
Clone the repo
git clone --depth 1 https://github.com/tomzx/agents

Made for: Claude Code, Codex.

Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,652 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00048 $0.01652
Opus 5 $0.00024 $0.00826
Sonnet 5 $0.00010 $0.00330
Haiku 4.5 $0.00005 $0.00165

Measured yesterday against content hash 0ee8fe1513fc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

create-codebase-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/create-codebase-analysis/SKILL.md · 96 lines

How it starts

The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Create Codebase Analysis

Analyzes the existing internal code and architecture that a feature will rely on, change, or replace, and assesses each relevant part's changeability before the design is committed. The goal is to know the terrain before specifying how to change it: what exists today, how it is coupled, what can be touched safely, and what must stay stable.

This is the internal counterpart to create-existing-solutions. create-existing-solutions surveys external prior art (libraries, OSS, products) and checks for cheap internal reuse. This skill goes deeper into the internal architecture you are about to modify: it maps components, coupling, and blast radius, and decides a change disposition for each part (reuse as-is, extend, refactor, or replace).

Prerequisites

  • Apply the shared SDLC conventions in skills/sdlc/references/shared.md.
  • If no argument is provided, locate the feature directory under .sdlc/features/ whose frontmatter issue field references $ISSUE_NUMBER.
  • .sdlc/features/N-<slug>/requirements.md (must have passed review with findings verdict approved), or a requirements document provided in context or as a file path ($1)
  • .sdlc/features/N-<slug>/existing-solutions.md (optional): carry forward any internal reuse candidates it already identified so they are not re-discovered
  • Read any files present under .sdlc/context/ (project-overview.md, architecture.md, conventions.md, vocabulary.md, schema.dbml) for project-level context
  • Apply any artifact style rules found in conventions.md to the produced document

Steps

  1. Read the requirements document and extract the functional and non-functional requirements that imply changes to existing code.
  2. Read .sdlc/context/architecture.md (if present) to ground the analysis in the documented system topology, and read the existing solutions survey if one was produced.
  3. Determine the analysis scope: which parts of the codebase this feature will touch, integrate with, or replace. Trace inward from the requirements to concrete modules, services, data stores, and interfaces.
  4. Locate the relevant code by searching the codebase. Record the entry points used (queries, paths) so the search is auditable.
  5. For each relevant component, capture its name, location (file or module path), current responsibility, and how the feature interacts with it (reads, writes, extends, replaces).
  6. Map dependencies and coupling between the relevant components and any external systems as a Mermaid flowchart LR with one node per component and class assignments matching the change dispositions (reuse / extend / refactor / replace). Call out shared state, synchronous vs. asynchronous boundaries, and the blast radius of changing each part in the accompanying prose. The diagram makes unintended coupling visible at a glance; the prose carries what the diagram cannot.
  7. For each component, decide a change disposition and justify it:
    • Reuse as-is — the component already does what is needed; do not modify it.
    • Extend — add to the component along its existing seams (new method, new config, new consumer) without altering current behavior.
    • Refactor — restructure the component's internals to accept the change, while preserving its observable behavior.
    • Replace — supersede the component (or a path through it) with a new implementation.
  8. For every Refactor or Replace disposition, outline migration and impact: the path from current to target behavior, backward compatibility, rollout strategy, what else breaks, and how to de-risk (feature flag, dual-run, shadow comparison).
  9. Record assumptions about existing behavior that the analysis relies on but has not fully verified. Promote any that carry meaningful risk via /create-assumption, and log architectural choices via /create-decision.
  10. Flag open questions where the changeability of a part cannot be decided without more investigation.
  11. Write the output to .sdlc/features/N-<slug>/codebase-analysis.md.

Read the full file on GitHub · 96 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 96 lines · 48 tokens per session scan A 0ee8fe1513fc

Subscribe to this mod's changes

create-codebase-analysis is a skill published in the GitHub repository tomzx/agents (5 stars, last pushed 4d ago), licensed MIT. It adds 48 tokens to every session and 1,652 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens