agentleFS
jmolzjmolz/m0lz.01/.agents/skills/source-command-commit-and-deploy/SKILL.md

source-command-commit-and-deploy

Skill0 starsChanged 6 months agoMITView on GitHub

Build, test, commit by feature, and deploy — adapts to any project's toolchain

  • Commits and pushes

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. About 0 are common, 16 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill when the user asks to run the migrated source command commit-and-deploy.

    line 8
  2. Distinctive:

    Run these checks in order.

    line 17
  3. Distinctive:

    Run the project's build command:

    line 34
  4. Distinctive:

    Remove this comment block once customized.

    line 51
  5. Distinctive:

    Run any project-specific validation scripts discovered in Step 1:

    line 54
  6. Distinctive:

    Run tests in order of speed — fast feedback first:

    line 64
  7. Distinctive:

    If the project has multiple test targets (e.g., a Python service alongside a JS frontend), run each:

    line 74
  8. Distinctive:

    Before committing, check if any project docs need updating based on what changed:

    line 93
  9. Distinctive:

    README.md: Update if commands, env vars, architecture, or setup changed

    line 103
  10. Distinctive:

    Subproject READMEs: Update if that subsystem's endpoints, models, config, or architecture changed

    line 105
  11. Very specific:

    If any AI layer files changed (AGENTS.md, .codex/rules/, .agents/skills/source-command-), add a Context: section to the commit body …

    line 145
  12. Distinctive:

    If you committed on a feature branch in a worktree, merge it into main:

    line 151
  13. Distinctive:

    If the merge has conflicts:

    line 170
  14. Distinctive:

    Run the full validation suite (Phase 1) again after resolving

    line 173
  15. Distinctive:

    Commit the merge resolution

    line 174
  16. Distinctive:

    After pushing, note what deploy mechanisms exist:

    line 193
  17. Distinctive:

    After a successful merge and push, remove the worktree and feature branch:

    line 208
  18. Very specific:

    If git branch -d refuses (branch not fully merged), investigate — this usually means the merge in Phase 5 didn't complete.

    line 229
  19. Distinctive:

    If deployment fails: check CI/CD logs (GitHub Actions, platform dashboard), verify builds locally, check platform console for errors.

    line 239

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

source-command-commit-and-deploy

Use this skill when the user asks to run the migrated source command commit-and-deploy.

Command Template

Commit and Deploy Workflow

Phase 1: Pre-Commit Validation

Run these checks in order. Fix failures before proceeding to the next level.

1. Discover Project Tools

# Identify package manager and scripts
cat package.json 2>/dev/null | grep -A 50 '"scripts"' | head -60
cat pyproject.toml 2>/dev/null | head -40
cat Makefile 2>/dev/null | grep '^[a-z]' | head -20

# Check for project-specific validation scripts
ls scripts/validate* scripts/check* 2>/dev/null
ls .github/workflows/ 2>/dev/null

2. Build

Run the project's build command:

# Use whatever this project has:
# npm run build / pnpm build / yarn build
# cargo build / go build ./...
# uv run python -m py_compile main.py

3. Project-Specific Checks

<!-- CUSTOMIZE: Add project-specific validation steps here. Examples: - maxDuration/timeout limit checks for serverless platforms - Pipeline pattern validation scripts - Docker builds for containerized services - Schema drift checks Remove this comment block once customized. -->

Run any project-specific validation scripts discovered in Step 1:

# Examples — use whatever this project has:
# ./scripts/validate-*.sh
# docker build -f {service}/Dockerfile .

4. Tests

Run tests in order of speed — fast feedback first:

# Regression / smoke tests (if they exist separately)
# {test-runner} {regression-test-directory}

# Full test suite
# npm test / pnpm test / pytest / cargo test

If the project has multiple test targets (e.g., a Python service alongside a JS frontend), run each:

# Examples:
# cd {service-dir} && python3 -m pytest -v
# npm test

5. Lint / Type Check (if not covered by build)

# Examples:
# npm run lint / npx tsc --noEmit
# ruff check . / mypy .
# cargo clippy

Phase 2: Documentation Updates

Before committing, check if any project docs need updating based on what changed:

# Find documentation files in the project
ls README.md TASK.md CHANGELOG.md docs/ 2>/dev/null
ls -d */README.md 2>/dev/null

For each doc that exists:

  • README.md: Update if commands, env vars, architecture, or setup changed
  • Task tracking files (TASK.md, TODO.md, etc.): Mark completed work, add discovered issues
  • Subproject READMEs: Update if that subsystem's endpoints, models, config, or architecture changed
  • User-facing docs (help pages, knowledge base): Review for accuracy if product behavior changed

Phase 3: Determine Context (Worktree or Main)

git branch --show-current
git worktree list

Determine if you're in a worktree (feature branch) or on main. The remaining phases adapt based on this.

Phase 4: Commit by Feature (CRITICAL)

Do NOT create one giant commit. Group changes by logical feature/purpose.

# Review everything
git status
git diff --stat HEAD

# Stage and commit by logical group — examples:
git add {frontend-files}
git commit -m "feat(ui): description of UI change"

git add {api-files}
git commit -m "feat(api): description of API change"

git add {schema/migration-files}
git commit -m "feat(db): description of schema change"

# Docs last, separately
git add README.md {other-docs}
git commit -m "docs: update documentation"

Commit tags: feat, fix, refactor, docs, test, chore, perf

Include scope: feat(ui), fix(api), refactor(db), etc.

If any AI layer files changed (AGENTS.md, .codex/rules/, .agents/skills/source-command-), add a Context: section to the commit body explaining what changed and why.

Phase 5: Merge to Main (Worktree Only)

Skip this phase if already on main.

If you committed on a feature branch in a worktree, merge it into main:

# Capture the current branch and worktree path
FEATURE_BRANCH=$(git branch --show-current)
WORKTREE_PATH=$(pwd)

# Navigate to the main repo
MAIN_REPO=$(git worktree list | head -1 | awk '{print $1}')
cd "$MAIN_REPO"

# Ensure main is up to date
git checkout main
git pull origin main

# Merge the feature branch
git merge "$FEATURE_BRANCH"

If the merge has conflicts:

  1. Resolve conflicts — favor the feature branch for new code, preserve main for unrelated changes
  2. Run the full validation suite (Phase 1) again after resolving
  3. Commit the merge resolution

Phase 6: Deploy

<!-- CUSTOMIZE: Replace with your project's deploy mechanism. Examples: - git push origin main (auto-deploys via Vercel/Netlify/Railway) - gh workflow run deploy.yml - ./scripts/deploy.sh - kubectl apply -f k8s/ Note expected deploy times and any multi-service deploy order. Remove this comment block once customized. -->
# Push from the main repo directory (not the worktree)
git push origin main

After pushing, note what deploy mechanisms exist:

# Check for deploy automation
ls .github/workflows/ 2>/dev/null
cat vercel.json 2>/dev/null | head -5
cat netlify.toml 2>/dev/null | head -5
cat fly.toml 2>/dev/null | head -5
cat render.yaml 2>/dev/null | head -5

Phase 7: Clean Up Worktree (Worktree Only)

Skip this phase if you were already on main.

After a successful merge and push, remove the worktree and feature branch:

# From the main repo directory
git worktree remove "$WORKTREE_PATH"
git branch -d "$FEATURE_BRANCH"

Verify cleanup:

git worktree list
# Expected: only the main worktree remains (plus any other active feature worktrees)

git branch
# Expected: feature branch is gone

git status
# Expected: "nothing to commit, working tree clean"

If git branch -d refuses (branch not fully merged), investigate — this usually means the merge in Phase 5 didn't complete. Do NOT force-delete with -D without understanding why.

Phase 8: Final Verification

git log --oneline -5
git status
# Expected: on main, clean tree, feature commits visible in log

If deployment fails: check CI/CD logs (GitHub Actions, platform dashboard), verify builds locally, check platform console for errors.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.