Skip to content

codex: installer can update AGENTS.md (markers; --no-agents)#411

Open
kundeng wants to merge 3 commits intoobra:mainfrom
kundeng:pr/codex-agents
Open

codex: installer can update AGENTS.md (markers; --no-agents)#411
kundeng wants to merge 3 commits intoobra:mainfrom
kundeng:pr/codex-agents

Conversation

@kundeng
Copy link

@kundeng kundeng commented Feb 4, 2026

Adds an optional, idempotent update of ~/.codex/AGENTS.md during installer install/upgrade to ensure the Superpowers system block is present.

  • Uses marker-bounded block insertion for safe re-runs
  • Adds --no-agents to opt out
  • Removes one legacy unmarked duplicate block outside markers to avoid duplication

I split this from the core installer PR since it edits a user config file and may warrant separate review.

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

Introduces a new installer core module providing install, upgrade, and health-check functionality for Superpowers tooling. The core module handles repository cloning, Git operations, symlink creation, and IDE-specific configuration. Two CLI tools integrate this core module by exposing install, upgrade, and doctor subcommands to manage installations across different IDE environments.

Changes

Cohort / File(s) Summary
Installer Core Module
lib/installer-core.js
New module exporting install/upgrade/doctor functions and CLI argument parsing. Implements repository cloning/updating, Git checkout operations, symlink creation, IDE path configuration, and health-check diagnostics with comprehensive error handling.
CLI Integration
.codex/superpowers-codex, .opencode/superpowers-opencode
New and extended CLI entrypoints integrating the installer core. Each exposes install, upgrade, and doctor subcommands with flag support (--repo, --ref, --dir, --force, --no-update, --no-agents) and help documentation.

Sequence Diagram(s)

sequenceDiagram
    participant User as User CLI
    participant CLI as Superpowers CLI
    participant Installer as Installer Core
    participant Git as Git/Repository
    participant IDE as IDE Paths
    participant FS as Filesystem

    User->>CLI: install/upgrade [flags]
    CLI->>CLI: parseArgs & resolveConfig
    CLI->>Installer: runInstall/runUpgrade(ide, args)
    
    Installer->>Git: gitEnsureCloned(repoUrl, dir)
    Git->>FS: Clone repository
    FS-->>Git: Success
    Git-->>Installer: Cloned/Updated
    
    Installer->>Git: gitCheckoutRef(ref)
    Git->>FS: Checkout ref
    FS-->>Git: Success
    Git-->>Installer: Checked out
    
    Installer->>IDE: getIdePaths(ide)
    IDE-->>Installer: IDE paths config
    
    Installer->>FS: ensureSymlink(repo, target)
    FS-->>Installer: Symlinks created
    
    Installer->>FS: ensureCodexAgentsMd (optional)
    FS-->>Installer: Agents metadata updated
    
    Installer-->>CLI: Success
    CLI-->>User: Installation complete
Loading
sequenceDiagram
    participant User as User CLI
    participant CLI as Superpowers CLI
    participant Doctor as Doctor Check
    participant Git as Repository
    participant IDE as IDE Paths
    participant FS as Filesystem

    User->>CLI: doctor [flags]
    CLI->>Doctor: runDoctor(ide, args)
    
    Doctor->>Git: Check central repo status
    Git->>FS: Verify repo exists & clean
    FS-->>Git: Status result
    Git-->>Doctor: Repo health
    
    Doctor->>IDE: getIdePaths(ide)
    IDE-->>Doctor: IDE config
    
    Doctor->>FS: Verify IDE symlinks & dirs
    FS-->>Doctor: Path status
    
    Doctor->>Doctor: Compile results
    Doctor-->>CLI: Print status & exit
    CLI-->>User: Health check complete
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Poem

🐰 Hop hop, the installer now takes flight,
With symlinks dancing in the light,
Git operations smooth and clean,
The finest CLI tools ever seen!
Doctor checks each path with care—
Installation magic everywhere!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adding installer capability to update AGENTS.md with marker-based insertion and a --no-agents opt-out flag.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@obra obra added codex Issues related to OpenAI Codex support enhancement New feature or request labels Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex Issues related to OpenAI Codex support enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants