Token导航 LogoToken导航

Agent Skill · 研究检索

spec-rules-init(规范规则初始化)

spec-rules-init 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

spec-rules-init 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 56,831。

总安装 445周安装 18GitHub Stars 1下载 140核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:spec-rules-init(规范规则初始化)
来源仓库:https://github.com/anyoneanderson/agent-skills
仓库路径:skills/spec-rules-init
安装命令:
npx skills add https://github.com/anyoneanderson/agent-skills --skill spec-rules-init
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/anyoneanderson/agent-skills --skill spec-rules-init

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

spec-rules-init 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。适用于需要根据关键词或任务场景进行信息检索和筛选的工作流。通过关键词输入和来源线索匹配,输出结构化候选结果列表。

安装命令:npx skills add https://github.com/anyoneanderson/agent-skills --skill spec-rules-init 建议确认权限范围和维护状态,注意可能触发联网或文件读写操作

来源仓库内路径:skills/spec-rules-init

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/anyoneanderson/agent-skills --skill spec-rules…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

spec-rules-init 怎么安装?

在终端执行 npx skills add https://github.com/anyoneanderson/agent-skills --skill spec-rules-init。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

spec-rules-init 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

spec-rules-init 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

spec-rules-init 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

spec-rules-init 用的人多吗?

公开数据是累计安装 445 次,近一周安装 18 次,下载 140 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

spec-rules-init 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
spec-rules-init

规范规则初始化 · 本页

4451操作浏览器未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

spec-rules-init — Coding Rules Generator

Extract project conventions and generate a unified coding-rules.md for use as a quality gate during implementation.

Language Rules

  1. Auto-detect input language → output in the same language
  2. Japanese input → Japanese output, use references/rules-template.ja.md
  3. English input → English output, use references/rules-template.md
  4. Explicit override takes priority (e.g., "in English", "日本語で")

Execution Flow

Step 0: Initial Context Check

BEFORE any interaction, execute these checks:

  1. Check current directory: pwd ls -la
  2. Detect convention files (parallel where possible): # 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/null
  3. Detect existing source code: find. -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 -30
  4. Scan installed skills: ls ~/.claude/skills/*/SKILL.md.claude/skills/*/SKILL.md 2>/dev/null
  5. Check for existing coding-rules.md: find. -name "coding-rules.md" -type f 2>/dev/null

Step 1: Rule Extraction from Convention Files

Read detected convention files and extract rules by category.

Detection targets (by priority):

FileContent to ExtractPriority
CLAUDE.md (root)Project-wide rulesHigh
src/CLAUDE.mdSource-specific rulesHigh
AGENTS.mdAgent-oriented rulesHigh
.claude/ contentsProject settingsMedium
package.jsonlint/test script presenceMedium
test/CLAUDE.mdTest-specific rulesMedium
.eslintrc* / biome.jsonLint rulesLow
tsconfig.jsonTypeScript strict settingsLow
.prettierrc*Format settingsLow

Extraction categories and keywords:

  • Testing Standards: "coverage", "test", "spec", "E2E", "カバレッジ", "テスト"
  • Code Quality: "lint", "typecheck", "strict", "import", "naming", "命名"
  • Error Handling: "try/catch", "Logger", "error", "throw", "例外"
  • Documentation: "JSDoc", "TSDoc", "@ApiProperty", "comment", "コメント"
  • Security: "secret", "password", "hash", "HTTPS", "ログに出力しない"
  • Git: "commit", "branch", "コミットメッセージ", "feature branch"

For each extracted rule, record:

  • Category (one of the 6 above)
  • Content (the rule text)
  • Severity: [MUST] (explicit requirement), [SHOULD] (recommended), [MAY] (optional)
  • Source file and line reference

Rules from CLAUDE.md / AGENTS.md are Priority 1 and default to [MUST].

Step 2: Codebase Analysis

If source code exists, analyze the codebase to detect implicit conventions. Skip this step entirely if no source files are found (new project).

2a. Directory structure analysis:

  • Scan directory tree (up to 3 levels deep)
  • Detect patterns: feature-based (modules/{feature}/), layer-based (controllers/, services/), co-located tests vs separate tests/ directory

2b. File naming convention detection:

  1. Collect file names under src/ (or primary source directory)
  2. Classify each name: kebab-case, camelCase, PascalCase, snake_case
  3. If one pattern is 60%+ of files → propose as [MUST]
  4. Minority patterns → propose as [SHOULD] for unification

2c. Library analysis:

  1. Read dependency file (package.json, go.mod, requirements.txt, etc.)
  2. Identify major libraries:

- Frameworks: NestJS, Next.js, Express, Fastify, Django, Flask, Gin, etc. - Testing: Jest, Vitest, Playwright, pytest, etc. - Validation: Zod, class-validator, Joi, etc. - ORM: Prisma, TypeORM, Drizzle, SQLAlchemy, GORM, etc. - Linters: ESLint, Biome, ruff, golint, etc.

  1. Add library-specific best practice recommendations as [SHOULD] rules

