Wrap up work by syncing documentation, committing changes, pushing to the remote, and opening a pull request. Consult this skill whenever committing code, pushing changes, creating a pull request, or finishing a task that involves documentation updates — including partial workflows like "just commit" or "push and create a PR."
Install
npx skillscat add kvnwolf/devtools/commit Install via the SkillsCat registry.
Commit
Workflow
1. Require Documentation Section
Check if @CLAUDE.md contains a ## Documentation section.
If the section exists, skip to step 2.
If NOT exists:
- Inform: "This project needs a documentation section in CLAUDE.md. Starting setup..."
- Launch 3 parallel subagents (Task tool with
subagent_type: Explore):
Agent 1 - Project Structure & Tech Stack:- Analyze top-level and src/ directories to identify logical areas
- Identify package manager, framework, and build tools
- Return project context summary with detected areas and stack
Agent 2 - Existing Documentation: - Find all
*.mdfiles (excluding node_modules, .git, dist) - Read each file and analyze its content in depth
- For each file, determine its purpose and what specific condition should trigger an update (be precise — e.g. "Function signatures in src/api/ change" not just "Code changes")
- Return mapping of files to their detected purpose and update condition
Agent 3 - Documentation Gaps: - Based on project structure and existing docs, identify what documentation is missing
- Common gaps: API reference, contributing guide, changelog, architecture overview
- Only suggest files that provide real value for the project's size and type
- Return suggestions with file path, purpose, and rationale
- Wait for all agents to complete.
- If Agent 3 found gaps, present suggestions to the user with
AskUserQuestion(multiSelect: true). Create any selected files with initial content. - Build the
## Documentationtable from Agent 2 results (plus any files created in step 4):File Purpose Update When (each file with its detected purpose and precise update condition) - Edit @CLAUDE.md to add the
## Documentationsection with the table. It must be the last section in the file. - Show the generated table to the user for confirmation.
The documentation section is a prerequisite for the remaining steps because it drives which files get updated in step 4. Confirm it exists before proceeding.
2. Gather Context
Run each command separately:
git diff --staged- Only if step 1 had NO output:
git diff git log --oneline
3. Determine Staging
- If
git diff --stagedhas output -> staged changes exist, use them as-is (user curated manually) - If
git diff --stagedis empty -> rungit add -Ato stage everything
4. Sync Documentation
- Read the
## Documentationtable from @CLAUDE.md - Find all staged
*.mdfiles, detect its purpose and update condition, then register it in the table. - For each tracked file, evaluate whether its "Update When" condition is met by the staged changes.
- Read and update every file whose condition is met. The update must reflect the actual staged changes accurately.
- If new files were registered in step 2, persist the updated table in @CLAUDE.md.
5. Stage Documentation
Stage any .md files updated or created in step 4:
git add <updated-doc-files>6. Generate and Execute Commit
Subject line: imperative mood, start with a lowercase letter (keeps consistency with conventional-commit prefixes like feat:, fix:), no period, max 70 characters. Describe what the change does as a clear, self-contained statement.
Body: explain why the change was made. Include context that the diff alone cannot convey: motivation, trade-offs, decisions, or migration steps. If the change breaks backward compatibility, state it explicitly in the body.
References: append issue/ticket references on their own line at the end (e.g., Closes #142).
- Analyze the staged diff to understand what changed
- Write a subject line that describes the change in imperative mood
- Write a body explaining why the change was made
- Add issue references if applicable
- Execute with a HEREDOC to preserve newlines and avoid shell escaping issues with quotes and special characters in the commit body:
git commit -m "$(cat <<'EOF'
subject line describing what changed
Body explaining why this change was made. What problem does it solve?
What was the motivation? Any important context the diff can't convey.
Closes #issue (if applicable)
EOF
)"7. Push
git push -u origin HEAD8. Pull Request
Only offer this step if the branch was pushed in step 7.
- Run
git branchto determine the current branch. If the branch ismain, then stop - Generate a PR title and body from commits since divergence:
git log <base-branch>..HEAD --oneline git diff <base-branch>...HEAD - Create the PR:
gh pr create --title "<title>" --body "$(cat <<'EOF' ## Summary <bullet points from commit analysis> ## Test plan <checklist> EOF )"