当前位置: 首页 > Skill >

Agent Orchestration

Agent Orchestration

Agent Orchestration

精通派生与管理子智能体,编写高效的提示词,追踪运行状态,并从每次结果中汲取经验。Hal Stack 🦞 系列之一。

1.0.0 2026.11.24 959
获取Skill文件查看使用说明
作 者:苏舟 许可证: 更新时间:2026.11.24
本文目录展开

Agent Orchestration 🦞

By Hal Labs — Part of the Hal Stack

Your agents fail because your prompts suck. This skill fixes that.

The Core Problem

You're not prompting. You're praying.

Most prompts are wishes tossed into the void:

❌ "Research the best vector databases and write a report"

You type something reasonable. The output is mid. You rephrase. Still mid. You add keywords. Somehow worse. You blame the model.

Here's what you don't understand: A language model is a pattern-completion engine. It generates the most statistically probable output given your input.

Vague input → generic output. Not because the model is dumb. Because generic is what's most probable when you give it nothing specific to work with.

The model honored exactly what you asked for. You just didn't realize how little you gave it.

The Core Reframe

A prompt is not a request. A prompt is a contract.

Every contract must answer four non-negotiables:

Element Question
Role Who is the model role-playing as?
Task What exactly must it accomplish?
Constraints What rules must be followed?
Output What does "done" look like?

Miss one, the model fills the gap with assumptions. Assumptions are where hallucinations are born.

The 5-Layer Architecture

Effective prompts share a specific structure. This maps to how models actually process information.

Layer 1: Identity

Who is the model in this conversation?

Not "helpful assistant" but a specific role with specific expertise:

You are a senior product marketer who specializes in B2B SaaS positioning.
You have 15 years of experience converting technical features into emotional benefits.
You write in short sentences. You never use jargon without explaining it.

The model doesn't "become" this identity—it accesses different clusters of training data, different stylistic patterns, different reasoning approaches.

Identity matters. Miss this and you get generic output.

Layer 2: Context

What does the model need to know to do this task exceptionally well?

Context must be:

  • Ordered — Most important first
  • Scoped — Only what's relevant
  • Labeled — What's rules vs. editable vs. historical
## Context

### Rules (never change)
- Design system: Tailwind, shadcn components
- Voice: Professional but warm, never corporate

### Current State (may evolve)
- Landing page exists at /landing
- Using Next.js 14 with App Router

### Historical (for reference)
- Originally built with Create React App, migrated Jan 2025

Without labels, the model treats everything as equally optional. Then it rewrites your core logic halfway through.

Layer 3: Task

What specific action must be taken?

Not "write something about X" but precise instructions:

## Task
Produce a 500-word product description that:
- Emphasizes time-saving benefits for busy executives
- Opens with the primary pain point
- Includes 3 specific use cases
- Ends with a clear call to action

The more precisely you define the task, the more precisely the model executes.

Layer 4: Process ⚡

This is where most prompts fail.

You're asking for output. You should be asking for how the output is formed.

❌ Bad:

Write me a marketing page.

✅ Good:

## Process
1. First, analyze the target audience and identify their primary pain points
2. Then, define the positioning that addresses those pain points
3. Then, write the page
4. Show your reasoning at each step
5. Do not skip steps
6. Audit your work before reporting done

You don't want answers. You want how the answer is formed.

Think like a director. You're not asking for a scene—you're directing how the scene gets built.

Layer 5: Output

What does "done" actually look like?

If you don't specify, you get whatever format the model defaults to.

## Output Format
Return a JSON object with:
- `headline`: string (max 60 chars)
- `subheadline`: string (max 120 chars)  
- `body`: string (markdown formatted)
- `cta`: string (action verb + benefit)

Do not include explanations, notes, or commentary. Only the JSON.

Miss one layer, the structure wobbles. Miss two, it collapses.

Model Selection

Prompt portability is a myth.

Different models are different specialists. You wouldn't give identical instructions to your exec assistant, designer, and backend dev.

