Skip to content

feat: 品質チェックコマンドのドキュメントを追加 - #69

Merged
keito4 merged 5 commits into
mainfrom
feat/quality-check-docs
Aug 1, 2025
Merged

feat: 品質チェックコマンドのドキュメントを追加#69
keito4 merged 5 commits into
mainfrom
feat/quality-check-docs

Conversation

@keito4

@keito4 keito4 commented Aug 1, 2025

Copy link
Copy Markdown
Owner

Summary

  • Claude Codeのコマンドドキュメントを追加しました
  • 開発品質向上のための各種チェックコマンドを文書化

追加したコマンド

  • /check-coverage - テストカバレッジの確認
  • /fix-ci - CI/CDエラーの修正
  • /pr-create - プルリクエストの作成
  • /quality-check - 品質ゲートチェック
  • /test-all - 全テストの実行
  • /update-deps - 依存関係の更新

Test plan

  • 各ドキュメントのMarkdown構文が正しいことを確認
  • コマンドの目的と手順が明確に記載されていることを確認

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added detailed guides for checking test coverage, handling CI failures, creating pull requests, performing quality checks, running all tests, and updating dependencies.
    • Enhanced the project initialization guide with additional notes and new mount points.
    • Included a new permission entry for allowed Bash commands and updated commit message linting rules.
    • All documents include step-by-step procedures, success criteria, troubleshooting tips, and standardized checklists to improve workflow consistency and code quality.

- check-coverageコマンドの追加
- fix-ciコマンドの追加
- pr-createコマンドの追加
- quality-checkコマンドの追加
- test-allコマンドの追加
- update-depsコマンドの追加

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 1, 2025

Copy link
Copy Markdown

Warning

Rate limit exceeded

@keito4 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 40 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 6d5a4e3 and 4b45e32.

📒 Files selected for processing (1)
  • .claude/commands/init-project.md (2 hunks)

Walkthrough

Several new markdown documents were added to the .claude/commands/ directory, each providing standardized procedures and checklists for key engineering workflows such as test coverage verification, CI failure handling, PR creation, dependency updating, project initialization, comprehensive testing, and quality checks. Some existing documentation was also updated for clarity.

Changes

Cohort / File(s) Change Summary
Test Coverage Documentation
.claude/commands/check-coverage.md
Introduces a detailed guide for verifying and maintaining test coverage standards, specifying coverage goals, critical paths, commands, troubleshooting, and improvement strategies.
CI Failure Handling
.claude/commands/fix-ci.md
Adds a procedural document for resolving CI failures within 24 hours, including error classification, local reproduction, targeted fixes, reporting, and troubleshooting steps.
PR Creation Workflow
.claude/commands/pr-create.md
Provides a checklist and workflow for creating pull requests, enforcing file/line limits, commit standards, issue linkage, and quality gates, with troubleshooting for common PR issues.
Comprehensive Testing
.claude/commands/test-all.md
Documents a unified procedure for running all test types, verifying coverage, and troubleshooting test failures or insufficient coverage.
Dependency Update Procedure
.claude/commands/update-deps.md
Adds a guide for updating dependencies, auditing vulnerabilities, handling major upgrades, verifying builds/tests, and resolving issues such as license conflicts or npm audit hangs.
Quality Check Workflow
.claude/commands/quality-check.md
Introduces a checklist for automated code quality checks: linting, formatting, type checking, vulnerability scanning, license verification, and SAST, with troubleshooting.
Project Initialization Update
.claude/commands/init-project.md
Updates documentation to clarify project re-initialization steps and adds three new mount points (~/.gitconfig, ~/.gitignore, ~/.config/gh/hosts.yml) for container setups. Also adds recommended Git commitlint config supporting Japanese commit messages and documents Conventional Commits format.
Configuration Update
.claude/settings.local.json
Adds a new allowed permission entry "Bash(git fetch:*)" to the list of permitted Bash commands.
Commitlint Configuration
commitlint.config.js
Disables the 'subject-case' rule for commit message subjects by setting its severity to 0, removing case enforcement.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant CommandsDoc
    participant CI
    participant Repo

    Developer->>CommandsDoc: Consults procedure (e.g., check-coverage, fix-ci)
    Developer->>Repo: Runs prescribed commands (tests, lint, audit, etc.)
    Repo-->>Developer: Returns results (coverage, errors, etc.)
    Developer->>CI: Pushes changes/fixes
    CI-->>Developer: Reports status (pass/fail)
    Developer->>CommandsDoc: Follows troubleshooting or reporting steps if needed
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

