Skip to main content
ClaudeWave
Slash Command828 repo starsupdated 13d ago

todo

The todo slash command automatically inserts TODO comments into code files with language-appropriate syntax. It detects priority levels from prefixes (exclamation mark for HIGH, question mark for DISCUSS) and formats comments correctly for JavaScript, Python, HTML, CSS, Shell, and other languages, positioning them logically near related code or at block starts.

Install in Claude Code
Copy
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/huangjia2019/claude-code-engineering/HEAD/05-Commands/projects/01-basic-commands/.claude/commands/todo.md -o ~/.claude/commands/todo.md
Then start a new Claude Code session; the slash command loads automatically.

todo.md

Add a TODO comment based on: $ARGUMENTS

## Priority Detection

- `!` at start → HIGH priority: `// TODO [HIGH]: message`
- `?` at start → DISCUSS: `// TODO [DISCUSS]: message`
- No marker → Normal: `// TODO: message`

## Comment Format by Language

Detect the file type and use appropriate comment syntax:

- JavaScript/TypeScript: `// TODO: message`
- Python: `# TODO: message`
- HTML: `<!-- TODO: message -->`
- CSS: `/* TODO: message */`
- Shell: `# TODO: message`

## Steps

1. Identify the file context (currently open or recently edited)
2. Parse the message and detect priority
3. Format the TODO comment appropriately
4. Add at a logical location:
   - Near related code if context is clear
   - At the top of the function/block otherwise
5. Confirm the addition

## Examples

Input: `/todo fix null check`
Output: `// TODO: fix null check`

Input: `/todo ! critical security fix`
Output: `// TODO [HIGH]: critical security fix`

Input: `/todo ? should we use async here`
Output: `// TODO [DISCUSS]: should we use async here`

## Output

Confirm briefly:
```
✓ Added TODO at [file]:[line]
```