commit

Solid

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

Code & Development 83 stars 5 forks Updated today MIT

Install

View on GitHub

Quality Score: 80/100

Stars 20%
64
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 提交代码 在不覆盖用户本地工作的前提下创建 Git commit,并在需要时更新关联任务状态。 更新关联 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。 ## 常见违规借口与反驳 | 借口 | 反驳 | |------|------| | 「测试之前跑过了,不用重跑」 | 暂存内容是最新现实;提交前必须重新核对 `git status`/`git diff`,不能凭记忆。 | | 「`git add -A` 更省事」 | 禁止 `git add -A`/`git add .`;只暂存明确列出的文件,避免带入无关改动。 | | 「改了带版权头的文件,年份先不动」 | 改了就更新版权年份(动态取 `date +%Y`),这是提交前的硬性检查。 | ## 任务上下文解析 > 入口允许省略 task ref,也接受旧位置 task ref 或 `--task <ref>` / `-t <ref>`。先从完整参数中分离 task scope 并原样保留其他业务操作数,再调用 `agent-infra-internal task-context resolve {task-scope}`;`{task-scope}` 为空、位置 ref 或 task flag 之一。只读取结构化结果的 `taskId`,后续把 `{task-id}` 绑定为该完整 `TASK-YYYYMMDD-HHMMSS`。解析失败时透传非零退出码,不自行扫描任务。 未显式指定 task scope 时,只有 `TASK_CONTEXT_NOT_FOUND` 可继续既有纯提交路径;detached HEAD、损坏候选或多匹配属于歧义,必须失败。显式 task scope 解析失败时一律失败。 ## 步骤开始:写入 started 标记 开始检查本地修改之前,向 task.md `## 活动日志` 追加一条 started 标记(与本步骤 done 条目同基名 + ` [started]` 后缀,note 用 `started`): ``` - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Commit [started]** by {agent} — started ``` `ai task log` 会把它与提交完成时写入的 done 条目配对成一行(进行中 → 已完成)。格式与配对规则见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。仅当本任务存在 task.md 时写入(无任务上下文的纯提交可跳过)。 ## 1. 检查本地修改(关键) 在任何编辑前先检查: ```bash git status --short git diff ``` 必须尊重现有用户改动;如果你的计划与之冲突,先停止并征求确认。 ## 2. 更新版权头年份 动态获取当前年份,只更新已经改动过的文件。 > 完整版权检查流程见 `reference/copyright-check.md`。修改任何版权头前,先读取 `reference/copyright-check.md`。 ## 3. 生成提交信息 检查状态、diff 和最近历史,然后按 Conventional Commits 生成 message,并补齐正确的协作署名。 ...

Details

Author
fitlab-ai
Repository
fitlab-ai/agent-infra
Created
4 months ago
Last Updated
today
Language
TypeScript
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category