1.8 KiB
1.8 KiB
name, description
| name | description |
|---|---|
| git-workspace-hygiene | Maintain safe, low-noise Git workflows for OpenClaw workspaces. Use when initializing repository tracking, creating secure .gitignore rules, making clean checkpoint commits, reviewing diffs, preventing secret leaks, and preparing rollback-friendly history. |
Git Workspace Hygiene
Goals
- Keep change history clear and reversible.
- Prevent accidental commits of secrets and noisy runtime files.
- Encourage small, meaningful checkpoints.
Setup workflow
- Ensure repository exists (
git initif missing). - Create/update
.gitignorewith workspace-safe defaults. - Verify ignored files include credentials, env files, logs, and transient runtime state.
- Stage intended files only.
- Create baseline commit.
Commit hygiene rules
- Prefer small scoped commits (one concern per commit).
- Use Conventional Commits format:
<type>(<scope>): <summary>.- Types:
feat,fix,docs,chore,refactor,test,build,ci. - Examples:
chore(boot): harden startup checks,feat(skills): add inbox-triage.
- Types:
- Review
git diff --stagedbefore committing. - Never commit tokens/secrets.
Quick review routine
git status --shortgit diff --statgit diff --staged- Run secret/noise scan script:
skills/git-workspace-hygiene/scripts/precommit-scan.sh - Commit only after clean scan
Rollback playbook
- Inspect history:
git log --oneline --decorate -n 20 - Undo last commit (keep changes):
git reset --soft HEAD~1 - Restore a file from HEAD:
git restore <path> - Revert committed change safely:
git revert <commit>
Optional cadence
- Create end-of-day checkpoint commit if meaningful changes accumulated.
- Tag stable milestones (
git tag <name>) when workflow is known-good.