skills/mine/architectural-analysis/SKILL.md
Deep architectural audit focused on finding dead code, duplicated functionality, architectural anti-patterns, type confusion, and code smells. Use when user asks for architectural analysis, find dead code, identify duplication, or assess codebase health. Don't use for style/formatting issues, performance profiling, security audits, or feature-level code review.
npx skillsauth add pedronauck/skills architectural-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Perform comprehensive architectural audit focused on structural issues, dead code, duplication, and systemic problems.
# Get directory structure
find . -type d -not -path "*/node_modules/*" -not -path "*/.git/*"
# Count files by type
find . -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" | wc -l
index.ts, main.ts, app.ts)index.ts files)Use Glob to find all source files. Create todo list with one item per file to analyze.
For EACH file in the todo list:
For each export, search if it's imported/used anywhere:
# Search for imports of this export
grep -r "import.*ExportName" . --include="*.ts" --include="*.tsx"
grep -r "from.*filename" . --include="*.ts" --include="*.tsx"
# Search for direct usage
grep -r "ExportName" . --include="*.ts" --include="*.tsx"
Dead Code (mark for removal):
Possibly Dead (needs verification):
Internal Dead Code:
Not dead if:
window or global scopeFile: path/to/file.ts
Status: [DEAD|POSSIBLY_DEAD|USED]
Exports: [list]
Dead Exports:
- ExportName - No imports found
- AnotherExport - Only used in test for deprecated feature
Confidence: [HIGH|MEDIUM|LOW]
Update todo list.
Search for common patterns that suggest duplication:
Manual Pattern Recognition:
Grep-Based Detection:
# Find similar function signatures
grep -r "function validateEmail" . --include="*.ts"
grep -r "async.*fetch.*api" . --include="*.ts"
grep -r "export.*UserForm" . --include="*.tsx"
For each potential duplication:
Exact Duplication (CRITICAL):
Similar Logic (HIGH):
Conceptual Duplication (MEDIUM):
Type Duplication (HIGH):
Duplication Group: Email Validation
Type: Exact Duplication
Instances:
- src/utils/validators.ts:42 - validateEmail()
- src/lib/email.ts:15 - isValidEmail()
- src/components/forms/validation.ts:67 - checkEmailFormat()
Analysis: All three implement same regex check
Recommendation: Keep utils/validators.ts version, remove others
Impact: 3 places to update when logic changes
Search for files that do too much:
# Find large files
find . -name "*.ts" -exec wc -l {} + | sort -rn | head -20
Analyze large files:
Look for:
Use grep to trace import chains:
# Check what file imports
grep "^import.*from" src/services/auth.ts
# Check what imports this file
grep -r "from.*auth" src/ --include="*.ts"
Identify:
Check architecture layers:
Singleton Abuse:
Anemic Domain Models:
Shotgun Surgery:
Feature Envy:
Search for problematic type usage:
# Find 'any' usage
grep -r ": any" . --include="*.ts" --include="*.tsx" -n
# Find 'unknown' usage
grep -r ": unknown" . --include="*.ts" -n
# Find type assertions
grep -r "as any" . --include="*.ts" -n
grep -r "as unknown" . --include="*.ts" -n
# Find @ts-ignore
grep -r "@ts-ignore" . --include="*.ts" -n
grep -r "@ts-expect-error" . --include="*.ts" -n
For each file with type issues:
any used?Look for:
Check for:
any from missing type annotations# Find functions with many lines
# (manual inspection of large files)
Flag functions over 50 lines - likely doing too much.
Search for functions with 4+ parameters:
Look for:
Search for:
Should be named constants.
# Find commented code blocks
grep -r "^[[:space:]]*//.*function\|class\|const" . --include="*.ts"
Commented code should be deleted (use git history).
Look for:
usr, msg, tmp)Read assets/report-template.md and write the populated report to .audits/architectural-analysis-[timestamp].md. Replace every placeholder (X, Y, Z, file paths, line numbers) with findings from Phases 2-6. Keep every section present even if a finding count is zero — note "None found" rather than deleting headings.
Read assets/summary-template.md and emit the populated summary inline in chat after writing the full report. Replace placeholders and link to the full report at the end.
A complete architectural analysis includes:
development
Guides a founder through the full Y Combinator batch application end-to-end. A 10-phase workflow that captures the live YC form, profiles the founders, stress-tests the idea via an embedded grill loop, runs a mandatory 5-agent parallel external research pass on the startup, drafts every form field with anti-pattern and accepted-example checks, produces founder-video bullet notes (no script), runs a final adversarial gate, generates paste-ready submission answers, unlocks an interview-prep simulator after invite, and supports reapplicant delta tracking and post-decision post-mortems. Writes a documented markdown trail under a user-chosen workspace. Use when a founder wants to prepare a YC batch application, build their founder video, drill mock YC interview questions, or reapply with delta evidence. Don't use for pitch-deck design unrelated to YC, generic startup advice without applying, or post-funding work.
development
Authors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
tools
Provides guardrails for user-facing UI work: usability heuristics, accessibility floors, design-system discipline, component states, microcopy, motion, dark mode, responsive behavior, and human-AI UX. Use when designing, generating, reviewing, or refactoring visible product surfaces such as components, pages, dashboards, forms, dialogs, loading/empty/error states, or AI interfaces. Do not use for backend-only work, infrastructure, CLI/TUI design, or pure documentation editing.
tools
Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects. Don't use for plain JavaScript, runtime validation libraries (Zod, Yup), or basic TypeScript syntax questions.