Refactor: Break down CLAUDE.md into progressively disclosed documentation
## Problem Statement
The CLAUDE.md file is 271 lines and contains too much information in one place. It includes outdated content (wrong Node version, CLI commands that don't match package.json), information that Claude should discover dynamically (scripts, tech stack), and domain-specific knowledge that belongs in separate files.
## Solution
Break CLAUDE.md into progressively disclosed documentation:
- Tiny CLAUDE.md (~20 lines) with links to other docs
- Effect-TS patterns become an agent skill in `.claude/skills/`
- Video workflow documentation in `docs/video-workflow.md`
- Environment variables documented in `.env.example` with comments
- Package/app READMEs serve as the primary documentation source
## Implementation Plan
Each step is a single commit, leaves codebase working.
1. Create `.claude/skills/` directory in repo
2. Create `.claude/skills/effect-ts/SKILL.md` agent skill with Effect patterns + service structure + error handling guidance
3. Create `docs/` directory
4. Create `docs/video-workflow.md` with auto-editing workflow, subtitle generation, article generation content
5. Expand `.env.example` with all environment variables and comments (video processing, article generation, queue, AI services, database)
6. Create `apps/internal-cli/README.md` - brief overview of CLI tool and main commands
7. Create `apps/written-content/README.md` - content management system overview
8. Create `apps/written-content-manager/README.md` - web interface overview
9. Create `apps/twoslash-preview-server/README.md` - dev server overview
10. Create `apps/twoslash-lint/README.md` - linting tool overview
11. Create `apps/twoslash-to-simple-markdown/README.md` - conversion tool overview
12. Rewrite `apps/remotion-subtitle-renderer/README.md` - replace generic Remotion template with actual purpose
13. Update `packages/ffmpeg/README.md` - remove file references, keep brief
14. Update `packages/shared/README.md` - remove file references, keep brief
15. Update `packages/twoslash-shared/README.md` - remove file references, keep brief
16. Rewrite `CLAUDE.md` to be minimal: repo overview (2-3 sentences), build command (`pnpm build`, `pnpm ci`), type checking note, links to docs/READMEs
## Decision Document
### Modules Modified
- `.claude/skills/` - new directory for project-specific agent skills
- `docs/` - new directory for cross-cutting documentation
- All package and app READMEs
### Skill Structure
- Agent skill at `.claude/skills/effect-ts/SKILL.md`
- Description: "Use this skill whenever writing Effect.ts code"
- Contains: Service pattern, tagged errors, workflows, layers, config guidance
### README Philosophy
- Brief overview + main purpose only
- No file path references (prevents staleness)
- Main commands/usage where applicable
- Let Claude discover implementation details dynamically
### Environment Variables
- All vars documented in `.env.example` with comments
- Removed from CLAUDE.md entirely
- Grouped by purpose (video, articles, queue, AI, database)
### Content Removed from CLAUDE.md
- Quick Commands section (Claude discovers from package.json)
- Technology Stack section (Claude discovers from package.json)
- Common Development Patterns (killed)
- Monorepo Structure (implicit from file structure)
- Environment Configuration (moved to .env.example)
- DaVinci Resolve Integration (link to existing README)
## Testing Decisions
No tests needed - this is documentation-only refactoring. No code behavior changes.
## Out of Scope
- `apps/recordings-manager/` - orphaned directory, separate cleanup task
- Package code changes
- Any functional changes
- Creating tests for documentation
关闭于 2026-01-27 1 条评论