Model Type Best For Watch Out For
Claude Opus Complex reasoning, nuanced writing, long context Expensive, can be verbose
Claude Sonnet Balanced tasks, code, analysis Less creative than Opus
GPT-4 Broad knowledge, structured output Can be sycophantic
Smaller models Quick tasks, simple queries Limited reasoning depth

Adapt your prompts per model:

  • Some prefer structured natural language
  • Some need explicit step sequencing
  • Some collapse under verbose prompts
  • Some ignore constraints unless repeated
  • Some excel at analysis but suck at creativity

The person who writes model-specific prompts will outperform the person with "better ideas" every time.

Constraints Are Instructions

Vagueness isn't flexibility. It's cowardice.

You hedge because being specific feels risky. But the model doesn't read your mind.

Constraints are not limitations. Constraints are instructions.

## Constraints
- Never alter the existing design system
- Always maintain the established voice/tone
- Never change the data model without explicit approval
- Max 3 API calls per operation
- If unsure, ask rather than assume

Every conversation starts at zero. The model doesn't have accumulated context from working with you. Consistency comes from instruction, not memory.

Canonical Documentation

If you don't have docs, you're gambling.

Document Purpose
PRD What we're building and why
Design System Visual rules and components
Constraints Doc What must never change
Context Doc Current state and history

The rule: Reference docs in your prompts.

The attached PRD is the source of truth. Do not contradict it.
The design system in /docs/design.md must be followed exactly.

Without explicit anchoring, the model assumes everything is mutable—including your core decisions.

"Good prompting isn't writing better sentences. It's anchoring the model to reality."

The Complete Template

## Identity
You are a [specific role] with [specific expertise].
[Behavioral traits and style]

## Context

### Rules (never change)
- [Constraint 1]
- [Constraint 2]

### Current State
- [Relevant background]

### Reference Docs
- [Doc 1]: [what it contains]
- [Doc 2]: [what it contains]

## Task
[Specific, measurable objective]

## Process
1. First, [analysis step]
2. Then, [planning step]
3. Then, [execution step]
4. Finally, [verification step]

Show your reasoning at each step.

## User Stories
1. As [user], I want [goal], so that [benefit]
2. As [user], I want [goal], so that [benefit]

## Output Format
[Exact specification of deliverable]

## Constraints
- [Limit 1]
- [Limit 2]
- [What NOT to do]

## Error Handling
- If [situation]: [action]
- If blocked: [escalation]

## Before Reporting Done
1. Review each user story
2. Verify the output satisfies it
3. If not, iterate until it does
4. Only then report complete

Ralph Mode

For complex tasks where first attempts often fail:

## Mode: Ralph
Keep trying until it works. Don't give up on first failure.

If something breaks:
1. Debug and understand why
2. Try a different approach  
3. Research how others solved similar problems
4. Iterate until user stories are satisfied

You have [N] attempts before escalating.

When to use:

  • Build tasks with multiple components
  • Integration work
  • Anything where first-try success is unlikely

Agent Tracking

Every spawned agent gets tracked. No orphans.

Maintain notes/areas/active-agents.md:

## Currently Running

| Label | Task | Spawned | Expected | Status |
|-------|------|---------|----------|--------|
| research-x | Competitor analysis | 9:00 AM | 15m | 🏃 Running |

## Completed Today

| Label | Task | Runtime | Result |
|-------|------|---------|--------|
| builder-v2 | Dashboard update | 8m | ✅ Complete |

Heartbeat check:

1. Run sessions_list --activeMinutes 120
2. Compare to tracking file
3. Investigate any missing/stalled agents
4. Log completions to LEARNINGS.md

The Learnings Loop

Every agent outcome is data. Capture it.

Maintain LEARNINGS.md:

## What Works
- User stories + acceptance loop
- Ralph mode for complex builds
- Explicit output formats
- Process layer with reasoning steps

## What Doesn't Work
- Lazy task dumps
- Missing success criteria
- No scope limits
- Vague constraints

## Experiment Log
### [Date]: [Agent Label]
**Approach:** [What you tried]
**Outcome:** [What happened]  
**Lesson:** [What you learned]

