360 Secure SkillHub
360 安全技能中心

Preserve Human Code Edits - load human changes into context before editing

核心功能为检测文件是否被Git忽略、识别人类代码编辑并确保保留,完成编辑后执行Git提交。仅在用户请求时使用,适用于需保障代码编辑不丢失的场景,通过终端Git命令操作,最终输出含提交记录的代码修改结果。

tobiaswestholm
tobiaswestholm
热度 13.76
最近更新 2026-08-04 21:15:36
分类:开发依赖:代码执行 / 读写文件应用场景:DevOps

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add respect-human-edits
Metadata
name
respect-human-edits
description
Detect and preserve human code edits
version
1.0.1

Safe Git Editing & Committing Workflow

Use this skill only when requested by the user to ensure human code edits are preserved and changes are tracked.

Workflow Steps

  1. Check if gitignored: Before editing a file, use the terminal command git check-ignore -v <filepath> to see if a file is ignored by git.

  2. Check Human Edits: If ignored: Load the file into context before editing. If tracked: Check if the user modified it with the terminal command git diff -U1 <filepath>. Any diff is a human edit and must be preserved unless instructed otherwise.

  3. Always commit: After finishing each series of edits, finish by committing to git with a very concise message.