Skip to content

Prepare agentic development environment #131

Description

@szymonmaszke

Create an agentic environment simplifying opentemplate usage.

Currently it would consist of (approximately):

  • new dev-agent pyproject.toml section which includes opentemplate dependency

  • opentemplate mcp server subcommand (built using argparse and fastmcp) with flags:

    • [--tools] <tool1, tool2, ..., toolN> - which tools to enable, by default None means all tools
    • --finalize-loops=INT - how many times, at most, should the finalize tool run (by default: infinitely,
      until output doesn't change)
    • [--transport] (specifies the MCP transport protocol ["stdio" or "http"), by default STDIO
    • Necessary flags if `--transport == "http"`` from here: https://gofastmcp.com/deployment/http

Tools of the mcp server should run specific opentemplate dev commands, namely:

  • refresh:

    • pdm lock -G:all
    • pdm setup
    • if 0 exit status does not return anything, otherwise returns concatenated stdout and stderr as string
  • test:

    • pdm run tests
    • if 0 exit status does not return anything, otherwise returns concatenated stdout and stderr as string
  • finalize:

    • pdm run prek run --show-diff-on-failure --no-progress --quiet --files $(git diff --name-only --cached; git diff --name-only; git ls-files --others --exclude-standard)
    • runs N times (possibly +inf times if it's the default)
    • if command returns non-zero obtain the output
    • if the output is different from the last one (initial output: empty string "") run the command again
    • if the output is the same as previous run (or N was reached) AND the exit status is not 0 - return concatenated stdout and stderr as string
    • if the output is 0 - return nothing

Metadata

Metadata

Assignees

Labels

highHigh PrioritynormalNormal DifficultystaleStale pull request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions