From blueprint-plugin
Derives Claude rules from git commit history by analyzing decisions in refactor, fix, feat, chore commits. Resolves conflicts by prioritizing newer commits.
npx claudepluginhub laurigates/claude-plugins --plugin blueprint-pluginThis skill is limited to using the following tools:
Extract project decisions from git commit history and codify them as Claude rules. Newer commits override older decisions when conflicts exist.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Extract project decisions from git commit history and codify them as Claude rules. Newer commits override older decisions when conflicts exist.
Use case: Derive implicit project patterns from git history to establish consistent AI-assisted development guidelines.
Usage: /blueprint:derive-rules [--since DATE] [--scope SCOPE]
| Use this skill when... | Use alternative when... |
|---|---|
| Want to extract implicit decisions from git history | Creating rules from requirements (use PRDs instead) |
| Project has significant commit history | New project with little history |
| Establishing project coding standards | Quick manual rule creation |
git rev-parse --git-dirfind docs/blueprint -maxdepth 1 -name 'manifest.json' -type fgit rev-list --count HEADgit log --format="%s"find .claude/rules -name "*.md" -type fParse $ARGUMENTS:
--since DATE: Analyze commits from specific date (e.g., --since 2024-01-01)--scope SCOPE: Focus on specific area (e.g., --scope api, --scope testing)Execute the complete git-to-rules derivation workflow:
/blueprint:init first--since and --scope flags to determine analysis rangeUse parallel agents to analyze git history efficiently (see REFERENCE.md):
refactor: commits for code style patternsfix: commits for repeated issue typesfeat!: and BREAKING CHANGE: commits for architecture decisionschore: and build: commits for tooling decisionsConsolidate findings by domain (code-style, testing, api-design, etc.), chronologically (newest first), and by frequency (most common wins).
When multiple commits address the same topic:
git log --format="%H|%ai|%s" | grep "{topic}"feat!: trumps regular commits.claude/rules/For each decision, generate rule file using template from REFERENCE.md:
paths frontmatter when the rule is naturally scoped to specific file types (see REFERENCE.md for suggested patterns per category)Generate separate rule files by category (see REFERENCE.md):
code-style.md, testing-standards.md, api-conventions.md, error-handling.md, dependencies.md, security-practices.mdPath-scope rules where appropriate — e.g., testing-standards.md scoped to test files reduces context noise when working on non-test code.
Check for conflicts with existing rules in .claude/rules/:
Update the task registry entry in docs/blueprint/manifest.json:
jq --arg now "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
--arg sha "$(git rev-parse HEAD 2>/dev/null)" \
--argjson processed "${COMMITS_ANALYZED:-0}" \
--argjson created "${RULES_DERIVED:-0}" \
'.task_registry["derive-rules"].last_completed_at = $now |
.task_registry["derive-rules"].last_result = "success" |
.task_registry["derive-rules"].context.commits_analyzed_up_to = $sha |
.task_registry["derive-rules"].stats.runs_total = ((.task_registry["derive-rules"].stats.runs_total // 0) + 1) |
.task_registry["derive-rules"].stats.items_processed = $processed |
.task_registry["derive-rules"].stats.items_created = $created' \
docs/blueprint/manifest.json > tmp.json && mv tmp.json docs/blueprint/manifest.json
docs/blueprint/manifest.json with derived rules metadata: timestamp, commits analyzed, rules generated, source commits| Context | Command |
|---|---|
| Check git status | git rev-parse --git-dir 2>/dev/null && echo "YES" || echo "NO" |
| Count total commits | git rev-list --count HEAD 2>/dev/null || echo "0" |
| Conventional commits % | git log --format="%s" | grep -c "^(feat|fix|refactor)" || echo 0 |
| Extract decision commits | git log --format="%H|%s|%b" | grep -E "(always|never|must|prefer)" |
| Fast derivation | Use parallel agents (Explore) for multi-domain analysis |
For git analysis patterns, rule templates, conflict resolution, and detailed procedures, see REFERENCE.md.