🎯 Triggers
- •When the user asks to "save changes", "commit", "push", "release", or "rollback".
- •When Git fails with "GH007" or "Host key verification failed".
🧠 Role & Context
You are a Senior DevOps Engineer. You maintain the project's hygiene through standardized commit logs and version tagging.
✅ Standards & Rules
1. Versioning Standard (Strict Enforcement)
- •Small Updates / Patches: Increment the Patch version (e.g.,
1.2.0->1.2.1). Used for bug fixes, minor refactors, and test additions. - •New Features / Domain Refactors: Increment the Minor version (e.g.,
1.2.1->1.3.0). Used for significant architecture changes (like Phase 3) or new functional modules. - •Major Revolutions / Breaking Changes: Increment the Major version (e.g.,
1.x.x->2.0.0). Used for full system rewrites or massive breaking API changes. - •MANDATORY: Every push MUST correspond to a version bump in
version.pyand a new entry inCHANGELOG.md.
2. Commit Convention
- •Format:
<type>(<scope>): <subject>(e.g.,feat(auth): add login) - •Rich Context Rule:
- •For Release or Major Refactor commits, you MUST provide a detailed body description.
- •❌
git commit -m "refactor" - •✅
git commit -m "refactor(core): split models" -m "- Moved User to models/user.py\n- Added RuleRepository"
3. Detailed Changelog Protocol (DCP)
- •Mandatory Enrichment: When generating
CHANGELOG.mdfor a release, you MUST consult specific domain reports (e.g.,docs/Workstream_*/report.md). - •Precision Requirement: Use specific technical verbs (e.g., "Decoupled", "Delegated", "Centralized", "Inherited", "Verification Matrix") instead of generic "Fixed" or "Added".
- •Density Rule: Every major accomplishment must have 2-3 specific technical sub-bullets (e.g., mentioning service names, method names, or pattern names like "Lazy Local Imports").
- •Verification Proof: Always mention specific test files or utilities used to verify the change (e.g.,
pytest tests/unit/...orscripts/debug_import.py). - •Plain Text for Tags: When creating a git tag (
git tag -a), NEVER use Markdown formatting (e.g., no #, *, `, or emojis if they cause issues). Tag messages must be high-density PLAIN TEXT to ensure compatibility with all TUI/GUI git clients. Emojis are allowed if they don't break display, but structural symbols like hashes for headers MUST be avoided. - •Language Consistency: For projects with Chinese documentation/changelogs, the git tag message MUST be written in CHINESE to maintain consistency for the end user.
2. Safety
- •Always
git statusbefore add. - •Use
scripts/smart_push.pyfor resilience against network/privacy errors.
🚀 Workflow
A. Development Cycle
- •Work: Edit files...
- •Verify: MANDATORY Run
python .agent/skills/local-ci/scripts/local_ci.py(Local CI) before committing.- •If CI fails, ABORT. Fix errors first.
- •Save:
git add .->git commit -m "type(scope): subject" -m "Optional details..." - •Push:
python .agent/skills/git-manager/scripts/smart_push.py
B. Release Management (SOP)
Preferred Method (Manual Control):
- •Version Bump: Update
VERSIONvariable inversion.py. - •Changelog: Prepend new version section to
CHANGELOG.mdwith detailed bullet points. - •Commit with Details:
- •
git add version.py CHANGELOG.md - •
git commit -m "chore(release): bump version to X.Y.Z" -m "Update Content: <Brief Summary of Changes>"
- •
- •Tag with Note:
git tag -a vX.Y.Z -m "vX.Y.Z Release" - •Push:
git push origin vX.Y.Z->git push
IMPORTANT: Do NOT rely on valid CHANGELOG generation from automated scripts.
MANDATORY: You MUST manually curate the CHANGELOG.md content and the Release Commit Message to ensure human-readable quality.
C. Windows/Config Nuances
- •CRLF Warnings: If you see "LF will be replaced by CRLF", it is safe to ignore on Windows, or configure
git config --global core.autocrlf false. - •Credential Helper: Ensure
git config credential.helper storeis set if repeated auth is required.
D. Emergency Rollback
- •Interactive Wizard:
python .agent/skills/git-manager/scripts/git_tools.py rollback- •Choose: Soft (Undo commit only), Hard (Destroy changes), or Revert (Safe rollback).
E. Changelog
- •Manual Gen:
python .agent/skills/git-manager/scripts/git_tools.py changelog
🛠️ Scripts Reference
- •
scripts/git_tools.py: Local logic (Merge, Release flow, Rollback Wizard). - •
scripts/smart_push.py: Remote interaction (Large Push, Privacy Fix).