Skip to content

fix: stop downloading stale AGENTS.md, generate neutral template locally - #3

Closed
mostafamm44 wants to merge 1 commit into
yallma3:mainfrom
mostafamm44:fix/agents-md-generate-locally
Closed

mostafamm44 wants to merge 1 commit into
yallma3:mainfrom
mostafamm44:fix/agents-md-generate-locally

Conversation

@mostafamm44

@mostafamm44 mostafamm44 commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes

    • Local agent instruction files are no longer overwritten during remote updates.
    • Missing instruction files are automatically recreated with a standard header.
    • Mode-specific execution guidance is added when needed, preventing duplicate entries.
  • Chores

    • Removed outdated instruction content from the tracked configuration file.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change removes the bulk instructions from AGENTS.md and updates codewiser.ps1 to preserve that file during remote updates, create it with a neutral header when absent, and append a selected-mode execution protocol when needed.

Changes

AGENTS.md Management

Layer / File(s) Summary
Remote exclusion
codewiser.ps1
Remote manifest processing skips AGENTS.md.
Local protocol initialization
AGENTS.md, codewiser.ps1
The script creates AGENTS.md with a shared-instructions header and conditionally appends the selected mode’s execution protocol.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RemoteManifest
  participant codewiser.ps1
  participant AGENTS.md
  RemoteManifest->>codewiser.ps1: Provide manifest entries
  codewiser.ps1->>AGENTS.md: Skip remote AGENTS.md update
  codewiser.ps1->>AGENTS.md: Create shared header if missing
  codewiser.ps1->>AGENTS.md: Append mode protocol if absent
Loading

Possibly related PRs

Suggested reviewers: assemhassan

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: AGENTS.md is no longer downloaded and is generated locally as a neutral template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
codewiser.ps1 (1)

435-452: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Avoid accumulating conflicting mode protocols.

A later run selecting a different mode leaves the old ## <Mode> Execution Protocol header intact and appends another one. Bootstrap then has multiple valid mode markers to resolve, so the effective workflow becomes ambiguous. Replace the existing mode marker (or prompt before changing it) rather than appending a second one.

Based on learnings, AGENTS.md is the shared source of global instructions and behavioral constraints.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@codewiser.ps1` around lines 435 - 452, Update the AGENTS.md handling in the
selectedMode block to detect an existing “## <Mode> Execution Protocol” section
and replace or explicitly confirm changing it before writing the new protocol.
Ensure only one mode protocol marker remains, while preserving the existing
append behavior when no protocol is present.

Source: Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@codewiser.ps1`:
- Around line 435-452: Update the AGENTS.md handling in the selectedMode block
to detect an existing “## <Mode> Execution Protocol” section and replace or
explicitly confirm changing it before writing the new protocol. Ensure only one
mode protocol marker remains, while preserving the existing append behavior when
no protocol is present.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7f1dacad-6854-4f63-97c7-2f5b531e7f35

📥 Commits

Reviewing files that changed from the base of the PR and between dffbb35 and 53d4edc.

📒 Files selected for processing (2)
  • AGENTS.md
  • codewiser.ps1
💤 Files with no reviewable changes (1)
  • AGENTS.md

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.

1 participant