Skip to content

Commit 7d7bc63

Browse files
committed
start agents.md to guide coding assistants
1 parent c1add09 commit 7d7bc63

File tree

4 files changed

+663
-0
lines changed

4 files changed

+663
-0
lines changed
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Check Dependency Update PRs
2+
3+
You are helping review unmerged dependency update PRs (from Dependabot or manual updates). Follow these steps:
4+
5+
## 1. Find Dependency PRs
6+
7+
If the user provides specific PR number(s), use those. Otherwise, automatically find ALL recent **unmerged** dependency PRs:
8+
9+
- Run `gh pr list --repo mozilla/fx-private-relay --state open --limit 30 --json number,title,author` to get open PRs
10+
- Filter for PRs with patterns: "build(deps)", "bump", "update", or authored by "dependabot"
11+
- Process ALL matching dependency PRs found (not just one)
12+
- **IMPORTANT**: Only check OPEN/UNMERGED PRs - do NOT check merged dependency PRs
13+
- If no open dependency PRs are found, inform the user
14+
15+
## 2. Process Each PR
16+
17+
For EACH dependency PR found, follow these steps:
18+
19+
### 2.1 Fetch PR Information
20+
21+
Run in parallel:
22+
23+
- `gh pr view <PR_NUMBER> --json title,body,files`
24+
- Extract from PR body and title:
25+
- Dependency name(s)
26+
- Current version(s)
27+
- New version(s)
28+
- Version range (all versions between current → new)
29+
30+
### 2.2 Identify Dependency Type
31+
32+
Based on the changed files:
33+
34+
- **Python dependencies**: `requirements.txt`, `pyproject.toml`, `Pipfile`
35+
- **JavaScript/Node**: `package.json`, `package-lock.json`, `yarn.lock`
36+
- **Other**: `Gemfile`, `Cargo.toml`, etc.
37+
38+
### 2.3 Find Changelog/Release Notes
39+
40+
Try multiple sources in order:
41+
42+
1. **PR body**: Look for "Release notes" or "Changelog" links in Dependabot PR description
43+
2. **GitHub releases**: Check for links or try `https://github.com/{org}/{repo}/releases`
44+
3. **CHANGELOG file**: Common locations:
45+
- `https://raw.githubusercontent.com/{org}/{repo}/{branch}/CHANGELOG.md`
46+
- `https://raw.githubusercontent.com/{org}/{repo}/{branch}/CHANGELOG.rst`
47+
- `https://raw.githubusercontent.com/{org}/{repo}/{branch}/CHANGES.md`
48+
- Try branches: `main`, `master`, `develop`
49+
4. **Package registry**: npm, PyPI, etc. may have release notes
50+
51+
**Special case - boto3/botocore**:
52+
53+
- These have VERY large changelogs that must be fetched incrementally
54+
- URL: `https://raw.githubusercontent.com/boto/boto3/develop/CHANGELOG.rst`
55+
- Use curl with head/tail to fetch 20-30 lines at a time
56+
- Continue fetching until you find all versions in the update range
57+
- Extract only the relevant version entries
58+
59+
For other large changelogs, fetch incrementally (20-30 lines at a time) until you find all relevant version entries.
60+
61+
### 2.4 Analyze Codebase Usage
62+
63+
Search the codebase to understand how the dependency is used:
64+
65+
**For Python packages**:
66+
67+
- Search for import statements: `from {package}` or `import {package}`
68+
- Check for specific class/function usage patterns
69+
- Look in configuration files for related settings
70+
71+
**For JavaScript packages**:
72+
73+
- Search for import statements: `import ... from '{package}'` or `require('{package}')`
74+
- Check for specific API usage patterns
75+
- Look in config files for related settings
76+
77+
**For specific dependency types**:
78+
79+
- **AWS/boto3/botocore**:
80+
- Search for boto3 client/resource usage patterns
81+
- Check privaterelay/settings.py for AWS\_\* configuration
82+
- Known services in Relay: SES (email sending), S3 (storage), SQS (queue), SNS (notifications)
83+
- Focus ONLY on changes to these specific AWS services
84+
- **Testing libraries**: Find test files and usage patterns
85+
- **Build tools**: Check build scripts and configurations
86+
- **UI libraries**: Search for component imports and usage
87+
88+
### 2.5 Cross-reference Changes with Usage
89+
90+
For each changelog entry in the version range:
91+
92+
- Identify if it affects features/APIs used in the codebase
93+
- Categorize as:
94+
- **⚠️ Breaking changes**: Require code updates
95+
- **🔧 Important**: Bug fixes or deprecations affecting used features
96+
- **✨ Relevant**: New features or improvements to used functionality
97+
- **ℹ️ Not relevant**: Changes to unused features/services
98+
99+
## 3. Provide Summary
100+
101+
For EACH PR, provide a structured summary:
102+
103+
### PR #{number}: {dependency_name}
104+
105+
#### Version Update
106+
107+
- Current: `v{old}`
108+
- New: `v{new}`
109+
- [Link to full changelog/releases]
110+
111+
#### Codebase Usage
112+
113+
- Brief description of how the dependency is used
114+
- Key files/locations where it's imported or configured
115+
116+
#### Relevant Changes
117+
118+
For each version in the range, list:
119+
120+
- Version number and date
121+
- Changes that affect your codebase (with severity indicator)
122+
- Direct quotes from changelog for important items
123+
124+
#### Changes Not Affecting Your Code
125+
126+
Brief summary of other changes in the version range that don't affect used features.
127+
128+
#### Risk Assessment
129+
130+
- **Low/Medium/High risk** classification
131+
- Specific concerns or action items (if any)
132+
- Test areas to focus on
133+
- ✅/⚠️ Recommendation on whether to merge
134+
135+
---
136+
137+
## 4. Final Summary
138+
139+
After reviewing all PRs, provide a brief overview:
140+
141+
- Total PRs reviewed
142+
- High-risk updates (if any)
143+
- Recommended merge order (if applicable)
144+
- Overall assessment
145+
146+
## Tips
147+
148+
- Process PRs concurrently when possible for efficiency
149+
- Be concise and actionable - focus on what matters to this codebase
150+
- If changelog is unavailable or unclear, state this explicitly
151+
- For patch versions (x.x.X), typically focus on bug fixes
152+
- For minor versions (x.X.x), look for new features and deprecations
153+
- For major versions (X.x.x), carefully check for breaking changes
154+
- Include relevant links so the team can dig deeper if needed
155+
- For boto3/botocore, be especially careful to filter to only the AWS services actually used by Relay

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ gcp_key.json
2222
version.json
2323
docs/api_schema.yaml
2424
docs/api_docs.html
25+
26+
.claude/settings.local.json

CLAUDE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Agent Lightbeam - Project Context
2+
3+
This file is automatically loaded by Claude Code.
4+
5+
@agents.md

0 commit comments

Comments
 (0)