Skip to content

Refactor: Reorganize agent/ directory structure #18

@leandrodamascena

Description

@leandrodamascena

The problem

The agent/ directory is a flat mix of everything - Python source code, Dockerfile, shell scripts, lock files, configs, tests, all sitting at the same level. When I was going through the project trying to understand how things fit together, it wasn't obvious what's source code and what's build infrastructure.

agent/                  <- current state
├── Dockerfile
├── README.md
├── entrypoint.py       <- source
├── server.py           <- source
├── memory.py           <- source
├── task_state.py       <- source
├── observability.py    <- source
├── system_prompt.py    <- source
├── prepare-commit-msg.sh  <- script
├── run.sh              <- script
├── mise.toml           <- config
├── pyproject.toml      <- config
├── uv.lock             <- lock file
├── prompts/            <- source
├── scripts/            <- scripts
└── tests/              <- tests

I think we have the following problems:

  • Makes it harder than it should be to find what you're looking for, especially for someone new to the project
  • AI coding assistants also benefit from clear separation - when everything is flat, models have to figure out what's source code vs infrastructure on every interaction
  • As the entrypoint refactor (see follow-up issue) adds more modules, the flat structure will get even messier

Proposed solution

Move all Python source code into agent/src/. Build/infra files stay at the root:

agent/
├── Dockerfile
├── README.md
├── mise.toml
├── pyproject.toml
├── uv.lock
├── prepare-commit-msg.sh
├── run.sh
├── scripts/
├── tests/
│
└── src/
    ├── entrypoint.py
    ├── server.py
    ├── memory.py
    ├── task_state.py
    ├── observability.py
    ├── system_prompt.py
    └── prompts/
        ├── __init__.py
        ├── base.py
        ├── new_task.py
        ├── pr_iteration.py
        └── pr_review.py

Acknowledgements

  • I may be able to implement this feature
  • This might be a breaking change

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