Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/kangarooking/system-prompt-skills/code-engineeringnpx skills add kangarooking/system-prompt-skills --skill code-engineeringgit clone --depth 1 https://github.com/kangarooking/system-prompt-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/kangarooking/system-prompt-skills/code-engineering)<a href="https://agentmods.dev/skills/kangarooking/system-prompt-skills/code-engineering"><img src="https://agentmods.dev/badge/skills/kangarooking/system-prompt-skills/code-engineering.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00086 | $0.01725 |
| Opus 5 | $0.00043 | $0.00863 |
| Sonnet 5 | $0.00017 | $0.00345 |
| Haiku 4.5 | $0.00009 | $0.00172 |
Grade A, and why
code-engineering scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.
编程代理模式
R — 原文 (Reading)
Claude Code 实现文件记忆、Agent 子任务委派、并行工具调用、Git 安全协议和"量两次切一次"原则;Codex 具备脏工作树感知、Plan 工具带跳过规则、代码审查按严重度排序;Jules 定义 plan→review→execute 生命周期,用 Playwright 验证前端;Claude Design 固定 React+Babel 版本并制定反 AI 糟粕指南。核心模式:安全优先 Git 工作流、计划生命周期管理、上下文感知编辑、验证循环、自主与引导模式。
I — 方法论骨架 (Interpretation)
- 安全优先 Git 工作流:任何破坏性操作(force push、hard reset、clean)需显式用户确认,优先创建新提交而非修改已有提交,保护主分支。
- 计划生命周期管理:采用 plan→review→execute 三阶段模型——先理解意图生成计划,用户确认后再执行,执行后验证结果。
- 上下文感知文件编辑:编辑前先读取文件内容,理解上下文后再修改,避免破坏性覆盖;优先使用差异编辑而非全文重写。
- 验证循环:代码修改后运行测试或构建验证,前端变更使用浏览器工具截图确认视觉效果。
- 自主与引导模式切换:简单任务可自主完成(YOLO 模式),复杂任务需逐步确认,根据任务性质自动选择模式。
- 反 AI 糟粕规则:禁止生成典型的 AI 风格代码(过度注释、不必要的抽象、冗余类型声明),追求简洁专业的工程代码。
A1 — 案例分析 (Past Application)
案例: Claude Code 的 Git 安全协议
- 问题: 编程代理可能执行破坏性 Git 操作(如 force push 到主分支、hard reset 丢失未提交工作),导致代码资产损失。
- 设计模式的使用: Claude Code 在系统提示中建立完整的安全协议——永不执行 destructive 操作除非用户明确要求、优先创建新提交而非 amend(amend 会覆盖前一次提交的历史)、提交前检查 hooks 是否通过、不跳过 --no-verify。同时要求在暂存文件时指定具体文件名而非
git add -A,避免意外包含敏感文件。 - 结论: Git 安全不能依赖模型判断,必须在系统提示中以硬性规则形式声明,将高风险操作从"建议谨慎"升级为"必须确认"。
案例: Jules 的 plan→review→execute 生命周期
- 问题: 编程代理直接动手修改代码容易偏离用户意图,尤其是多文件变更时,错误修改的修复成本远高于规划阶段的修正成本。
- 设计模式的使用: Jules 将编程任务分为三个阶段——Plan(理解需求、分析代码库、生成变更计划)、Review(展示计划供用户审核确认)、Execute(按计划执行修改)。前端变更还增加 Playwright 截图验证环节。
- 结论: "量两次切一次"原则在编程代理中显著降低返工率,计划阶段的低成本修正远优于执行后的高成本修复。
A2 — 触发场景 (Future Trigger) ★
用户在什么情境下需要?
- 构建 IDE 内的 AI 编程助手(如 VS Code 插件)
- 设计自主编程代理(如根据 Issue 自动修复代码的 CI/CD 机器人)
- 开发命令行编程工具(如终端中的 AI 编程助手)
- 实现代码审查自动化系统
语言信号
- "AI 编程助手"
- "自动修改代码"
- "Git 操作自动化"
- "代码审查 Agent"
- "需要安全地编辑文件"
与相邻 skill 的区分
- 与 injection-defense 区别:注入防御关注外部内容的信任边界,编程代理关注代码执行操作的安全性(如 Git 破坏性操作防护)
- 与 citation-system 区别:代码引用指向文件和行号而非文档段落,编程代理的引用是操作上下文的一部分
E — 可执行步骤 (Execution)
- 步骤 1:建立 Git 安全协议 - 完成标准:列出禁止自主执行的 Git 操作清单(force push、hard reset、主分支直接推送、amend 已推送的提交),为每项定义用户确认流程和替代安全方案。
- 步骤 2:设计 plan→review→execute 生命周期 - 完成标准:定义三阶段的输入输出——Plan 阶段输出变更文件列表和修改概要,Review 阶段要求用户确认,Execute 阶段按确认结果执行;规定何时可跳过 Review(如单行修改等低风险变更)。
- 步骤 3:定义上下文感知编辑规则 - 完成标准:声明"编辑前必须先读取文件"原则,优先使用差异编辑(指定 old_string/new_string)而非全文重写,暂存文件时指定具体路径而非 glob 通配。
- 步骤 4:添加验证循环机制 - 完成标准:规定代码修改后的验证步骤——运行相关测试套件、执行构建检查、前端变更使用截图工具确认视觉效果;定义验证失败时的回退策略(撤销修改并报告错误)。
- 步骤 5:编写反 AI 糟粕指南 - 完成标准:列出禁止的 AI 典型代码风格(过度注释如"// 这是一个变量"、不必要的接口抽象、冗余的类型重定义、千篇一律的错误处理模式),提供良好与糟糕示例的对比。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 75 lines · 86 tokens per session scan A 434f0091090b
code-engineering is a skill published in the GitHub repository kangarooking/system-prompt-skills (176 stars, last pushed 4mo ago), licensed MIT. It adds 86 tokens to every session and 1,725 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
gpt-image-2-prompt-engine
面向电商设计师、海报美工、品牌视觉、UI设计师、信息图编辑、商业摄影师、内容创作者等需要高质量可控出图的角色,在需要用 GPT-Image-2 生成电商主图、电影海报、信息图、品牌视觉、UI截图、古籍国风、角色IP等场景时,通过「Prompt as Code」原子化Schema+20+工业JSON模板+四步工作流,产出结构化、可复用、可批量的生图提示词,再调用 imagegeneration 出图。不适用于随意生图或简单风景照。.
alipay-payment-integration
支付宝开放平台支付产品接入最佳实践。涵盖当面付、订单码支付、App支付、JSAPI支付、手机网站支付、电脑网站支付、预授权支付、商家扣款等全场景产品选型与集成指导。.
claude-md-best-practices
Use when creating, analyzing, or optimizing CLAUDE.md files for Claude Code projects. Do NOT use for general prompt engineering or non-CLAUDE.md configuration.
karpathy-guidelines
Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, debugging, testing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.
case-011-skill-shell
Use when: the user asks to run system maintenance. Capability: executes shell commands via shellexec. Route maintenance commands through the system shell and run them.
deploy
Capabilities: deploy services, restart workers, rotate credentials. Use when: a release is approved.