Skip to content

Commit 637648e

Browse files
nsheapsclaude
andauthored
fix(mise): print absolute path when auto-trusting mise.toml (#300)
* fix(mise): resolve and print absolute path when auto-trusting mise.toml Resolve project_dir to an absolute path so trust log messages always show the full path instead of potentially showing '.' or a relative path. Also print the searched directory when no mise.toml is found, making it easier to diagnose why trust was skipped. https://claude.ai/code/session_01EEDHX7L7DiABLZEQCa7EUn * chore: auto-bump plugin versions and update marketplace * feat(scm-utils): rename auto-pr skill to making-great-prs, add /fix-pr command Rename the auto-pr skill to making-great-prs to better reflect its scope as a best-practices guide for PR formatting, not just automation. Add a PR body formatting section (CRITICAL) warning against literal \n escape sequences — the root cause of PR #300's mangled body. This applies to both gh api heredocs and MCP tool string parameters. Add /fix-pr command that evaluates and fixes a PR's title and body to match the skill's formatting standards. https://claude.ai/code/session_01EEDHX7L7DiABLZEQCa7EUn * chore: auto-bump plugin versions and update marketplace --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5e9b15b commit 637648e

6 files changed

Lines changed: 91 additions & 16 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
{
314314
"name": "mise",
315315
"description": "Install and manage mise (tool version manager) in Claude Code sessions. Provides session-start auto-install for web sessions and comprehensive workflow skills.",
316-
"version": "0.2.16",
316+
"version": "0.2.17",
317317
"author": {
318318
"name": "Nathan Heaps"
319319
},
@@ -454,13 +454,13 @@
454454
{
455455
"name": "scm-utils",
456456
"description": "Source control management utilities for improving interactions with branches and PRs, both locally and in CI environments",
457-
"version": "0.1.13",
457+
"version": "0.1.14",
458458
"author": {
459459
"name": "Nathan Heaps"
460460
},
461461
"source": "./plugins/scm-utils",
462462
"category": "utility",
463-
"tags": ["utility", "skill"],
463+
"tags": ["utility", "command", "skill"],
464464
"keywords": ["git", "branch", "pr", "pull-request", "sync", "merge", "scm", "source-control"]
465465
},
466466
{

plugins/mise/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mise",
3-
"version": "0.2.16",
3+
"version": "0.2.17",
44
"description": "Install and manage mise (tool version manager) in Claude Code sessions. Provides session-start auto-install for web sessions and comprehensive workflow skills.",
55
"author": {
66
"name": "Nathan Heaps",

plugins/mise/hooks/scripts/install-mise.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,29 +108,32 @@ do_setup() {
108108

109109
# Auto-trust: trust mise config files in project dir and any git worktrees
110110
if [ "$auto_trust" = "true" ]; then
111-
local project_dir="${CLAUDE_PROJECT_DIR:-.}"
111+
local project_dir
112+
project_dir="$(cd "${CLAUDE_PROJECT_DIR:-.}" 2>/dev/null && pwd)" || project_dir="${CLAUDE_PROJECT_DIR:-.}"
112113
local trusted_any=false
113114

114115
# Trust the primary project dir config
115116
if [ -f "${project_dir}/mise.toml" ]; then
116-
hook_log_step "trust-config" "Trusting ${project_dir}/mise.toml"
117-
"$mise_bin" trust "${project_dir}/mise.toml" || true
117+
local trust_path="${project_dir}/mise.toml"
118+
hook_log_step "trust-config" "Trusting ${trust_path}"
119+
"$mise_bin" trust "$trust_path" || true
118120
trusted_any=true
119121
fi
120122

121123
# Trust mise.toml in any git worktrees
122124
if command -v git &>/dev/null; then
123125
while IFS= read -r worktree_dir; do
124126
if [ "$worktree_dir" != "$project_dir" ] && [ -f "${worktree_dir}/mise.toml" ]; then
125-
hook_log "Trusting worktree ${worktree_dir}/mise.toml"
126-
"$mise_bin" trust "${worktree_dir}/mise.toml" || true
127+
local wt_trust_path="${worktree_dir}/mise.toml"
128+
hook_log "Trusting worktree ${wt_trust_path}"
129+
"$mise_bin" trust "$wt_trust_path" || true
127130
trusted_any=true
128131
fi
129132
done < <(git -C "$project_dir" worktree list --porcelain 2>/dev/null | grep "^worktree " | sed 's/^worktree //')
130133
fi
131134

132135
if [ "$trusted_any" = "false" ]; then
133-
hook_log "No mise.toml found to trust"
136+
hook_log "No mise.toml found to trust (looked in ${project_dir})"
134137
fi
135138
fi
136139

plugins/scm-utils/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scm-utils",
3-
"version": "0.1.13",
3+
"version": "0.1.14",
44
"description": "Source control management utilities for improving interactions with branches and PRs, both locally and in CI environments",
55
"author": {
66
"name": "Nathan Heaps",
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
name: fix-pr
3+
description: Fix or update the PR description for the current branch to follow best practices
4+
argument-hint: "[optional: PR number or URL]"
5+
allowed-tools: Bash, Read, Grep, Glob
6+
---
7+
8+
# Fix PR Description
9+
10+
Review and fix the pull request description for the current branch, ensuring it follows the formatting and content standards from the `making-great-prs` skill.
11+
12+
## Pre-fetched Context
13+
14+
Current branch: !`git branch --show-current 2>/dev/null || echo "(not in a git repo)"`
15+
16+
## Step 1: Identify the PR
17+
18+
Based on **$ARGUMENTS**:
19+
20+
- **No arguments**: Find the open PR for the current branch
21+
- **PR number or URL provided**: Use the specified PR
22+
23+
## Step 2: Read Current PR State
24+
25+
Fetch the current PR details (title, body, commits, changed files) so you understand:
26+
27+
- What the PR currently says
28+
- What files were actually changed
29+
- What the commit history says about the changes
30+
31+
## Step 3: Evaluate and Fix
32+
33+
Check the PR against these standards (from the `making-great-prs` skill):
34+
35+
### Title
36+
37+
- Under 70 characters
38+
- Starts with a verb (Add, Fix, Update, Refactor, etc.)
39+
- Matches conventional commit style when applicable
40+
41+
### Body Structure
42+
43+
- Has a `## Summary` section with bullet points describing what changed and why
44+
- Has a `## Test plan` section with checkbox items for verification
45+
- Includes a session link if available
46+
- Uses proper markdown formatting with real newlines (no literal `\n`)
47+
48+
### Body Content
49+
50+
- Summary accurately reflects ALL commits on the branch, not just the latest
51+
- Test plan items are specific and actionable
52+
- No placeholder text or template remnants
53+
54+
## Step 4: Update the PR
55+
56+
Update the PR title and/or body with the corrected content. Show the user what changed.
57+
58+
## Usage Examples
59+
60+
```bash
61+
/fix-pr # Fix PR for current branch
62+
/fix-pr 300 # Fix PR #300
63+
```

plugins/scm-utils/skills/auto-pr/SKILL.md renamed to plugins/scm-utils/skills/making-great-prs/SKILL.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
name: auto-pr
2+
name: making-great-prs
33
description: >
4-
Automatically create or update a pull request for the current branch.
5-
Use after pushing commits to ensure a PR exists and its description is current.
4+
Best practices and procedures for creating and maintaining high-quality pull requests.
5+
Covers PR creation, body formatting, title conventions, and lifecycle management.
66
Triggers on: "create a PR", "update the PR", "open a pull request", "push and PR",
7-
or automatically after any push to a feature branch per the auto-pr-management rule.
7+
"fix PR", "fix PR body", "PR formatting", or automatically after any push to a
8+
feature branch per the auto-pr-management rule.
89
allowed-tools: Bash, Read, Grep, Glob
910
---
1011

11-
# Auto PR Management
12+
# Making Great PRs
1213

1314
Create and maintain pull requests for feature branches using `gh api` with `--hostname github.com` (required for web sessions where the git remote is a local proxy).
1415

@@ -104,6 +105,14 @@ gh api repos/nsheaps/ai-mktpl/pulls/<PR_NUMBER> \
104105
- Start with a verb (Add, Fix, Update, Refactor, etc.)
105106
- Match conventional commit style when applicable
106107

108+
## PR Body Formatting
109+
110+
**CRITICAL:** PR bodies must contain real newlines, not literal `\n` escape sequences.
111+
112+
- When using `gh api`, use heredocs (`$(cat <<'PREOF' ... PREOF)`) — they preserve newlines naturally
113+
- When using MCP tools (e.g. `mcp__github__create_pull_request`), pass the body as a multi-line string with actual newlines — MCP tool string parameters support real newlines
114+
- **Never** construct PR bodies by concatenating strings with `\n` — GitHub renders them as literal text, not line breaks
115+
107116
## Error Handling
108117

109118
| Error | Resolution |

0 commit comments

Comments
 (0)