Skip to content

Commit e67aea6

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

File tree

1 file changed

+168
-0
lines changed

1 file changed

+168
-0
lines changed

AGENTS.md

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

0 commit comments

Comments
 (0)