Skip to content

Feat: Supporting search content inside task files#289

Merged
tninja merged 15 commits intomainfrom
kang_feat
Apr 12, 2026
Merged

Feat: Supporting search content inside task files#289
tninja merged 15 commits intomainfrom
kang_feat

Conversation

@tninja
Copy link
Copy Markdown
Owner

@tninja tninja commented Apr 11, 2026

This updates a few editor workflows that were still a bit rough around the edges, especially around sending out PRs and working with task files.

The PR creation flow now asks for an optional title and reuses minibuffer history so it is faster to iterate on follow-up PRs. If no title is provided, the generated prompt now explicitly tells the AI to come up with a concise PR title. I also updated the prompt text so the final response includes the exact title and description that were used.

On the task-file side, ai-code-create-or-open-task-file now supports a C-u path that asks AI to search .org file contents under a chosen directory, with dedicated history for the search directory and a confirmation step before sending the prompt. In parallel, backend skill management now supports uninstall as a first-class action, routes Claude to the fallback flow, and adds clearer validation around unsupported actions.

For verification, I added ERT coverage for the optional PR-title prompt, the new task-file search prompt flow, and the install/uninstall backend-skills branches. Per request, I did not run tests for this PR creation step.

@tninja tninja changed the title Improve PR creation and task file workflows Feat: Supporting search content inside multiple task files Apr 11, 2026
@tninja tninja requested a review from Copilot April 11, 2026 04:53
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a7edc371c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +329 to +330
(should (member "PR title (optional, leave empty for AI to generate): "
captured-read-prompts))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Mock read-string for PR-title path in this ERT

This new assertion assumes the PR title prompt is captured through ai-code-read-string, but ai-code--pull-or-review-pr-with-source now reads the title with read-string (ai-code-git.el, PR-title branch). In non-interactive ERT runs, that means this prompt is never recorded in captured-read-prompts (so this assertion fails) and can also try to read from stdin if read-string is not stubbed. The test should stub read-string (or capture via a separate list) for the title prompt path.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves a few interactive Emacs workflows in ai-code-interface.el, focusing on smoother PR creation prompts, enhanced task-file handling, and expanded backend “skills” management.

Changes:

  • Adds an optional PR title prompt (with minibuffer history) to the “send current branch PR” flow and updates the generated prompt instructions accordingly.
  • Extends ai-code-create-or-open-task-file with a C-u flow to ask the AI to search .org file contents under a chosen directory (with dedicated directory history + confirmation).
  • Expands backend skills management to support uninstall as a first-class action, with fallback prompt generation and validation.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
ai-code.el Updates transient menu labels to reflect new “(Un)Install skills” and task-file search prefix behavior.
ai-code-prompt-mode.el Implements task-file search prompt flow, adds directory history var, and extends ai-code-create-or-open-task-file to accept prefix arg.
ai-code-git.el Adds optional PR title prompting/history and updates PR creation prompt construction.
ai-code-backends.el Adds install/uninstall action selection and a unified fallback helper; routes Claude skills to fallback by clearing :install-skills.
test/test_ai-code-prompt-mode.el Adds ERT coverage for the new task-file search prefix flow.
test/test_ai-code-git.el Updates ERT coverage for the optional PR title prompt behavior.
test/test_ai-code-backends.el Adds ERT coverage for uninstall and invalid-action validation; updates install tests to account for action selection.

Comment on lines 313 to 321
((symbol-function 'ai-code-read-string)
(lambda (prompt &optional initial-input _candidate-list)
(push prompt captured-read-prompts)
(cond
((string= prompt "Target branch to merge into: ")
(or initial-input "main"))
((string= prompt "PR title (optional, leave empty for AI to generate): ")
"")
((string= prompt "Enter PR creation prompt: ")
:agent-file "CLAUDE.md"
:upgrade "npm install -g @anthropic-ai/claude-code@latest"
:install-skills ai-code-claude-code-install-skills
:install-skills nil
Comment on lines 618 to 624
@@ -606,15 +622,25 @@
- symbol: call the function.
Otherwise fall back to prompting the AI session to install from a
skills repository URL."
Comment on lines +670 to +672
(target-dir (expand-file-name (if (string-empty-p input)
ai-code-files-dir
input))))
(ai-code--open-or-create-task-file task-file confirmed-filename task-name task-url)))))))
using GPTel, and creates the task file.
With prefix ARG, prompt AI to search org file content under a target directory."
;; DONE: when C-u pressed, let AI search content inside ai-code-files-dir given search target description. User firstly confirm the target dir to search (it support dedicate history entered), by default it is ai-code-files-dir, then input search description, it will build up prompt to search .org files inside target directory, and user confirm with ai-code-read-string. After that, the prompt will be sent to ai coding session to perform search.
@tninja tninja changed the title Feat: Supporting search content inside multiple task files Feat: Supporting search content inside task files Apr 12, 2026
@tninja tninja merged commit 3e435f4 into main Apr 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants