idea-analogist
想法群聊室 — 类比者角色。被 idea-team 主编排器调用,或用户单独说"类比一下"、"别的行业有没有"、"yes-and 扩展"、"X 让你想到什么"、"跨界启示"时触发。**专门做跨界类比 + yes-and…
Comprehensive codebase health analysis. Use when reviewing code quality, identifying technical debt, checking dependencies, or assessing project structure.
Claude Code
$ npx -y skills add majiayu000/spellbook --skill project-health-auditor --agent claude-code
Codex
$ npx skills add majiayu000/spellbook --skill project-health-auditor -a codex -y
Cursor
$ npx skills add majiayu000/spellbook --skill project-health-auditor -a cursor -y
Gemini CLI
$ npx skills add majiayu000/spellbook --skill project-health-auditor -a gemini-cli -y
GitHub Copilot
$ npx skills add majiayu000/spellbook --skill project-health-auditor -a github-copilot -y
OpenCode
$ npx skills add majiayu000/spellbook --skill project-health-auditor -a opencode -y
Windsurf
$ npx skills add majiayu000/spellbook --skill project-health-auditor -a windsurf -y
name: project-health-auditor description: Comprehensive codebase health analysis. Use when reviewing code quality, identifying technical debt, checking dependencies, or assessing project structure. allowed-tools: Read, Grep, Glob, Bash
> Inspired by [claude-code-plugins-plus](https://github.com/jeremylongshore/claude-code-plugins-plus)
Analyze codebase health across multiple dimensions: code quality, dependencies, security, testing, documentation, and architecture.
# Count lines per file (identify large files) find src -name "*.ts" -o -name "*.js" | xargs wc -l | sort -n # Find long functions (over 50 lines) # Check for deeply nested code # Identify duplicate code patterns
| Smell | Indicator | Action | |-------|-----------|--------| | Long files | >500 lines | Split into modules | | Long functions | >50 lines | Extract methods | | Deep nesting | >4 levels | Flatten logic | | Many parameters | >5 params | Use objects | | Duplicate code | Similar blocks | Extract shared | | Dead code | Unused exports | Remove | | Magic numbers | Hardcoded values | Use constants |
## Code Quality Audit - [ ] No files over 500 lines - [ ] No functions over 50 lines - [ ] No nesting deeper than 4 levels - [ ] No functions with >5 parameters - [ ] No obvious code duplication - [ ] No dead/unused code - [ ] Consistent naming conventions - [ ] Proper error handling
# Check outdated packages (npm) npm outdated # Check for vulnerabilities npm audit # Analyze bundle size npx webpack-bundle-analyzer # Check unused dependencies npx depcheck
| Metric | Healthy | Warning | Critical | |--------|---------|---------|----------| | Outdated (major) | 0 | 1-3 | >3 | | Outdated (minor) | <5 | 5-10 | >10 | | Vulnerabilities | 0 | Low/Med | High/Crit | | Unused deps | 0 | 1-3 | >3 | | Bundle size | <500KB | 500KB-1MB | >1MB |
## Dependencies Audit - [ ] No critical vulnerabilities - [ ] No high vulnerabilities - [ ] <3 major version updates pending - [ ] No unused dependencies - [ ] Lock file in sync - [ ] Bundle size reasonable
# Check for secrets in code grep -r "password\|secret\|api_key\|token" --include="*.ts" --include="*.js" # Check for hardcoded credentials grep -r "Bearer \|Basic " --include="*.ts" # Check .env is gitignored cat .gitignore | grep ".env"
| Check | Concern | Solution | |-------|---------|----------| | Secrets in code | Credential exposure | Use env vars | | .env committed | Secret leak | Add to .gitignore | | SQL strings | SQL injection | Use parameterized queries | | User input in HTML | XSS | Sanitize/escape | | Outdated deps | Known vulns | Update regularly | | No rate limiting | DoS | Add rate limits | | No input validation | Injection | Validate all inputs |
## Security Audit - [ ] No hardcoded secrets - [ ] .env files gitignored - [ ] Dependencies scanned for vulns - [ ] Input validation in place - [ ] Output encoding for XSS - [ ] SQL injection prevention - [ ] Authentication implemented - [ ] Authorization checks exist
# Run tests with coverage (npm/jest) npm test -- --coverage # Run tests with coverage (pytest) pytest --cov=src --cov-report=html
| Metric | Good | Acceptable | Poor | |--------|------|------------|------| | Line coverage | >80% | 60-80% | <60% | | Branch coverage | >70% | 50-70% | <50% | | Function coverage | >80% | 60-80% | <60% |
## Testing Audit - [ ] Unit tests exist - [ ] Integration tests exist - [ ] Line coverage >60% - [ ] Critical paths tested - [ ] Edge cases covered - [ ] Tests run in CI - [ ] Test execution <5 min - [ ] No flaky tests
# Check for README ls README.md # Check for API docs ls docs/ || ls documentation/ # Check for inline docs (JSDoc, docstrings) grep -r "@param\|@returns\|Args:\|Returns:" src/
| Doc Type | Purpose | Required | |----------|---------|----------| | README.md | Project overview | Always | | CONTRIBUTING.md | Contribution guide | Open source | | API docs | Endpoint reference | APIs | | Code comments | Complex logic | As needed | | Architecture docs | System design | Large projects | | CHANGELOG.md | Version history | Libraries |
## Documentation Audit - [ ] README exists and current - [ ] Installation instructions - [ ] Usage examples - [ ] API documentation - [ ] Contributing guide - [ ] License specified - [ ] Complex code documented
| Aspect | Check | Concern | |--------|-------|---------| | Coupling | Import chains | Tight coupling | | Cohesion | Module size | God modules | | Layers | Directory structure | Layer violations | | Dependencies | Package.json | Circular deps | | Config | Hardcoded values | Environment issues |
## Architecture Smells - Circular dependencies - God classes/modules - Feature envy (cross-module reaching) - Shotgun surgery (changes touch many files) - Inappropriate intimacy (modules know too much)
## Architecture Audit - [ ] Clear module boundaries - [ ] No circular dependencies - [ ] Proper layer separation - [ ] Configuration externalized - [ ] Environment-specific settings - [ ] Scalability considered - [ ] Single responsibility
# Project Health Report **Project:** [Name] **Date:** [Date] **Auditor:** Claude ## Summary | Category | Score | Status | |----------|-------|--------| | Code Quality | X/10 |
想法群聊室 — 类比者角色。被 idea-team 主编排器调用,或用户单独说"类比一下"、"别的行业有没有"、"yes-and 扩展"、"X 让你想到什么"、"跨界启示"时触发。**专门做跨界类比 + yes-and…
想法群聊室 — 反方角色。被 idea-team 主编排器调用,或用户单独说"反方意见"、"挑这个想法的刺"、"为什么会失败"、"找漏洞 / 反例"、"devil's…
想法群聊室 — 调研员角色。被 idea-team 主编排器调用,或用户单独说"调研一下 X"、"X 的现状/竞品/数据"、"找 2026 数据"、"事实底"时触发。**用 WebSearch 拉真实 2026…
想法群聊室主持人 — 把一句话想法丢给多角色 AI 团队(调研员/反方/类比者)做查漏补缺。每个角色有自己的 voice,他们互相 @ 接话;你随时插话。**这是创意扩展工具,不打分、不否决、不堵路**。Use when…
端到端产品教练 — 把一句话想法走到 PRD + 可点击 HTML 原型。会顶嘴、强制砍功能、用 Nielsen + Norman 做友好性硬检。Use when user 说"我有一个想法"、"想做一个产品"、"做 MVP"、"写…
Mobile app UI design expert for iOS and Android. Use when designing app interfaces, creating design systems, ensuring…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.