Skip to content

Repository files navigation

Competitive Programming Agent

Turn draft contest ideas into ready-to-judge problem packages. The agent takes a rough statement and returns a refined statement, IO specification, constraints, test generator, validator, reference solution, and more.

Features

  • Python CLI – feed a draft statement and receive Markdown + JSON output
  • Web UI – paste the draft in an interactive interface, configure your API key, and generate results
  • Mock mode – experiment without an API key using bundled sample output
  • Configurable backend – supply your own OpenAI-compatible base URL, model and organization

Installation

pip install -e .

Create a .env file or export environment variables with your API credentials:

OPENAI_API_KEY=sk-your-key
CP_AGENT_MODEL=gpt-4o-mini
OPENAI_BASE_URL=https://api.openai.com/v1

CLI usage

cp-agent path/to/draft.txt --output package.md

Arguments:

  • --model – override the model per run
  • --tags tag1 tag2 – hint topical tags
  • --difficulty – target difficulty label
  • --notes – additional free-form instructions
  • --mock-response samples/mock_response.json – bypass API calls for dry-runs

The CLI writes a Markdown summary to --output (or stdout) and a matching JSON file next to it.

Web app

flask --app app run --debug

Open http://127.0.0.1:5000. Fill in the form, provide an API key (or use the mock response), and hit Generate Package.

Development

  • Formatters: black and isort
  • HTTP client: httpx
  • Front-end is a single static page (templates/index.html) with vanilla JS (static/app.js)

Contributions and issue reports are welcome!

About

An agent that turns your competitive programming problem idea into a ready-to-go problem!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages