| name | version-control-skill |
| description | Enable AI agents to efficiently query history, compute differences, and follow safe workflows across version control systems. |
| metadata | {"author":"Nitin Bhide (nitinbhide@thinkingcraftsman.in)","version":"1.0"} |
| license | Apache 2.0 |
| allowed-tools | bash git hg svn |
| user-invocable | true |
| disable-model-invocation | true |
Version Control - Activity Skill
Purpose
Enable AI agents to efficiently query history, compute differences, and follow safe workflows across version control systems.
Core Principles
- Always ensure working copy is synchronized before performing operations.
- Prefer read-only operations for history exploration.
- Use explicit time ranges or branch references when querying logs.
- Generate outputs in a consistent, human-readable format.
- Delegate actual command execution to VCS-specific references.
Scenarios
1. Generate Change Logs
Inputs
- Time range:
- today
- yesterday
- last week
Flow
- Resolve the time range into concrete start and end timestamps.
- Query commit history within the range.
- Extract:
- commit identifier
- author
- timestamp
- message
- Format output as chronological log (latest first preferred).
Output Format
Will be as per the version control that you are using.
2. Log Between Two Branches
Assumption
Branches share a common ancestor.
Inputs
- source branch
- target branch
Flow
- Identify commits reachable from one branch and not the other.
- Direction:
- changes in source not in target
- Retrieve commit metadata.
- Present ordered list.
Output Format
Same as change logs.
3. Generate Unified Diff Between Two Branches
Inputs
- base branch
- comparison branch
Flow
- Resolve both branches to their latest revisions.
- Compute differences between trees.
- Generate unified diff format:
- file paths
- additions (+)
- deletions (-)
Output Format
Standard unified diff format
4. Ensure Safe Working State Before Modification
Flow
- Check if local working copy is clean.
- Synchronize with remote repository.
- Handle conflicts if detected.
- Only then allow further operations (outside scope).
Error Handling
- If branches do not share a common ancestor → abort with explanation.
- If working directory is dirty → warn before proceeding.
- If time range yields no commits → return empty result.
References
- See
/references/git.md
- See
/references/hg.md
- See
/references/subversion.md
Each reference maps these flows to concrete commands for specific version control system.