Skip to content

Conversation

@yamadashy
Copy link
Owner

Apply EARS (Easy Approach to Requirements Syntax) patterns to CLAUDE.md to make guidelines clearer and more unambiguous.

EARS Patterns Used

Pattern Keyword Usage
Ubiquitous (none) The assistant shall [action]
Event-Driven When When [trigger], the assistant shall [action]
Optional Where Where [condition], the assistant shall [action]
Unwanted If-Then If [condition], then the assistant shall [action]

Changes

  • Coding Guidelines: Rewritten with EARS patterns
  • Commit Messages: Rewritten with EARS patterns
  • Pull Request Guidelines: Rewritten with EARS patterns
  • PR Review Guidelines: Rewritten with EARS patterns
  • Dependencies and Testing: Rewritten with EARS patterns
  • Generate Comprehensive Output: Rewritten with EARS patterns
  • GitHub Release Note Guidelines: Rewritten with EARS patterns

Reference

Checklist

  • Run npm run test
  • Run npm run lint

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.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 7, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The PR rewrites guideline statements in the agent rules documentation from imperative to prescriptive "shall" style, standardizing language and formatting throughout the guidelines without introducing any functional code changes.

Changes

Cohort / File(s) Summary
Agent Guidelines Documentation
​.agents/rules/base.md
Rewrites guideline items to prescriptive "shall" style; reformats statements for consistency without changing functional behavior

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the main change: rewriting documentation in EARS format.
Description check ✅ Passed The description is comprehensive, includes the required checklist items (both checked), explains EARS patterns used, and details all sections modified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @yamadashy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the CLAUDE.md documentation by applying the Easy Approach to Requirements Syntax (EARS) patterns. The primary goal is to enhance the clarity and reduce ambiguity across various guidelines, including coding standards, commit messages, pull request procedures, review processes, dependency management, output generation, and release note creation. This change aims to make the documentation more precise and easier to understand for all contributors.

Highlights

  • Coding Guidelines: Rewritten to use EARS (Easy Approach to Requirements Syntax) patterns, explicitly stating actions the assistant 'shall' take for clarity.
  • Commit Messages: Updated to apply EARS patterns, detailing rules for format, types, scope, and body instructions for commit messages.
  • Pull Request Guidelines: Reframed with EARS patterns for submitting pull requests, including requirements for summaries and referencing related issues.
  • PR Review Guidelines: Converted to EARS patterns, specifying areas where the assistant 'shall' provide thoughtful feedback during reviews.
  • Dependencies and Testing: Guidelines for dependency injection and mocking in tests now follow EARS patterns, clarifying when and how to use them.
  • Comprehensive Output Generation: Rules for generating comprehensive output are now expressed using EARS patterns, emphasizing inclusion of all content and optimization for large codebases.
  • GitHub Release Note Guidelines: Rewritten with EARS patterns for improved specificity when referencing issues/PRs and using past release examples.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov
Copy link

codecov bot commented Dec 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.38%. Comparing base (456318b) to head (2872993).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #997   +/-   ##
=======================================
  Coverage   90.38%   90.38%           
=======================================
  Files         110      110           
  Lines        7890     7890           
  Branches     1528     1528           
=======================================
  Hits         7131     7131           
  Misses        759      759           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 7, 2025

Deploying repomix with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2872993
Status: ✅  Deploy successful!
Preview URL: https://3f84d69d.repomix.pages.dev
Branch Preview URL: https://chore-ears.repomix.pages.dev

View logs

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully refactors the agent guidelines in .agents/rules/base.md to use the EARS (Easy Approach to Requirements Syntax) format, which makes the rules clearer and more unambiguous. The application of EARS patterns is consistent and well-executed.

I have two minor suggestions to further improve the document's clarity and structure. One is to rephrase an introductory sentence in the PR review guidelines to make it a complete statement. The other is to remove a requirement from the commit body guidelines that is more of a goal statement than an actionable instruction.

Please also note that the pull request title and description refer to CLAUDE.md, but the changes are in .agents/rules/base.md. It would be helpful to update them for accuracy.


- When writing commit body, the assistant shall include context about what led to this commit.
- When writing commit body, the assistant shall describe the conversation or problem that motivated the change.
- The assistant shall preserve the decision-making process for future reference.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This requirement seems to state the goal of the previous two requirements rather than being a distinct action for the assistant. The original text was an explanation (This helps preserve...). As a requirement, it's abstract and could be confusing for an AI. Consider removing it to make the guidelines more direct and actionable, as the previous two points already cover how to achieve this goal.

## PR Review Guidelines
When reviewing pull requests, provide thoughtful feedback on:

When reviewing pull requests, the assistant shall provide thoughtful feedback on:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This introductory sentence is incomplete and relies on the following list, which doesn't strictly follow the EARS format where each requirement should be a self-contained statement. To improve this while avoiding repetition, you could rephrase this line to be a complete sentence that introduces the list.

Suggested change
When reviewing pull requests, the assistant shall provide thoughtful feedback on:
When reviewing pull requests, the assistant shall provide thoughtful feedback on the following topics:

@claude
Copy link
Contributor

claude bot commented Dec 7, 2025

Code Review: EARS Format Documentation Update

Thank you for implementing EARS (Easy Approach to Requirements Syntax) patterns in the documentation. This is a valuable improvement that enhances clarity and reduces ambiguity. Here's my comprehensive review:

Strengths

Well-executed EARS implementation
  • Consistent Pattern Application: The conversion to EARS patterns is applied systematically across all sections
  • Improved Clarity: Using "The assistant shall" removes ambiguity about who performs actions
  • Better Traceability: Each requirement is now clearly identifiable and testable
  • Proper Use of EARS Keywords: Good application of If-Then, When, and Where patterns for conditional requirements

