# T Push

> 由 AI 基于 git diff 总结提交内容，使用脚本运行受影响区域 CI，通过后 git commit && git push。

- **Type:** Skill
- **Install:** `agentstack add skill-timzaak-web-dev-skills-t-push`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [timzaak](https://agentstack.voostack.com/s/timzaak)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [timzaak](https://github.com/timzaak)
- **Source:** https://github.com/timzaak/web-dev-skills/tree/main/skills/t-push

## Install

```sh
agentstack add skill-timzaak-web-dev-skills-t-push
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Push with Local CI

运行时边界统一参考：`${CLAUDE_PLUGIN_ROOT}/protocols/runtime-boundaries.md`

## Fixed Flow

先由 AI 读取 `git status --short` 和必要的 `git diff`，识别本次变更涉及的源码文件。

在生成 commit message 和调用脚本前，AI 必须清理本次变更源码文件中的明显低价值注释。清理范围只限本次变更文件，不做全仓历史清理。

应删除的低价值注释包括：

- 仅对应 `.ai/design`、`.ai/task` 章节名、item 名、步骤名的注释。
- 复述函数名、变量名、类型名、文件名或目录职责的注释。
- 逐行解释显而易见语句的注释，例如“设置值”“调用接口”“返回结果”。
- 标记开发阶段、迁移步骤、临时分层、实现顺序，但对运行时代码没有帮助的注释。
- 与当前实现不再一致、语义空泛、只表达“这里处理逻辑”的注释。

必须保留的注释包括：

- 解释业务规则、领域不变量、权限/安全边界、兼容性原因、外部协议约束的注释。
- 解释复杂算法、非直观性能取舍、并发/事务/生命周期风险的注释。
- 有明确责任人的 TODO/FIXME，或指向具体缺陷、后续任务、版本约束的注释。
- 测试追溯、license、lint/coverage 指令、生成代码标记、公共 API 文档注释。

清理后重新查看必要的 `git diff`，确认 diff 中剩余注释有实际信息增量，再总结本次变更并生成简洁 commit message。commit message 必须来自 AI 对清理后实际变更的总结，不能由脚本根据目录名自动猜测。

然后使用脚本完成验证、提交和推送：

```bash
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/push.py --message ""
```

脚本负责：

- 检查 `git status --short`，无变更时停止。
- 读取 tracked、staged、unstaged 和 untracked 文件，检测 backend、frontend、demo 变更范围。
- 为受影响区域并发运行本地 CI；同一区域内部保持顺序执行。
- 使用 AI 传入的 `--message` 作为 commit message；执行提交时没有 `--message` 则停止。
- CI 全部通过后执行 `git add -A`、`git commit` 和 `git push`。

## CI Rules

- Backend 变更：依次执行 `cargo clippy --fix --allow-dirty --allow-staged --all-targets --all-features -- -D warnings`、`cargo fmt --all`，再执行一次不带 `--fix` 的 `cargo clippy --all-targets --all-features -- -D warnings` 作为最终校验（`--fix` 遇到无法自动修复的 denied lint 时仍会以 0 退出，仅靠 `--fix` 无法拦截，需此步骤才能真正强制 `-D warnings`）。若该校验报错，AI 应根据错误信息修复代码后重新运行脚本，直到通过。
- Frontend 变更：执行 `npm run lint`、`npm run format:check`、`npm run type-check`、`npm run test:run`；其中 `format:check` 和 `test:run` 不存在时跳过。
- Demo 变更：执行 `npm run lint` 和 `npm run type-check`。
- 无 backend/frontend/demo 变更时跳过本地 CI，直接进入 commit/push。

## Useful Script Options

```bash
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/push.py --dry-run
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/push.py --checks-only
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/push.py --message "chore: update workflow docs"
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/push.py --message "chore: update workflow docs" --no-push
```

## Failure

- 任一 CI 步骤失败：脚本停止，不执行 commit/push，并输出失败区域和步骤。
- 执行提交但没有传入 `--message`：脚本停止，提示先由 AI 基于 diff 生成 commit message。
- commit 失败：脚本停止，不执行 push。
- push 失败：脚本输出错误，并提示本地 commit 已保留。

## Success Criteria

- 受影响区域的 CI 检查全部通过，或无受影响区域而跳过。
- 代码已 commit 并 push 到远程。

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [timzaak](https://github.com/timzaak)
- **Source:** [timzaak/web-dev-skills](https://github.com/timzaak/web-dev-skills)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-timzaak-web-dev-skills-t-push
- Seller: https://agentstack.voostack.com/s/timzaak
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
