modify skill and plugin

This commit is contained in:
NINI
2026-05-13 22:27:48 +09:00
parent d414338780
commit 2d59191df2
24 changed files with 2051 additions and 1 deletions
@@ -0,0 +1,42 @@
{
"name": "agents-md-management",
"version": "1.0.0-codex.1",
"description": "Tools to maintain Codex AGENTS.md guidance: audit quality, capture session learnings, and keep project instructions current.",
"author": {
"name": "Anthropic, converted for Codex locally",
"email": "support@anthropic.com",
"url": "https://github.com/anthropics/claude-plugins-official"
},
"homepage": "https://github.com/anthropics/claude-plugins-official/tree/main/plugins/claude-md-management",
"repository": "https://github.com/anthropics/claude-plugins-official",
"license": "Apache-2.0",
"keywords": [
"agents-md",
"codex",
"instructions",
"project-memory",
"skills"
],
"skills": "./skills/",
"interface": {
"displayName": "AGENTS.md Management",
"shortDescription": "Audit and update Codex AGENTS.md guidance",
"longDescription": "A Codex conversion of Anthropic's CLAUDE.md management plugin. It provides skills for auditing AGENTS.md quality and capturing useful session learnings into Codex project instructions.",
"developerName": "Anthropic / local Codex conversion",
"category": "Productivity",
"capabilities": [
"Interactive",
"Read",
"Write"
],
"websiteURL": "https://github.com/anthropics/claude-plugins-official/tree/main/plugins/claude-md-management",
"privacyPolicyURL": "https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement",
"termsOfServiceURL": "https://docs.github.com/en/site-policy/github-terms/github-terms-of-service",
"defaultPrompt": [
"Audit my AGENTS.md files",
"Revise AGENTS.md with this session's learnings"
],
"brandColor": "#10A37F",
"screenshots": []
}
}
+202
View File
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+36
View File
@@ -0,0 +1,36 @@
# AGENTS.md Management Plugin
Codex conversion of Anthropic's CLAUDE.md management plugin.
## What It Does
Two complementary skills help keep Codex instruction files useful and current:
| Skill | Purpose | Use when |
| --- | --- | --- |
| `agents-md-improver` | Audit AGENTS.md quality against the current codebase | You want to check, improve, or repair project guidance |
| `revise-agents-md` | Capture durable learnings from the current session | The session revealed commands, gotchas, setup quirks, or conventions future Codex runs should know |
## Codex Mapping
- `CLAUDE.md` became `AGENTS.md`.
- `.claude.local.md` became Codex's supported override pattern: `AGENTS.override.md`.
- The original `/revise-claude-md` slash command became the `revise-agents-md` skill.
Codex reads global guidance from `~/.codex/AGENTS.md` or `~/.codex/AGENTS.override.md`, then walks from the project root toward the current directory and includes one `AGENTS.override.md` or `AGENTS.md` per directory.
## Usage
Ask Codex things like:
```text
Audit my AGENTS.md files.
Check whether this repo's AGENTS.md is current.
Revise AGENTS.md with the learnings from this session.
```
## Source
Based on `claude-md-management` from:
https://github.com/anthropics/claude-plugins-official/tree/main/plugins/claude-md-management
@@ -0,0 +1,151 @@
---
name: agents-md-improver
description: Audit and improve Codex AGENTS.md and AGENTS.override.md files in repositories. Use when the user asks to check, audit, update, improve, fix, optimize, or maintain AGENTS.md files, Codex project instructions, or agent guidance.
---
# AGENTS.md Improver
Audit, evaluate, and improve Codex instruction files so future Codex sessions get concise, current, actionable project context.
This skill can write to AGENTS.md files. Always present a quality report and proposed diffs before editing. Only apply changes after the user approves the exact target files or has explicitly asked you to apply a specific diff.
## Codex Instruction Model
Codex discovers guidance in this order:
1. Global scope: `~/.codex/AGENTS.override.md` if present, otherwise `~/.codex/AGENTS.md`.
2. Project scope: from the project root toward the current working directory. In each directory, Codex checks `AGENTS.override.md`, then `AGENTS.md`, then configured fallback names.
3. Merge order: root guidance appears first; files closer to the current directory appear later and can override earlier guidance.
Use `AGENTS.override.md` for stronger or more specific overrides. Use `AGENTS.md` for normal shared guidance.
## Workflow
### Phase 1: Discovery
Find repository instruction files:
```powershell
rg --files -g 'AGENTS.md' -g 'AGENTS.override.md'
```
When the user asks about global defaults too, inspect:
```powershell
Test-Path "$env:USERPROFILE/.codex/AGENTS.md"
Test-Path "$env:USERPROFILE/.codex/AGENTS.override.md"
```
Also inspect relevant project files that prove current reality:
- Package or build manifests: `package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`, `Makefile`, `justfile`, workflow files.
- Repo structure: top-level directories and any nested package boundaries.
- Test and lint configuration.
- Existing `.codex/config.toml`, hooks, and project-specific scripts.
Prefer `rg` and `rg --files` for search. Use the repo's existing conventions before proposing new sections.
### Phase 2: Quality Assessment
For each file, evaluate against `references/quality-criteria.md`.
Score out of 100:
| Criterion | Points |
| --- | ---: |
| Commands and workflows | 20 |
| Architecture clarity | 20 |
| Non-obvious patterns | 15 |
| Conciseness | 15 |
| Currency | 15 |
| Actionability | 15 |
Grades:
- A: 90-100, comprehensive, current, actionable.
- B: 70-89, good coverage with minor gaps.
- C: 50-69, basic info with important gaps.
- D: 30-49, sparse or outdated.
- F: 0-29, missing or severely outdated.
### Phase 3: Quality Report
Always output the report before edits:
```markdown
## AGENTS.md Quality Report
### Summary
- Files found: X
- Average score: X/100
- Files needing update: X
### File-by-File Assessment
#### 1. ./AGENTS.md
**Score: XX/100 (Grade: X)**
| Criterion | Score | Notes |
| --- | ---: | --- |
| Commands/workflows | X/20 | ... |
| Architecture clarity | X/20 | ... |
| Non-obvious patterns | X/15 | ... |
| Conciseness | X/15 | ... |
| Currency | X/15 | ... |
| Actionability | X/15 | ... |
**Issues:**
- ...
**Recommended additions:**
- ...
```
### Phase 4: Targeted Updates
Propose only changes that help future Codex sessions:
- Real commands or workflows discovered during analysis.
- Current architecture facts that are not obvious from filenames.
- Gotchas, environment quirks, or testing approaches that save rediscovery.
- Repository-specific rules that affect how Codex should edit or verify work.
Avoid:
- Generic best practices.
- Obvious descriptions of self-named classes or directories.
- Verbose explanations where one line is enough.
- One-off fixes unlikely to recur.
- Instructions that contradict higher-priority user or project guidance.
Show every proposed change as a focused diff:
```markdown
### Update: ./AGENTS.md
**Why:** The repo has a lint command but the current instructions do not mention verification.
```diff
+## Commands
+
+`npm run lint` - Run ESLint before handing off frontend changes.
```
```
### Phase 5: Apply Approved Updates
After approval, edit only approved files. Preserve existing structure when it is clear. If a file is mostly placeholder content, replace it with a concise project-specific structure using `references/templates.md`.
Before finalizing, validate:
- Commands exist and are named correctly.
- Paths are real.
- Each addition is project-specific.
- The result stays concise enough to be prompt-friendly.
- Nested `AGENTS.override.md` files do not accidentally hide useful `AGENTS.md` guidance in the same directory.
## References
- `references/quality-criteria.md` - scoring rubric.
- `references/templates.md` - concise AGENTS.md templates.
- `references/update-guidelines.md` - what to add and what to avoid.
@@ -0,0 +1,115 @@
# AGENTS.md Quality Criteria
## Scoring Rubric
### 1. Commands and Workflows - 20 points
20 points: all essential commands documented with context.
- Build, test, lint, format, dev, and deploy commands are present when relevant.
- Development workflow is clear.
- Common operations and verification expectations are documented.
15 points: most commands present, some missing context.
10 points: basic commands only, little workflow.
5 points: few commands, many missing.
0 points: no commands documented.
### 2. Architecture Clarity - 20 points
20 points: clear codebase map.
- Key directories explained.
- Module relationships documented.
- Entry points identified.
- Data flow described where relevant.
15 points: good structure overview, minor gaps.
10 points: basic directory listing only.
5 points: vague or incomplete.
0 points: no architecture info.
### 3. Non-Obvious Patterns - 15 points
15 points: gotchas and quirks captured.
- Known issues documented.
- Workarounds explained.
- Edge cases noted.
- Unusual "why this way" rules explained briefly.
10 points: some patterns documented.
5 points: minimal pattern documentation.
0 points: no patterns or gotchas.
### 4. Conciseness - 15 points
15 points: dense, valuable content.
- No filler or obvious info.
- Each line adds value.
- No redundancy with code comments or README basics unless Codex specifically needs it.
10 points: mostly concise, some padding.
5 points: verbose in places.
0 points: mostly filler or restates obvious code.
### 5. Currency - 15 points
15 points: reflects current codebase.
- Commands work as documented.
- File references are accurate.
- Tech stack and architecture are current.
10 points: mostly current, minor staleness.
5 points: several outdated references.
0 points: severely outdated.
### 6. Actionability - 15 points
15 points: instructions are executable.
- Commands can be copied and run.
- Steps are concrete.
- Paths are real.
- Verification expectations are clear.
10 points: mostly actionable.
5 points: some vague instructions.
0 points: vague or theoretical.
## Assessment Process
1. Read each instruction file completely.
2. Cross-reference with the actual codebase.
3. Check documented commands against package manifests, scripts, and config.
4. Verify file and directory references.
5. Score each criterion.
6. Calculate total and assign grade.
7. List specific issues.
8. Propose concrete, concise improvements.
## Red Flags
- Commands that would fail.
- References to deleted files or folders.
- Outdated tech versions.
- Placeholder template content.
- Generic advice not specific to the project.
- Duplicate or contradictory guidance across nested instruction files.
- An `AGENTS.override.md` that accidentally hides a sibling `AGENTS.md`.
@@ -0,0 +1,180 @@
# AGENTS.md Templates
## Key Principles
- Concise: dense, human-readable content; one line per concept when possible.
- Actionable: commands should be copy-paste ready.
- Project-specific: document patterns unique to this repo.
- Current: reflect the actual codebase and active tooling.
- Scoped: put broad rules at the repo root; put narrow rules in nested `AGENTS.md` or `AGENTS.override.md`.
## Recommended Sections
Use only sections that matter for the project.
### Commands
```markdown
## Commands
| Command | Purpose |
| --- | --- |
| `<install command>` | Install dependencies |
| `<dev command>` | Start development server |
| `<build command>` | Production build |
| `<test command>` | Run tests |
| `<lint command>` | Lint or format |
```
### Architecture
```markdown
## Architecture
```
<root>/
<dir>/ # <purpose>
<dir>/ # <purpose>
<dir>/ # <purpose>
```
```
### Key Files
```markdown
## Key Files
- `<path>` - <purpose>
- `<path>` - <purpose>
```
### Code Style
```markdown
## Code Style
- <project-specific convention>
- <preference over alternative>
```
### Environment
```markdown
## Environment
Required:
- `<VAR_NAME>` - <purpose>
Setup:
- <setup step>
```
### Testing
```markdown
## Testing
- `<test command>` - <what it tests>
- <testing convention or pattern>
```
### Gotchas
```markdown
## Gotchas
- <non-obvious issue, prerequisite, or ordering dependency>
```
### Workflow
```markdown
## Workflow
- <when to do X>
- <preferred approach for Y>
```
## Minimal Project Root Template
```markdown
# <Project Name>
<One-line description>
## Commands
| Command | Purpose |
| --- | --- |
| `<command>` | <description> |
## Architecture
```
<structure>
```
## Gotchas
- <gotcha>
```
## Comprehensive Project Root Template
```markdown
# <Project Name>
<One-line description>
## Commands
| Command | Purpose |
| --- | --- |
| `<command>` | <description> |
## Architecture
```
<structure with descriptions>
```
## Key Files
- `<path>` - <purpose>
## Code Style
- <convention>
## Environment
- `<VAR>` - <purpose>
## Testing
- `<command>` - <scope>
## Gotchas
- <gotcha>
```
## Nested Override Template
Use this for a subdirectory whose rules differ from the repo root.
```markdown
# <Directory> Instructions
## Scope
- Applies to `<path>/`.
## Local Rules
- <specific rule that differs from root guidance>
## Verification
- `<command>` - <focused check for this directory>
```
@@ -0,0 +1,131 @@
# AGENTS.md Update Guidelines
## Core Principle
Only add information that will genuinely help future Codex sessions. The context window is precious; every line must earn its place.
## What To Add
### Commands and Workflows Discovered
```markdown
## Commands
`npm run build` - Production build.
`npm run lint` - ESLint check required before handoff.
```
Why: saves future sessions from rediscovering commands.
### Gotchas and Non-Obvious Patterns
```markdown
## Gotchas
- Tests must run sequentially because they share a local database.
- Regenerate API clients with `npm run codegen` after editing OpenAPI files.
```
Why: prevents repeated debugging.
### Package Relationships
```markdown
## Architecture
- `packages/api` owns route handlers; `packages/ui` must call it through the shared client.
```
Why: captures relationships that are not obvious from filenames.
### Testing Approaches That Worked
```markdown
## Testing
- API endpoint tests use `tests/helpers/request.ts`; avoid ad hoc server setup.
```
Why: establishes known-good patterns.
### Configuration Quirks
```markdown
## Environment
- `NEXT_PUBLIC_*` variables must be set at build time.
```
Why: environment details often waste time when omitted.
## What Not To Add
### Obvious Code Info
Bad:
```markdown
The `UserService` class handles user operations.
```
The class name already says that.
### Generic Best Practices
Bad:
```markdown
Always write tests for new features.
Use meaningful variable names.
```
Add only project-specific rules.
### One-Off Fixes
Bad:
```markdown
We fixed a bug where the login button did not work.
```
Unless the lesson is durable, leave it out.
### Verbose Explanations
Bad:
```markdown
The authentication system uses JWT tokens. JWT means JSON Web Token...
```
Good:
```markdown
Auth: JWT HS256 tokens in `Authorization: Bearer <token>`.
```
## Diff Format
For each suggested change:
```markdown
### Update: ./AGENTS.md
**Why:** The build command exists but was missing from project instructions.
```diff
+## Commands
+
+`npm run build` - Production build.
```
```
## Validation Checklist
- Each addition is project-specific.
- No generic advice or obvious info.
- Commands are verified against the repo.
- File paths are accurate.
- The wording is concise.
- A new Codex session would benefit from the line.
@@ -0,0 +1,97 @@
---
name: revise-agents-md
description: Capture durable learnings from the current Codex session into AGENTS.md or AGENTS.override.md. Use when the user asks to revise AGENTS.md, update Codex project instructions from this session, capture session learnings, or keep AGENTS.md current at the end of work.
---
# Revise AGENTS.md
Review this session for durable learnings about working with Codex in this codebase. Propose concise updates to `AGENTS.md` or `AGENTS.override.md` that would help future Codex sessions be more effective.
Always show proposed changes before editing. Only apply changes after user approval unless the user provided an exact patch to apply.
## Step 1: Reflect
Identify context that was missing or newly confirmed:
- Commands that were used or discovered.
- Code style patterns followed.
- Testing approaches that worked.
- Environment or configuration quirks.
- Warnings, gotchas, or failure modes encountered.
- Codex-specific workflow notes, such as hooks, plugins, skill locations, or project instruction precedence.
Do not add transient details, personal commentary, or one-off fixes.
## Step 2: Find Instruction Files
Find project instruction files:
```powershell
rg --files -g 'AGENTS.md' -g 'AGENTS.override.md'
```
Choose the right target:
- `AGENTS.md` - Normal shared guidance for the repo or a directory.
- `AGENTS.override.md` - Stronger guidance that should override sibling `AGENTS.md` in the same directory.
- `~/.codex/AGENTS.md` - User-wide Codex defaults, only when the learning is not repo-specific.
- `~/.codex/AGENTS.override.md` - User-wide hard override, use sparingly.
If no project `AGENTS.md` exists and the user wants persistent repo guidance, propose creating one at the project root.
## Step 3: Draft Additions
Keep additions concise. One line per concept is usually enough.
Preferred format:
```markdown
`<command or path>` - <brief durable note>
```
or, for rules:
```markdown
- <specific recurring rule or gotcha>
```
Avoid:
- Verbose explanations.
- Obvious information.
- Generic best practices.
- One-off fixes unlikely to recur.
- Duplicating content already present in a clearer form.
## Step 4: Show Proposed Changes
For each addition:
```markdown
### Update: ./AGENTS.md
**Why:** <one-line reason>
```diff
+<the addition - keep it brief>
```
```
If multiple files could receive the update, explain why the selected target has the right scope.
## Step 5: Apply with Approval
Ask whether the user wants to apply the changes. If approved:
- Edit only the approved files.
- Preserve existing section order where possible.
- Add a new section only when the content does not fit an existing one.
- Keep wording terse and actionable.
## Final Check
Before final response:
- Confirm the final file still reads cleanly.
- Confirm no stale or contradictory guidance was introduced.
- Mention which file changed and what category of learning was captured.