blueprint-generate-rules
БесплатноБез исполняемых скриптовНе проверен(Re)generate path-scoped rules from PRDs into generated_rules_path, with hash-based conflict checks. Use when creating or refreshing rules from docs/prds/…
от laurigates★ 61 звезда на GitHubОб этом скилле
Generate project-specific rules from Product Requirements Documents.
When to Use This Skill
| Use this skill when... | Use alternative when... |
|---|---|
| Need to generate rules from existing PRDs | Use /blueprint:rules to manually create/edit rules |
| Want path-scoped rules for specific file types | Use /blueprint:claude-md for general project instructions |
| Automating rule creation from requirements | Writing custom rules without PRD reference |
| Extracting architecture/testing patterns from PRDs | Need to create one-off rules for specific contexts |
| Refreshing rules after a PRD changes | Setting up rules, workflow commands and the manifest mapping in one pass (use blueprint-development) |
Rules are generated to the directory configured in structure.generated_rules_path (defaults to .claude/rules/ when the field is absent). Rules with paths frontmatter are loaded conditionally when working on matching files.
Execution
Execute this rule-generation workflow:
Prerequisites:
docs/prds/directory exists- At least one PRD file in
docs/prds/
Step 0: Resolve the output path
Read structure.generated_rules_path from docs/blueprint/manifest.json (default .claude/rules/):
RULES_DIR=$(jq -r '.structure.generated_rules_path // ".claude/rules/"' docs/blueprint/manifest.json)
mkdir -p "$RULES_DIR"
Use $RULES_DIR for all subsequent reads/writes. This isolates blueprint-managed rules from any hand-written files in the parent .claude/rules/ directory (issue #1043).
Step 1: Find and read all PRDs
- Use Glob to find all
.mdfiles indocs/prds/ - Read each PRD file
- If no PRDs found, report error and suggest writing PRDs first
Step 2: Check for existing generated rules
ls "$RULES_DIR" 2>/dev/null
- Scope conflict checks to files under
$RULES_DIRonly — never to the parent.claude/rules/. Hand-written files outside$RULES_DIRare invisible to this check. - If rules exist, check manifest for content hashes
- Compare current content hash vs stored hash
- If modified, offer options: overwrite, skip, or backup
Step 3: Analyze PRDs and extract (aggregated from all PRDs)
Architecture Patterns:
- Project structure and organization
- Architectural style (MVC, layered, hexagonal, etc.)
- Design patterns
- Dependency injection approach
- Error handling strategy
- Code organization conventions
- Integration patterns
Testing Strategies:
- TDD workflow requirements
- Test types (unit, integration, e2e)
- Mocking patterns
- Coverage requirements
- Test structure and organization
- Test commands
Implementation Guides:
- How to implement APIs/endpoints
- How to implement UI components (if applicable)
- Database operation patterns
- External service integration patterns
- Background job patterns (if applicable)
Quality Standards:
- Code review checklist
- Performance baselines
- Security requirements (OWASP, validation, auth)
- Code style and formatting
- Documentation requirements
- Dependency management
Step 4: Generate four aggregated domain rules
Create in $RULES_DIR (the configured structure.generated_rules_path):
architecture-patterns.md:
- Aggregated patterns from all PRDs
- Fill in project-specific patterns extracted from PRDs
- Include code examples where possible
- Reference specific files/directories
testing-strategies.md:
- Aggregated testing requirements from all PRDs
- Fill in TDD requirements from PRDs
- Include coverage requirements
- Include test commands for the project
- Add
pathsfrontmatter if tests live in specific directories:--- paths: - "tests/**/*" - "**/*.{test,spec}.*" ---
implementation-guides.md:
- Aggregated implementation patterns from all PRDs
- Fill in step-by-step patterns for feature types
- Include code examples
- Scope to source paths if applicable:
--- paths: - "src/**/*" - "lib/**/*" ---
quality-standards.md:
- Aggregated quality requirements from all PRDs
- Fill in performance baselines from PRDs
- Fill in security requirements from PRDs
- Create project-specific checklist
Path-scoping guidance: Add paths frontmatter when a rule only applies to specific file types or directories. This reduces context noise — Claude only loads the rule when working on matching files. Use brace expansion for concise patterns: *.{ts,tsx}, src/{api,routes}/**/*.
Step 5: Update manifest with generation tracking
Register the rules through the shared helper rather than hand-writing the
jq — /blueprint:init Step 8a calls the same script, so the two producers of
$RULES_DIR cannot drift apart on the record shape or on how the hash is
computed (issue #2331):
bash "${CLAUDE_SKILL_DIR}/../../scripts/register-generated-rules.sh" \
--source "docs/prds/*" \
--source-hash "$PRD_AGGREGATE_SHA256" \
architecture-patterns.md testing-
Установить blueprint-generate-rules в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteGlobBash(bash ${CLAUDE_SKILL_DIR}/../../scripts/register-generated-rules.sh *)Bash(jq *)Bash(mkdir *)Bash(ls *)Bash(sha256sum *)Bash(date *)Bash(mv *)AskUserQuestionFAQ
Что делает скилл blueprint-generate-rules?
(Re)generate path-scoped rules from PRDs into generated_rules_path, with hash-based conflict checks. Use when creating or refreshing rules from docs/prds/; for full setup use blueprint-development.
Как установить скилл blueprint-generate-rules?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл blueprint-generate-rules запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic