Skip to content

Commit 7523dd4

Browse files
balzssclaude
andcommitted
chore: configure Claude Code slash commands
Add shared slash commands for InstUI workflow: - /commit: Create commits following InstUI conventions with HUSKY=0 - /pr: Create pull requests following InstUI conventions Update .gitignore to track only shared commands while ignoring user-specific local commands. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 564c4be commit 7523dd4

File tree

3 files changed

+117
-0
lines changed

3 files changed

+117
-0
lines changed

.claude/commands/commit.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
description: Create a commit following InstUI conventions with HUSKY=0
3+
---
4+
5+
Create a commit following the Instructure UI commit conventions:
6+
7+
## Format Requirements
8+
9+
Use Conventional Commits format:
10+
```
11+
type(scope): subject
12+
13+
[optional body]
14+
Document any breaking changes here with BREAKING CHANGE: prefix
15+
16+
[optional footer]
17+
```
18+
19+
**Types**: feat, fix, docs, style, refactor, test, chore
20+
21+
**Scope**: Full package name as-is (e.g., ui-button, ui-select). Use comma-separated for multiple packages, `many` for many packages, or omit for repo-wide changes.
22+
23+
**Subject**: Brief imperative description (e.g., "add loading state", not "adds" or "added")
24+
25+
## Breaking Changes
26+
27+
Mark breaking changes with an exclamation mark after scope and document in body:
28+
```
29+
feat(ui-select)!: remove deprecated onOpen prop
30+
31+
BREAKING CHANGE: The onOpen prop has been removed. Use onShowOptions instead.
32+
```
33+
34+
Breaking changes include:
35+
- Removing/renaming props or components
36+
- Changing prop types or behavior
37+
- Changing defaults that affect behavior
38+
- Removing theme variables or exports
39+
40+
## Commit Footer
41+
42+
Always include:
43+
```
44+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
45+
46+
Co-Authored-By: Claude <[email protected]>
47+
```
48+
49+
## Process
50+
51+
1. Run `git status` and `git diff` to see changes
52+
2. Analyze the changes and draft appropriate commit message
53+
3. Add files to staging if needed: `git add <files>`
54+
4. Create commit with `HUSKY=0 git commit -m "$(cat <<'EOF'
55+
[commit message here with proper footer]
56+
EOF
57+
)"`
58+
5. Run `git status` after to verify
59+
60+
**Important**: Use HUSKY=0 prefix to skip interactive prompt since AI can't interact with it.

.claude/commands/pr.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
description: Create a pull request following InstUI conventions
3+
---
4+
5+
Create a pull request following Instructure UI conventions:
6+
7+
## PR Requirements
8+
9+
All PRs must include:
10+
11+
1. **Summary**: Brief description of changes (1-3 bullet points)
12+
2. **Test Plan**: Clear steps for reviewers to test the changes
13+
3. **Jira Reference**: Include relevant Jira ticket number if applicable (e.g., `Fixes INST-1234`)
14+
4. **AI Disclosure**: Must clearly indicate this was created with AI assistance
15+
16+
## Draft vs Ready
17+
18+
- Open as **draft** when work is in progress or not ready for review
19+
- Mark as **ready for review** only when complete and all requirements met
20+
21+
## Process
22+
23+
1. Run `git status` to check current branch and remote tracking
24+
2. Run `git log master..HEAD` to see all commits that will be in the PR
25+
3. Run `git diff master...HEAD` to see full diff from base branch
26+
4. Analyze changes across ALL commits (not just latest)
27+
5. Draft PR summary covering all changes
28+
6. **If Jira ticket number is unknown, ask the user for it before creating the PR**
29+
7. Push to remote if needed: `git push -u origin <branch>`
30+
8. Create PR with `gh pr create --title "title" --body "$(cat <<'EOF'
31+
## Summary
32+
- Bullet point 1
33+
- Bullet point 2
34+
35+
## Test Plan
36+
- [ ] Step 1
37+
- [ ] Step 2
38+
39+
## Jira Reference
40+
Fixes INST-XXXX (or omit this section if not applicable)
41+
42+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
43+
EOF
44+
)"`
45+
9. Return the PR URL
46+
47+
**Important**:
48+
- Base branch is usually `master` (not main)
49+
- Analyze ALL commits in the branch, not just the latest one
50+
- Use markdown checklists for test plan
51+
- Include AI attribution footer
52+
- Always confirm Jira ticket number with user if not found in commits or branch name

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@ tsconfig.build.tsbuildinfo
2626
.claude/settings.local.json
2727
.claude/cache/
2828
.claude/*.local.*
29+
30+
# Ignore all commands except shared ones
31+
.claude/commands/*
32+
!.claude/commands/commit.md
33+
!.claude/commands/pr.md

0 commit comments

Comments
 (0)