Skip to content

docs: align agent instructions and coverage config - #138

Merged
keito4 merged 2 commits into
mainfrom
fix/agent-docs-coverage
Nov 12, 2025
Merged

docs: align agent instructions and coverage config#138
keito4 merged 2 commits into
mainfrom
fix/agent-docs-coverage

Conversation

@keito4

@keito4 keito4 commented Nov 12, 2025

Copy link
Copy Markdown
Owner

Summary

  • document the non-duplication policy directly in agents.md for easier reuse
  • update README.md to reference the actual agents.md file, replace the non-existent docs/ directory description with issues/, and clarify where agent docs sync after setup
  • fix Jest coverage collection paths so scripts in script/ are tracked correctly

Testing

  • npm test

Summary by CodeRabbit

  • Documentation

    • Updated documentation structure and reorganized file references for improved navigation
    • Added new deduplication guidelines section with best practices and examples
  • Chores

    • Updated test coverage collection configuration

@coderabbitai

coderabbitai Bot commented Nov 12, 2025

Copy link
Copy Markdown

Walkthrough

Documentation and configuration restructuring: agent documentation path moved from .codex/agents/AGENTS.md to top-level AGENTS.md, jest coverage glob updated from scripts/ to script/, directory listing in README adjusted, and deduplication guidelines added to AGENTS.md.

Changes

Cohort / File(s) Change Summary
Documentation structure updates
README.md
Updated agent documentation reference from nested .codex/agents/AGENTS.md to top-level AGENTS.md; changed directory listing from docs/ to issues/; added script/ and vscode/ directories; updated Configuration Files section with new AGENTS.md reference and synchronization notes
Configuration updates
jest.config.js
Renamed coverage collection glob from scripts/**/*.js to script/**/*.js (singular path form) with corresponding exclusion adjustments
Agent documentation expansion
AGENTS.md
Added new section "非冗長にして重複を排除する" detailing deduplication guidelines with purpose, applicable scenarios, rules, steps, metrics, anti-patterns, related tags, and commit examples

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

These changes are primarily documentation and configuration updates with no logic modifications. Verification focuses on reference consistency and path accuracy across files.

Possibly related PRs

Poem

📚 From nested depths to the surface so bright,
Agents now rest at the top-level sight,
A script path refined with one letter's care,
Guidelines for dedupe—clear rules laid bare! 🐰✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly reflects the three main changes: documentation updates to agent instructions (AGENTS.md and README.md) and coverage configuration fix (jest.config.js).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/agent-docs-coverage

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.

@keito4 keito4 self-assigned this Nov 12, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d3814a0 and 8c65644.

📒 Files selected for processing (3)
  • README.md (2 hunks)
  • agents.md (1 hunks)
  • jest.config.js (1 hunks)
🔇 Additional comments (6)
agents.md (1)

37-81: Well-structured deduplication guidelines.

The new section provides clear, actionable guidance on eliminating code duplication with practical steps, metrics, and anti-patterns. The structure (purpose, application scenarios, rules, steps, metrics, anti-patterns, tags, examples) makes it easy to reference and apply.

README.md (5)

14-14: Agent documentation reference correctly updated.

The change from .codex/agents/AGENTS.md to agents.md accurately reflects the actual file location in the repository.


21-21: Directory documentation corrected.

Adding the issues/ directory and removing the non-existent docs/ directory accurately reflects the repository structure.


25-26: Script and VSCode directories documented.

The documentation now includes the script/ directory (which aligns with the Jest coverage path correction) and the vscode/ directory, providing a more complete view of the repository structure.


156-156: Agent documentation reference updated consistently.

The reference is correctly updated from AGENTS.md to agents.md to match the actual filename.


151-151: The review comment is incorrect—the sync mechanism referenced in the README is user-level, not repo-level.

The repository does not contain a .codex/setup-agents.sh or any repo-level script that syncs agents.md to ~/.codex/agents.md. The README accurately references ~/.codex/scripts/sync-agents.sh (lines 122, 125, 128) as user-initiated tools for end-users to optionally sync the agents documentation into their home directory. These are not part of the repository setup; they're documented features for users to run manually. The claim in line 151 that agents.md syncs "after setup" refers to user action, not automatic repository setup. There is nothing in the codebase to verify on this point.

Likely an incorrect or invalid review comment.

