From legacy-analysis
A skill for progressively understanding legacy code through iterative concrete-to-abstract cycles. Three maps (system overview, DFD, I/O interface) are "grown" rather than "built."
npx claudepluginhub t-hasuike/clysis --plugin legacy-analysisThis skill uses the workspace's default tool permissions.
> This is a generic skill from [CLysis](https://github.com/t-hasuike/CLysis).
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Automates semantic versioning and release workflow for Claude Code plugins: bumps versions in package.json, marketplace.json, plugin.json; verifies builds; creates git tags, GitHub releases, changelogs.
This is a generic skill from CLysis. Terminology can be customized via
config/terminology.md.
A skill for progressively understanding legacy code through iterative concrete-to-abstract cycles. Three maps (system overview, DFD, I/O interface) are "grown" rather than "built."
See config/terminology.md for term customization
First Run:
Second Run and After:
knowledge/README.md must be current| Prerequisite | Check Method | First Run | Subsequent Runs |
|---|---|---|---|
| Local repository clones | ls to verify paths | Required | Required |
knowledge/system/01_overview/birdseye_project_overview.md | File exists? | Not needed (Phase 0 generates) | Required |
knowledge/README.md | File exists? | Not needed (use /project-guide for guidance) | Required |
knowledge/system/02_structure/ directory | Directory exists? | Not needed (Phase 0 creates) | Required |
Note: During first run, Phase 0 automatically creates knowledge/system/ subdirectories with mkdir -p if they don't exist.
Auto-collect "indisputable facts" readable from code, and derive the minimal set of questions to ask humans.
Step 1: Auto-collection (no human input required) Auto-collect the following from each repository:
If DB schema (schema.duckdb) is available, extract table list and foreign key relationships. If schema.duckdb is not available:
| Collection Target | Method | Output |
|---|---|---|
| Orphan Endpoints | Glob public/ and root directories for executable files (.php, .asp, .cgi, .pl, etc.) | Endpoint list |
| OS Scheduled Jobs | Search crontab, infra/ shell scripts, Docker cron definitions | Scheduled job list |
| Database Logic | Extract Triggers, Stored Procedures, Views definitions (skip if unavailable) | DB-layer logic list |
| External Service Integrations | Full-codebase grep for http://, https://, curl, guzzle, axios, fetch keywords | External service endpoints |
Base Quantitative Scan (counting only — do not read file contents):
Risk Quantitative Scan (code metrics for risk assessment):
| Metric | Method | Purpose |
|---|---|---|
| File LOC Top 10 | wc -l on all files; rank by line count | Identify bloated "God Classes" and baseline investigation difficulty |
| Incoming Coupling | Serena find_referencing_symbols or grep for references | Determine maximum impact radius |
| Dynamic Table Reference | Regex search for patterns like table_{year} or string-based table names | Discover hidden table dependencies |
| Raw SQL Queries | grep for DB::raw, query(, direct SQL literals (patterns vary by language) | Identify complex hidden joins and business logic in SQL |
| Category | Method | Purpose |
|---|---|---|
| Code Liveness | Git Blame for last update date; flag files not updated in 1+ year as "dormant" | Prioritize investigation targets; identify dead code areas |
| Runtime/Library EOL Risk | Extract dependency versions from composer.json, package.json, go.mod, build.gradle; check for deprecated APIs and EOL runtimes | Early security and maintainability risk detection |
Phase 0 quantitative scanning is limited to counting (how many routes, models, tables exist). Reading the contents or analyzing complexity belongs to Phase 1.
Validation: ~65-73% of project information is automatically determined from README, composer.json, package.json, etc.
Step 2: Organize "what we know" Organize information identified from auto-collection using the following four categories:
1. Technology Stack
2. Repository Roles
3. Inter-Repository Connections
4. Batch & Infrastructure
Step 3: Present "what we don't know" as questions Generate questions dynamically based on what Step 1-2 revealed and what remains unknown. The following are reference examples of common question categories:
Please provide the following items. The rest has been auto-collected:
1. Business domain of the service (1-2 sentences)
-> What does the service provide and to whom?
2. Target user names and specific roles
-> README mentions "for XX", but please describe each user's specific role
3. Domain-specific terminology meanings
-> Meanings of proprietary terms (plan names, etc.) found during auto-collection
4. Industry/attributes per user type
-> Specific industries that terms like "Partner" refer to
5. Importance assessment
-> Which repository is most critical, which has highest change frequency
6. Legacy system positioning
-> Migration status of old systems, whether still in use
7. Supplementary inter-repository integration details
-> Confirmation of integrations that could not be auto-estimated
8. Organization/brand name context
-> Official meanings of proper nouns appearing in README
9. Production domain mapping (optional)
-> URLs where each service is running
Step 4: Generate initial overview.md and overview diagram Integrate Step 2 (auto-collection results) + Step 3 (human answers) to:
Select one specific change theme and trace it through the system. Map fragments emerge as a byproduct of tracing.
Verify the accuracy of Phase 1 deliverables. AI can hallucinate.
Integrate fragments obtained in Phase 1-2 and update the three maps. Persist knowledge.
knowledge/domain/After completing Phase 1-2 investigations, Phase 3 (map update) MUST be executed.
If investigation ends without Phase 3, findings remain trapped in the session, and subsequent investigations will re-cover the same ground. By updating maps and domain knowledge in Phase 3:
Repeat Phase 1-3 with different change themes. With each iteration:
| Role | Assignment | Notes |
|---|---|---|
| Ashigaru A | Code tracing and impact analysis (investigator role) | - |
| Ashigaru B | Knowledge organization and diagram updates (scribe role) | - |
| Role | Assignment | Notes |
|---|---|---|
| Ashigaru A | Repository A investigation (investigator) | - |
| Ashigaru B | Repository B investigation (investigator) | - |
| Ashigaru C | Knowledge integration and diagram updates (scribe) | - |
| Metsuke | Quality audit (deployed Phase 2) | Independent verification |
| Pattern | Implementation | Phase |
|---|---|---|
| Advanced RAG | schema.duckdb + Serena | All Phases |
| ReAct | /change-impact, /current-spec | Phase 1 |
| Self-Reflection | Metsuke audit | Phase 2 |
| Multi-Agent | Shogun + Ashigaru team + Metsuke | Phase 1-3 |
| Plan-and-Execute | /change-impact + Phase decomposition | Phase 1 |
| Knowledge Graph Memory | domain knowledge directory + diagrams | Phase 3 |
| Sequential Chain | Phase 0→1→2→3 iteration | Overall |
| Type | Description | Required/Optional | Example |
|---|---|---|---|
| Phase | Phase 0, 1, 2, or 3 | Required | Phase 0, Phase 1 |
| Change theme | Specific change theme (Phase 1 only) | Required for Phase 1 | I want to add a new product category |
| Investigation target | Target repositories or features | Optional | backend, order processing feature |
| Type | Format | Destination |
|---|---|---|
| Phase 0 deliverables | overview.md + system overview diagram + known/unknown list | Project information directory (knowledge/system/) |
| Phase 1 deliverables | Impact analysis report + Service specs + DFD fragments + unknown list update | reports/, diagram storage location |
| Phase 2 deliverables | Audited deliverables (with corrections applied) | reports/ (updated) |
| Phase 3 deliverables | Updated 3 maps + domain knowledge | Diagram storage location, domain knowledge directory |
Phase 0 -> Phase 1 -> Phase 2 -> Phase 3 -> (return to Phase 1 and iterate)