with one click
skill-015
Commit changes and push to GitHub following Spaarke git conventions
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Commit changes and push to GitHub following Spaarke git conventions
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
First use any clearly matching enabled local/user Agent Skill. If none matches, prefer this router for skill-shaped requests involving a named tool, API, service, CLI, platform, file format, dataset, or domain workflow, including when a generic built-in skill such as browser, Chrome, or web search also seems applicable; use built-ins directly only when explicitly requested or when the task is primarily live browsing, logged-in page operation, clicking, screenshotting, or current webpage inspection. Also use directly to audit, slim, disable, restore, or route locally installed Agent Skills across supported hosts. Examples include Vercel, Netlify, Cloudflare, Render, Playwright, Sentry, Linear, GitHub, OpenAI APIs, PDF, DOCX, PPTX, and spreadsheets.
ใณในใ่ฆ็ฉๆธใไฝๆใใใไบ็ฎ็ญๅฎใ่ฆ็ฉใใใใณในใ่จ็ปๆใซไฝฟใใ
Advanced tools for creating, modifying, and analyzing pivot tables in Excel, enabling quick data summarization and insights.
PDF manipulation toolkit. Extract text/tables, create PDFs, merge/split, fill forms, for programmatic document processing and analysis.
Third-party WordPress plugin integration patterns. Use when adding new integrations, debugging compatibility with other plugins, or working with existing integrations.
Intelligent agent routing and topology selection based on task characteristics
| name | skill-015 |
| description | Commit changes and push to GitHub following Spaarke git conventions |
Category: Operations Last Updated: January 2026
Automate the git workflow from staged changes to pull request creation. Ensures code quality checks run before commits, generates conventional commit messages, and creates well-documented PRs that link to related issues and specs.
git config user.name and git.config user.email setmain or master for feature workgh CLI for automated PR creationWhen working in a git worktree (e.g., spaarke-wt-{project-name}), additional sync is required:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Main Repo (C:/code_files/spaarke) โ
โ โโ LOCAL master branch โ needs explicit pull after merge โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Worktree (C:/code_files/spaarke-wt-{project}) โ
โ โโ feature/work branch โ pushes to origin/master โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ GitHub (origin/master) โ "merge to master" updates this โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
DETECT worktree:
git rev-parse --git-common-dir
IF output contains ".git/worktrees":
โ Working in a worktree
โ MAIN_REPO_PATH = git rev-parse --git-common-dir (parent of .git/worktrees)
โ After merge to master, MUST sync main repo
When merging to master from a worktree, always sync the main repo:
# After pushing branch:master
cd {MAIN_REPO_PATH}
git fetch origin
git pull origin master
This ensures the main repo's local master matches origin/master.
PRs should be created early in the project lifecycle for visibility:
| Stage | Action | PR State |
|---|---|---|
| After project artifacts created | Create feature branch | No PR yet |
| After first meaningful commit | Create draft PR | Draft |
| Implementation complete | Mark PR ready | Ready for Review |
| After code review passes | Merge to master | Merged |
Project start (after /design-to-project Phase 3):
git checkout -b feature/{project-name}
git add projects/{project-name}/
git commit -m "feat({scope}): initialize {project-name} project"
git push -u origin feature/{project-name}
Create draft PR (for visibility):
gh pr create --draft --title "feat({scope}): {project-name}" --body "## Status\n- [ ] Implementation in progress"
During implementation (incremental commits):
git add .
git commit -m "{type}({scope}): {description}"
git push
When ready for review:
gh pr ready # Converts draft to ready-for-review
After approval (merge to master):
gh pr merge --squash # Or merge via GitHub UI
Before committing, verify code quality:
CHECK current branch:
IF on main/master AND has changes:
โ WARN: "You're on the main branch. Create a feature branch first?"
โ SUGGEST: git checkout -b feature/{description}
CHECK for uncommitted changes:
git status --porcelain
IF no changes:
โ "No changes to commit. Nothing to do."
โ STOP
RUN quality checks (ask user first):
โ "Should I run linting, code review, and ADR check before committing? (recommended)"
IF yes:
โ Execute linting on changed files:
โข TypeScript/PCF: cd src/client/pcf && npm run lint
โข C#: dotnet build --warnaserror (Roslyn analyzers)
โ Execute /code-review on changed files
โ Execute /adr-check on changed files
โ Report any issues found
โ IF lint errors OR critical issues: STOP and ask user to fix first
This step prevents accidentally leaving source files uncommitted.
CHECK for untracked source files:
git status --porcelain | grep "^??" | grep -E "\.(cs|ts|tsx|ps1|js|json|md)$"
IF untracked source files found:
โ ๐จ WARNING: Untracked source files detected!
โ List all untracked source files with paths
โ ASK: "These files are NOT staged for commit. Actions:"
1. Add all to this commit (git add {files})
2. Add to .gitignore (if intentionally excluded)
3. Review each file individually
4. Abort and investigate
โ REQUIRE explicit user decision before proceeding
โ IF user chooses to add: git add {files}
โ IF user chooses to ignore: Confirm files are truly not needed
โ DO NOT proceed to Step 2 until resolved
IF no untracked source files:
โ Continue to Step 2
RATIONALE: Untracked source files are a common cause of "missing code after merge"
issues. This check ensures all source files are explicitly handled before push.
Source file patterns to check:
.cs - C# source files.ts, .tsx - TypeScript/React files.js - JavaScript files.ps1 - PowerShell scripts.json - Configuration files (in src/ directories).md - Documentation (in docs/ or project directories)# Show what will be committed
git status
# Show diff summary
git diff --stat
# For detailed review
git diff
Present summary to user:
๐ Changes to commit:
Modified: {N} files
Added: {N} files
Deleted: {N} files
Files:
M src/server/api/SomeFile.cs
A src/client/pcf/NewComponent/index.ts
D src/old/deprecated.js
Proceed with commit? (y/n)
# Stage all changes (default)
git add .
# Or stage specific files if user requests
git add {specific files}
Follow Conventional Commits format:
{type}({scope}): {description}
{body - optional}
{footer - optional}
| Type | When to Use |
|---|---|
feat | New feature |
fix | Bug fix |
docs | Documentation only |
style | Formatting, no code change |
refactor | Code change that neither fixes nor adds |
perf | Performance improvement |
test | Adding or fixing tests |
chore | Build process, dependencies, tooling |
| Scope | Area |
|---|---|
api | BFF API changes |
pcf | PCF control changes |
plugin | Dataverse plugin changes |
dataverse | Dataverse configuration/ribbon |
infra | Infrastructure/Bicep |
docs | Documentation |
deps | Dependency updates |
ANALYZE changed files to determine:
- Primary type (feat/fix/refactor/etc.)
- Scope (api/pcf/plugin/etc.)
- Brief description (imperative mood, <50 chars)
PROPOSE commit message:
"{type}({scope}): {description}"
ASK user to confirm or modify
Example messages:
feat(pcf): add dark mode theme selector to command barfix(api): resolve token caching race conditionrefactor(dataverse): update ribbon XML for UCI compatibilitydocs(skills): add pr-workflow skill for git automationgit commit -m "{approved message}"
# Push current branch to origin
git push origin HEAD
# If branch doesn't exist on remote yet
git push -u origin HEAD
# Check if PR already exists for this branch
gh pr list --head {current-branch} --state open --json number,url,title
IF PR exists:
โ "โ
PR #{number} already exists: {title}"
โ " {PR URL}"
โ " Changes pushed to existing PR."
โ SKIP PR creation
โ DONE
IF no PR exists:
โ "No PR found for branch '{branch}'. Create one? (y/n)"
โ IF user says no:
โ "Pushed to remote. Create PR manually when ready:"
โ " https://github.com/spaarke-dev/spaarke/compare/{branch}?expand=1"
โ DONE
โ IF user says yes:
โ Continue to PR creation below
# Check if gh is available
gh --version
# Create PR interactively
gh pr create --title "{commit message}" --body "{PR body}"
# Or with full template
gh pr create --title "{title}" --body @- << 'EOF'
## Summary
{Brief description of changes}
## Related
- Closes #{issue number} (if applicable)
- Related to: {link to spec or design doc}
## Changes
- {Change 1}
- {Change 2}
## Testing
- [ ] Unit tests pass
- [ ] Manual testing completed
- [ ] ADR compliance verified
## Checklist
- [ ] Code follows Spaarke conventions
- [ ] Documentation updated (if needed)
- [ ] No secrets or sensitive data committed
EOF
PROVIDE GitHub PR URL:
https://github.com/spaarke-dev/spaarke/compare/{branch}?expand=1
SUGGEST PR template content for user to paste
After pushing, the sdap-ci.yml workflow runs automatically.
# Check CI status for the PR
gh pr checks
# Or watch CI progress in real-time
gh pr checks --watch
CI Pipeline Jobs (see ci-cd skill for details):
| Job | What It Checks | Blocking? |
|---|---|---|
security-scan | Trivy vulnerability scan | Yes |
build-test | Build + unit tests | Yes |
code-quality | Format, ADR tests, plugin size | Yes |
adr-pr-comment | Posts ADR violations to PR | No |
WAIT for CI checks:
gh pr checks --watch
IF any check fails:
โ View logs: gh run view {run-id} --log
โ Fix issues locally
โ Commit and push again
โ CI will re-run automatically
IF all checks pass:
โ Ready for review/merge
โ
PR Workflow Complete
Branch: {branch-name}
Commit: {short-sha} - {commit message}
PR: {PR URL or "Create manually at {URL}"}
CI Status: gh pr checks (run to verify)
Next steps:
1. Monitor CI: gh pr checks --watch
2. Fix any CI failures
3. Request reviewers (when CI green)
4. Merge when approved and CI passes
When user requests "merge to master" or "merge and sync":
1. Verify CI passes:
gh pr checks (or gh run list --branch {branch})
2. Push branch to master:
git push origin {branch}:master
3. IF in worktree (MANDATORY):
MAIN_REPO=$(git rev-parse --git-common-dir | sed 's|/.git/worktrees.*||')
cd "$MAIN_REPO"
git fetch origin
git pull origin master
โ Report: "โ
Main repo synced to {commit-sha}"
4. Summary:
โ
Merged to master
โ
Remote origin/master updated
โ
Main repo local master synced (if worktree)
Important: "Merge to master" updates origin/master but does NOT automatically update the main repo's local master when working in a worktree. Step 3 ensures full sync.
| Type | Pattern | Example |
|---|---|---|
| Feature | feature/{description} | feature/dark-mode-theme |
| Bug fix | fix/{description} | fix/token-cache-race |
| Hotfix | hotfix/{description} | hotfix/prod-auth-failure |
| Project | project/{project-name} | project/mda-darkmode-theme |
Closes #123 or Refs #456| Situation | Response |
|---|---|
| On main/master branch | Warn user, suggest creating feature branch |
| No changes to commit | Inform user, stop workflow |
| Code review finds critical issues | Report issues, ask user to fix before continuing |
| Push rejected (behind remote) | Suggest git pull --rebase origin {branch} |
| Push rejected (no upstream) | Use git push -u origin HEAD |
gh CLI not installed | Fall back to manual PR creation with URL |
| Merge conflicts | Stop and guide user through resolution |
code-review - Run before committing to catch issuesadr-check - Validate ADR compliance before committingspaarke-conventions - Naming and coding standardsci-cd - Monitor CI pipeline status and troubleshoot failures# Full workflow in commands
git status # Review changes
git add . # Stage all
git commit -m "type(scope): message" # Commit
git push origin HEAD # Push
gh pr create # Create PR (if gh installed)
git status before committing so user sees what's included/code-review and /adr-check by default unless user declinesgh CLI creates the PRgh pr checks to show CI statusgh run view {id} --log to diagnose before suggesting fixesci-cd skill for detailed troubleshooting guidancegit rev-parse --git-common-dir to find the main repo path