Skip to content

Commit 85cb038

Browse files
committed
docs(claude): Rewrite CLAUDE.md in EARS format
Apply EARS (Easy Approach to Requirements Syntax) patterns to make guidelines clearer and more unambiguous: - Ubiquitous: "The assistant shall [action]" - Event-Driven: "When [trigger], the assistant shall [action]" - State-Driven: "While [state], the assistant shall [action]" - Optional: "Where [condition], the assistant shall [action]" - Unwanted: "If [condition], then the assistant shall [action]" This change improves clarity by explicitly stating conditions and expected behaviors using standardized requirement syntax.
1 parent 456318b commit 85cb038

File tree

1 file changed

+33
-31
lines changed

1 file changed

+33
-31
lines changed

.agents/rules/base.md

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,23 @@ repomix/
4747

4848

4949
# Coding Guidelines
50-
- Follow the Airbnb JavaScript Style Guide.
51-
- Always maintain feature-based directory structure and avoid dependencies between features.
52-
- Split files into smaller, focused units when appropriate:
53-
- Aim to keep code files under 250 lines. If a file exceeds 250 lines, split it into multiple files based on functionality.
54-
- Add comments to clarify non-obvious logic. **Ensure all comments are written in English.**
55-
- Provide corresponding unit tests for all new features.
56-
- After implementation, verify changes by running:
50+
51+
- The assistant shall follow the Airbnb JavaScript Style Guide.
52+
- The assistant shall maintain feature-based directory structure and avoid dependencies between features.
53+
- If a file exceeds 250 lines, then the assistant shall split it into multiple files based on functionality.
54+
- Where non-obvious logic exists, the assistant shall add comments in English to clarify.
55+
- When implementing new features, the assistant shall provide corresponding unit tests.
56+
- When implementation is complete, the assistant shall verify changes by running:
5757
```bash
5858
npm run lint # Ensure code style compliance
5959
npm run test # Verify all tests pass
6060
```
6161

6262
## Commit Messages
63-
- Follow the [Conventional Commits](https://www.conventionalcommits.org/) specification for all commit messages
64-
- Always include a scope in your commit messages
65-
- Format: `type(scope): Description`
63+
64+
- The assistant shall follow the [Conventional Commits](https://www.conventionalcommits.org/) specification for all commit messages.
65+
- The assistant shall always include a scope in commit messages.
66+
- The assistant shall use the format: `type(scope): Description`
6667
```
6768
# Examples:
6869
feat(cli): Add new --no-progress flag
@@ -72,18 +73,19 @@ repomix/
7273
refactor(core): Split packager into smaller modules
7374
test(cli): Add tests for new CLI options
7475
```
75-
- Types: feat, fix, docs, style, refactor, test, chore, etc.
76-
- Scope should indicate the affected part of the codebase (cli, core, website, security, etc.)
77-
- Description should be clear and concise in present tense
78-
- Description must start with a capital letter
76+
- The assistant shall use types: feat, fix, docs, style, refactor, test, chore, etc.
77+
- The assistant shall use scope to indicate the affected part of the codebase (cli, core, website, security, etc.).
78+
- The assistant shall write description in clear, concise present tense starting with a capital letter.
7979

8080
### Commit Body Guidelines
81-
- Include context about what led to this commit
82-
- Describe the conversation or problem that motivated the change
83-
- This helps preserve the decision-making process for future reference
81+
82+
- When writing commit body, the assistant shall include context about what led to this commit.
83+
- When writing commit body, the assistant shall describe the conversation or problem that motivated the change.
84+
- The assistant shall preserve the decision-making process for future reference.
8485

8586
## Pull Request Guidelines
86-
- All pull requests must follow the template:
87+
88+
- When creating a pull request, the assistant shall follow the template:
8789
```md
8890
<!-- Please include a summary of the changes -->
8991

@@ -92,18 +94,20 @@ repomix/
9294
- [ ] Run `npm run test`
9395
- [ ] Run `npm run lint`
9496
```
95-
- Include a clear summary of the changes at the top of the pull request description
96-
- Reference any related issues using the format `#issue-number`
97+
- When creating a pull request, the assistant shall include a clear summary of the changes at the top.
98+
- Where related issues exist, the assistant shall reference them using `#issue-number`.
9799

98100
## PR Review Guidelines
99-
When reviewing pull requests, provide thoughtful feedback on:
101+
102+
When reviewing pull requests, the assistant shall provide thoughtful feedback on:
100103
- Code quality and best practices
101104
- Potential bugs or issues
102105
- Suggestions for improvements
103106
- Overall architecture and design decisions
104107

105108
## Dependencies and Testing
106-
- Inject dependencies through a deps object parameter for testability
109+
110+
- The assistant shall inject dependencies through a deps object parameter for testability.
107111
- Example:
108112
```typescript
109113
export const functionName = async (
@@ -117,21 +121,19 @@ When reviewing pull requests, provide thoughtful feedback on:
117121
// Use deps.defaultFunction1() instead of direct call
118122
};
119123
```
120-
- Mock dependencies by passing test doubles through deps object
121-
- Use vi.mock() only when dependency injection is not feasible
124+
- When writing tests, the assistant shall mock dependencies by passing test doubles through deps object.
125+
- If dependency injection is not feasible, then the assistant shall use vi.mock().
122126

123127
## Generate Comprehensive Output
124-
- Include all content without abbreviation, unless specified otherwise
125-
- Optimize for handling large codebases while maintaining output quality
128+
129+
- The assistant shall include all content without abbreviation, unless specified otherwise.
130+
- The assistant shall optimize for handling large codebases while maintaining output quality.
126131

127132
# GitHub Release Note Guidelines
128-
When writing release notes, please follow these guidelines:
129133

130-
- When referencing issues or PRs, use the gh command to verify the content:
134+
- When writing release notes, the assistant shall reference issues or PRs using gh command to verify content:
131135
```bash
132136
gh issue view <issue-number> # For checking issue content
133137
gh pr view <pr-number> # For checking PR content
134138
```
135-
This helps ensure accuracy in release note descriptions.
136-
137-
Please retrieve and reference the latest release notes from `.github/releases/` as they contain past release examples.
139+
- When writing release notes, the assistant shall retrieve and reference the latest release notes from `.github/releases/` as they contain past release examples.

0 commit comments

Comments
 (0)