Version Control Best Practices
Overview
This skill defines version control standards for all work products beyond just git - including documentation versions, knowledge entries, configuration, and data. Consistent version control practices enable traceability, recovery, and collaboration.
When to Use
- When committing any change to shared repositories
- When creating versions of documents, knowledge entries, or configurations
- When branching, merging, or managing parallel work streams
- When tagging releases or important milestones
- Don't use when: Working only on local drafts not yet ready for shared storage
Core Procedures
Step 1: Commit Standards
Every commit must have:
- Clear message: Start with verb, describe WHAT changed and WHY (not just "update" or "fix")
- Atomic: One logical change per commit (don't mix unrelated changes)
- Attributed: Correct author information
- Tested: Don't commit known-broken code to shared branches
Message format:
[type]: brief description
Detailed explanation if needed.
Related: [ticket/issue number if applicable]
Types: feat, fix, docs, refactor, test, chore, config, knowledge
Step 2: Branch Strategy
- main/master: Always deployable, protected branch
- develop: Integration branch for features (if using gitflow)
- feature/name: One branch per feature or task
- hotfix/name: Urgent fixes to production
- release/version: Stabilization before release
- Branch names use lowercase-with-dashes
Step 3: Version Numbering
Use semantic versioning (MAJOR.MINOR.PATCH):
- MAJOR: Breaking changes that require user action
- MINOR: New features that are backward compatible
- PATCH: Bug fixes and minor improvements
For documentation/knowledge:
- Major structural rewrites
- New content sections added
- Corrections, clarifications, updates
Step 4: Knowledge Versioning
For non-code assets (knowledge, documentation):
- Track version in document frontmatter
- Maintain changelog at top of significant documents
- Use tags to mark: current, deprecated, archived, experimental
- Never delete, only supersede or archive
Step 5: Merge and Review
- Never push directly to main (if protected)
- Create pull request or merge request for all changes
- At least one reviewer for significant changes
- Resolve all conflicts before merging
- Delete branches after merging
Quality Checklist
Error Handling
- Error: Accidentally committed secrets or sensitive data
Response: Immediately revoke secret, force push to rewrite history, rotate all potentially exposed secrets
- Error: Merge conflict in critical file
Response: Don't force merge, get input from both authors, ensure both intents preserved
- Error: Committed broken code to main
Response: Revert immediately, fix on separate branch, improve guardrails to prevent recurrence
Cross-Team Integration
Related Skills: finishing-a-development-branch, using-git-worktrees, requesting-code-review, knowledge-capture
Used By: ALL agents working with shared repositories, especially developers, documenters, knowledge managers
1---2name: version-control-best-practices3description: >4 Use when managing versions of code, documentation, knowledge, or configuration.5 This skill provides standardized version control practices across all repositories6 and knowledge stores, ensuring consistency, traceability, and recoverability.7metadata:8 source: https://skillmd.com/skills/construct-ai-primary/version-control-best-practices9---1011# Version Control Best Practices1213## Overview14This skill defines version control standards for all work products beyond just git - including documentation versions, knowledge entries, configuration, and data. Consistent version control practices enable traceability, recovery, and collaboration.1516## When to Use17- When committing any change to shared repositories18- When creating versions of documents, knowledge entries, or configurations19- When branching, merging, or managing parallel work streams20- When tagging releases or important milestones21- **Don't use when:** Working only on local drafts not yet ready for shared storage2223## Core Procedures2425### Step 1: Commit Standards26Every commit must have:27- **Clear message:** Start with verb, describe WHAT changed and WHY (not just "update" or "fix")28- **Atomic:** One logical change per commit (don't mix unrelated changes)29- **Attributed:** Correct author information30- **Tested:** Don't commit known-broken code to shared branches3132Message format:33```34[type]: brief description3536Detailed explanation if needed.3738Related: [ticket/issue number if applicable]39```4041Types: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `config`, `knowledge`4243### Step 2: Branch Strategy44- **main/master:** Always deployable, protected branch45- **develop:** Integration branch for features (if using gitflow)46- **feature/name:** One branch per feature or task47- **hotfix/name:** Urgent fixes to production48- **release/version:** Stabilization before release49- Branch names use lowercase-with-dashes5051### Step 3: Version Numbering52Use semantic versioning (MAJOR.MINOR.PATCH):53- **MAJOR:** Breaking changes that require user action54- **MINOR:** New features that are backward compatible55- **PATCH:** Bug fixes and minor improvements5657For documentation/knowledge:58- Major structural rewrites59- New content sections added60- Corrections, clarifications, updates6162### Step 4: Knowledge Versioning63For non-code assets (knowledge, documentation):64- Track version in document frontmatter65- Maintain changelog at top of significant documents66- Use tags to mark: current, deprecated, archived, experimental67- Never delete, only supersede or archive6869### Step 5: Merge and Review70- Never push directly to main (if protected)71- Create pull request or merge request for all changes72- At least one reviewer for significant changes73- Resolve all conflicts before merging74- Delete branches after merging7576## Quality Checklist77- [ ] All commits follow message format78- [ ] Branch naming follows convention79- [ ] Version numbers follow semantic versioning80- [ ] No broken code committed to shared branches81- [ ] All merges are reviewed before completion82- [ ] Old versions properly archived, not deleted8384## Error Handling85- **Error:** Accidentally committed secrets or sensitive data86 **Response:** Immediately revoke secret, force push to rewrite history, rotate all potentially exposed secrets87- **Error:** Merge conflict in critical file88 **Response:** Don't force merge, get input from both authors, ensure both intents preserved89- **Error:** Committed broken code to main90 **Response:** Revert immediately, fix on separate branch, improve guardrails to prevent recurrence9192## Cross-Team Integration93**Related Skills:** finishing-a-development-branch, using-git-worktrees, requesting-code-review, knowledge-capture94**Used By:** ALL agents working with shared repositories, especially developers, documenters, knowledge managers