-
-
Notifications
You must be signed in to change notification settings - Fork 25
feat: add ruler instructions for the project #643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,62 @@ | ||||||||||||||
| # AI Agent Instructions for backend/ | ||||||||||||||
|
|
||||||||||||||
| All the following instructions must be followed when writing code in the ./backend/ directory. | ||||||||||||||
| This includes all Python code, tests, and any other files related to the backend project. | ||||||||||||||
|
|
||||||||||||||
| ## Coding Standards | ||||||||||||||
|
|
||||||||||||||
| - Use Python 3.14 and Django 5.2 conventions. | ||||||||||||||
tudoramariei marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
| - Always follow PEP8 and Python best practices for style and structure with a line length of 120. | ||||||||||||||
| - Name variables, functions, and classes descriptively and consistently. | ||||||||||||||
| - Write modular code: split logic into reusable functions and classes. | ||||||||||||||
| - Add concise docstrings to all public functions and classes. | ||||||||||||||
| - Don't use hardcoded strings, if possible. | ||||||||||||||
| If a function exists to generate that string, use it. | ||||||||||||||
| If the string is a constant, define it in its (or another appropriate) module. | ||||||||||||||
| - Never use `__future__` imports. | ||||||||||||||
| - Use type hints for all arguments and return values. | ||||||||||||||
| - Use type annotations for all variables, and functions. | ||||||||||||||
| - When having to run code, use uv to run the project and always use the `--active` flag: `uv run --active`. | ||||||||||||||
| - The code is formatted using `ruff` exclusively. The most used command to run is: | ||||||||||||||
| `ruff format . && ruff check --select I --fix ./ && ruff check --fix ./` | ||||||||||||||
|
|
||||||||||||||
| ## Template Standards | ||||||||||||||
|
|
||||||||||||||
| - Use Django's template language for all HTML templates. | ||||||||||||||
| - Use Tailwind CSS 4 for styling, and ensure it is properly integrated with Django templates. | ||||||||||||||
| - Use Alpine.js 3 for any necessary JavaScript interactivity in templates. | ||||||||||||||
| - Follow best practices for template structure and organization. | ||||||||||||||
| - Use template inheritance to avoid duplication. | ||||||||||||||
| - Name templates descriptively and consistently. | ||||||||||||||
| - Avoid logic in templates; keep it in views or template tags. | ||||||||||||||
|
|
||||||||||||||
| ## Testing Requirements | ||||||||||||||
|
|
||||||||||||||
| - Store tests in `tests.py` or a `tests/` directory within each app. | ||||||||||||||
| - Use Django's `TestCase` for all unit and integration tests. | ||||||||||||||
| - Write tests for every new feature, model, and view. | ||||||||||||||
| - Ensure tests are independent and do not rely on external state. | ||||||||||||||
| - Name test methods clearly and assert expected results. | ||||||||||||||
|
|
||||||||||||||
| ## Dependency Management | ||||||||||||||
|
|
||||||||||||||
| - Add dependencies using uv: `uv pip install <package>`. | ||||||||||||||
| - Let uv update `pyproject.toml` and `uv.lock` automatically. | ||||||||||||||
| - Never manually edit `uv.lock`. | ||||||||||||||
|
Comment on lines
+43
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect The command To add dependencies and update 📝 Proposed fix ## Dependency Management
-- Add dependencies using uv: `uv pip install <package>`.
-- Let uv update `pyproject.toml` and `uv.lock` automatically.
+- Add dependencies using uv: `uv add <package>`.
+- This will update `pyproject.toml` and `uv.lock` automatically.
- Never manually edit `uv.lock`.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| ## Django Project Practices | ||||||||||||||
|
|
||||||||||||||
| - Register new models in `admin.py` for admin access. | ||||||||||||||
| - Create and apply migrations for model changes. | ||||||||||||||
| - Keep Django settings modular and environment-specific in `settings/`. | ||||||||||||||
|
|
||||||||||||||
| ## Commit and Workflow | ||||||||||||||
|
|
||||||||||||||
| - Ensure code is formatted and linted before commit. | ||||||||||||||
| - Include tests for new features and bug fixes. | ||||||||||||||
| - Write clear commit messages describing changes. | ||||||||||||||
|
|
||||||||||||||
| ## Summary | ||||||||||||||
|
|
||||||||||||||
| Follow these instructions to ensure code quality, maintainability, and reliability in the backend project. | ||||||||||||||
| All code, tests, formatting, and dependencies must comply with these rules. | ||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Ruler Configuration File | ||
| # See https://ai.intellectronica.net/ruler for documentation. | ||
|
|
||
| # To specify which agents are active by default when --agents is not used, | ||
| # uncomment and populate the following line. If omitted, all agents are active. | ||
| default_agents = ["copilot", "junie"] | ||
|
|
||
| # --- Agent Specific Configurations --- | ||
| # You can enable/disable agents and override their default output paths here. | ||
| # Use lowercase agent identifiers: amp, copilot, claude, codex, cursor, windsurf, cline, aider, kilocode | ||
|
|
||
| [agents.copilot] | ||
| enabled = true | ||
| output_path = ".github/copilot-instructions.md" | ||
tudoramariei marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # [agents.claude] | ||
| # enabled = true | ||
| # output_path = "CLAUDE.md" | ||
|
|
||
| # [agents.codex] | ||
| # enabled = true | ||
| # output_path = "AGENTS.md" | ||
|
|
||
| # [agents.cursor] | ||
| # enabled = true | ||
| # output_path = ".cursor/rules/ruler_cursor_instructions.mdc" | ||
|
|
||
| # [agents.windsurf] | ||
| # enabled = true | ||
| # output_path = ".windsurf/rules/ruler_windsurf_instructions.md" | ||
|
|
||
| # [agents.cline] | ||
| # enabled = true | ||
| # output_path = ".clinerules" | ||
|
|
||
| # [agents.aider] | ||
| # enabled = true | ||
| # output_path_instructions = "ruler_aider_instructions.md" | ||
| # output_path_config = ".aider.conf.yml" | ||
|
|
||
| # [agents.firebase] | ||
| # enabled = true | ||
| # output_path = ".idx/airules.md" | ||
|
|
||
| # [agents.gemini-cli] | ||
| # enabled = true | ||
|
|
||
| # [agents.kilocode] | ||
| # enabled = true | ||
| # output_path = ".kilocode/rules/ruler_kilocode_instructions.md" | ||
Uh oh!
There was an error while loading. Please reload this page.