only droids
This commit is contained in:
6
.factory/rules/code.md
Normal file
6
.factory/rules/code.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Code Rules
|
||||
|
||||
1. Never use emojis in the code. Use ASCII characters as much as possible.
|
||||
Kaomojis are also fine to make it fun but do not use emojis.
|
||||
|
||||
2. Keep files under 300 lines. Create nested folders/files for modularity.
|
||||
4
.factory/rules/github.md
Normal file
4
.factory/rules/github.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# GitHub Rules
|
||||
|
||||
We have `gh` cli. Use that as much as possible. But read only.
|
||||
Ask user to run specific commands if they are not read only.
|
||||
11
.factory/rules/markdown.md
Normal file
11
.factory/rules/markdown.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Markdown Rules
|
||||
|
||||
## Tables
|
||||
|
||||
The tables in markdown should always by ascii char count justified for better readability.
|
||||
|
||||
Example:
|
||||
|
||||
| Name | Age | City |
|
||||
|------------|-----|---------------|
|
||||
| Abhishek | 30 | New York |
|
||||
17
.factory/rules/project.md
Normal file
17
.factory/rules/project.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Project Rules
|
||||
|
||||
Do not put obvious comments in the code. Every comment should add value to the codebase.
|
||||
Docstrings are different than comments.
|
||||
Do not put emojis in the code. Use ASCII characters as much as possible.
|
||||
|
||||
## Explore
|
||||
|
||||
Always start with `tree --gitignore`. Do not get stuck in loop of running `ls` or `grep`.
|
||||
|
||||
Try to understand the code structure first.
|
||||
Try to grab the coding style and patterns used in the codebase. It will help you to write code that is consistent with the existing codebase.
|
||||
|
||||
## Motive
|
||||
|
||||
The motive should to do things the right way and not the easy way. The right way is to follow the coding standards and best practices.
|
||||
The easy way is to write code that is quick and not manageable. Avoid the easy way.
|
||||
24
.factory/rules/python.md
Normal file
24
.factory/rules/python.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Python Rules
|
||||
|
||||
Always make sure to run linter and typecheck.
|
||||
Possibly with `uv` like `uv run ruff check --fix` and `uv run ty`.
|
||||
|
||||
## Package management
|
||||
|
||||
use `uv pip` instead of `pip` as I always create my virtual environments with `uv` if it doesn't already exist. Example: `uv venv -p 3.12`
|
||||
|
||||
## Code style
|
||||
|
||||
Do not try to use comments to work around the linter (ruff) or type checker (ty) issues.
|
||||
Chances are Makefiles are present read and use them. If doesn't exist then create it.
|
||||
Run formatting after done with changes.
|
||||
Never use `sys.path` or `pathlib` for resources. Use `importlib.resources`.
|
||||
|
||||
## Some rules to configure in ruff
|
||||
|
||||
- Ban relative imports.
|
||||
- Keep imports at the top of the file.
|
||||
|
||||
## Type checking
|
||||
|
||||
Try to write type safe code. Use type hints and type annotations as much as possible. It will help you to catch bugs early and it will also help you to understand the code better.
|
||||
15
.factory/rules/subagents.md
Normal file
15
.factory/rules/subagents.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Subagent Rules
|
||||
|
||||
Always use prep time to understand where you can leverage your available subagents.
|
||||
|
||||
## Coding with subagents
|
||||
|
||||
The specialized coder subagent shall handle code generation. And even code refactoring.
|
||||
|
||||
### Productivity Trick
|
||||
|
||||
Do utilize it in multiple stages:
|
||||
|
||||
- Ask to analyze the code with in context of the task
|
||||
- Ask to show you a proposed plan which you'll evaluate and can ask for alternative approach or give a goahead.
|
||||
- Give the goahead and ask to implement the code.
|
||||
Reference in New Issue
Block a user