mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-02-08 07:33:08 +08:00
Major OpenCode integration overhaul: - llms.txt: Comprehensive OpenCode documentation for LLMs (642 lines) - .opencode/plugins/ecc-hooks.ts: All Claude Code hooks translated to OpenCode's plugin system - .opencode/tools/*.ts: 3 custom tools (run-tests, check-coverage, security-audit) - .opencode/commands/*.md: All 24 commands in OpenCode format - .opencode/package.json: npm package structure for opencode-ecc - .opencode/index.ts: Main plugin entry point - Delete incorrect LIMITATIONS.md (hooks ARE supported via plugins) - Rewrite MIGRATION.md with correct hook event mapping - Update README.md OpenCode section to show full feature parity OpenCode has 20+ events vs Claude Code's 3 phases: - PreToolUse → tool.execute.before - PostToolUse → tool.execute.after - Stop → session.idle - SessionStart → session.created - SessionEnd → session.deleted - Plus: file.edited, file.watcher.updated, permission.asked, todo.updated - 12 agents: Full parity - 24 commands: Full parity (+1 from original 23) - 16 skills: Full parity - Hooks: OpenCode has MORE (20+ events vs 3 phases) - Custom Tools: 3 native OpenCode tools The OpenCode configuration can now be: 1. Used directly: cd everything-claude-code && opencode 2. Installed via npm: npm install opencode-ecc
2.1 KiB
2.1 KiB
description, agent, subtask
| description | agent | subtask |
|---|---|---|
| Remove dead code and consolidate duplicates | refactor-cleaner | true |
Refactor Clean Command
Analyze and clean up the codebase: $ARGUMENTS
Your Task
- Detect dead code using analysis tools
- Identify duplicates and consolidation opportunities
- Safely remove unused code with documentation
- Verify no functionality broken
Detection Phase
Run Analysis Tools
# Find unused exports
npx knip
# Find unused dependencies
npx depcheck
# Find unused TypeScript exports
npx ts-prune
Manual Checks
- Unused functions (no callers)
- Unused variables
- Unused imports
- Commented-out code
- Unreachable code
- Unused CSS classes
Removal Phase
Before Removing
- Search for usage - grep, find references
- Check exports - might be used externally
- Verify tests - no test depends on it
- Document removal - git commit message
Safe Removal Order
- Remove unused imports first
- Remove unused private functions
- Remove unused exported functions
- Remove unused types/interfaces
- Remove unused files
Consolidation Phase
Identify Duplicates
- Similar functions with minor differences
- Copy-pasted code blocks
- Repeated patterns
Consolidation Strategies
- Extract utility function - for repeated logic
- Create base class - for similar classes
- Use higher-order functions - for repeated patterns
- Create shared constants - for magic values
Verification
After cleanup:
npm run build- builds successfullynpm test- all tests passnpm run lint- no new lint errors- Manual smoke test - features work
Report Format
Dead Code Analysis
==================
Removed:
- file.ts: functionName (unused export)
- utils.ts: helperFunction (no callers)
Consolidated:
- formatDate() and formatDateTime() → dateUtils.format()
Remaining (manual review needed):
- oldComponent.tsx: potentially unused, verify with team
CAUTION: Always verify before removing. When in doubt, ask or add // TODO: verify usage comment.