- Example: Prisma detected → [SHOULD] Use Prisma Client for all DB access - Example: Zod detected → [SHOULD] Use Zod for runtime validation

2d. Code pattern analysis (if code intelligence tools are available):

  • Import style: relative (./) vs path alias (@/)
  • Export style: named exports vs default exports
  • Error handling patterns in use

2e. Shared utility and library detection:

  1. Scan the codebase for shared utility modules, helper functions, and internal libraries:

- Look for directories named utils/, helpers/, lib/, shared/, common/ - Identify frequently imported internal modules

  1. Cross-reference with dependency file to identify commonly used libraries
  2. Present a summary of detected shared utilities and libraries to the user: Detected shared utilities and libraries: Internal: utils/logger.ts, lib/validation.ts, helpers/date.ts External: Zod (validation), Prisma (DB), date-fns (dates)
  3. For each detected shared utility or library, generate a [SHOULD] rule:

- Example: [SHOULD] Use lib/validation.ts for input validation - Example: [SHOULD] Use Zod for runtime validation - Example: [SHOULD] Use utils/logger.ts instead of console.log

  1. Include the detected list in the generated coding-rules.md under a "Shared Utilities" section

Codebase analysis results are Priority 2 and assigned [MUST] (for 60%+ majority patterns) or [SHOULD].

Step 3: Installed Skills Analysis

Scan installed skills for framework-specific best practices.

3a. Skill detection:

  1. Scan ~/.claude/skills/ (global skills)
  2. Scan .claude/skills/ (project skills)
  3. Read each SKILL.md frontmatter description and body

3b. Framework match: Compare detected project tech stack (from Steps 1-2) with skill keywords:

Project TechMatching Keywords
Next.jsnext, next.js, vercel, react, RSC, server component
NestJSnest, nestjs, express, fastify, typescript backend
Reactreact, hooks, component, jsx, tsx
Gogo, golang, goroutine
Pythonpython, django, flask, fastapi

3c. User confirmation (if matching skills found):

Use AskUserQuestion:

question: "The following installed skills were detected. Use them for rule extraction?" / "以下のインストール済みスキルが検出されました。ルール抽出に使用しますか?"
header: "Skills"
multiSelect: true
options:
  - "{skill-name} — {description} (Recommended)" / "{skill-name} — {説明}"

3d. Priority mapping:

  • Skill-derived rules are Priority 3 → [SHOULD] or [MAY]
  • If a skill rule contradicts Priority 1 or 2 rules → keep higher priority, show warning
  • Record source as Source: skill/{skill-name} in coding-rules.md

3e. No matching skills: If no matching skills are installed, optionally inform the user:

"Matching skills may be available on skills.sh for your tech stack.
Install and re-run to incorporate best practices."
/ "技術スタックに適合するスキルが skills.sh にある可能性があります。
インストール後に再実行すると、ベストプラクティスを取り込めます。"

Step 4: Interactive Dialogue

4a. Present extraction results:

Display detected rules summary by category:

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

If any category has 0 rules, highlight it for user attention.

4b. Output path selection (AskUserQuestion):

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"

If user selects "Other", accept any valid file path.

4c. Rule supplementation (AskUserQuestion):

For categories with missing or insufficient rules, ask targeted questions:

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(英語)"

Suggest project-type-specific rules based on detected frameworks. Refer to the Project-Type Recommendations section in the reference template.

4d. review_rules.md generation (AskUserQuestion):

Skip if --with-review-rules (auto-generate) or --no-review-rules (skip). Otherwise ask:

question: "Generate review_rules.md alongside coding-rules.md?" /
          "coding-rules.md と一緒に review_rules.md も生成しますか?"
header: "Review Rules"
options:
  - "Yes, generate both (Recommended)" / "はい、両方生成する(推奨)"
  - "No, coding-rules.md only" / "いいえ、coding-rules.md のみ"

Step 5: Existing File Detection and Idempotency

If an existing coding-rules.md was found in Step 0:

  1. Read the existing file
  2. Also check for existing review_rules.md: find. -name "review_rules.md" -type f 2>/dev/null
  3. Compare with newly extracted rules (additions, changes, removals)
  4. Use AskUserQuestion: question: "Existing coding-rules.md found. How to proceed?" / "既存の coding-rules.md が見つかりました。どうしますか?" header: "Existing File" options: - "Overwrite" / "上書きする" - "Merge differences" / "差分のみマージ" - "Cancel" / "キャンセル"
  5. If "Cancel" → exit without changes

Step 6: Generate coding-rules.md

  1. Load the appropriate reference template (based on Language Rules)
  2. Fill in extracted rules by category
  3. Apply severity tags: [MUST], [SHOULD], [MAY]
  4. Add source attribution for each rule
  5. Include the Sources summary table at the end
  6. Create output directory if it does not exist
  7. Write the file

