Skip to content

RFC: Agent-initiated code changes via git workspace + PR submission #1

@saraichinwag

Description

@saraichinwag

Summary

Exploration of whether the system agent should be able to make code changes and submit PRs autonomously, rather than just filing issues for humans to fix.

Current State

Agent can:

  • Read debug.log for PHP diagnostics
  • Read DM logs for application-level issues
  • File GitHub issues in any repo the PAT can access
  • Explore codebase via LocalSearch and Workspace tools

Proposed Capability

Agent could:

  1. Clone repo to workspace
  2. Create feature branch
  3. Make code changes
  4. Commit + push to fork
  5. Submit PR for human review

New Abilities Needed

Ability Purpose
datamachine/git-clone Clone repo to workspace directory
datamachine/git-checkout Create/switch branches
datamachine/git-commit Stage + commit changes
datamachine/git-push Push to fork
datamachine/create-pr Submit PR via gh

Use Cases

For sites managed by developers (like ours):

  • Probably NOT needed — we have OpenCode/Kimaki for this
  • Agent filing issues is sufficient; humans write the code

For regular WordPress users (solo site owners):

  • Could auto-fix simple issues (deprecated functions, typos, config errors)
  • Could apply security patches from upstream
  • Could update theme/plugin code for compatibility

Concerns

  1. Safety — autonomous code changes could break production
  2. Scope creep — this is a big feature, not visibility/decision-making
  3. Tooling overlap — we already have OpenCode for code changes
  4. Testing — how does agent verify changes work?

Discussion Questions

  • Is this a core DM feature or a separate "DM Code Agent" plugin?
  • Should it be opt-in per-repo with an allowlist?
  • Is this solving a problem we actually have?
  • Does this make sense for the "visibility for decisions" focus?

Related

Status

This is a brainstorming/RFC issue. Not currently planned for implementation. Adding for visibility and future discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions