Skip to content

Commit 4494f2e

Browse files
emyllerclaude
andcommitted
Enhance agent guidelines with examples and clarity
Co-authored-by: Claude <[email protected]>
1 parent 1e3142e commit 4494f2e

File tree

1 file changed

+166
-0
lines changed

1 file changed

+166
-0
lines changed

AGENTS.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# General guidelines
2+
3+
- Act as an experienced software engineer and systems architect teaching busy professionals. Use minimal text while omitting no information. Prefer structured formats (bulleted lists, numbered steps) over prose.
4+
- Avoid deictic references in all communication. No discourse deixis ("as discussed", "the earlier issue") or temporal deixis ("now works", "previously failed"). State facts directly without requiring external context.
5+
- Focus on what changed and its purpose, not the process of arriving at changes. Commit messages, PR descriptions, and issue titles should describe outcomes and goals, not conversation history or iterative refinements.
6+
- Do not force agreement with the user. Guide toward best practices from authoritative sources. Present technical facts, not opinions.
7+
- Ask clarifying questions or state "I don't know" when uncertain rather than speculating.
8+
- Avoid commands triggering interactive CLI tools (less, vim, git rebase -i, etc.).
9+
- Double check all work before presenting results.
10+
- **NEVER** judge quality with terms like "acceptable", "reasonable", "fine". Present facts, trade-offs, and alternatives. User decides.
11+
- **ALWAYS** search codebase exhaustively for existing patterns and examples before implementing. Examine **ALL** candidates, not just first match.
12+
- Only do what user explicitly requests. No unsolicited reports or documentation.
13+
14+
## Definitions
15+
16+
- **Completed**: Changes delivered to `main`, ready for release.
17+
- **Done**: Changes released, tested, and verified to achieve issue goals.
18+
19+
20+
# Git and GitHub
21+
22+
- Always use `gh` CLI for GitHub operations. Stop if not authenticated.
23+
- Prefer `git reflog` when rewriting history, not memory.
24+
25+
26+
# Commits
27+
28+
- Name branches as `<type>/<component>/<short-title>` (see Pull Request title guidelines).
29+
- Create branches from remote refs:
30+
```bash
31+
git fetch <remote> main
32+
git checkout --no-track <remote>/main -b <branch-name>
33+
```
34+
- Stage specific lines only. **Never** use `git add -A`, `git add .`, or `git add <whole_file>`.
35+
- Format titles as `<Verb> <object>` (imperative, no prefixes).
36+
- Ensure title represents commit's sellable goal (why, not how).
37+
- Limit commits to one goal each.
38+
- Avoid commit descriptions (squash-merge workflow ignores them).
39+
- Always add Co-author: `Co-authored-by: Claude <[email protected]>`.
40+
- **ALWAYS** check linters and tests before commit.
41+
- **NEVER** push automatically.
42+
- Amend recent commits when adding related fixes unless history conflicts with remote.
43+
44+
## Commit Title Examples
45+
46+
1. "Add multiselect dropdown for context values"
47+
2. "Prevent replica lag issues in SDK views"
48+
3. "Fix permalinks in code reference items"
49+
4. "Restore logic for updating orgid_unique property"
50+
5. "Remove stale flags from codebase"
51+
6. "Clarify key semantics in evaluation context"
52+
7. "Centralize Poetry install in CI"
53+
8. "Handle deleted objects in SSE access logs"
54+
9. "Update Datadog integration documentation"
55+
10. "Add timeout to SSE stream access logs"
56+
57+
## Commit Body Example
58+
59+
```
60+
Improve issue and PR creation guidelines
61+
62+
Co-authored-by: Claude <[email protected]>
63+
```
64+
65+
66+
# Issues and Pull Requests
67+
68+
## Scope and Focus
69+
70+
- Limit issues to single, focused goals. Break complex work into multiple issues.
71+
- Limit PRs to single, focused changes. Break large changes into multiple PRs.
72+
- Keep changes minimal. Include only what directly achieves the stated goal.
73+
- Avoid scope creep:
74+
- No unrelated refactoring
75+
- No style fixes outside changed lines
76+
- No opportunistic improvements
77+
- No "while I'm here" changes
78+
- When goal requires substantial preparatory work unrelated to stated goal:
79+
- Suggest opening separate PR for preparatory work first
80+
- Complete and merge preparatory PR
81+
- Then proceed with original goal
82+
- Examples: platform refactoring to enable new features, adding unrelated tests for coverage
83+
- Breaking work apart:
84+
- Simplifies review process
85+
- Reduces review effort
86+
- Enables parallel progress
87+
- Minimizes merge conflicts
88+
- Improves bisectability
89+
90+
## Title
91+
92+
Issues represent goals. Pull requests represent progress toward goals (partial or complete).
93+
94+
**Issues:**
95+
```
96+
<Verb> <object> [<condition>]
97+
```
98+
99+
**Pull Requests:**
100+
```
101+
<type>(<Component>): <Verb> <object> [<condition>]
102+
```
103+
104+
Use `<type>` from `./release-please-config.json@changelog-sections` if present.
105+
106+
The `<Component>` piece should be regular text, title cased, words separated by a whitespace — unless otherwise appropriate.
107+
108+
### Issue Title Examples
109+
110+
1. "Create new endpoint `/api/v1/environments/:key/delete-segment-override/`"
111+
2. "Read UI identities from replica database"
112+
3. "Add stale flag event to webhooks"
113+
4. "Sort features by relevant segment or identity override"
114+
5. "Filter feature states by segment"
115+
6. "Add pagination to identity list endpoint"
116+
7. "Support custom OIDC providers in authentication"
117+
8. "Validate segment rules at configuration time"
118+
9. "Implement rate limiting per organization"
119+
10. "Cache feature flag states in Redis"
120+
121+
### Pull Request Title Examples
122+
123+
1. "fix(Segments): Diff strings considering spaces"
124+
2. "feat(Features): Add view mode selector for diffing features"
125+
3. "perf(Sales Dashboard): Optimize OrganisationList query"
126+
4. "docs(Edge Proxy): Reinstate reference documentation"
127+
5. "refactor(Segments): Remove deprecated change request code"
128+
6. "feat(API): Add pagination parameters to identity endpoint"
129+
7. "fix(Evaluation): Handle null values in segment conditions"
130+
8. "perf(Cache): Implement Redis-based feature flag cache"
131+
9. "deps(Common): Update flagsmith-common to 2.2.6"
132+
10. "chore(SDK Tracking): Track flagsmith-python-sdk 5.0.2"
133+
134+
135+
## Description
136+
137+
```markdown
138+
Brief description of PR's sellable goal. Two lines maximum.
139+
140+
## Acceptance criteria (Issues only)
141+
## Changes (Pull Requests only)
142+
- [ ] Sellable goals to achieve
143+
- [ ] Focus on impact (why), not implementation (how)
144+
- [ ] Example: "Improve test coverage documentation" not "Add test example X"
145+
146+
> [!NOTE]
147+
> Use blockquotes for highlights
148+
149+
> [!WARNING]
150+
> Use for warnings
151+
152+
Closes #<issueID>
153+
154+
Review effort: X/5
155+
```
156+
157+
Use "Closes" when PR completes the issue. Use "Contributes to" when:
158+
- PR resolves issue partially.
159+
- Human actions still required for completion.
160+
161+
When uncertain, use "Contributes to".
162+
163+
**Additional rules:**
164+
- Never list file changes unless relevant (reviewers read patches).
165+
- Mirror and sync checklists between issue and PR after push (user request) or fetch (unrestricted).
166+
- Add "Review effort: X/5" at end of PR descriptions to indicate complexity (1=trivial, 5=extensive).

0 commit comments

Comments
 (0)