Skip to content

Commit 440c52e

Browse files
authored
refactor: migrate commands to Anthropic skills pattern (#40)
* refactor: migrate commands to Anthropic skills pattern - Add skills/ directory with SKILL.md files for each command - Add .ruler/skills/ for Ruler-generated skill outputs - Update Makefile with skills-sync and skills-copy targets - Enable skills in ruler.toml configuration - Remove legacy commands/ and .ruler/*.md command files - Rename RULES_SKIP_HELP to DOTAGENTS_SKIP_HELP * refactor: migrate commit-push documentation to commands directory
1 parent c56e304 commit 440c52e

15 files changed

Lines changed: 90 additions & 17 deletions

File tree

.ruler/commands.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

.ruler/ruler.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ enabled = true
9090
# MCP merge strategy: 'merge' or 'overwrite' (default: 'merge')
9191
merge_strategy = "merge"
9292

93+
# --- Skills Configuration ---
94+
[skills]
95+
enabled = true
96+
9397
# --- Global .gitignore Configuration ---
9498
[gitignore]
9599
# Enable/disable automatic .gitignore updates (default: true)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
allowed-tools: Read, Glob, Grep, Write, Bash, TodoWrite
3+
description: Generate changeset entries following Changesets semantics
4+
---
5+
16
# /changesets — Generate changeset entries
27

38
Generate release documentation entries following Changesets semantics.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
allowed-tools: Read, Bash, TodoWrite
3+
description: Validate commit messages against conventional commit format
4+
---
5+
16
# /commit-lint — Commit message validation
27

38
Ensure commits follow conventional commit format and pass quality checks.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
allowed-tools: Read, Bash, TodoWrite, mcp__Linear__*
3+
description: Create Linear issues with proper assignment and labeling
4+
---
5+
16
# /issue-create — Create Linear issues
27

38
Create Linear issues with proper assignment and labeling.
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
allowed-tools: Read, Bash, TodoWrite
3+
description: Create GitHub PRs with proper formatting, labeling, and quality checks
4+
---
5+
16
# /pr-create — Create pull requests
27

38
Create GitHub PRs with proper formatting, labeling, and quality checks.
@@ -21,7 +26,7 @@ gh pr create \
2126
## Testing
2227
- All checks pass
2328
24-
🤖 Generated with [AI_TOOL] by [AI_MODEL]" \
29+
Generated with [AI_TOOL] by [AI_MODEL]" \
2530
--base main
2631
```
2732

@@ -45,7 +50,7 @@ gh pr merge $(gh pr view --json number -q '.number') --squash --auto
4550
## Testing
4651
- Verification steps
4752

48-
🤖 Generated with [AI_TOOL] by [AI_MODEL]
53+
Generated with [AI_TOOL] by [AI_MODEL]
4954
```
5055

5156
## Labeling
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
allowed-tools: Read, Bash
3+
description: Apply labels to PRs based on conventional commit types
4+
---
5+
16
# /pr-label — Label pull requests
27

38
Apply labels to PRs based on conventional commit types.
File renamed without changes.

Makefile

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
COMMANDS_SRC_DIR := $(dir $(lastword $(MAKEFILE_LIST)))commands
88
COMMANDS_TARGET_DIRS := $(HOME)/.cursor/commands $(HOME)/.claude/commands $(HOME)/.codex/prompts $(HOME)/.config/opencode/command $(HOME)/.config/amp/commands $(HOME)/.kilocode/workflows $(HOME)/Documents/Cline/Rules
99

10+
SKILLS_SRC_DIR := $(dir $(lastword $(MAKEFILE_LIST)))skills
11+
SKILLS_RULER_DIR := $(dir $(lastword $(MAKEFILE_LIST))).ruler/skills
12+
SKILLS_TARGET_DIRS := $(HOME)/.claude/skills $(HOME)/.cursor/skills $(HOME)/.codex/skills $(HOME)/.roo/skills $(HOME)/.gemini/skills $(HOME)/.agents/skills $(HOME)/.vibe/skills
13+
1014
MCP_SRC := $(dir $(lastword $(MAKEFILE_LIST))).ruler/mcp.json
1115
MCP_TARGET_DIRS := $(HOME)/.cursor $(HOME)/.claude $(HOME)/.codex
1216

@@ -15,13 +19,15 @@ MCP_TARGET_DIRS := $(HOME)/.cursor $(HOME)/.claude $(HOME)/.codex
1519
# ====================================================================================
1620

1721
.PHONY: sync
18-
sync: ## Sync project commands and MCP configuration to assistant-specific directories.
22+
sync: ## Sync project commands, skills, and MCP configuration to assistant-specific directories.
1923
@make commands-sync
24+
@make skills-sync
2025
@make mcp-sync
2126

2227
.PHONY: prepare
2328
prepare: ## Prepare the project for development.
2429
@make commands-copy
30+
@make skills-copy
2531

2632
# ====================================================================================
2733
# COMMANDS
@@ -43,6 +49,30 @@ commands-sync: ## Sync project commands to assistant-specific directories.
4349
commands-copy: ## Copy commands to .ruler directory.
4450
@cp $(COMMANDS_SRC_DIR)/*.md .ruler/
4551

52+
# ====================================================================================
53+
# SKILLS
54+
# ====================================================================================
55+
56+
.PHONY: skills-copy
57+
skills-copy: ## Copy skills from root to .ruler/skills directory.
58+
@rsync -a --delete $(SKILLS_SRC_DIR)/ $(SKILLS_RULER_DIR)/
59+
@echo "Synced $(SKILLS_SRC_DIR)$(SKILLS_RULER_DIR)"
60+
61+
.PHONY: skills-sync
62+
skills-sync: ## Sync Ruler skills to agent-specific directories.
63+
@for target in $(SKILLS_TARGET_DIRS); do \
64+
if mkdir -p $$target && rsync -a --delete $(SKILLS_RULER_DIR)/ $$target/; then \
65+
echo "Synced $(SKILLS_RULER_DIR)$$target"; \
66+
else \
67+
echo "Failed syncing $(SKILLS_RULER_DIR)$$target"; \
68+
exit 1; \
69+
fi; \
70+
done
71+
72+
# ====================================================================================
73+
# MCP
74+
# ====================================================================================
75+
4676
.PHONY: mcp-sync
4777
mcp-sync: ## Sync MCP configuration from .ruler/mcp.json to CLI tools.
4878
@if [ ! -f $(MCP_SRC) ]; then \
@@ -62,7 +92,7 @@ mcp-sync: ## Sync MCP configuration from .ruler/mcp.json to CLI tools.
6292
# HELP
6393
# ====================================================================================
6494

65-
ifeq ($(RULES_SKIP_HELP),)
95+
ifeq ($(DOTAGENTS_SKIP_HELP),)
6696
.PHONY: help
6797
help: ## Show this help message.
6898
@echo "Usage: make <target>"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
allowed-tools: Read, Glob, Grep, Write, Bash, TodoWrite
3+
description: Generate changeset entries following Changesets semantics
4+
---
5+
16
# /changesets — Generate changeset entries
27

38
Generate release documentation entries following Changesets semantics.

0 commit comments

Comments
 (0)