Systematic methodology for understanding and working with existing codebases
"Read Everything, Understand First, Modify Never Without Comprehension"
Before implementing anything, determine what exists vs what needs implementation. Undocumented functionality is worthless - documentation-first, implementation second.
- Start with README.md - Complete project overview and usage patterns
- Follow all documentation links - Don't skip linked guides or references
- Understand the project structure - What packages exist, what tools are available
- Note discrepancies - Documentation that doesn't match directory structure
- Check timestamp - Are .api files older than source code?
- Regenerate if needed - Use project's API generation tools
- Handle generation issues - Some tools have assertion bugs (-da flag)
- Verify completeness - All packages should have corresponding .api files
- Package-level APIs - What classes and methods actually exist
- Cross-package dependencies - How components interact
- Public interfaces - What's exposed vs internal implementation
- Gap identification - What documentation claims vs what code provides
Use a minimal-intelligence agent to verify usability:
Launch haiku agent with task: "Follow the README.md to compile and run the primary tool. Document any issues or missing functionality."
The Haiku Test Standard: If a Haiku instance cannot achieve full functionality based solely on documentation and standard procedures, the system is NOT tactically deployable.
Document Results:
- ✅ Working as documented - Update project status
- ❌ Missing/broken - Create GitHub issues with specific failures
⚠️ Partially working - Document workarounds needed
- Read implementation files - Understand existing patterns before changing
- Follow project conventions - Don't introduce inconsistent patterns
- Implement systematically - One component at a time
- Return to Step 4 - Verify your implementation works via Haiku test
- Before implementing anything in an existing project
- When documentation seems incomplete or inconsistent
- Before claiming "X doesn't work" - verify systematically first
- When handed an unfamiliar codebase requiring modifications
- Project Resumption: Always use this before resuming work on existing projects
- Feature Requests: Verify current capabilities before implementing new features
- Bug Reports: Confirm bugs exist and understand scope before fixing
- Code Reviews: Ensure new code integrates with existing functionality
# WRONG: Immediate classpath hacking
export CLASSPATH="$DIR/tools:$DIR/marketing:$DIR/build"
javac -cp $CLASSPATH *.java# CORRECT: Read README.md first, follow established build patterns
sh compile.sh # Use project's documented build process"This project probably doesn't have X, so I'll implement it."
- Read documentation for X
- Check .api files for X
- Test with Haiku agent for X
- Only then implement if genuinely missing
Creating plausible-sounding .api files without actual generation tools.
Use project's actual API generation tools, handle bugs with appropriate flags.
- Read README.md - Compilation and usage instructions
- Check .api files - Generated package overviews
- Use compile.sh - Don't manually craft javac commands
- Test with project's shell scripts - Follow documented usage patterns
- Check for auxiliary scripts - memdetect.sh, javasetup.sh patterns
- Understand argument parsing - How complex vs simple patterns
- Test help functionality - Every script should respond to --help
- Follow memory/environment patterns - Laptop vs cluster defaults
- Verify link integrity - All referenced files exist
- Check generation timestamps - Auto-generated content up to date
- Test documentation completeness - Can Haiku follow instructions successfully
- Validate examples - Do provided examples actually work
- Document the discrepancy in project issues
- Create minimal fix - Don't overhaul entire system
- Update documentation - Fix what you found broken
- Test fix with Haiku - Ensure you didn't break other functionality
- Try generation with standard flags first
- Use assertion bypass (-da) if interface bugs exist
- Document generation issues - Help future developers
- Generate all packages - Don't leave gaps in API coverage
- Identify specific failure points - Compilation? Usage? Documentation?
- Fix most critical blocker first - Usually compilation or missing files
- Incremental improvement - Don't try to fix everything at once
- Retest after each fix - Ensure progress, not regression
- ✅ Compilation:
sh compile.shsucceeds without errors - ✅ Primary tool: Main functionality accessible via documented command
- ✅ Help system:
sh tool.sh --helpprovides useful information - ✅ API coverage: All packages have corresponding .api files
- ✅ Haiku success: Minimal agent can achieve full functionality from documentation
- ✅ Completeness: Every feature mentioned has usage example
- ✅ Accuracy: Examples actually work as documented
- ✅ Accessibility: Haiku-level agent can follow instructions successfully
- ✅ Maintenance: Generated content has recent timestamps
- ✅ Convention adherence: New code follows existing patterns
- ✅ Dependency management: Uses project's established classpath/build system
- ✅ Error handling: Consistent with project's error reporting patterns
- ✅ Documentation update: New functionality properly documented
- Zero classpath hacking - Always use documented build processes
- Systematic approach - Apply 5-step methodology consistently
- Evidence-based claims - Never guess about functionality, always verify
- Integration mindset - Work with existing patterns, not against them
- Haiku Test passing - Minimal intelligence can achieve full functionality
- Documentation accuracy - Claims match reality of implementation
- Developer onboarding - New contributors can quickly become productive
- Maintenance efficiency - Issues traced to specific, documentable causes
Systematic functionality investigation prevents wasted effort and ensures reliable, maintainable development practices
"If it's not documented and testable by Haiku, it doesn't exist operationally."
Every system must pass the Haiku Test to be considered deployment-ready. This ensures functionality is accessible through documentation alone, without requiring deep codebase knowledge or institutional memory.