Autotrader Bot - Agent Guidelines
Defines build commands, architecture, code style, and an autonomous implementation workflow for a BTC-AUD trading bot.
What this file does
Defines build commands, architecture, code style, and an autonomous implementation workflow for a BTC-AUD trading bot.
When to use it
- Setting up a new Python trading bot project
- Establishing team conventions for a machine learning project
- Creating an autonomous agent workflow for iterative development
- Standardising linting, testing, and formatting across a repo
Assumes this stack
trigger: always_on
Autotrader Bot - Agent Guidelines
Build/Test/Lint Commands
- Run all tests:
make testorpytest tests/ - Run single test:
pytest tests/test_<filename>.pyorpytest tests/test_<filename>.py::test_function_name - Run with coverage:
make test-coverageorpytest --cov=. --cov-report=html tests/ - Lint code:
make lint(runs flake8 + mypy) - Format code:
make format(runs black + isort) - Build/validate:
make build(runs tests + lint) - Run app:
make runorpython autotrader.py
Architecture
- Main entry:
autotrader.pywithContinuousAutoTraderclass - Core modules:
autotrader/package withcore/,api/,ml/,trading/,data/,utils/ - ML Engine: LSTM-based neural network with TensorFlow for price prediction
- Data Source: BTCMarkets API for live BTC-AUD trading data
- Storage: Pickle files for model/state persistence (
autotrader_model.keras,trader_state.pkl)
Code Style
- Formatting: Black (88 char line length) + isort for imports
- Type hints: Required, mypy strict mode enabled
- Docstrings: Required for all public functions/classes
- Testing: pytest with fixtures in
conftest.py, separate unit/integration tests - Error handling: Structured logging with
structlog, graceful exception handling - Naming: snake_case for functions/variables, PascalCase for classes
Main Development Cycle
- Study specs/
- Pick the highest value item from IMPLEMENTATION_PLAN.MD and implement it using up to 5-8 subagents.
- Test the new changes then update IMPLEMENTATION_PLAN.MD to say the implementation is done using a single subagent.
- Add changed code and IMPLEMENTATION_PLAN.MD with "git add -A" via bash then do a 'git commit' with a message that describes the changes you made
Code Quality
- Run automated tests and resolve test failures using a single subagent.
- Important: when authoring documentation capture the why tests are important.
- Important: We want single sources of truth, no migrations/adapters. If tests unrelated to your work fail then it's your job to resolve these tests as part of the increment of change.
Autonomous Implementation Prompt for Cline
You are now in autonomous mode. Your task is to fully implement all requirements specified in the SPEC.md file without waiting for further human input. SPEC.md already exists, do not create a new one
Instructions:
- Read and analyze the complete SPEC.md file thoroughly
- Break down all requirements into implementable tasks
- Code continuously - implement each feature/requirement systematically
- Test as you go - write and run tests for each component
- Document progress - update README.md with implementation status
- Handle errors independently - debug and fix issues without asking
- Make reasonable assumptions when specs are ambiguous
- Prioritize core functionality first, then optional features
- Before finishing a task run unit tests, them pass
- After finishing a task, commit with a descriptive commit message
- Keep SPEC.md updated with the latest changes
Autonomous Behavior:
- Don't ask for permission or clarification - make informed decisions
- If you encounter blockers, try alternative approaches
- Keep working until ALL requirements are implemented
- Only stop when the specification is fully satisfied
- Do it ALL in ONE TASK, do not start a new task
Output:
- Provide periodic status updates in comments
- Log major decisions and assumptions made
- Final summary when complete
What's inside
6 sections: build commands, architecture overview, code style rules, development cycle, code quality steps, autonomous implementation prompt
Change this for your project
- Replace
autotrader.pywith your own entry point - Replace
autotrader/package name with your project's package - Replace
BTCMarketsAPI references with your data source - Replace
autotrader_model.kerasandtrader_state.pklwith your model and state file names
Where it goes
Save as AGENTS.md in your repository root. Read by Codex, Cursor and other agents that follow the AGENTS.md convention.
Worth borrowing
- Autonomous implementation prompt that instructs an agent to read SPEC.md and implement all requirements without human input
- Structured development cycle with subagents and single-commit updates to IMPLEMENTATION_PLAN.MD
Related Documents
Browser-only development
Guides AI assistants on an Electron + React + TypeScript desktop app for browsing and organizing AI-generated images locally.
Claude Agents — Reference & Recommendations
Catalogues 40+ Claude agents and marketing skills for building a cat adoption charity landing page, with a ready-to-paste prompt and backend API reference.
Golden DKG Prototype -- Master Plan
Defines an 8-phase implementation plan for a Rust prototype of the Golden non-interactive DKG protocol using BLS12-381 and tokio.
Swarms Examples Index
Lists 60+ example scripts for building single and multi-agent systems with the Swarms framework, organized by category and use case.