🔍 Areas for Consideration

1. EARS Pattern Consistency

Details

While most guidelines follow EARS well, consider these refinements:

  • Line 53: "If a file exceeds 250 lines, then the assistant shall..." - This correctly uses the Unwanted pattern
  • Line 54: "Where non-obvious logic exists..." - Good use of Optional pattern
  • Line 55-56: "When implementing..." and "When implementation is complete..." - Excellent Event-Driven patterns

However, some guidelines could benefit from more specific trigger conditions. For example, the commit body guidelines could specify:

  • "When a commit involves architectural decisions, the assistant shall include rationale in the body"
  • "When a commit fixes a bug, the assistant shall reference the issue number in the body"

2. Missing Context Preservation

Details

The original documentation mentioned that commit bodies help "preserve the decision-making process for future reference." The EARS version maintains this but could be more explicit:

Consider: "The assistant shall preserve the decision-making process for future reference by documenting alternatives considered and reasons for rejection"

3. Potential Grammar Enhancement

Details

Line 81: "When writing commit body" could be "When writing a commit body" or "When writing the commit body" for better grammatical flow. This applies to lines 81-82.

🚀 Suggestions for Enhancement

Additional EARS patterns to consider
  1. Complex State Pattern: For scenarios with multiple conditions

    • Example: "While in PR review mode, if critical issues are found, then the assistant shall prioritize security concerns over style issues"
  2. More Specific Triggers:

    • Instead of: "When implementing new features..."
    • Consider: "When implementing new features that introduce external dependencies..."
  3. Negative Requirements: Consider adding what the assistant shall NOT do

    • Example: "The assistant shall NOT merge PRs without running tests"

🔒 Security & Risk Analysis (Premortem)

Potential failure scenarios and mitigations
  1. Risk: Overly rigid interpretation of EARS patterns might lead to less helpful responses

    • Mitigation: The current implementation strikes a good balance - no action needed
  2. Risk: New contributors unfamiliar with EARS might find the documentation harder to understand initially

    • Mitigation: Consider adding a brief EARS primer link at the top of the document (you've already included a reference, which is good)
  3. Risk: Automated tools or AI assistants might struggle with natural language requirements

    • Mitigation: The structured format actually helps AI systems - this is a benefit, not a risk

Verification

  • The PR follows conventional commit format: docs(claude): Rewrite CLAUDE.md in EARS format
  • Tests and linting have been run as per the checklist
  • No breaking changes introduced (documentation only)

📊 Overall Assessment

This is a high-quality documentation improvement that enhances clarity without introducing risks. The EARS format makes requirements testable and unambiguous, which is particularly valuable for AI assistant guidelines.

Recommendation: ✅ Approve with minor suggestions

The changes are ready to merge. The minor suggestions above are optional enhancements that could be addressed in a follow-up PR if desired.


Generated with Claude Code assistance following the repository's review guidelines

- Remove abstract requirement about preserving decision-making process
  (covered by previous two requirements)
- Make PR review guideline sentence self-contained by adding "the following topics"
@claude
Copy link
Contributor

claude bot commented Dec 7, 2025

Code Review: Additional Observations

I've reviewed PR #997 and the EARS format implementation. Building on the previous reviews by CodeRabbit and Gemini, here are some additional observations:

✅ Improvements Successfully Achieved

The transformation to EARS format brings immediate benefits:

  • Testability: Each requirement is now verifiable with clear subject ("The assistant") and action ("shall")
  • Consistency: Uniform structure across all guidelines eliminates interpretation ambiguity
  • Pattern Application: Appropriate use of EARS patterns (Ubiquitous, Event-Driven, Optional, Unwanted)

📝 Additional Suggestions Not Previously Mentioned

1. File Path Discrepancy

The PR title and description reference "CLAUDE.md" but the actual changes are in .agents/rules/base.md. Consider updating the PR title to:

docs(agents): Rewrite agent rules in EARS format

2. Missing Original Intent Preservation

Line 83 removed an important clarification: "This helps preserve the decision-making process for future reference."

Consider restoring this as:

- When writing commit body, the assistant shall describe the conversation or problem that motivated the change to preserve the decision-making process for future reference.

3. Grammar Consistency

Lines 82-83 use "commit body" without an article. For consistency with other sections:

  • Change to: "When writing a commit body" or "When writing the commit body"

4. Potential Future Enhancement: Priority Levels

Consider adding RFC 2119 keywords (MUST, SHOULD, MAY) for requirement prioritization in a future iteration:

  • "The assistant MUST follow Conventional Commits" (mandatory)
  • "The assistant SHOULD keep files under 250 lines" (recommended)
  • "The assistant MAY add explanatory comments" (optional)

🔍 Risk Analysis

Low Risk Changes: Documentation-only update with no runtime impact. The structured format actually reduces risk of misinterpretation.

✅ Verification Complete

  • Changes are confined to documentation
  • No breaking changes introduced
  • Tests and linting confirmed as passing

Recommendation: Approve - The EARS implementation is well-executed and improves documentation clarity. The minor suggestions above are optional enhancements.


Review conducted following repository PR review guidelines

@yamadashy yamadashy merged commit 755e5a4 into main Dec 7, 2025
54 checks passed
@yamadashy yamadashy deleted the chore/ears branch December 7, 2025 08:17
@yamadashy yamadashy restored the chore/ears branch December 7, 2025 08:17
@yamadashy yamadashy deleted the chore/ears branch December 7, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants