/agent-almanac:analyze-codebase-for-mcpfrom agent-almanac
Scans codebases to identify functions, APIs, and data sources suitable for exposure as MCP tools, producing a structured specification document.
Ships in agent-almanac. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Scan a codebase to discover functions, REST endpoints, CLI commands, and data access patterns that are good candidates for MCP tool exposure, then produce a structured tool specification document.
scaffold-mcp-server1.1. Use Glob to map the directory tree, focusing on source directories:
src/**/*.{ts,js,py,R,go,rs} for source files**/routes/**, **/api/**, **/controllers/** for endpoint definitions**/cli/**, **/commands/** for CLI entry points**/package.json, **/setup.py, **/DESCRIPTION for dependency metadata1.2. Categorize files by role:
1.3. Count total files, lines of code, and exported symbols to gauge project size.
Expected: A categorized file inventory with role annotations.
On failure: If the codebase is too large (>10,000 files), narrow the scan to specific directories or modules using the domain focus input. If no source files are found, verify the root path and language parameters.
2.1. Use Grep to find exported functions and public APIs:
export (async )?function, export default, module.exports_, @app.route, @router#' @export roxygen tags2.2. For each candidate function, extract:
2.3. For REST APIs, additionally extract:
2.4. Build a candidate list sorted by potential utility (public, documented, well-typed functions first).
Expected: A list of 20-100 candidate functions/endpoints with extracted metadata.
On failure: If few candidates are found, broaden the search to include internal functions that could be made public. If documentation is sparse, flag this as a risk in the output.
3.1. For each candidate, assess against MCP tool criteria:
3.2. Score each candidate on a 1-5 scale:
3.3. Filter candidates to those scoring 3 or above. Flag score-2 items as "future candidates" requiring refactoring.
Expected: A scored and filtered candidate list with suitability rationale for each.
On failure: If most candidates score below 3, the codebase may need refactoring before MCP exposure. Document the gaps and recommend specific improvements (add types, extract pure functions, wrap side effects).
4.1. For each selected candidate (score >= 3), draft a tool specification:
- name: tool_name
description: >
One-line description of what the tool does.
source_function: module.function_name
source_file: src/path/to/file.ts:42
parameters:
param_name:
type: string | number | boolean | object | array
description: What this parameter controls
required: true | false
default: value_if_optional
returns:
type: string | object | array
description: What the tool returns
side_effects:
- description of any side effect
estimated_latency: fast | medium | slow
suitability_score: 5
4.2. Group tools into logical categories (e.g., "Data Queries", "File Operations", "Analysis", "Configuration").
4.3. Identify dependencies between tools (e.g., "list_datasets" should be called before "query_dataset").
4.4. Determine if any tools need wrappers to:
Expected: A complete YAML tool specification with categories, dependencies, and wrapper notes.
On failure: If tool specifications are ambiguous, revisit Step 2 to extract more detail from source code. If parameter types cannot be inferred, flag for manual review.
5.1. Write the final specification document with these sections:
5.2. Save as mcp-tool-spec.yml (machine-readable) and optionally mcp-tool-spec.md (human-readable summary).
5.3. If an existing MCP server was provided, include a gap analysis section:
Expected: A complete tool specification document ready for consumption by scaffold-mcp-server.
On failure: If the document exceeds reasonable size (>200 tools), split into modules with cross-references. If the codebase has no suitable candidates, produce a "readiness assessment" document with refactoring recommendations instead.
Grep for file writes, network calls, and database mutations.scaffold-mcp-server - use the output spec to generate a working MCP serverbuild-custom-mcp-server - manual server implementation referenceconfigure-mcp-server - connect the resulting server to Claude Code/Desktoptroubleshoot-mcp-connection - debug connectivity after deploying the serverreview-software-architecture - architecture review for tool surface designsecurity-audit-codebase - security audit before exposing functions externallyWhat SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (pjt222/agent-almanac) — no native marketplace selected
npx claudepluginhub p/pjt222-agent-almanac377 skills in this plugin
/adapt-architectureExecute structural metamorphosis using strangler fig migration, chrysalis phases, and interface preservation. Covers transformation planning, parallel running, progressive cutover, rollback design, and post-metamorphosis stabilization for system architecture evolution. Use when assess-form has classified the system as READY for transformation, when migrating from monolith to microservices, when replacing a core subsystem while dependents continue operating, or when any architectural change must be gradual rather than big-bang.
/adapticMaster skill composing the 5-step synoptic cycle for panoramic synthesis across multiple domains. Orchestrates meditate, expand-awareness, observe, awareness, integrate-gestalt, and express-insight into a coherent process that produces unified understanding rather than sequential compromise. Use when a problem genuinely spans 3+ domains and the interactions between domains matter more than depth in any one, when sequential analysis feels like compromise rather than integration, or before major architectural decisions affecting multiple stakeholders.
/add-puzzle-typeScaffold a new puzzle type across all 10+ pipeline integration points in jigsawR. Creates the core puzzle module, wires it into the unified pipeline (generation, positioning, rendering, adjacency), adds ggpuzzle geom/stat layers, updates DESCRIPTION and config.yml, extends the Shiny app, and creates a comprehensive test suite. Use when adding a completely new puzzle type to the package or following the 10-point integration checklist to ensure nothing is missed end-to-end.
Other plugins' skills for the same job