-
Notifications
You must be signed in to change notification settings - Fork 1
Update seed plugin to match post-cutback pattern #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
96c2c1d
Update seed plugin to match post-cutback pattern
jeremy 42fb12f
Address review feedback on seed plugin hooks
jeremy 9995610
Add marketplace harness and setup claude to seed templates
jeremy 30c837a
Add 3A.6/3A.7 rubric criteria for marketplace plugin pattern
jeremy d2a3de9
Address Copilot review feedback on seed plugin hooks
jeremy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| --- | ||
| name: {{.Name}}-doctor | ||
| description: Check {{.Name}} plugin health — CLI, auth, API connectivity, project context. | ||
| invocable: true | ||
| --- | ||
|
|
||
| # /{{.Name}}-doctor | ||
|
|
||
| Run the {{.Name}} CLI health check and report results. | ||
|
|
||
| ```bash | ||
| {{.Name}} doctor --json | ||
| ``` | ||
|
|
||
| Interpret the output: | ||
| - **pass**: Working correctly | ||
| - **warn**: Non-critical issue (e.g., shell completion not installed) | ||
| - **skip**: Check not run (e.g., unauthenticated or not applicable) | ||
| - **fail**: Broken — needs attention | ||
|
|
||
| For any failures, follow the `hint` field in the check output. Common fixes: | ||
| - Authentication failed → `{{.Name}} auth login` | ||
| - API unreachable → check network / VPN | ||
| - Plugin not installed → `{{.Name}} setup claude` | ||
|
|
||
| Report results concisely: list failures and warnings with their hints. If everything passes, say so. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "hooks": { | ||
| "SessionStart": [ | ||
| { | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh", | ||
| "timeout": 5 | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "PostToolUse": [ | ||
| { | ||
| "matcher": "Bash", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "${CLAUDE_PLUGIN_ROOT}/hooks/post-commit-check.sh", | ||
| "timeout": 5 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| #!/usr/bin/env bash | ||
| # post-commit-check.sh - Check for {{.Name}} item references after git commits | ||
| # | ||
| # This hook runs after Bash tool use and checks if a git commit was made | ||
| # that references a {{.Name}} item ({{.Upper}}-12345, item-12345, etc.) | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| # Require jq for JSON parsing | ||
| if ! command -v jq &>/dev/null; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Read tool input from stdin (JSON with tool_name, tool_input, tool_output) | ||
| input=$(cat) | ||
|
|
||
| # Extract tool input (the bash command that was run) | ||
| tool_input=$(echo "$input" | jq -r '.tool_input.command // empty' 2>/dev/null) | ||
|
|
||
| # Only process git commit commands | ||
| if [[ ! "$tool_input" =~ ^git\ commit ]]; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Check if commit succeeded by looking for output patterns | ||
| tool_output=$(echo "$input" | jq -r '.tool_output // empty' 2>/dev/null) | ||
|
|
||
| # Skip if commit failed — detect error indicators before checking for success. | ||
| # Only match lines that look like git/hook errors, not commit subject lines | ||
| # (e.g. "[branch abc1234] Fix failed login" should not trigger this guard). | ||
| # We strip the "[branch hash] subject" success line before scanning for errors. | ||
| filtered_output=$(echo "$tool_output" | grep -v '^\[.*[a-f0-9]\{7,\}\]' || true) | ||
| if echo "$filtered_output" | grep -qiE '(^|[[:space:]])(error|fatal|aborted|rejected)[[:space:]:]|hook[[:space:]].*[[:space:]]failed|pre-commit[[:space:]].*[[:space:]]failed|^error:'; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Verify commit actually succeeded - look for commit hash pattern or "create mode" | ||
| if [[ ! "$tool_output" =~ \[.*[a-f0-9]{7,}\] ]] && [[ ! "$tool_output" =~ "create mode" ]]; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Look for item references in the commit message or branch name | ||
| branch=$(git branch --show-current 2>/dev/null || true) | ||
| last_commit_msg=$(git log -1 --format=%s 2>/dev/null || true) | ||
|
|
||
| # Patterns: {{.Upper}}-12345, item-12345, {{.Name}}-12345 | ||
| todo_patterns='{{.Upper}}-[0-9]+|item-[0-9]+|{{.Name}}-[0-9]+' | ||
|
|
||
| found_in_branch=$(echo "$branch" | grep -oEi "$todo_patterns" | head -1 || true) | ||
| found_in_msg=$(echo "$last_commit_msg" | grep -oEi "$todo_patterns" | head -1 || true) | ||
|
|
||
| if [[ -n "$found_in_branch" ]] || [[ -n "$found_in_msg" ]]; then | ||
| ref="${found_in_msg:-$found_in_branch}" | ||
| # Extract just the number | ||
| item_id=$(echo "$ref" | grep -oE '[0-9]+') | ||
|
|
||
| short_sha=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown") | ||
| comment="Commit ${short_sha}: ${last_commit_msg}" | ||
| escaped_comment=$(printf '%q' "$comment") | ||
|
|
||
| cat << EOF | ||
| <hook-output> | ||
|
jeremy marked this conversation as resolved.
|
||
| Detected {{.Name}} item reference: $ref | ||
|
|
||
| To link this commit to {{.Name}}: | ||
| {{.Name}} comment ${escaped_comment} --on $item_id | ||
|
|
||
| Or complete the item: | ||
| {{.Name}} done $item_id | ||
| </hook-output> | ||
| EOF | ||
| fi | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.