You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feat: Add context collection list management functions (#45)
* Add Git repository context storage and management functions
* Use # for line and function separators in context refs and add
context action command
* Enhance code implementation prompts with region location details
* Add repository context tracking and display in AI prompts
* Add repository context info to AI code change prompt
* Include repository context info in AI code questions prompt
* addressing feedback
* bump version and update HISTORY
* Update ai-code-file.el
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update ai-code-discussion.el
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update transient_menu.png to a new version
* Rewrite README Key Features for clarity and conciseness
* Reorganize Typical Workflows section in README.org
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.org
+12-35Lines changed: 12 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,8 +50,16 @@ An Emacs interface for AI-assisted software development. *The purpose is to prov
50
50
51
51
You can add other backends by customizing the `ai-code-backends` variable.
52
52
53
-
*** Main Entry Point
54
-
Press `C-c a` to open the main transient menu, which provides access to all major features.
53
+
** Key Features
54
+
55
+
- *Transient-Driven Hub (`C-c a`)*: One keystroke opens a contextual transient menu that groups every capability (CLI control, code actions, agile workflows, utilities) so you never need to memorize scattered keybindings.
56
+
- *AI CLI Session Management*: Start (`a`), resume (`R`), or jump back into (`z`) the active AI CLI buffer, instantly swap backends (`s`), upgrade them (`u`), edit backend configs (`g`), and run prompts against the current file (`|`).
57
+
- *Context-Aware Code Actions*: The menu exposes dedicated entries for changing code (`c`), implementing TODOs (`i`), asking questions (`q`), explaining code (`x`), sending free-form commands (`<SPC>`), and refreshing AI context (`@`). Each command automatically captures the surrounding function, region, or clipboard contents (via `C-u`) to keep prompts precise.
58
+
- *Agile Development Workflows*: Use the refactoring navigator (`r`), the guided TDD cycle (`t`), and the pull/review diff helper (`v`) to keep AI-assisted work aligned with agile best practices. Prompt authoring is first-class through quick access to the prompt file (`p`), block sending (`b`), and AI-assisted shell/file execution (`!`).
59
+
- *Productivity & Debugging Utilities*: Initialize project navigation assets (`.`), investigate exceptions (`e`), auto-fix Flycheck issues in scope (`f`), copy or open file paths formatted for prompts (`k`, `o`), generate MCP inspector commands (`m`), and capture session notes straight into Org (`n`).
60
+
- *Seamless Prompt Management*: Open `.ai.code.prompt.org`, send regions with `ai-code-prompt-send-block`, and reuse prompt snippets via `yasnippet` to keep conversations organized.
61
+
- *Interactive Chat & Context Tools*: Dedicated buffers hold long-running chats, automatically enriched with file paths, diffs, and history from Magit or Git commands for richer AI responses.
62
+
- *AI-Assisted Bash Commands*: From Dired, shell, eshell, or vterm, run `C-c a !` and type natural-language commands prefixed with `:` (e.g., `:count lines of python code recursively`); the tool generates the shell command for review and executes it in a compile buffer.
55
63
56
64
*** Typical Workflows
57
65
- *Changing Code*: Position the cursor on a function or select a region of code. Press `C-c a`, then `c` (`ai-code-code-change`). Describe the change you want to make in the prompt. The AI will receive the context of the function or region and your instruction.
@@ -60,43 +68,12 @@ An Emacs interface for AI-assisted software development. *The purpose is to prov
60
68
- *Refactoring a Function*: With the cursor in a function, press `C-c a`, then `r` (`ai-code-refactor-book-method`). Select a refactoring technique from the list, provide any required input (e.g., a new method name), and the prompt will be generated.
61
69
- *Reviewing a Pull Request*: Press `C-c a`, then `v` (`ai-code-pull-or-review-diff-file`). Choose to generate a diff between two branches. The diff will be created in a new buffer, and you'll be prompted to start a review.
62
70
63
-
*** The Prompt File
64
-
Use `M-x ai-code-open-prompt-file` to open or create `.ai.code.prompt.org` at the root of your Git repository. This file is an Org-mode buffer where you can write, edit, and manage your prompts. Press `C-c C-c` (`ai-code-prompt-send-block`) on a block of text to send it directly to the AI.
65
-
66
-
** Key Features
67
-
68
-
- *Interactive AI Chat*: Start an interactive session with an AI assistant in a dedicated Emacs buffer.
69
-
- *Context-Aware Prompting*: Automatically include relevant context in your prompts, such as file paths, selected code regions, or the current function.
70
-
- *Code Manipulation*:
71
-
- *Change Code*: Request changes to the current function or a selected region.
72
-
- *Implement TODOs*: Automatically generate code to fulfill `TODO` comments.
73
-
- *Explain Code*: Get explanations for a symbol, line, function, file, or selected region.
74
-
- *Fix Errors*: Use `Flycheck` integration to automatically generate fixes for reported errors.
75
-
- *Agile Development*:
76
-
- *TDD Cycle*: A guided workflow for the Red-Green-Refactor cycle of Test-Driven Development.
77
-
- *Refactoring*: Apply common refactoring techniques (e.g., Extract Method, Rename Variable) with AI assistance.
78
-
- *Git & Magit Integration*:
79
-
- *Review Diffs*: Generate and review diffs for commits, branches, or staged changes.
80
-
- *Analyze History*: Use `git blame` and `git log` output to get AI-powered insights into code evolution and contributor patterns.
81
-
- *Transient Menus*: Access AI commands directly from the Magit interface.
82
-
- *Prompt Management*:
83
-
- *Prompt File*: Use a dedicated `.ai.code.prompt.org` file to manage and reuse prompts.
84
-
- *Snippets*: Leverage `yasnippet` for a library of predefined, reusable prompts.
85
-
- *Usability Enhancements*:
86
-
- *Transient Menu*: A clean, organized menu (`C-c a`) for easy command discovery.
87
-
- *Helm/Completing-Read*: Enhanced input completion with history.
88
-
- *Clipboard Utilities*: Easily copy file paths (formatted for AI prompts) and open clipboard paths in Dired.
89
-
- *AI assisted bash command generation and running*
90
-
- C-c a ! in a dired buffer, or shell / eshell / vterm buffer, and start type command lead with : character, eg, :count lines of python code recursively, it will generate the full command with ai for review, and then run it in a compile buffer.
91
-
- *MCP debugging feature*
92
-
- C-c a m to automatically generate mcp inspector command for python MCP project.
93
-
- *Project Initialization*
94
-
- C-c a . to initialize .projectile and create gtags for the project. For easy code navigation.
95
-
96
71
** Add a new AI coding CLI backend
97
72
98
73
- [[https://github.com/tninja/ai-code-interface.el/pull/2][This PR]] add the github-copilot-cli (require claude-code.el). It can be an example to add basic support for other AI coding CLI.
99
74
75
+
- Open a issue, Post information about the new AI coding CLI backend (eg. cursor CLI?), at least providing the command line name. You can also include the version upgrade command, how to resume, where the configuration files are located, and so on. We can ask GitHub Copilot to add support features based on the issue.
76
+
100
77
** [[https://github.com/tninja/aider.el/blob/main/appendix.org#be-careful-about-ai-generated-code][Why Agile development with AI?]]
;; With prefix argument: implement after comment, not in-place
176
190
(cond
177
191
(region-text
178
-
(format"Please implement code after this requirement comment block starting on line %d: '%s'. Leave the comment as-is and add the implementation code after it. Keep the existing code structure and add the implementation after this specific block.%s%s"
(format"Please implement code after this requirement comment on line %d: '%s'. Leave the comment as-is and add the implementation code after it. Keep the existing code structure and add the implementation after this specific comment.%s%s"
@@ -189,8 +206,11 @@ Argument ARG is the prefix argument."
189
206
;; Without prefix argument: replace in-place (original behavior)
190
207
(cond
191
208
(region-text
192
-
(format"Please implement this requirement comment block starting on line %d in-place: '%s'. It is already inside current code. Please replace it with implementation. Keep the existing code structure and implement just this specific block.%s%s"
(format"Please implement this requirement comment on line %d in-place: '%s'. It is already inside current code. Please replace it with implementation. Keep the existing code structure and implement just this specific comment.%s%s"
0 commit comments