In burrows deep, with docs anew,
This rabbit hops to guide your crew.
With coverage, checks, and PR flair,
CI’s fixed with utmost care.
Dependencies fresh, tests run all night—
Our project’s future’s looking bright!
🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/quality-check-docs

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@keito4 keito4 self-assigned this Aug 1, 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: 2

🧹 Nitpick comments (11)
.claude/commands/init-project.md (1)

11-13: Consider clarifying “features” discovery & version-pinning

Stating “プロジェクト特有のfeaturesを追加” is helpful, but newcomers may not know where to find the Dev Container features registry or how to pin a specific version (e.g. "ghcr.io/devcontainers/features/node:1.0.1").
A quick link or example would remove that friction.

.claude/commands/test-all.md (1)

16-18: Clean coverage artifacts before each test stage

Running unit → component → E2E with separate --coverage flags may overwrite or erase the previous coverage data. Adding rm -rf coverage (or nyc --clean) before Step 2 and consolidating with --coverageDirectory ./coverage/unit etc. will guarantee that npm run coverage:report can merge correctly.

.claude/commands/quality-check.md (1)

32-46: Tighten vulnerability/SAST commands & performance

  • npm audit scans all deps including dev and is very noisy; npm audit --omit=dev --audit-level=high (or npm audit --production) drastically reduces false positives.
  • semgrep --config=auto pulls the entire default ruleset each run and may be slow; consider vendoring a curated .semgrep.yml to keep the signal high and runtime low, then reference it here.
.claude/commands/pr-create.md (2)

18-26: Default branch may be main, not master

Several hosted repos (including new GitHub projects) default to main. Replacing origin/master with $(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') or simply documenting “main/master” avoids confusion.


55-57: gh pr create multi-line body formatting & assignee syntax

  1. In most shells, \n inside a quoted string won’t render real newlines. Use a heredoc or --body-file.
  2. --assignee @me is invalid; use --assignee $(gh api user --jq .login) or omit the @.

Example:

gh pr create -t "feat: <summary>" \
  -b "$(cat <<'EOF'
Closes #<issue-number>

## 概要
...
EOF
)"
.claude/commands/fix-ci.md (1)

58-60: Prefer cache-safe rebuild over deleting node_modules

rm -rf node_modules package-lock.json discards the lockfile and risks supply-chain drift. Use npm ci --force or pnpm install --frozen-lockfile to reproduce the exact dependency tree while clearing cache problems.

.claude/commands/check-coverage.md (3)

1-1: Use the exact slash-command as the H1 heading for consistency

All other command docs in .claude/commands/ start their title with the actual slash command (e.g. /test-all).
Aligning this file avoids small UX frictions when scanning the directory.

-# check-coverage
+# /check-coverage

5-6: Reflect all coverage thresholds in the “目的” sentence

The “成功基準” section later introduces branch- and function-coverage targets, but the introduction only mentions line- and critical-path coverage. Stating all four KPIs up-front prevents readers from missing important constraints.

-テストカバレッジが全リポジトリ70%以上、クリティカルパス100%の基準を満たしているか確認する。カバレッジの詳細レポートを生成し、改善点を特定。
+テストカバレッジが「ライン70%以上・ブランチ60%以上・関数65%以上」、かつクリティカルパス100%という基準を満たしているか確認する。カバレッジの詳細レポートを生成し、改善点を特定。

30-39: Consider sourcing the critical-path list from a single JSON file

Hard-coding the echo statements means two places to update if the path list changes (here and .critical-paths.json).
A tiny refactor keeps the list DRY:

-echo "クリティカルパス:"
-echo "- 認証/認可関連機能"
-echo "- 決済処理"
-echo "- セキュリティ関連機能"
-echo "- データの保存/削除処理"
-echo "- エラーハンドリング"
+# jq -r '.[]' .critical-paths.json | sed 's/^/- /'

Readers immediately see the single source of truth and can maintain it in one place.

.claude/commands/update-deps.md (2)

79-80: Commit message: add a scope to follow the project’s Conventional Commits rule

Past learnings specify the <type>(<scope>): <subject> format.
Suggest adding a deps scope:

-git commit -m "chore: 依存関係を更新し脆弱性を修正"
+git commit -m "chore(deps): 依存関係を更新し脆弱性を修正"

110-112: Wrap the bare URL to satisfy markdownlint MD034

Markdownlint flags naked URLs; convert to an inline link:

-npmレジストリの状態を確認: https://status.npmjs.org/
+npmレジストリの状態を確認: <https://status.npmjs.org/>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 088e2de and 2857b95.

📒 Files selected for processing (7)
  • .claude/commands/check-coverage.md (1 hunks)
  • .claude/commands/fix-ci.md (1 hunks)
  • .claude/commands/init-project.md (2 hunks)
  • .claude/commands/pr-create.md (1 hunks)
  • .claude/commands/quality-check.md (1 hunks)
  • .claude/commands/test-all.md (1 hunks)
  • .claude/commands/update-deps.md (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
PR: keito4/config#0
File: .cursor/rules/commit.cursorrules:0-0
Timestamp: 2025-06-25T06:37:26.200Z
Learning: Commit messages must follow the Conventional Commits format: <type>(<scope>): <subject>, where type can be feat, fix, docs, refactor, etc.
🪛 markdownlint-cli2 (0.17.2)
.claude/commands/update-deps.md

112-112: Bare URL used

(MD034, no-bare-urls)

🔇 Additional comments (4)
.claude/commands/init-project.md (1)

61-62: Verify the necessity & security implications of mounting ~/.gitconfig / ~/.gitignore

  1. ~/.gitignore is not picked up by Git unless it’s referenced via core.excludesFile; consider mounting ~/.gitignore_global instead or documenting the required git-config line.
  2. ~/.gitconfig may contain user tokens/credentials. If you keep the mount, note that credential helpers or user.signingkey will also propagate to the container, which could be undesirable on shared CI machines.
.claude/commands/quality-check.md (1)

55-60: Add automated exit codes for quality gates

The success list is clear, but CI only fails if the underlying commands exit non-zero. Document flags such as:

npm run lint -- --max-warnings 0
npm audit --omit=dev --audit-level=high

so that failures propagate automatically.

.claude/commands/pr-create.md (1)

37-39: Script name mismatch with other docs

Here you call npm run quality:check, but .claude/commands/quality-check.md labels the command quality:report (Step 7). Align the script name to prevent copy-paste failures.

.claude/commands/fix-ci.md (1)

64-69: Use npm audit fix --omit=dev before --force

--force can silently introduce breaking major upgrades. Document running npm audit fix --omit=dev first, and resort to --force only after reviewing changelogs.

Comment on lines +32 to +36
npm ci
npm run test:all
npm run quality:check
npm run build
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Package-manager inconsistency (pnpm vs npm)

Earlier docs recommend pnpm; this section uses npm ci. Mixing tools can create divergent lockfiles and caches. Standardise on one (or note both variants).

🤖 Prompt for AI Agents
In .claude/commands/fix-ci.md around lines 32 to 36, the commands use `npm ci`
while earlier documentation recommends `pnpm`, causing inconsistency. Update
this section to use `pnpm install` or the equivalent pnpm commands consistently,
or clearly note both npm and pnpm variants to avoid divergent lockfiles and
caches.

Comment on lines +34 to +40
## 成功基準

- ✅ すべてのテストがグリーン(Pass)
- ✅ 全体の行カバレッジが70%以上
- ✅ クリティカルパスのカバレッジが100%
- ✅ カバレッジレポートが正常に生成される

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Document how the coverage thresholds are enforced in CI

You list “70 % overall / 100 % critical path” as success criteria, but nothing indicates the thresholds are codified (e.g. Jest coverageThreshold, Istanbul --check-coverage). Without automation the gate is manual and error-prone.

🤖 Prompt for AI Agents
In .claude/commands/test-all.md around lines 34 to 40, the document lists
coverage thresholds as success criteria but does not explain how these
thresholds are enforced automatically in CI. Add documentation describing the
specific configuration or commands used to enforce these coverage thresholds,
such as Jest's coverageThreshold settings or Istanbul's --check-coverage option,
to clarify how the coverage gate is automated and prevents manual errors.

github-actions Bot and others added 3 commits August 1, 2025 09:58
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
commitlintのsubject-caseルールが日本語の文字を大文字として認識し、
エラーになる問題を修正しました。

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- 日本語コミットメッセージでのsubject-caseエラーを回避する設定を明記
- Conventional Commitsの形式説明を追加
- 日本語での利用を前提とした推奨設定として記載

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

@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: 0

🧹 Nitpick comments (2)
.claude/commands/init-project.md (2)

11-13: Clarify what “features” means for first-time readers

Line 11 uses “features” without prior definition. In the DevContainer context this refers to Dev Container Features from the devcontainers/features registry. Consider adding a short parenthetical note or a link so newcomers understand exactly what they are expected to add.


65-102: Add language identifier to Conventional Commits example block

markdownlint flags the fence at Line 89 because no language is specified (MD040).
Minimal fix:

-```
+```gitcommit

Any identifier (gitcommit, console, plaintext) will satisfy the linter.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eae78ec and 6d5a4e3.

📒 Files selected for processing (1)
  • .claude/commands/init-project.md (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: keito4/config#0
File: .cursor/rules/commit.cursorrules:0-0
Timestamp: 2025-06-25T06:37:26.200Z
Learning: Commit messages must follow the Conventional Commits format: <type>(<scope>): <subject>, where type can be feat, fix, docs, refactor, etc.
📚 Learning: commit messages must follow the conventional commits format: (): , where type ...
Learnt from: CR
PR: keito4/config#0
File: .cursor/rules/commit.cursorrules:0-0
Timestamp: 2025-06-25T06:37:26.200Z
Learning: Commit messages must follow the Conventional Commits format: <type>(<scope>): <subject>, where type can be feat, fix, docs, refactor, etc.

Applied to files:

  • .claude/commands/init-project.md
🪛 markdownlint-cli2 (0.17.2)
.claude/commands/init-project.md

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

(MD040, fenced-code-language)

🔇 Additional comments (1)
.claude/commands/init-project.md (1)

61-64: Verify ~/.gitignore mount path

Git’s global ignore file is usually named ~/.gitignore_global (or any filename configured via git config --global core.excludesFile …). Mounting ~/.gitignore will have no effect unless users explicitly set core.excludesFile=~/.gitignore.
Please confirm the intended filename or update the docs accordingly.

以下の設定を追加しました:
- ESLint/Prettier設定
- Husky設定
- GitHub Actions CI設定
- package.jsonの推奨スクリプト
- .gitignore推奨設定
- VSCode推奨設定

CLAUDE.mdの品質基準に準拠した開発環境構築をサポート

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
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