| name | analyze-emacs-package-updates |
| description | Analyzes the log of incoming emacs package updates (usually in `emacs-update.org`), producing a report for each package, with special focus on any changes required in the current emacs config (`Emacs.org`). |
Analyze Emacs package updates
Rules
- ALWAYS try sticking with allowed permissions as much as possible, to avoid having to ask for user confirmation.
- NEVER use
cd ... && git ... as that requires additional permissions: use git -C ... instead!
- If permissions use relative path, you SHOULD also!
Inputs
emacs-update.org: generated by the user's elpaca update helpers, by comparing contents of a lock file with the latest available package updates. Each top-level * TODO <pkg> / * DONE <pkg> heading contains a single package with locked version, new version, and the commits between them (if computable).
Emacs.org: the user's literate Emacs config. Package settings live in (use-package <pkg> ...) blocks inside #+begin_src emacs-lisp source blocks. Some packages also have additional (with-eval-after-load '<pkg> ...) blocks elsewhere.
elpaca/repos/<pkg>/: clone of each package's repo, useful when you need to look at a CHANGELOG, confirm a symbol survived a rename, or diff a specific commit.
Both org files are large, so read only the slices you need.
What you produce
For each package marked with TODO in emacs-update.org, add a subheading at the bottom of that package's entry:
** [#A|B|C] AI analysis
*TL;DR:* <short summary, focused on what the user needs to do.>
<concise bullets / short paragraphs. Cite commits by short hash and/or short message. Quote symbols from the user's config.>
Use priority cookies as:
[#A] for breaking changes to user's config.
[#B] for notable/interesting changes but not breaking.
[#C] for no impact.
Don't modify TODO/DONE status of headings.
Don't modify Emacs.org.
Suggested workflow
1. Create one task per package upfront
Get a list of packages to analyze:
grep -n '^\* ' <path to emacs-update.org>
Focus only on those with TODO prefix, skip those with DONE.
Use TaskCreate in a single message (parallel) to create one task per package.
2. Ensure emacs-update-ai-analysis/ dir exists
mkdir -p emacs-update-ai-analysis/
3. Run one agent per package
Run one agent per package, in parallel.
Pass them your context + instructions above in this skill + following tips / instructions (<pkg> to be replaced with package name/id):
- If AI analysis file for this package already exists and is newer than
emacs-update.org, skip the analysis. Call the skill script: ./check-ai-analysis-existence.sh <pkg> (exit 0 = skip).
- Read the whole package entry from
emacs-update.org. Use grep -En '^\*\s.*\b<pkg>\b' to find heading line. Usually reading ~50 lines is more than enough, but expand as needed.
- Read the package user config from
Emacs.org. Use grep -En '\buse-package\s+<pkg>\b' and grep -En "\bwith-eval-after-load\s+'<pkg>\b to locate the relevant pieces of config. Read ~50 lines around each match, expand as needed.
- If extra info/context needed, inspect the package repo at
elpaca/repos/<pkg>/. You might want to check the changelog, commits, ... . If using git, YOU MUST use it with -C to avoid triggering permission asks, don't use cd ... && git .... Don't overdo this or spend too much time on it, use it sparingly, only when more info is needed.
- Create the file
emacs-update-ai-analysis/<pkg>.org and write the analysis into it, with the heading: * [#A|B|C] AI analysis.
- If no entry in user config, mark AI analysis with
[#C].
- Return
[#A|B|C] <pkg>: <one-sentence headline> so the parent can build the final summary.
- Parent is using
TaskCreate so let it know your task is done.
- Keep it concise in general.
4. Collect and summarize
When all packages are processed by the agents, read all the files from emacs-update-ai-analysis/ and copy each package analysis as the last subheading under the corresponding package heading in emacs-update.org: ** [#A|B|C] AI analysis.
Finally, print a final summary, keep it short.
Also, if there are any suggestions you have to improve this skill, inform the user.