Skip to content

Commit 37d7e5c

Browse files
committed
feat: add gh-cli and gh-mcp feature flags for GitHub integration
- Add gh-mcp flag for GitHub MCP tool instructions - Add gh-cli flag for GitHub CLI instructions - Add unlessFlags directive for fallback content - Validate mutual exclusivity of gh-cli and gh-mcp Users can now generate commands tailored to their GitHub setup: - gh-mcp: Use mcp__github__* tools exclusively - gh-cli: Use gh CLI commands exclusively - Default: Show generic fallback instructions
1 parent eb3a4b5 commit 37d7e5c

26 files changed

Lines changed: 807 additions & 48 deletions

.claude/commands/contribute-a-command.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,15 @@ Flexible structure. Interactive commands use `(no arguments - interactive)` hint
155155
| `beads-integration.md` | PR, planning (featureFlag='beads') |
156156
| `commit-process.md` | Commit |
157157
| `no-plan-files.md` | Commit (featureFlag='no-plan-files') |
158-
| `github-issue-fetch.md` | Issue fetching |
158+
| `github-issue-fetch.md` | Issue fetching (MCP-first with CLI fallback, default) |
159+
| `github-issue-fetch-gh-mcp.md` | Issue fetching (MCP only, featureFlag='gh-mcp') |
160+
| `github-issue-fetch-gh-cli.md` | Issue fetching (CLI only, featureFlag='gh-cli') |
161+
| `github-pr-fetch.md` | PR fetching (MCP-first with CLI fallback, default) |
162+
| `github-pr-fetch-gh-mcp.md` | PR fetching (MCP only, featureFlag='gh-mcp') |
163+
| `github-pr-fetch-gh-cli.md` | PR fetching (CLI only, featureFlag='gh-cli') |
164+
| `git-host-detection.md` | Multi-host detection (MCP+CLI, default) |
165+
| `git-host-detection-gh-mcp.md` | Multi-host detection (MCP only, featureFlag='gh-mcp') |
166+
| `git-host-detection-gh-cli.md` | Multi-host detection (CLI only, featureFlag='gh-cli') |
159167
| `test-quality-criteria.md` | Code review |
160168

161169
## Rules

.claude/commands/create-issues.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,19 @@ If input looks like a GitHub issue:
4949
- From branch name: check patterns like `issue-123`, `123-feature`, `feature/123`
5050

5151
**Step 2: Fetch Issue**
52-
Try GitHub MCP first:
5352

54-
- If available: use `mcp__github__issue_read` to fetch issue details
55-
- If not available: show message and try `gh issue view <number>`
53+
Try to fetch the issue using GitHub MCP (mcp__github__issue_read tool).
54+
55+
If GitHub MCP is not configured, show:
5656

5757
```
5858
GitHub MCP not configured!
5959
See: https://github.com/modelcontextprotocol/servers/tree/main/src/github
6060
Trying GitHub CLI fallback...
6161
```
6262

63+
Then try using `gh issue view [ISSUE_NUMBER] --json` as fallback.
64+
6365
**Step 3: Use Issue as Discovery Input**
6466

6567
- Title → Feature name

.claude/commands/worktree-add.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Uncommitted changes: `git status --short`
5555
<step_0b>
5656
<description>Detect git hosting provider and available tools (only needed if argument is an issue URL)</description>
5757
<condition>Only run this step if first argument looks like a git hosting URL</condition>
58+
5859
<detect_provider>
5960
<check_remote_url>git remote get-url origin</check_remote_url>
6061
<identify_host>

.claude/commands/worktree-cleanup.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Current worktrees: `git worktree list`
3535
<execution_steps>
3636
<step_0>
3737
<description>Detect git hosting provider and available tools</description>
38+
3839
<detect_provider>
3940
<check_remote_url>git remote get-url origin</check_remote_url>
4041
<identify_host>

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[![Made with Claude Code](https://img.shields.io/badge/Made%20with-Claude%20Code-blueviolet)](https://claude.ai/code)
1515
[![Contributors](https://img.shields.io/github/contributors/wbern/claude-instructions)](https://github.com/wbern/claude-instructions/graphs/contributors)
1616
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen)](https://github.com/wbern/claude-instructions/pulls)
17-
[![Commands](https://img.shields.io/badge/commands-29-blue)](https://github.com/wbern/claude-instructions#available-commands)
17+
[![Commands](https://img.shields.io/badge/commands-30-blue)](https://github.com/wbern/claude-instructions#available-commands)
1818

1919
```
2020
_==/ i i \==_
@@ -236,6 +236,7 @@ flowchart TB
236236
- `/beepboop` - Communicate AI-generated content with transparent attribution
237237
- `/add-command` - Guide for creating new slash commands
238238
- `/kata` - Generate a TDD practice challenge with boilerplate test setup
239+
- `/adr` - Create an Architecture Decision Record
239240
- `/research` - Research a problem in parallel via web docs, web search, codebase exploration, and deep ultrathink
240241
- `/commitlint-checklist-nodejs` - Audit commit hook automation for Node.js projects
241242
- `/upgrade-deps` - Check for dependency upgrades and assess safety before updating

0 commit comments

Comments
 (0)