prompt-engineering

prompt-engineering is a skill for Claude Code, Codex from liyecom/liye-ai. It costs 12 tokens per session (1,208 once invoked), scanned A, original, Apache-2.0.

Guidance for writing instructions that help AI agents produce consistent results, including structured prompts, examples, constraints, and workflow patterns. It also covers how to organize the information an agent receives.

In plain words
What is it for?
Use it to design system prompts, improve agent workflows, add examples and constraints, or organize retrieved information and conversation context.
Why use it?
It helps reduce unclear or inconsistent agent responses and makes complex tasks easier to control. Clear structure can also reduce unnecessary context and processing.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths.

Good fit Use it to design system prompts, improve agent workflows, add examples and constraints, or organize retrieved information and conversation context.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/liyecom/liye-ai/prompt-engineering
Install

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.

Any agent
npx skills add liyecom/liye-ai --skill prompt-engineering
Clone the repo
git clone --depth 1 https://github.com/liyecom/liye-ai

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for prompt-engineering

README.md
[![agentmods](https://agentmods.dev/badge/skills/liyecom/liye-ai/prompt-engineering/github.svg)](https://agentmods.dev/skills/liyecom/liye-ai/prompt-engineering)
Your own site
<a href="https://agentmods.dev/skills/liyecom/liye-ai/prompt-engineering"><img src="https://agentmods.dev/badge/skills/liyecom/liye-ai/prompt-engineering/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for prompt-engineering

Your own site · 80×15
<a href="https://agentmods.dev/skills/liyecom/liye-ai/prompt-engineering"><img src="https://agentmods.dev/badge/skills/liyecom/liye-ai/prompt-engineering.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,208 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00012 $0.01208
Opus 5 $0.00006 $0.00604
Sonnet 5 $0.00002 $0.00242
Haiku 4.5 $0.00001 $0.00121

Measured 9d ago against content hash 128f6a51f6bc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

prompt-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 9d 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.

Skills/00_Core_Utilities/meta/prompt-engineering/SKILL.md · 178 lines

How it starts

The opening of the file, as written. The whole thing — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Prompt Engineering

来源: ComposioHQ/awesome-claude-skills 适配: LiYe OS 三层架构

教授提示工程技术,包括 Anthropic 最佳实践、Agent 设计模式、上下文工程。

When to Use This Skill

当需要优化 AI 交互时:

  • 设计高效 System Prompt
  • 优化用户提示
  • 构建 Agent 工作流
  • 减少 Token 消耗
  • 提升输出质量

Core Capabilities

1. 提示结构设计

# System Prompt 结构

## 角色定义
你是 [角色],专长于 [领域]。

## 核心指令
1. [首要任务]
2. [次要任务]

## 约束条件
- [限制 1]
- [限制 2]

## 输出格式
[期望的输出格式说明]

## 示例
[Few-shot 示例]

2. Anthropic 最佳实践

技术 描述 效果
XML 标签 使用 <tag> 结构化内容 提升解析准确度
Chain of Thought 引导逐步推理 提升复杂任务表现
角色扮演 明确定义 AI 角色 输出更一致
Few-shot 提供示例 输出格式更稳定
显式约束 明确禁止行为 减少意外输出

3. 上下文工程

┌─────────────────────────────────┐
│        System Prompt            │ ← 角色、规则、格式
├─────────────────────────────────┤
│      Retrieved Context          │ ← RAG 检索内容
├─────────────────────────────────┤
│      Conversation History       │ ← 对话历史
├─────────────────────────────────┤
│        User Message             │ ← 用户输入
└─────────────────────────────────┘

4. Agent 设计模式

ReAct 模式:

Thought: 我需要...
Action: [工具调用]
Observation: [结果]
Thought: 根据结果...
Action: [下一步]
...
Final Answer: [最终答案]

Plan-and-Execute:

1. 分析任务 → 生成计划
2. 逐步执行计划
3. 根据反馈调整
4. 汇总结果

Multi-Agent 协作:

Coordinator → Researcher → Writer → Reviewer
     ↑__________________________________|

5. Token 优化策略

  • 简洁表达
  • 避免冗余说明
  • 使用缩写和符号
  • 结构化而非叙述
  • 懒加载上下文

Usage Examples

示例 1: System Prompt 设计

用户: 帮我设计一个代码审查 Agent 的 System Prompt
Claude: [使用 prompt-engineering 设计角色、规则、输出格式]

示例 2: 提示优化

用户: 这个提示效果不好,帮我优化
Claude: [使用 prompt-engineering 分析问题、应用技术、重写提示]

示例 3: Agent 工作流

用户: 我想让 Claude 自动完成研究任务
Claude: [使用 prompt-engineering 设计 ReAct 循环、定义工具、编排流程]

Dependencies

无外部依赖,纯方法论技能。

LiYe OS Integration

业务域引用

此技能被以下业务域引用:

  • 12_Meta_Cognition: 提示工程(主域)
  • 06_Technical_Development: Agent 开发

与 LiYe OS 的关系

本技能直接服务于 LiYe OS 的核心交互层:

  • 优化 .claude/packs/ 的 Context Packs
  • 提升 Skill 描述的触发准确度
  • 改进 Agent 协作效率

Read the full file on GitHub · 178 lines

Changes

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.

  1. 9d ago First seen · 178 lines · 12 tokens per session scan A 128f6a51f6bc

Subscribe to this mod's changes

prompt-engineering is a skill published in the GitHub repository liyecom/liye-ai (33 stars, last pushed 2d ago), licensed Apache-2.0. It adds 12 tokens to every session and 1,208 once invoked, about $0.0001 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.