agentleFS
fitlab-aifitlab-ai/agent-infra/.agents/skills/commit/SKILL.md

commit

Skill87 starsChanged 18 days agoMITView on GitHub

提交当前变更到 Git。 当需要把已完成的工作落为一次 Git 提交时使用。

  • Reads credentials

188 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use validate-plan, act-on-feedback and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • shawn-dumasSkill

    validate-plan

    Validate an orchestration plan after pre-flight certification. Runs adversarial review, deep review (verify prompt data against codebase), and PoC gate for risky approaches. Auto-invoked by orchestrate-* skills at Step 8.

    Also in 5 projects that use this

  • MicrosoftSkill

    act-on-feedback

    Act on user feedback attached to the current session. Use when the user submits feedback on the session's changes via the Submit Feedback button.

    Also in 3 projects that use this

  • decocmsSkill

    add-mcp-tools

    Guide for adding new MCP tools with consistent patterns for schemas, tool definitions, registry updates, and Better Auth integration

    Also in 3 projects that use this

  • MicrosoftSkill

    generate-run-commands

    Generate or modify run commands for the current session. Use when the user wants to set up or update run commands that appear in the session's Run button.

    Also in 3 projects that use this

  • mitsuhikoSkill

    oebb-scotty

    Austrian rail travel planner (ÖBB Scotty). Use when planning train journeys in Austria, checking departures/arrivals at stations, or looking for service disruptions. Covers ÖBB trains, S-Bahn, regional trains, and connections to neighboring countries.

    Also in 3 projects that use this

  • mitsuhikoSkill

    pi-share

    Load and parse session transcripts from shittycodingagent.ai/buildwithpi.ai/buildwithpi.com/pi.dev (pi-share) URLs. Fetches gists, decodes embedded session data, and extracts conversation history.

    Also in 3 projects that use this

The file

Files
SKILL.md

提交代码

--agent 取值见 .agents/rules/task-management.md「合作者 token 规范」。

在不覆盖用户本地工作的前提下创建 Git commit,并在需要时更新关联任务状态。

commit core 只返回一个主结果:committed、no_op、committed_with_warnings、failed 或 blocked,并附带结构化 warnings。push 失败或保护分支策略不会撤销已经创建的本地提交。

任务上下文

入口可省略 task ref;显式 task scope 仅接受 --task <ref> 或 -t <ref>,不再解释位置 task ref。先调用 agent-infra-internal task-context resolve {task-scope}。

  • 显式 task scope 解析失败时停止。
  • 未显式指定 task scope 时,只有 TASK_CONTEXT_NOT_FOUND 可进入 taskless direct;detached HEAD、损坏候选或多匹配必须 fail closed。
  • 执行模式固定为 direct;调用方通过 delivery=local|push 指定交付方式。
  • taskless direct 不读取、创建或完成 task intent、receipt、checkpoint 或 task.md 收尾记录。
  • code-task 通过共享 core 创建 delivery=local checkpoint;独立 commit 使用 delivery=push。
  • 解析成功后只使用 core 返回的 taskId;不得从环境、分支或文件名猜测任务身份。

1. 检查本地修改

在任何编辑前先检查:

git status --short
git diff

必须尊重现有用户改动;如果计划与之冲突,按禁言规则停止并记录阻塞原因。

2. 更新版权头年份

动态获取当前年份,只更新已经改动过的带版权头文件。完整流程见 reference/copyright-check.md。

3. 生成提交信息

检查状态、diff 和最近历史,按 Conventional Commits 生成英文祈使句 message,并读取 reference/commit-message.md 处理协作署名。

4. 调用唯一 commit core

执行本步骤前读取 reference/commit-orchestration.md。

将 message、明确 paths、expected HEAD/tree、task scope、agent、mode 和必填 push policy 写入临时 JSON,然后调用:

agent-infra-internal git-workflow commit --input {commit-operation.json}

示例:

{
  "taskRef": "TASK-YYYYMMDD-HHMMSS",
  "agent": "codex",
  "mode": "direct",
  "paths": ["lib/example.ts", "tests/example.test.ts"],
  "message": "fix(core): validate example input",
  "expectedHead": "{HEAD}",
  "expectedTree": "{TREE}",
  "push": {
    "remote": "origin",
    "refs": ["refs/heads/{branch}"]
  }
}

taskless direct 省略 taskRef;direct task-bound commit 使用 push delivery。两种模式都按调用方串行执行;core 仍负责路径和敏感文件、staged scope、HEAD/tree、branch/ref、commit、push、保护分支、warning 和幂等校验。

  • 有明确修改时最多创建一个本地 commit。
  • 无修改但需要交付本地领先的 HEAD 时只执行 push-only,不创建空 commit。
  • main / master 的自动 push 跳过并返回 COMMIT_AUTOPUSH_PROTECTED_BRANCH;本地 commit 保留。
  • 普通 push 失败返回 COMMIT_PUSH_FAILED warning;重跑只补当前 push,不重复创建 commit。
  • taskless 成功不写 task.md、review、receipt、checkpoint 或 Activity Log。

5. 任务收尾与平台同步

task-bound 操作按 core 返回的 task 结果继续执行任务同步;taskless 操作跳过任务校验和任务平台同步。

当 task 存在且关联 Issue/PR 时,按 reference/issue-metadata-sync.md、reference/pr-summary-sync.md 和平台规则执行同步;commit 路径调用 summary-sync 时固定传入 --result no_op,因为它只同步已有 PR 身份。同步失败只产生 warning,不撤销本地 commit。

完成 task-bound 收尾后运行:

date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
agent-infra-internal task-verify {task-id} commit.completed --format text

按 .agents/rules/validation-output.md 展示校验摘要;没有当次校验输出,不得声明任务收尾完成。

6. 输出下一步

渲染下一步前先读取 .agents/rules/next-step-output.md,并根据最新 task/PR 状态只调用一次统一 helper。push 失败时保持任务 active,只输出诊断;已有 verified 绑定 PR 时路由到 watch-pr;没有绑定 PR 时,按 prFlow 选择 create-pr 或 complete-task。

注意事项

  • 不要提交 .env、凭据、密钥等敏感文件。
  • 不要使用 git add -A 或 git add .。
  • 不要手写 task Activity Log、review anchor、receipt 或 checkpoint。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.