Loading...
Loading...
Coding rules generator — Extract and generate coding-rules.md from project conventions. Scans CLAUDE.md, AGENTS.md, config files, existing source code, and installed skills to produce a unified coding-rules.md that spec-implement uses as a quality gate. English triggers: "Generate coding rules", "Create coding-rules.md", "Extract project rules" 日本語トリガー: 「コーディングルールを生成」「coding-rules.mdを作成」「プロジェクトルールを抽出」
npx skill4agent add anyoneanderson/agent-skills spec-rules-initcoding-rules.mdreferences/rules-template.ja.mdreferences/rules-template.mdpwd
ls -la# Convention files
ls CLAUDE.md src/CLAUDE.md AGENTS.md test/CLAUDE.md 2>/dev/null
ls -d .claude/ 2>/dev/null
# Config files
ls package.json go.mod requirements.txt Cargo.toml 2>/dev/null
ls .eslintrc* biome.json tsconfig.json .prettierrc* 2>/dev/nullfind . -maxdepth 3 -type f \( -name "*.ts" -o -name "*.js" -o -name "*.py" -o -name "*.go" -o -name "*.java" -o -name "*.rs" \) 2>/dev/null | head -30ls ~/.claude/skills/*/SKILL.md .claude/skills/*/SKILL.md 2>/dev/nullfind . -name "coding-rules.md" -type f 2>/dev/null| File | Content to Extract | Priority |
|---|---|---|
| Project-wide rules | High |
| Source-specific rules | High |
| Agent-oriented rules | High |
| Project settings | Medium |
| lint/test script presence | Medium |
| Test-specific rules | Medium |
| Lint rules | Low |
| TypeScript strict settings | Low |
| Format settings | Low |
[MUST][SHOULD][MAY][MUST]modules/{feature}/controllers/services/tests/src/[MUST][SHOULD]package.jsongo.modrequirements.txt[SHOULD][SHOULD] Use Prisma Client for all DB access[SHOULD] Use Zod for runtime validation./@/utils/helpers/lib/shared/common/Detected shared utilities and libraries:
Internal: utils/logger.ts, lib/validation.ts, helpers/date.ts
External: Zod (validation), Prisma (DB), date-fns (dates)[SHOULD][SHOULD] Use lib/validation.ts for input validation[SHOULD] Use Zod for runtime validation[SHOULD] Use utils/logger.ts instead of console.log[MUST][SHOULD]~/.claude/skills/.claude/skills/SKILL.md| Project Tech | Matching Keywords |
|---|---|
| Next.js | |
| NestJS | |
| React | |
| Go | |
| Python | |
question: "The following installed skills were detected. Use them for rule extraction?" / "以下のインストール済みスキルが検出されました。ルール抽出に使用しますか?"
header: "Skills"
multiSelect: true
options:
- "{skill-name} — {description} (Recommended)" / "{skill-name} — {説明}"[SHOULD][MAY]Source: skill/{skill-name}"Matching skills may be available on skills.sh for your tech stack.
Install and re-run to incorporate best practices."
/ "技術スタックに適合するスキルが skills.sh にある可能性があります。
インストール後に再実行すると、ベストプラクティスを取り込めます。"Extraction Results:
Testing Standards: {n} rules
Code Quality: {n} rules
Error Handling: {n} rules
Documentation: {n} rules
Security: {n} rules
Git: {n} rules
Total: {total} rules (Priority 1: {n}, Priority 2: {n}, Priority 3: {n})question: "Where to save coding-rules.md?" / "coding-rules.md の出力先は?"
header: "Output"
options:
- "docs/coding-rules.md (Recommended)" / "docs/coding-rules.md(推奨)"
- "docs/development/coding-rules.md"question: "Any additional testing rules?" / "テスト基準について追加ルールはありますか?"
header: "Testing"
options:
- "Require 80%+ coverage (Recommended)" / "カバレッジ80%以上を必須にする"
- "Specify E2E test patterns" / "E2Eテストパターンを指定する"
- "No additions needed" / "追加不要"question: "Commit message language?" / "コミットメッセージの言語は?"
header: "Git"
options:
- "Japanese only" / "日本語のみ"
- "English only" / "英語のみ"
- "Conventional Commits (English)" / "Conventional Commits(英語)"coding-rules.mdquestion: "Existing coding-rules.md found. How to proceed?" / "既存の coding-rules.md が見つかりました。どうしますか?"
header: "Existing File"
options:
- "Overwrite" / "上書きする"
- "Merge differences" / "差分のみマージ"
- "Cancel" / "キャンセル"[MUST][SHOULD][MAY]AGENTS.mdCLAUDE.mdquestion: "Add reference to coding-rules.md in AGENTS.md / CLAUDE.md?" / "AGENTS.md / CLAUDE.md に coding-rules.md の参照を追記しますか?"
header: "Update"
options:
- "Yes, add reference (Recommended)" / "はい、追記する(推奨)"
- "No, skip" / "いいえ、スキップ"## Coding Rules
Follow the coding rules in this file during implementation:
- [{output_path}]({output_path}) — Quality rules generated by spec-rules-init## コーディングルール
実装時のコーディングルールは以下のファイルに従ってください:
- [{output_path}]({output_path}) — spec-rules-init で生成された品質ルール集"Warning: No AGENTS.md or CLAUDE.md found. Skipping reference update."
/ "警告: AGENTS.md も CLAUDE.md も見つかりません。参照追記をスキップします。""coding-rules.md has been generated. The following spec-series skills now reference it:
- spec-generator: Uses coding-rules.md as design constraints during the design phase
- spec-inspect: Checks [MUST] rules in Check 13 (Project Rule Compliance)
- spec-implement: Uses coding-rules.md as a quality gate during implementation"
/ "coding-rules.md を生成しました。以下の spec-series スキルが参照するようになっています:
- spec-generator: design フェーズで coding-rules.md を設計制約として使用
- spec-inspect: Check 13(プロジェクトルール準拠)で [MUST] ルールをチェック
- spec-implement: 実装時の品質ゲートとして coding-rules.md を使用"| Option | Description |
|---|---|
| Overwrite existing coding-rules.md without confirmation |
| Generate rules for a specific category only (e.g., |
"Warning: Could not read {filename}. Skipping."
/ "警告: {filename} を読み取れません。スキップします。"mkdir -p {output_directory}"Error: Cannot write to {path}. Try a different location."
/ "エラー: {path} に書き込めません。別のパスを指定してください。""No convention files (CLAUDE.md, AGENTS.md, etc.) found. Proceeding with dialogue-only mode."
/ "規約ファイル(CLAUDE.md, AGENTS.md等)が見つかりません。対話のみモードで進みます。"# Generate coding rules from project conventions
"Generate coding rules"
「コーディングルールを生成して」
# Create coding-rules.md with forced overwrite
"Create coding-rules.md --force"
「coding-rules.md を作成 --force」
# Extract rules for a specific category
"Extract project rules --category testing"
「テストルールだけ抽出して」
# After generating, re-run to update
"Update coding-rules.md"
「coding-rules.md を更新して」question: "coding-rules.md generated. What's next?" / "coding-rules.md を生成しました。次のアクションは?"
header: "Next"
options:
- "Generate specifications (spec-generator)" / "仕様書を生成する(spec-generator)"
- "Set up development workflow (spec-workflow-init)" / "開発ワークフローを設定する(spec-workflow-init)"
- "Done for now" / "完了"