Step 6.5: Generate review_rules.md (if opted in)

Skip this step if user chose "No" in Step 4d or --no-review-rules was specified.

Input: Generated coding-rules.md content + project structure info from Steps 0-2.

Procedure:

  1. Load review template (references/review-template.md or references/review-template.ja.md per Language Rules)
  2. Extract [MUST] and [SHOULD] rules from coding-rules.md, summarize by review category:

- Security → §1 - Type safety → §2 - Framework patterns → §3 - Code quality → §4 - Testing → §5

  1. Generate review exclusion patterns from project structure:

- Auto-generated files: **/*.generated.* - Lock files (based on detected package manager) - Build artifacts: dist/**, build/** - Specs: .specs/** - ORM migrations (if ORM detected): e.g., prisma/migrations/**

  1. Apply template review output guidelines (§7) as-is from template
  2. Apply documentation update check (§8) as-is from template. The template instructs the reviewer to dynamically discover documentation files at review time rather than using a fixed list.
  3. Write to the same directory as coding-rules.md: {output_directory}/review_rules.md

Step 7: Update AGENTS.md / CLAUDE.md References

After generating coding-rules.md, append a reference to project convention files.

Procedure:

  1. Check if AGENTS.md exists at project root
  2. Check if CLAUDE.md exists (skip if it is a symlink to AGENTS.md)
  3. Use AskUserQuestion: question: "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" / "いいえ、スキップ"
  4. If approved, append to the end of each file (or after an existing "Coding Rules" section): English version: ## Coding Rules Follow the coding rules in these files during implementation: - [{coding_rules_path}]({coding_rules_path}) — Quality rules generated by spec-rules-init - [{review_rules_path}]({review_rules_path}) — Review criteria for code review and second opinion Japanese version: ## コーディングルール 実装時のコーディングルールは以下のファイルに従ってください: - [{coding_rules_path}]({coding_rules_path}) — spec-rules-init で生成された品質ルール集 - [{review_rules_path}]({review_rules_path}) — コードレビュー・セカンドオピニオン用のレビュー基準 If review_rules.md was not generated, omit the review_rules line.
  5. If neither file exists → skip with a warning message: "Warning: No AGENTS.md or CLAUDE.md found. Skipping reference update." / "警告: AGENTS.md も CLAUDE.md も見つかりません。参照追記をスキップします。"

Step 8: spec-series Integration Notice

After completing generation, inform the user about integration with other spec-series skills:

"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 を使用"

If review_rules.md was also generated, add:

"review_rules.md has also been generated. It will be used by:
- spec-implement: Review gate references review_rules.md
- spec-workflow-init: Workflow review phases reference review_rules.md
- cmux-second-opinion: Uses review_rules.md for second opinion reviews
- GitHub Actions: Can be referenced by claude-review.yml"
/ "review_rules.md も生成されました。以下で活用されます:
- spec-implement: レビューゲートで review_rules.md を参照
- spec-workflow-init: ワークフローのレビュー Phase で参照
- cmux-second-opinion: セカンドオピニオン実行時に参照
- GitHub Actions: claude-review.yml で参照可能"

Options

OptionDescription
--forceOverwrite existing coding-rules.md without confirmation
--category <name>Generate rules for a specific category only (e.g., --category testing)
--with-review-rulesAlso generate review_rules.md (skip confirmation)
--no-review-rulesDo not generate review_rules.md (skip confirmation)

Error Handling

  • Convention file unreadable: Warn and skip the file, continue with remaining files "Warning: Could not read {filename}. Skipping." / "警告: {filename} を読み取れません。スキップします。"
  • Output directory does not exist: Create it automatically mkdir -p {output_directory}
  • Write permission denied: Show error and suggest an alternative path "Error: Cannot write to {path}. Try a different location." / "エラー: {path} に書き込めません。別のパスを指定してください。"
  • No convention files found: Fall back to dialogue-only mode "No convention files (CLAUDE.md, AGENTS.md, etc.) found. Proceeding with dialogue-only mode." / "規約ファイル(CLAUDE.md, AGENTS.md等)が見つかりません。対話のみモードで進みます。"

Usage Examples

# 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 を更新して」

Post-Completion Actions

After generating coding-rules.md, suggest next actions with AskUserQuestion:

question: "Generation complete. What's next?" / "生成完了。次のアクションは?"
header: "Next"
options:
  - "Generate specifications (spec-generator)" / "仕様書を生成する(spec-generator)"
  - "Set up development workflow (spec-workflow-init)" / "開発ワークフローを設定する(spec-workflow-init)"
  - "Done for now" / "完了"

平台分布

Codex

32.37%
按下载量换算45

Claude

29.69%
按下载量换算42

Cursor

19.89%
按下载量换算28

Gemini CLI

9.2%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills