Trigger threshold
Use this skill only when the user explicitly states that the current project follows 璀璨工坊规范 or eliteforge specification . If the user has not made such a project-level declaration, do not enable this skill; handle it as a general capability.
Objective
In Git operation tasks, prioritize invoking the built-in scripts to complete standardized operations; only output native commands when scripting is not possible. Always ensure that the branching strategy, commit specifications, and MR gates are consistent with the team rules. For any task that "requires code modification," the branch gate must be satisfied first before editing files is allowed.
Execution principles
-
Branch prerequisite gate (mandatory)
Perform the branch check first; when the branch naming is incorrect or the local quality gate is not passed, modifying code and committing are prohibited. -
Identify the scenario
First determine whether it is正常迭代、热修、分支整理、提交/MR 合规or统计分析。
- Locate the script directory (mandatory)
Do not assume thatscripts/exists in the current repository. First locate the scripts under the skill's own directory, then invoke them.
ELITEFORGE_GIT_SCRIPTS=""
for root in "$PWD" "${SKILLS_HOME:-}" "$HOME"; do
[ -n "$root" ] || continue
found="$(find "$root" -type d -path '*/eliteforge-git-specification/scripts' 2>/dev/null | head -n 1)"
if [ -n "$found" ]; then
ELITEFORGE_GIT_SCRIPTS="$found"
break
fi
done
[ -n "$ELITEFORGE_GIT_SCRIPTS" ] || { echo "Cannot locate eliteforge-git-specification/scripts." >&2; exit 1; }
-
Scripts first
If a script already covers the corresponding capability, invoke the script first rather than repeatedly hand-writing long command sequences. -
Strict gates
Always check the branch prerequisites, whether squash is needed, the MR/pipeline status, and the release path. -
Structured output
The output content is fixed as:结论、分支门禁检查、命令序列、风险与门禁、提交/MR 文案。 -
The workflow must be strictly executed
Script mapping (use first)
-
Automatically pull and merge version branches
bash "$ELITEFORGE_GIT_SCRIPTS/auto_merge" [--ff-only | --merge | --rebase]
Applicable: on theqa/<version>orrelease/<version>branch, batch-merge the correspondingfeature/<version>/、bugfix/<version>/changes. -
Check the merge status of a specified version branch
bash "$ELITEFORGE_GIT_SCRIPTS/check_merge" <version> <branch>
Applicable: verify whetherfeature/<version>andbugfix/<version>have been merged into the target branch (such asreleaseorqa)。 -
Clean up local branches
bash "$ELITEFORGE_GIT_SCRIPTS/delete_local_branches"
Applicable: delete local branches exceptmaster/main. -
Clean up merged remote branches
bash "$ELITEFORGE_GIT_SCRIPTS/delete_merged_branches" <version>
Applicable: onrelease/<version>, identify and delete mergedfeature/<version>branches.
Note: this script includes interactive confirmation. -
Rename a branch
bash "$ELITEFORGE_GIT_SCRIPTS/rename_git_branch" <old-branch> <new-branch>
Applicable: rename a local branch and sync it to the remote. -
Generate a change summary
bash "$ELITEFORGE_GIT_SCRIPTS/git_change_summary.sh"
Applicable: output a change summary relative tomaster..HEAD(excludingstyle/build/test)。 -
Count author code volume
bash "$ELITEFORGE_GIT_SCRIPTS/user_code.sh" <base_dir> '<author1|author2|...>' <YYYY-MM-DD>
Applicable: count added, deleted, and modified lines across multiple repositories by author and start date.
Mandatory constraints
- One requirement, one feature branch
- Before any code change, first confirm that you are on a compliant development branch; developing directly on
master/main/nightly/qa/releaseis prohibited. featureSubmit for testing toqa 使用合并请求;联调自行合并到nightly`。featureBefore merging intorelease, squash into a single commit first.releaseMerge back intomasterusegit merge --ff-only。hotfixOnly for on-site blocking issues.- Commit format:
<type>(<scope>): <subject>。 - Must squash before the final MR; the MR title must match the squashed commit.
- Use
.gitlab/merge_request_templates/default.mdand complete the self-check.
References
- Read when you need the full specification, examples, and workflow
references/git-governance-reference.md。