nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Feature] AI! Watch Comments (Aider-style)

Open akramcodez opened this issue 3 months ago • 3 comments

Description

Add support for an "AI!" watch comment system. While nanocoder is parked, users can drop AI!, AI?, or AI at the end of a comment line in any file. This will auto-trigger a subagent to resolve the comment.

Use Case

This provides a "remote control" from any editor (VS Code, Vim, IntelliJ) without needing a specific IDE plugin. The user can just type a comment like // fix: null check missing AI! and nanocoder will see the change via file watching and automatically apply the fix.

Proposed Solution

  • Add a new event kind file.ai-comment.
  • Use chokidar (already a dependency) to watch for file changes.
  • Diff the changed file vs the last snapshot and detect new AI! markers.
  • Emit the event, synthesize a prompt containing the comment and surrounding code context.
  • Enqueue the prompt into the conversation loop to trigger a tool call to resolve it.

Alternatives Considered

  • A dedicated editor plugin for every editor (too much maintenance, already have a VS Code extension, but this provides universal support).
  • Requiring the user to manually switch to the terminal and type the prompt (friction).

Additional Context

  • [x] I have searched existing issues to ensure this is not a duplicate
  • [x] This feature aligns with the project's goals (local-first AI assistance)

Implementation Notes (optional)

  • Only new markers should fire (removing a marker shouldn't do anything).
  • Respect the existing tool approval policy for any triggered actions.
  • Requires changes to source/types/skills.ts, source/events/types.ts, and a new source/services/ai-comment-watcher.ts.

akramcodez avatar Aug 28 '26 09:08 akramcodez

Hey @akramcodez can I work on this?

AryanNandanwar avatar Aug 28 '26 09:08 AryanNandanwar

@AryanNandanwar you are already assigned in #806

akramcodez avatar Aug 28 '26 10:08 akramcodez

My bad, didn't see that one. I'll start on it

AryanNandanwar avatar Aug 28 '26 10:08 AryanNandanwar