Role Library

Build reusable role definitions:

# Role Library

## Research Analyst
You are a senior research analyst with 10 years experience in technology markets.
You are thorough but efficient. You cite sources. You distinguish fact from speculation.
You present findings in structured formats with clear recommendations.

## Technical Writer  
You are a technical writer who specializes in developer documentation.
You write clearly and concisely. You use examples liberally.
You assume the reader is smart but unfamiliar with this specific system.

## Code Reviewer
You are a senior engineer conducting code review.
You focus on correctness, maintainability, and security.
You explain your reasoning. You suggest specific improvements, not vague feedback.

Quick Reference

The 4 Non-Negotiables

  1. Role — Who is the model?
  2. Task — What must it do?
  3. Constraints — What rules apply?
  4. Output — What does done look like?

The 5 Layers

  1. Identity — Specific role and expertise
  2. Context — Ordered, scoped, labeled
  3. Task — Precise objective
  4. Process — How to approach (most overlooked!)
  5. Output — Exact format specification

Pre-Spawn Checklist

  • Identity assigned?
  • Context labeled (rules/state/history)?
  • Task specific and measurable?
  • Process described (not just output)?
  • User stories defined?
  • Output format specified?
  • Constraints explicit?
  • Error handling included?
  • Added to tracking file?

The Final Truth

The gap between "AI doesn't work for me" and exceptional results isn't intelligence or access.

One group treats prompting as conversation. The other treats it as engineering a system command.

The model matches your level of rigor.

  • Vague inputs → generic outputs
  • Structured inputs → structured outputs
  • Clear thinking → clear results

You don't need to be smarter. You need to be clearer.

Clarity is a system, not a talent.

Part of the Hal Stack 🦞

Got a skill idea? Email: halthelobster@protonmail.com

"You're not prompting, you're praying. Start engineering."

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • Agent Orchestration 🦞
    • The Core Problem
    • The Core Reframe
    • The 5-Layer Architecture
      • Layer 1: Identity
      • Layer 2: Context
      • Layer 3: Task
      • Layer 4: Process ⚡
      • Layer 5: Output
    • Model Selection
    • Constraints Are Instructions
    • Canonical Documentation
    • The Complete Template
    • Ralph Mode
    • Agent Tracking
    • The Learnings Loop
    • Role Library
    • Quick Reference
      • The 4 Non-Negotiables
      • The 5 Layers
      • Pre-Spawn Checklist
    • The Final Truth
  • 项目或源文件

相关 Skill

更多
Agent Orchestration Multi Agent Optimize.Skip Agent Orchestration Multi Agent Optimize.Skip 通过协同的性能分析、工作负载分配和成本感知编排优化多智能体系统。用于提升智能体性能和吞吐量。
agent-workflow-playbook agent-workflow-playbook AI Agent Workflow & Skill Architecture Guide — Design patterns for building autonomous AI agent systems, plugin marketplaces, and multi-agent orchestration. Battle-tested framework from shipping 200+ skills on ClawHub. By @WeiYipei.
LangGraph.js Agent Orchestration Framework LangGraph.js Agent Orchestration Framework LangGraph.js 的一个已验证技能,LangGraph.js 是 LangChain 提供的基于图的编排框架。它专注于可控代理、持久化、流式处理和部署入口点。
Agent Orchestration Multi Agent Optimize Agent Orchestration Multi Agent Optimize 通过协调分析、负载分配和成本感知编排优化多智能体系统。适用于提升智能体性能、吞吐量或可靠性。
StepGateSkill StepGateSkill Use this skill whenever working on multi-step tasks, large refactors, cross-session development, or multi-agent orchestration — any situation where skipping a planned step would be costly. This skill enforces an external cryptographic ledger: every planned step must be checkpointed with a valid key before the task can be finalized. Triggers on phrases like "multi-step plan", "refactor in phases", "orchestrate agents", "long task", "don't skip steps", "checkpoint my work", "gate my steps", or any