blueprint-rules
1
总安装量
1
周安装量
#48857
全站排名
安装命令
npx skills add https://github.com/laurigates/claude-plugins --skill blueprint-rules
Agent 安装分布
mcpjam
1
claude-code
1
replit
1
junie
1
windsurf
1
zencoder
1
Skill 文档
Manage modular rules for the project. Rules are markdown files in .claude/rules/ that provide context-specific instructions to Claude.
Steps:
-
Check blueprint status:
- Read
docs/blueprint/manifest.json - Check if modular rules are enabled
- If not enabled, offer to enable:
Use AskUserQuestion: question: "Modular rules are not enabled. Would you like to enable them?" options: - "Yes, create .claude/rules/ structure" â enable and continue - "No, use single CLAUDE.md" â exit
- Read
-
Determine action (use AskUserQuestion):
question: "What would you like to do with modular rules?" options: - "List existing rules" â show current rules - "Add a new rule" â create new rule file - "Edit existing rule" â modify rule - "Generate rules from PRDs" â auto-generate from requirements - "Sync rules with CLAUDE.md" â bidirectional sync - "Validate rules" â check for issues -
List existing rules:
- Scan
.claude/rules/recursively for.mdfiles - Parse frontmatter for
pathsfield (if scoped) - Display:
ð Modular Rules Global Rules (apply to all files): - development.md - TDD workflow and conventions - testing.md - Test requirements Scoped Rules (apply to specific paths): - frontend/react.md - paths: ["src/components/**/*.tsx"] - backend/api.md - paths: ["src/api/**/*.ts"] Total: 4 rules
- Scan
-
Add a new rule (use AskUserQuestion):
question: "What type of rule would you like to create?" options: - "Development workflow" â development.md template - "Testing requirements" â testing.md template - "Code style/conventions" â code-style.md template - "Architecture patterns" â architecture.md template - "Language-specific" â prompt for language - "Framework-specific" â prompt for framework - "Custom" â blank template with guidanceThen ask:
question: "Should this rule apply to all files or specific paths?" options: - "All files (global)" â no paths frontmatter - "Specific file patterns" â prompt for glob patterns -
Rule file templates:
Global rule template:
# {Rule Name} ## Overview {Brief description of when this rule applies} ## Requirements - {Requirement 1} - {Requirement 2} ## Examples {Code examples if applicable}Scoped rule template:
--- paths: - "src/components/**/*.tsx" - "src/components/**/*.ts" --- # {Rule Name} ## Overview {Brief description - applies only to matched paths} ## Requirements - {Requirement 1} - {Requirement 2} -
Generate rules from PRDs:
- Read all PRDs in
docs/prds/ - Extract key requirements and constraints
- Group by domain (testing, architecture, coding standards)
- Generate rule files:
rules/from-prd-testing.md– Test requirements from PRDsrules/from-prd-architecture.md– Architecture decisionsrules/from-prd-conventions.md– Coding conventions
- Read all PRDs in
-
Sync rules with CLAUDE.md:
- Parse existing CLAUDE.md sections
- Compare with rules in
.claude/rules/ - Offer sync options:
question: "How would you like to sync?" options: - "CLAUDE.md â rules (split into modular files)" - "Rules â CLAUDE.md (consolidate)" - "Merge both (combine unique content)"
-
Validate rules:
- Check for syntax errors in frontmatter
- Validate glob patterns in
pathsfield - Check for conflicting rules
- Warn about overly broad or narrow scopes
- Report:
â Rule Validation Checked: 4 rules Valid: 4 Warnings: 1 - frontend/react.md: paths pattern may be too broad No errors found.
-
Update manifest:
- Add created/modified rules to
generated_artifacts.rules - Update
updated_attimestamp
- Add created/modified rules to
-
Report:
â Rule management complete! {Action summary} Current rules: {count} files - Global: {count} - Scoped: {count} Run `/blueprint-status` to see full configuration. -
Prompt for next action (use AskUserQuestion):
question: "Rules updated. What would you like to do next?" options: - label: "Update CLAUDE.md (Recommended)" description: "Regenerate overview to reflect rule changes" - label: "Add another rule" description: "Create additional domain-specific rules" - label: "Check blueprint status" description: "Run /blueprint:status to see full configuration" - label: "I'm done for now" description: "Exit - rules are active immediately"Based on selection:
- “Update CLAUDE.md” â Run
/blueprint:claude-md - “Add another rule” â Restart at step 4 (Add a new rule)
- “Check blueprint status” â Run
/blueprint:status - “I’m done” â Exit
- “Update CLAUDE.md” â Run
Common Rule Patterns:
| Rule Type | Suggested Path | Scope Pattern |
|---|---|---|
| React components | rules/frontend/react.md |
["**/*.tsx", "**/*.jsx"] |
| API handlers | rules/backend/api.md |
["src/api/**/*", "src/routes/**/*"] |
| Database models | rules/backend/models.md |
["src/models/**/*", "src/db/**/*"] |
| Test files | rules/testing.md |
["**/*.test.*", "**/*.spec.*"] |
| Documentation | rules/docs.md |
["**/*.md", "docs/**/*"] |