Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions agents.md → AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,51 @@
3. **通知**: Claude エージェントが完了時に Slack へ通知(`CLAUDE.md` 参照)
4. **レポート作成**: 各コマンドのテンプレに従って Issue/PR コメントへ結果を貼り付ける

## 非冗長にして重複を排除する

### 目的

同じ知識/意図の複数実装を一本化し、矛盾と修正漏れを防ぐ。

### 適用場面

- 同一ロジックが3箇所以上で再実装
- マジックナンバー/リテラルが散在
- 類似ユーティリティ/ヘルパーの乱立

### 基本ルール

- 真実の所在は一箇所
- 定数・共通ロジックを共有点へ集約
- 使われないコードは削除

### 手順(最小リスク)

1. 重複箇所を洗い出し、唯一実装を決定
2. 参照側を順次置換(小さなPRで段階移行)
3. 旧実装を撤去し、テスト参照を一本化

### 測定指標(改善確認)

- 重複率↓、同義ヘルパー数↓
- 修正時の変更箇所数↓
- マジック値の出現回数↓

### アンチパターン

- 早すぎる共通化で可読性が下がる
- 巨大全能ヘルパーの作成

### 関連タグ(refactor)

`refactor:dedupe`, `refactor:simplify`(定数化・命名整理)

### コミット例

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

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).


## 参考ドキュメント

- `CLAUDE.md`: 品質基準、AI プロンプト設計ガイド、CI 連携
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ It includes settings for various tools, such as the shell (Zsh), Git, npm, and V
- **14 automated commands**: Code coverage checking, CI/CD troubleshooting, project initialization, pull request creation, quality checks, security reviews, test execution, dependency updates, and n8n MCP integration setup
- **Development quality standards**: Japanese-language guidelines for TDD methodology, static quality gates, Git workflow conventions, and AI-assisted development practices
- `.codex/`: Codex CLI configuration and agent distribution system with:
- **Agent Settings**: Centralized configuration for 13 specialized AI agents in `agents/AGENTS.md`
- **Agent Settings**: Centralized configuration for 13 specialized AI agents in `AGENTS.md`
- **Distribution Scripts**: Automated setup (`setup-agents.sh`), validation (`validate-agents.sh`), and synchronization (`sync-agents.sh`) tools
- **MCP Integration**: Configuration in `config.toml` for Model Context Protocol servers including Playwright and o3 search
- **Prompt Library**: Migrated prompts in `prompts/` directory with setup guides and automation workflows
- `.devcontainer/`: Development container configuration providing containerized development environment with consistent tooling across different machines.
- `brew/`: Contains Brewfiles for different operating systems (Linux, macOS) and dependency configurations, including lock files for reproducible package installations. Supports categorized package management and dependency analysis.
- `credentials/`: Contains templates and scripts for secure credential management using 1Password CLI integration.
- `docs/`: CLI tool setup guides (Japanese) for installing and configuring auxiliary tooling such as CodeRabbit CLI.
- `issues/`: Templates and helper notes for managing known issues and troubleshooting steps.
- `dot/`: Directory for dotfiles and configuration files that are typically placed in the home directory, including Zsh configuration with comprehensive aliases, functions, and environment setup.
- `git/`: Contains Git configuration files including gitconfig, gitignore, and modular configuration files in the `gitconfig.d/` subdirectory.
- `npm/`: Contains npm global package configuration.
Expand Down Expand Up @@ -148,12 +148,12 @@ Once installed, you can use the specialized agents in Claude Code:

#### Configuration Files

- **`~/.codex/agents/AGENTS.md`**: Complete agent documentation and usage instructions
- **`AGENTS.md`**: Complete agent documentation and usage instructions(セットアップ後は `~/.codex/AGENTS.md` に同期)
- **`~/.codex/config.json`**: Claude Code model configuration
- **`~/.codex/config.toml`**: MCP server integration settings (Playwright browser automation, o3 search, and other MCP services)
- **`~/.codex/scripts/`**: Maintenance and validation scripts

For detailed information about each agent and their capabilities, see the generated `~/.codex/agents/AGENTS.md` file after setup.
For detailed information about each agent and their capabilities, see `AGENTS.md`.

### Secure MCP Credential Configuration

Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
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.

coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'html'],
coverageThreshold: {
Expand Down