2.2 KiB
2.2 KiB
Agent Instructions: Universal Python Project Template
Project Overview
This repository is a universal and adaptable Python template intended to serve as a professional starting point for new projects.
Core Directives
- All code, comments, variables, string literals, commit messages, and documentation must be written in English.
- Use Python 3.11+ with type hints whenever possible.
- Follow clean code principles and PEP 8.
- Keep modules small, cohesive, and maintainable.
- Use consistent docstrings for public classes and functions.
- Prefer explicit error handling over silent failures.
Architecture Guidelines
- Keep business logic separate from infrastructure concerns.
- Avoid mixing configuration, I/O, and domain logic in the same module.
- Prefer reusable services over duplicated logic.
- Do not introduce unnecessary complexity or premature abstractions.
Quality Standards
- Every meaningful feature should include tests.
- Run formatting, linting, and type checks before considering a task complete.
- Keep the README updated whenever setup, commands, or structure changes.
- Do not leave placeholder code unless clearly marked.
Tooling
- Testing: pytest
- Formatting: black
- Linting: ruff
- Static typing: mypy
Expected Project Structure
src/app/ tests/ scripts/ README.md instructions-agent.md pyproject.toml
Agent Workflow
- First understand the repository structure.
- Propose a short implementation plan before major changes.
- Reuse existing modules whenever possible.
- Keep changes minimal, coherent, and production-oriented.
- Validate changes with tests and quality tools when possible.
Application Specification
This repository includes an application specification that defines the expected behavior of the project.
Primary specification file:
specs/cd_browser_spec.md
Agent rules:
- Before implementing any feature, read the application specification.
- If implementation details are unclear, follow the specification first.
- If the specification conflicts with a previous assumption, the specification takes precedence.
- Keep implementation aligned with the MVP scope unless explicitly asked to extend it.
- After code changes, run the appropriate validation workflow defined by this repository.