todos - TODO/HACK Comments
Overview
The todos command finds all TODO and HACK comments in your C# code. This helps you track technical debt, action items, and areas that need improvement. It’s useful for code reviews, sprint planning, and identifying work that needs to be done.
Syntax
nmbl todos <ProjectFileOrDirectory>Arguments
ProjectFileOrDirectory- Path to a .csproj file or directory containing C# files
Output
Lists all TODO and HACK comments with their locations (file and line number), making it easy to find and address them.
Examples
Find TODOs in a Project
nmbl todos src/MyProject/MyProject.csprojShows all TODO and HACK comments in the project.
Find TODOs in a Directory
nmbl todos src/Recursively searches all C# files in the directory tree.
Export to File for Tracking
nmbl todos src/ > technical-debt.txtSave the list to track over time.
Count Technical Debt Items
# Count TODO comments
nmbl todos src/ | grep -c "TODO"
# Count HACK comments
nmbl todos src/ | grep -c "HACK"Get a count of technical debt items (Unix/Linux).
Compare Before and After
# Before cleanup
nmbl todos src/ > todos-before.txt
# After addressing items
nmbl todos src/ > todos-after.txt
# See what was fixed
diff todos-before.txt todos-after.txtComment Formats Detected
The command finds comments like:
// TODO: description// HACK: description/* TODO: description *//* HACK: description */
Use Cases
Sprint Planning
nmbl todos src/ > sprint-planning/technical-debt.txtReview TODO items when planning work for the next sprint.
Code Review Checklist
# Check for new TODOs in a feature branch
git checkout feature-branch
nmbl todos src/ > todos-feature.txt
git checkout main
nmbl todos src/ > todos-main.txt
diff todos-main.txt todos-feature.txtEnsure new features don’t add excessive technical debt.
Technical Debt Tracking
# Weekly report
nmbl todos src/ | wc -l > metrics/todo-count-$(date +%Y-%m-%d).txtTrack the number of TODO items over time.
Pre-Release Cleanup
# Before a release, address critical TODOs
nmbl todos src/ | grep -i "critical"
nmbl todos src/ | grep -i "before release"Find items that must be addressed before shipping.
Best Practices
Writing Good TODO Comments
// ✅ Good - specific and actionable
// TODO: Replace magic number with constant after refactoring config system
// ❌ Bad - vague
// TODO: fix thisPrioritizing TODOs
// TODO [P0]: Critical - must fix before release
// TODO [P1]: Important - should fix soon
// TODO [P2]: Nice to have - fix when time allowsUsing HACK vs TODO
- TODO: Future work, improvements, or known limitations
- HACK: Quick fixes or workarounds that should be refactored