-
Notifications
You must be signed in to change notification settings - Fork 221
add AGENTS.md rules #1183
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
base: main
Are you sure you want to change the base?
add AGENTS.md rules #1183
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1183 +/- ##
==========================================
+ Coverage 87.43% 87.47% +0.03%
==========================================
Files 20 20
Lines 2538 2586 +48
==========================================
+ Hits 2219 2262 +43
- Misses 319 324 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Is there an instruction that can be used to block the prevent the "Initial plan" empty commit?
Other than that just one typo fix and one minor suggestion.
I'll be curious to see how this improves things.
Spent a few minutes trying to answer this myself and couldn't find anything. |
|
Most I can find is "no" https://github.com/orgs/community/discussions/160091 |
|
One thing I'm not sure about is whether it would be better to use the |
I like the more general approach. Looks like it's a little more widely adopted. Will work locally in some cases and I always prefer minimizing GitHub specific stuff when possible for future flexibility. |
|
i'm happy, looks like @ethanwhite needs to clear. |
|
Standby - we might go for the Agents.md approach, so it also works with Cursor/Claude/etc. (only requires moving files, and will fix content suggestions above) |
|
I don't know if its useful, but here are my copilot instructions for MillionTrees Preferred Function Design# Good: Simple, direct, functional
def filter_valid_annotations(annotations: list[dict]) -> list[dict]:
return [ann for ann in annotations if ann.get('x') and ann.get('y')]
# Avoid: Over-engineered with unnecessary error handling
def filter_valid_annotations(annotations: list[dict]) -> list[dict]:
try:
if not annotations:
return []
result = []
for ann in annotations:
try:
if ann.get('x') is not None and ann.get('y') is not None:
result.append(ann)
except (KeyError, AttributeError, TypeError):
continue
return result
except Exception:
return []Domain-Specific GuidelinesFor Data Processing Scripts
For CLI Scripts
For API Interactions
Comments and DocumentationWhen to Document
When NOT to Document
SummaryWrite code that is clear, direct, and fails obviously when something goes wrong. Prefer simplicity over robustness, and trust that proper system design and monitoring will catch issues rather than trying to handle every possible error case in the code itself. File I/O PatternsPreferred File Reading# Good: Let file operations fail fast and explicitly
def process_annotations(data_dir: str) -> pd.DataFrame:
treetops_file = os.path.join(data_dir, 'treetops.gpkg')
return gpd.read_file(treetops_file) # FileNotFoundError will bubble up clearly
# Good: Use optional return types when files may legitimately not exist
def load_optional_config(config_path: str) -> Optional[dict]:
try:
with open(config_path) as f:
return json.load(f)
except FileNotFoundError:
return None # Explicit handling of expected case
# Avoid: Silent failures with existence checks
def process_annotations(data_dir: str) -> Optional[pd.DataFrame]:
treetops_file = os.path.join(data_dir, 'treetops.gpkg')
if os.path.exists(treetops_file):
return gpd.read_file(treetops_file)
return None # Silent failure makes debugging harder |
|
For reference on agents.md see here |
|
Let's add, 'always run test using uv sync --dev to get access to pytest and inspect the results', then I'd like to get this merged. |
386a5a9 to
e6daa3b
Compare
e6daa3b to
97dcb40
Compare
|
Moved the files to AGENTS.md. @bw4sz I added general install instructions ( |
97dcb40 to
c8e7cc5
Compare
Adds two copilot instructions (for core + tests) following guidance here: https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions
Should hopefully improve generated outputs + reduce our load fixing things like tests.