Comment thread jest.config.js
testEnvironment: 'node',
testMatch: ['**/test/**/*.test.js', '**/test/**/*.spec.js'],
collectCoverageFrom: ['scripts/**/*.js', '!scripts/**/*.test.js', '!scripts/**/*.spec.js'],
collectCoverageFrom: ['script/**/*.js', '!script/**/*.test.js', '!script/**/*.spec.js'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Coverage path correctly updated to match directory structure.

The change from scripts/ to script/ aligns with the documented directory structure in README.md (line 25).

Verify that the script/ directory exists and contains JavaScript files:


🏁 Script executed:

#!/bin/bash
# Description: Verify script/ directory exists and contains .js files that should be tracked for coverage

# Check if script/ directory exists
if [ -d "script" ]; then
  echo "✓ script/ directory exists"
  
  # List all .js files in script/ (excluding test files)
  echo ""
  echo "JavaScript files in script/:"
  fd -e js -E '*.test.js' -E '*.spec.js' . script/
else
  echo "✗ script/ directory not found"
  exit 1
fi

# Check if scripts/ directory exists (old path)
if [ -d "scripts" ]; then
  echo ""
  echo "⚠ Warning: scripts/ directory still exists (should be removed or renamed)"
fi

Length of output: 56



🏁 Script executed:

#!/bin/bash
# Comprehensive verification of directory structure and documentation

echo "=== Checking script/ directory contents ==="
if [ -d "script" ]; then
  echo "✓ script/ exists"
  find script -type f -name "*.js" | head -20
else
  echo "✗ script/ not found"
fi

echo ""
echo "=== Checking scripts/ directory (old path) ==="
if [ -d "scripts" ]; then
  echo "✓ scripts/ exists"
  find scripts -type f -name "*.js" | head -20
else
  echo "✗ scripts/ not found"
fi

echo ""
echo "=== Checking README.md line 25 context ==="
if [ -f "README.md" ]; then
  sed -n '20,30p' README.md
else
  echo "README.md not found"
fi

echo ""
echo "=== Current jest.config.js collectCoverageFrom ==="
grep -A 1 "collectCoverageFrom" jest.config.js

Length of output: 1571


jest.config.js coverage pattern is broken — script/ contains shell scripts, not JavaScript files.

The directory rename from scripts/ to script/ is correct per README.md documentation. However, the jest coverage pattern searches for *.js files while the script/ directory contains only shell scripts (.sh): export.sh, import.sh, commit_changes.sh, credentials.sh, brew-deps.sh, version.sh, update-libraries.sh. The coverage glob will match zero files.

Either remove the script/**/*.js pattern from collectCoverageFrom if shell scripts shouldn't be covered, or correct the configuration if JavaScript files should exist in this directory.

🤖 Prompt for AI Agents
In jest.config.js around line 4, the collectCoverageFrom glob 'script/**/*.js'
targets JavaScript files but the script/ folder contains only shell scripts, so
the pattern matches nothing; either remove the 'script/**/*.js' pattern from
collectCoverageFrom (if shell scripts shouldn't be covered) or replace it with
the correct glob for JS files in the intended directory (e.g., 'scripts/**/*.js'
if the directory should be scripts/), then run tests to confirm coverage is
collected as expected.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8c65644 and e111379.

📒 Files selected for processing (2)
  • AGENTS.md (1 hunks)
  • README.md (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
AGENTS.md

78-78: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (1)
AGENTS.md (1)

37-76: Documentation section well-structured and aligns with PR objective.

The new "非冗長にして重複を排除する" section comprehensively documents the deduplication policy with clear guidance on purpose, applicable scenarios, rules, procedure, metrics, anti-patterns, and related tags. This directly fulfills the PR objective to document the policy in AGENTS.md for easier reuse across the project.

Placement after "Codex コマンド連携" and before "参考ドキュメント" is logical and maintains document flow.

Comment thread AGENTS.md
Comment on lines +78 to +80
```
refactor:dedupe date range handling across billing/reporting
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Specify language identifier for fenced code block.

The code block lacks a language identifier. Per Markdown best practices and markdownlint (MD040), add a language specifier (e.g., text, shell, or diff if the example follows Git diff format).

-```
+```text
 refactor:dedupe date range handling across billing/reporting
-```
+```
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

78-78: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In AGENTS.md around lines 78 to 80 the fenced code block lacks a language
identifier; update the opening fence to include a language (for example "text",
"diff", or "shell") so markdownlint MD040 is satisfied and syntax highlighting
is clearer (e.g., change ``` to ```text or ```diff depending on intent).

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.

1 participant