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

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.csproj

Shows 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.txt

Save 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.txt

Comment Formats Detected

The command finds comments like:

Use Cases

Sprint Planning

nmbl todos src/ > sprint-planning/technical-debt.txt

Review 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.txt

Ensure 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).txt

Track 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 this

Prioritizing TODOs

// TODO [P0]: Critical - must fix before release
// TODO [P1]: Important - should fix soon
// TODO [P2]: Nice to have - fix when time allows

Using HACK vs TODO