Agent skill
codebase-architect
Use when generating exhaustive architecture documentation for any WordPress plugin/theme with built-in self-checking, progress tracking, and verification loops. Produces comprehensive docs covering classes, functions, hooks, REST API, AJAX, JS, DB, templates, blocks, and more.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/codebase-architect-vapvarun-claude-backup
SKILL.md
Codebase Architect
Generate exhaustive architecture documentation for any WordPress plugin/theme with built-in self-checking, progress tracking, and verification loops.
When to use
Use this skill when:
- Creating comprehensive architecture documentation for a plugin/theme
- Auditing what exists in a codebase (classes, functions, hooks, APIs)
- Verifying existing documentation completeness
- Onboarding to a new codebase and need a reference guide
Inputs required
- Path to the plugin or theme directory.
- Scope level:
architectural,hybrid,reference, orverify. - Output directory for documentation files.
Scope Parameter
| Scope | Coverage | Best For | Output Size |
|---|---|---|---|
architectural |
Conceptual 95%, Reference 15% | Large codebases (500+ files) | 2,000-4,000 lines |
hybrid |
Conceptual 95%, Reference 50% | Medium codebases (50-500 files) | 4,000-8,000 lines |
reference |
Conceptual 95%, Reference 90%+ | Small codebases (<50 files) | 8,000+ lines |
verify |
Verification only | Check existing docs | Report only |
Procedure
0) Initialize manifest
Create manifest directory and tracking files:
mkdir -p <output-dir>/manifest
Create manifest files for each category:
- classes.txt, functions.txt, hooks.txt
- rest-endpoints.txt, ajax-handlers.txt
- js-files.txt, db-tables.txt, templates.txt
- blocks.txt, shortcodes.txt, widgets.txt
- cpt-taxonomies.txt, admin-pages.txt
- cron-jobs.txt, cli-commands.txt
- PROGRESS.md (master tracker)
Read:
references/manifest-format.md
1) Run enumeration (parallel agents)
Launch 16 enumeration agents in parallel to populate manifests:
- Classes:
grep -rn "^class \|^abstract class \|^trait \|^interface " - Functions:
grep -rn "^function [a-z_]" - Action hooks:
grep -rohn "do_action\s*(\s*['\"][^'\"]*['\"]" - Filter hooks:
grep -rohn "apply_filters\s*(\s*['\"][^'\"]*['\"]" - REST endpoints:
grep -rn "register_rest_route" - AJAX handlers:
grep -rn "wp_ajax_" - JavaScript files:
find -name "*.js" - DB tables:
grep -rn "CREATE TABLE" - Templates:
find -name "*.php" -path "*/templates/*" - Blocks:
find -name "block.json" - Shortcodes:
grep -rn "add_shortcode" - Widgets:
grep -rn "extends WP_Widget" - CPT/Taxonomies:
grep -rn "register_post_type\|register_taxonomy" - Admin pages:
grep -rn "add_menu_page\|add_submenu_page" - Cron jobs:
grep -rn "wp_schedule_event" - CLI commands:
grep -rn "WP_CLI::add_command"
Read:
references/enumeration-commands.md
2) Document (with progress updates)
For each category, launch documentation agents that:
- Read from manifest
- Document each item
- Update manifest status:
pending→documented - Update PROGRESS.md
Read:
references/documentation-agents.md
3) Self-verification loop
After documentation completes:
- Count items with
status:pending(gaps) - Count items with
status:documented(done) - If coverage < 100%, trigger gap filling
- Run cross-reference check
Read:
references/verification-loop.md
4) Gap filling (automatic)
For any gaps found:
- Read source code for item
- Generate documentation
- Update manifest
- Trigger verification again
5) Final validation
When verification passes:
- Structure check (TOC, links, code examples)
- Completeness check (all categories at 100%)
- Quality check (each item has required fields)
- Generate FINAL_REPORT.md
Verification
Documentation is COMPLETE when:
- All 15 manifest categories at 100% coverage
- Verification loop passes without finding new gaps
- Cross-reference check passes
- Final validation checklist complete
- FINAL_REPORT.md generated
Failure modes / debugging
- Enumeration returns 0 items:
- Path doesn't exist, wrong grep pattern, vendor folder included
- Documentation incomplete after multiple passes:
- Check for status:error items in manifests
- Review Gap Log in PROGRESS.md
- Cross-reference failures:
- Stale references from renamed/moved files
Read:
references/debugging.md
Escalation
- For very large codebases (1000+ files), use
architecturalscope - If enumeration takes too long, exclude vendor/node_modules
- For manual review items, document what's known and mark as partial
Output Files
<output-dir>/
├── PLUGIN_ARCHITECTURE.md # Final documentation
├── manifest/
│ ├── PROGRESS.md # Progress tracker
│ ├── classes.txt
│ ├── functions.txt
│ └── ... (other manifests)
└── FINAL_REPORT.md # Validation report
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?