Commit Feature Without Co-Authoring
Stage all changes, create a conventional commit message without Claude co-authoring, push to origin, and add a detailed PR comment with session context including TODOs and known issues.
Arguments
$ARGUMENTS should contain:
- type (required):
feat, fix, chore, docs, style, refactor, perf, test, build, ci, revert
- scope (optional): Component or area affected (e.g.,
api, ui, auth, database)
Examples:
/commit-feature feat api — New API feature
/commit-feature fix validation — Bug fix in validation
/commit-feature chore deps — Dependency updates
Step 1 — Parse Arguments
Extract type and optional scope from $ARGUMENTS:
bash
1ARGS="$ARGUMENTS"
2TYPE=$(echo "$ARGS" | awk '{print $1}')
3SCOPE=$(echo "$ARGS" | awk '{print $2}')
Validate type is one of: feat, fix, chore, docs, style, refactor, perf, test, build, ci, revert
If invalid or missing:
❌ Invalid or missing commit type
Usage: /commit-feature <type> [scope]
Valid types:
feat - New feature
fix - Bug fix
chore - Maintenance tasks
docs - Documentation changes
style - Code style/formatting
refactor - Code restructuring
perf - Performance improvements
test - Test additions/changes
build - Build system changes
ci - CI/CD changes
revert - Revert previous commit
Example: /commit-feature feat api
Step 2 — Check Git Status
bash
1git status --porcelain
If no changes found:
ℹ️ No changes to commit
Working directory is clean. Make some changes first.
Step 3 — Show Staged and Unstaged Changes
Display what will be committed:
bash
1echo "📋 Files to be committed:"
2git status --short
3
4echo ""
5echo "📊 Summary of changes:"
6git diff --stat
Step 4 — Stage All Changes
Confirm staging:
Step 5 — Analyze Changes for Commit Message
Read the git diff to understand what was changed:
Based on the diff, create a concise commit message following conventional commit format:
Format:
<type>[(scope)]: <subject>
[optional body]
[optional footer]
Rules:
- Subject: Imperative mood, lowercase, no period, max 50 chars
- Body: Explain WHAT and WHY (not HOW), wrap at 72 chars
- Footer: Breaking changes, issue references
Examples:
feat(api): add vulnerability triage endpoint
Implements POST /api/triage for bulk finding updates with
analysis state, justification, and response tracking.
Closes #123
fix(validation): handle null values in SBOM parser
Prevents TypeError when component.version is undefined in
CycloneDX SBOM processing.
chore(deps): update prisma to 5.20.0
Includes performance improvements for PostgreSQL queries
and fixes KV cache invalidation race condition.
Step 6 — Get Current Branch and PR
bash
1BRANCH=$(git branch --show-current)
2echo "Current branch: $BRANCH"
3
4# Check if PR exists
5PR_JSON=$(gh pr list --head "$BRANCH" --base main --json number,title,url,state --limit 1)
6PR_NUMBER=$(echo "$PR_JSON" | jq -r '.[0].number // empty')
7PR_URL=$(echo "$PR_JSON" | jq -r '.[0].url // empty')
Step 7 — Create Commit (No Co-Author)
Create commit with the conventional message (WITHOUT Claude co-authoring):
bash
1git commit -m "$(cat <<'EOF'
2<type>[(scope)]: <subject>
3
4<optional body>
5
6<optional footer>
7EOF
8)"
CRITICAL: Do NOT include Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> line.
Confirm commit created:
bash
1git log -1 --oneline
Step 8 — Push to Origin
bash
1git push origin "$BRANCH"
If push fails (no upstream), set upstream and push:
bash
1git push -u origin "$BRANCH"
Step 9 — Collect Session Context
Gather detailed information for PR comment:
9.1 — Get Session Todos
Use TaskList tool to retrieve all tasks with their status, subjects, and descriptions.
Categorize by status:
- ✅ Completed — Tasks marked as completed
- 🔄 In Progress — Tasks currently being worked on
- ⏳ Pending — Tasks not yet started
- ⚠️ Blocked — Tasks with unresolved blockers
9.2 — Identify Known Issues Outside Session Scope
Review the conversation history to identify:
- Pre-existing bugs or issues mentioned but not fixed
- Technical debt noted during implementation
- Code patterns that should be improved later
- Performance concerns identified but deferred
- Security considerations for future work
- Missing tests or documentation
- Commented "TODO" or "FIXME" in changed files
Search for these patterns in the diff:
bash
1git diff --cached | grep -E "(TODO|FIXME|XXX|HACK|NOTE:|WARNING:)"
From the conversation and code changes, document:
- Approach taken: High-level implementation strategy
- Key decisions: Why certain patterns or libraries were chosen
- Trade-offs: What was prioritized and what was deferred
- Edge cases: Known limitations or boundary conditions
- Dependencies: New packages or services added
- Configuration: Environment variables or settings changed
If PR exists ($PR_NUMBER is not empty), add detailed comment:
bash
1gh pr comment "$PR_NUMBER" --body "$(cat <<'EOF'
2## 🤖 Session Summary
3
4### Commit Details
5**Type:** <type>
6**Scope:** <scope>
7**Message:** <commit subject>
8
9---
10
11### 📝 Implementation Context
12
13#### What Changed
14<Detailed explanation of the changes in this commit, including:>
15- Key functionality added/modified
16- Files affected and why
17- Integration points with existing code
18- Data model or API changes
19
20#### Approach & Decisions
21<Document the implementation approach:>
22- Why this solution was chosen over alternatives
23- Technical decisions made during implementation
24- Libraries or patterns introduced
25- Performance or security considerations
26
27#### Testing Notes
28<Testing considerations:>
29- Test coverage added
30- Manual testing performed
31- Edge cases validated
32- Known test gaps (if any)
33
34---
35
36### ✅ Session Tasks
37
38<If tasks exist, format as markdown checklist grouped by status>
39
40#### Completed
41- [x] Task 1
42- [x] Task 2
43
44#### In Progress
45- [ ] Task 3
46
47#### Pending
48- [ ] Task 4
49
50<If no tasks: "No tracked tasks for this session">
51
52---
53
54### ⚠️ Known Issues & Technical Debt
55
56<List issues identified but not addressed in this commit:>
57
58#### Pre-Existing Issues
59- Issue 1: Description and why it wasn't addressed
60- Issue 2: Description and potential impact
61
62#### Deferred Work
63- TODO 1: What needs to be done and why it was deferred
64- TODO 2: Suggested approach for future implementation
65
66#### Code Quality Notes
67- Pattern 1: Existing pattern that could be improved
68- Pattern 2: Technical debt to address in future refactor
69
70<If none: "No significant issues identified outside session scope">
71
72---
73
74### 🔗 Related Work
75
76<If applicable, link to:>
77- Related issues: #123, #456
78- Documentation: Link to relevant docs
79- Design docs: Link to technical design
80- Dependent PRs: #789
81
82---
83
84<Timestamp>
85📅 Generated: <current date/time>
86🤖 [Claude Code](https://claude.com/claude-code) Session
87EOF
88)"
If NO PR exists:
ℹ️ No PR found for branch '$BRANCH'
Changes committed and pushed. Create a PR with:
gh pr create --base main --fill
The session context can be added as a comment after PR creation.
Step 11 — Final Summary
Output comprehensive summary:
╔═══════════════════════════════════════════════════╗
║ COMMIT & PUSH SUMMARY ║
╚═══════════════════════════════════════════════════╝
COMMIT:
Type: <type>
Scope: <scope>
Message: <subject>
Hash: <commit sha>
BRANCH: <branch name>
STATUS: ✅ Committed and pushed
FILES CHANGED:
Modified: <count>
Added: <count>
Deleted: <count>
PULL REQUEST:
Number: #<pr number>
URL: <pr url>
Comment: ✅ Added detailed session context
SESSION CONTEXT:
✅ Completed tasks: <count>
🔄 In progress: <count>
⏳ Pending: <count>
⚠️ Known issues: <count>
📝 Implementation details included
NEXT STEPS:
• Review PR comments for full session context
• Address any remaining TODOs or known issues
• Ensure CI/CD checks pass
• Request review when ready to merge
Error Handling
Invalid Commit Type
❌ Invalid commit type: '<type>'
Must be one of: feat, fix, chore, docs, style, refactor, perf, test, build, ci, revert
No Changes to Commit
ℹ️ Working directory is clean
No changes to commit. Make changes first, then run:
/commit-feature <type> [scope]
Push Failed
❌ Failed to push to origin
Possible causes:
1. Network connectivity issues
2. Authentication required
3. Remote branch conflicts
4. No upstream configured
Try:
git push -u origin <branch>
# or resolve conflicts with:
git pull --rebase origin <branch>
No PR Found
ℹ️ No open PR found for branch '<branch>'
Changes committed and pushed successfully. Create PR with:
gh pr create --base main --fill
Run /commit-feature again after PR creation to add session context.
Usage Examples
bash
1# Feature commit with scope
2/commit-feature feat api
3# → Creates: "feat(api): add triage endpoint"
4# → Pushes to origin
5# → Adds detailed PR comment with session context
6
7# Bug fix without scope
8/commit-feature fix
9# → Creates: "fix: handle null values in parser"
10# → Pushes and comments on PR
11
12# Chore with dependency scope
13/commit-feature chore deps
14# → Creates: "chore(deps): update prisma to 5.20.0"
15# → Documents dependency changes in PR comment
16
17# Documentation update
18/commit-feature docs
19# → Creates: "docs: update API authentication guide"
20# → Links to related documentation in PR comment
Conventional Commit Reference
| Type | Description | Example |
|---|
feat | New feature | feat(auth): add OAuth2 support |
fix | Bug fix | fix(validation): prevent XSS in input |
chore | Maintenance | chore(deps): upgrade dependencies |
docs | Documentation | docs(api): update endpoint examples |
style | Formatting | style: apply prettier to codebase |
refactor | Code restructure | refactor(db): extract query helpers |
perf | Performance | perf(api): optimize database queries |
test | Tests | test(auth): add integration tests |
build | Build system | build: update webpack config |
ci | CI/CD | ci: add automated deployment |
revert | Revert commit | revert: revert "add feature X" |
Safety Notes
- No Claude co-authoring: Commits will NOT include
Co-Authored-By line
- Review before push: Always verify staged changes match intent
- PR comments are append-only: Multiple runs will add multiple comments
- Session context is detailed: PR comments include implementation notes, TODOs, and known issues
- Push is automatic: Changes will be pushed immediately after commit
- Conventional commits: Follow the standard for automated changelog generation
- No destructive operations: This skill only adds commits and comments