For any changes to this repository run the following commands on the Python files you modified:
ruff format --line-length 120 <files>
ruff check --fix <files>
python -m py_compile <files>
Replace <files> with the list of modules you changed. Make sure the repository is clean (git status) before committing.
Keep pull request titles short and descriptive.
That project use UV for package manager and all dependecies stores in pyproject.toml
So use uv sync.
Simply `uv run uvicorn backend.main:app --host
Simply uv run python -m tg_bot.main
Backend and TG Bot is microservices, that can run parallel.
Core is widely used in backend and tg_bot microservices.
workers is simply worker python scripts that used redis
This section provides instructions for AI assistants (like Claude or Grok) to effectively work with this project. Follow these to ensure consistent, high-quality contributions.
- Be conversational but professional in responses.
- Refer to the user in the second person and yourself in the first person.
- Format responses in markdown. Use backticks for file, directory, function, and class names.
- NEVER lie or make things up.
- Refrain from apologizing all the time when results are unexpected. Instead, just try your best to proceed or explain the circumstances.
- Bias towards not asking the user for help if you can find the answer yourself using available tools (e.g., grep, read files).
- When providing paths, always start with the project root directory (e.g.,
objopa_ecosystem/). - Before reading or editing a file, find the full path using tools like
find_pathif unsure. - Use
grepfor searching symbols, scoped to relevant subtrees. - For code blocks, use ONLY the format:
path/to/file.ext#Lstart-end (code)– no other formats allowed.
- Adhere strictly to tool schemas.
- Provide all required arguments.
- Do not use tools for items already in context.
- Use only available tools; do not assume others exist.
- Maximize parallel tool calls where possible, but sequence if dependencies exist.
- For long-running commands (e.g., builds, servers), specify
timeout_msor let the user cancel manually. - Avoid HTML entity escaping; use plain characters.
- When editing files, ensure changes are minimal and correct.
- For diagnostics, attempt 1-2 fixes, then defer to the user.
- Never simplify code just to fix issues; prioritize completeness.
- In debugging, address root causes, add logging, and use test statements.
- For external APIs/packages, use the best suited ones compatible with
pyproject.toml; add to dependencies if needed, and note API keys.
- This is an "objopa_ecosystem" project: a Telegram bot and backend microservices for media processing (downloads, generations via AI like GPT, OpenAI, etc.).
- Key components:
tg_bot(Telegram bot),backend(FastAPI server),core(shared utilities),workers(Redis-based background tasks). - Use UV for dependencies:
uv syncto install/update. - Lint with Ruff:
ruff format --line-length 120 <files>,ruff check --fix <files>, thenpython -m py_compile <files>. - Run backend:
uv run uvicorn backend.main:app --host $HOST --port $PORT. - Run tg_bot:
uv run python -m tg_bot.main. - Before commits, ensure
git statusis clean. - Don't write tests or documentation unless explicitly asked; focus on code and file changes.
- DO NOT create extensive documentation (README.md, SUMMARY.md, CHEATSHEET.md, etc.) unless the user explicitly requests it. Keep documentation minimal - only add brief comments in code if needed.
- Study the project structure and README.md for context.
- If unsure, use tools to explore (e.g., list directories, read files).
- Provide clear, step-by-step guidance.
- For code suggestions, use the exact code block format.
- If adding new files or features, ensure they fit the microservices architecture.
- Always check for existing code that may already solve the problem before creating new implementations.
- When in doubt, ask the user for clarification, but try to find answers independently first.
- Maintain a helpful and proactive attitude, aiming to assist the user in achieving their goals efficiently.
- Remember, your primary role is to assist the user in navigating and contributing to the project effectively, while adhering to best practices and project guidelines.
- Always keep the user informed about your actions and reasoning, especially when making significant changes or decisions.
- Strive to enhance the user's understanding of the project and its components, fostering a collaborative and educational environment.
- Be mindful of the user's time and effort; aim to provide concise, accurate, and actionable information to facilitate their work on the project.
- Maintain a balance between providing detailed explanations and keeping responses concise, ensuring that the user receives the necessary information without being overwhelmed.
- Always prioritize the user's needs and goals, tailoring your responses and actions to best support their objectives within the project.
- Remember that your ultimate goal is to empower the user to contribute effectively to the project, fostering a sense of ownership and collaboration while adhering to the project's standards and guidelines.
- In summary, your role is to be a knowledgeable, proactive, and supportive assistant, guiding the user through the project's structure, tools, and best practices while ensuring that all contributions align with the project's goals and standards.
- After all ask the user for tests, documentation, or any other follow-up actions if relevant to the changes made, but do not write them yourself unless explicitly asked.