This commit is contained in:
eddiesoehnel committed 2026-07-14 14:10:19 -06:00
1 parent 2967e6a756
commit 506cae09ff
6 files changed
-2767

No files matched your search

-4
View File
@@ -1,4 +0,0 @@
6/26/26: added sections on Modularity and Skill Packs As Communication Rail to `READEME.md`.
6/24/26: added `Advanced AI Agent Design Framework` and referenced in where needed in `README.md`.
6/21/26: added `OSDR` framework doc
6/16/26: improved the receipt sections so that a durable, first class artifact is left so any future agent/process will know exactly what was run and how to accomplish the task. Pulled from https://x.com/ishaansehgal/status/2065129901427130678
-161
View File
@@ -1,161 +0,0 @@
# Outcome–Skill–Data–Receipt (OSDR) Framework
A practical framework for designing AI agents, prompts, and workflows.
## Core Principle
Most AI systems focus on the model. The real long-term value lives in the layers around the model:
```text
Outcome
↓
Skill
↓
Data
↓
Execution
↓
Receipt
```
Over time, models become commodities. Skills, data, and receipts become the proprietary intelligence layer.
---
## 1. Outcome
**What final state must exist for the task to be considered complete?**
The outcome defines success. It is the destination, not the steps along the way.
### Example
---
## 2. Skill
**How should the work be performed?**
A skill is more than a prompt. It contains:
* Methodology
* Domain expertise
* Checklists
* Tools required
* Decision criteria
* Validation rules
* Output structure
Skills are reusable intellectual property.
### Example
---
## 3. Data
**What information and context should be used?**
Data provides the raw material for reasoning.
Examples:
* Documents
* Databases
* APIs
* Websites
* Knowledge graphs
* Personal Identity Documents (PIDs)
* Historical receipts
### Example
---
## 4. Receipt
**What happened during execution?**
A receipt captures:
* Inputs used
* Decisions made
* Outputs generated
* Validation results
* Errors encountered
* Recommendations
* Timestamp
Receipts transform one-time execution into organizational memory.
### Example
---
## Optional Evaluation Layer
To improve quality and completeness, define explicit success criteria.
### Example
```text
Evaluation:
- Minimum 15 sources
- Sources less than 7 days old
- Actionable insights section present
- No duplicate links
```
If evaluation fails, continue execution until the outcome is achieved.
---
## Optional Loop Layer
Defines when the process should run.
### Example
```text
Schedule:
Every Monday at 9:00 AM Mountain Time
```
---
# Complete Prompt Structure
```text
OUTCOME
What final state must exist?
Some are using goals,but goals are really just signpost along the way to the outcome. A goal could be an interim task sequence using this framework that get us to the outcome.
SKILL
What methodology or skill should be used?
DATA
What information sources should be used?
EVALUATION
How do we verify success?
RECEIPT
What execution details should be recorded?
LOOP (Optional)
When should this run?
```
---
# Key Insight
**Outcome defines where we are going.**
**Skill defines how we think.**
**Data defines what we know.**
**Receipt defines what we learned.**
Together, these create a system that not only produces answers, but continuously builds reusable organizational intelligence over time. A company, community, or individual becomes smarter over time not because the model improves, but because the accumulated receipts continuously refine the skills and provide context for future decisions.
-419
View File
@@ -1,419 +0,0 @@
# Prompt Skill Template
This repo is a practical starting point for turning any repeatable task or workflow or AI prompts into reusable, testable skills. I assembled and maintain it from people in the AI industry who are open sourcing their work.
The central belief behind this repo is that skills are the durable layer of AI work. Models will change, tools will change, and different systems will call the work by different names, but a well-written skill can move across them. The skill defines how the work should be done, and the receipts or logs from each run preserve what happened, what was produced, and what was learned. In that sense, the valuable asset is not just the AI model. It is the skill pack and the history of outputs it creates.
If you want to automate skills, you use a harness. A harness is the system that calls the AI, runs skills in sequence, schedules recurring work, or launches multiple agents in parallel. The harness can call different models or tools, but the skill documents remain the center of the workflow. They are the part you own, improve, and carry forward.
If you have ever written a prompt that worked once but was hard to repeat later, this repo is meant to help. The core idea is simple: a useful AI workflow should not live only in a chat transcript. It should become a skill with a clear outcome, required inputs, validation steps, and a receipt of what happened.
# Security Scan NOW!
Regardless if you trust where a skill pack like this repo comes from, always ask your local AI model (Codex Dekstop, Claude Desktop, or any other model you use) to scan this repo for any vulnerabilities before you start working with it.
## What This Helps You Do
Use this repo when you want to:
- write better prompts for repeatable work
- turn a one-off AI workflow into a reusable process
- make AI agents less likely to skip important steps
- define what "done" means before the AI starts working
- create receipts so future AI runs can understand what happened before
- improve a workflow every time it fails instead of relying on memory
- coordinate multiple AI roles, such as reviewer, designer, domain expert, or code expert
- create triggers when to run the skill and ensure it operates around edge cases
The documents here are not about prompt tricks. They are about making AI work more dependable.
## Who This Is For
This repo can help:
- people who use ChatGPT, Claude, Codex, or other AI tools for real work
- teams who want AI outputs to be more consistent
- builders creating repeatable agent workflows
- non-technical users who want clearer instructions for AI tools
- technical users who want to treat prompts and skills more like software
You do not need to be an AI expert to use this. Start with the OSDR framework, then use the ratchet framework when you are ready to make a workflow more durable.
## The Main Idea
A strong AI workflow should answer these questions:
- What outcome should exist when the work is complete?
- What skill or method should the AI use?
- What data should it rely on?
- How will the result be checked?
- What receipt should be left behind so the work can be reviewed or repeated?
- What should be improved after a failure?
This repo gives language and structure for answering those questions.
## From Prompt To Autonomous Agent
This repo is meant to scale with your AI maturity.
At the beginning, you use it to write clearer prompts. Then you turn repeated work into reusable skills. Then you add receipts, evaluation, and ratchet loops so the workflow improves over time. The advanced end state is a fully autonomous agent system: a harness that runs loops, routes context, calls deterministic tools, manages memory, enforces permissions, observes its own work, and leaves an audit trail.
That advanced end state is covered in `advanced-ai-agent-design-framework.md`. It is the place to go when you are ready to move beyond "how do I prompt this well?" and start asking "how do I design an agent that can safely act, remember, coordinate, and improve?"
In short:
- `OSDR-framework.md` helps define the work.
- `ratchet-based-skill-framework.md` helps make the work repeatable and self-improving.
- `advanced-ai-agent-design-framework.md` helps design the full autonomous agent system around the work.
## Documents In This Repo
### `OSDR-framework.md`
The Outcome-Skill-Data-Receipt framework is the easiest place to start.
It breaks an AI workflow into:
- `Outcome`: what final state must exist
- `Skill`: how the work should be performed
- `Data`: what information should be used
- `Execution`: the actual run
- `Receipt`: what happened, what was produced, and what was learned
Use this when you are designing a prompt, automation, recurring task, or agent workflow and want to make the request clearer.
### `ratchet-based-skill-framework.md`
This is the deeper skill-design framework.
It explains how to build skills that improve over time. The key idea is the ratchet loop:
1. Run the workflow.
2. Validate the output.
3. Find what failed or was ambiguous.
4. Turn that lesson into a durable artifact.
5. Re-run validation so the same problem is harder to repeat.
A durable artifact might be a test, checklist, schema rule, validation step, anti-pattern, routing example, eval case, or stronger instruction.
Use this when a prompt or workflow matters enough that "it worked once" is not good enough.
### `advanced-ai-agent-design-framework.md`
This is the advanced autonomous-agent design framework and the long-term destination for this repo.
It takes the repo from reusable prompts and skills into full agent-system design: identity, permissions, context routing, harness loops, deterministic tools, memory, sandboxing, observability, safety, governance, and modular future-proofing.
Use this when you are designing agents that act over time, call tools, maintain memory, coordinate with other agents, or need checks and balances before high-stakes actions. This is where advanced users can think through the full system around a skill: not just the prompt, but the runtime, context, tools, state, evaluation, permissions, and audit trail required for safe autonomous operation.
Summary:
- Starts with identity and trust so the agent knows who it represents and what it is allowed to do.
- Separates the harness, tools, skills, resolvers, memory, and infrastructure into clear layers.
- Defines the loop for autonomous execution: trigger, route, reason, act, store, evaluate, and improve.
- Adds observability, sandboxing, governance, and modularity so the system can scale without becoming fragile.
### `personas.md`
This defines useful sub-agent personas for multi-agent workflows.
The current personas are:
- Designer
- Architect
- Domain Expert
- Code Expert
- Performance Expert
- Human Advocate
Use these when you want an AI system to review work from more than one perspective. For example, the Human Advocate can look for confusing instructions, while the Code Expert can focus on implementation risk.
### `CHANGELOG.md`
This records notable changes to the framework over time.
Use it to understand what changed and why, especially as the framework becomes more opinionated about receipts, validation, and durable learning.
## How To Use This Repo
You loosely define below, then use the templates in this repo to have AI build the skill.
### 1. Start With A Real Task
Pick something you already ask AI to do more than once.
Examples:
- summarize meeting notes
- turn a document into action items
- review a code change
- research a market
- create a weekly report
- clean up a spreadsheet
- publish content from draft notes
Do not start by trying to design a perfect AI system. Start with one repeatable job.
### 2. Define The Outcome
Write down what must be true when the work is done.
Example:
```text
Outcome:
Create a weekly project summary that lists completed work, blocked items, upcoming deadlines, and recommended next actions.
```
The outcome should describe the finished state, not every step.
### 3. Define The Skill
Describe how the AI should do the work.
Example:
```text
Skill:
Read the source notes, group related items, separate facts from assumptions, identify missing information, and produce a concise summary for a busy project lead.
```
This is where you capture method, judgment, rules, and format.
### 4. Define The Data
List what the AI is allowed or expected to use.
Example:
```text
Data:
- meeting notes from this week
- project task list
- prior weekly summary
- known deadlines
```
Clear data boundaries reduce hallucination and confusion.
### 5. Define Evaluation
Say how the output should be checked.
Example:
```text
Evaluation:
- every deadline must come from the source material
- action items must have an owner when one is known
- assumptions must be labeled
- unanswered questions must be listed separately
```
Evaluation is what turns a prompt into a more reliable process.
### 6. Require A Receipt
Ask the AI to leave a record of the run.
Example:
```text
Receipt:
- inputs used
- assumptions made
- output created
- validation performed
- issues found
- recommended follow-up
```
Receipts are useful because future runs can learn from past runs instead of starting from zero.
### 7. Add The Ratchet
When something goes wrong, do not only fix the current output. Improve the workflow.
Example:
```text
Failure:
The AI included a deadline that was not in the source notes.
Ratchet:
Add a validation rule: every deadline must include a source reference or be moved to "unconfirmed."
```
This is the most important habit in the repo. Every failure should make the next run better.
## Simple Prompt Template
You can copy this into an AI tool and fill in the blanks:
```text
OUTCOME
What final result should exist when this is complete?
SKILL
What method, role, checklist, or workflow should you use?
DATA
What information should you use? What should you ignore?
EVALUATION
How should we check whether the result is correct, useful, and complete?
RECEIPT
At the end, record what inputs you used, what you produced, what you checked, what failed, and what should improve next time.
RATCHET
If you discover a recurring mistake, ambiguity, or failure, suggest a durable improvement to this prompt or workflow.
```
## Example
```text
OUTCOME
Produce a clear customer-support response that answers the customer's question, acknowledges their concern, and recommends the next step.
SKILL
Act as a careful support specialist. Be concise, friendly, and specific. Do not promise anything that is not supported by the policy docs.
DATA
Use the customer message, the order notes, and the refund policy. Do not invent policy exceptions.
EVALUATION
Check that the response:
- answers the customer's actual question
- uses a calm and respectful tone
- does not include unsupported claims
- includes the next action
RECEIPT
Briefly list the source data used, any assumptions, and any policy uncertainty.
RATCHET
If the policy is unclear, suggest a rule or note that would prevent the same uncertainty next time.
```
## For Less AI-Savvy Users
Think of this repo as a way to make AI instructions less mysterious.
Instead of asking:
```text
Can you help me with this?
```
You are learning to ask:
```text
Here is the result I need.
Here is the method to use.
Here is the information to rely on.
Here is how to check your work.
Here is what to record for next time.
```
That structure helps the AI produce better work, and it helps you notice when the AI skipped something important.
## For More Technical Users
Treat skills like lightweight software artifacts.
A serious skill should have:
- a clear contract
- required inputs
- expected outputs
- validation surfaces
- edge cases
- anti-patterns
- state scope
- host capability requirements
- run receipts
- regression artifacts when failures are found
The stronger version of this repo's philosophy is:
> Build skills as tested execution contracts: validate the artifact, validate the agent behavior, and turn every failure into a durable guardrail.
## Suggested Reading Order
1. Read `OSDR-framework.md` to understand the basic structure.
2. Skim the simple prompt template in this README.
3. Use the template on one real task.
4. Read `ratchet-based-skill-framework.md` when you want to make the workflow repeatable and testable.
5. Read `advanced-ai-agent-design-framework.md` when you want to move from reusable skills into autonomous agent systems.
6. Use `personas.md` if the workflow needs multiple review perspectives.
7. Check `CHANGELOG.md` when you want to see how the framework is evolving.
## Roadmap
This repo provides a framework for creating prompts, building reusable skills, and tracking the outputs those skills produce.
### Determinstic Scripts
Skill packs like this may also include deterministic scripts that run without calling an AI model. These are regular code files that perform specific tasks reliably and repeatedly. We often create them with AI assistance, but once they exist, they can run without using AI tokens. That matters because tokens cost money, and deterministic scripts are often faster, cheaper, and more reliable for tasks that are clearly defined.
### Feedback Loops
When we create a skill, or skill pack that includes many skills and determinstic scripts for a workflow, using the templates in this repo, what we are doing additionally is building a feedback layer into the process of executing skills, which allows AI to use this feedback to improve the skills and process itself. The end goal is not just to have AI execute workflows for us, but to do so in a way where it learns and improves.
### Routing
The next evolution of skill packs is routing: deciding which parts of a skill should run as deterministic code, which parts should use a lightweight AI model, and which parts require a stronger model. Some tasks can be handled by simpler, lower-cost models. Other tasks may need more capable reasoning. Good routing helps complete the work with as little token usage as possible while still preserving quality.
So as you use this repo to design your own skill packs, keep in mind about also creating deterministic skills, creating feedback loops so AI can learn and routing to maximize efficiency.
### Autonomous Agent Systems
The advanced path is to wrap skills in a real agent system.
That means adding:
- a harness that can run loops and stop when done
- resolvers that decide what context to load and where outputs go
- deterministic tools with clear inputs, outputs, and permissions
- memory that acts as an audit trail
- observability so runs can be replayed and inspected
- sandboxing and governance for risky actions
- modular boundaries so models, tools, prompts, and memory systems can be swapped later
Use `advanced-ai-agent-design-framework.md` as the checklist for that stage. It is not the first thing most people need, but it is the direction this repo points toward: dependable autonomous agents built from clear skills, tested tools, routed context, durable receipts, and continuous improvement.
## Skill Packs As Communication Rail
As consumers increasingly rely on AI as their primary gateway to the internet, information comes to them — they no longer go looking for it. So how does a brand reach them in that world?
One answer is the skill pack: a downloadable bundle a consumer installs into their AI. Once active, it automatically pulls information from the brand, filters it based on the consumer's preferences, and surfaces only what's relevant to them.
Think of it as the inverse of email marketing. Instead of a brand pushing a message and hoping the subject line earns an open, the consumer's AI pulls from a richer stream of brand content — new products, events, articles, announcements — and delivers only what that specific person would actually care about.
The result is a better experience on both sides: brands can publish more freely without worrying about overwhelming people, and consumers get a curated feed without having to wade through irrelevant content.
## Skill Packs Cloud-Hosted With Local Processing Using MCP
One possible direction for AI is that desktop and cloud-based AI applications become the primary gateway to the internet. Instead of users searching for information across dozens of websites, their AI applications bring the right information, tools, and workflows to them.
In this model, organizations publish MCP (Model Context Protocol) servers that expose tools, knowledge, and reusable skill packs. Rather than downloading and periodically updating a local copy of a skill pack, a user's AI can retrieve the latest version directly from the provider's MCP server whenever it is needed.
The skill pack itself remains generic and version-controlled in the cloud, while the user's private data, preferences, credentials, receipts, and execution history remain local. The AI combines the cloud-hosted skill with the user's local context to perform the work, without requiring the provider to receive or store the user's data.
This architecture offers several advantages. Skill packs can be improved continuously without requiring users to download updates. Everyone benefits from the latest instructions, bug fixes, and best practices, while maintaining the privacy of their own data. It also enables a single skill pack to be used across many AI applications that support MCP, rather than being tied to a single vendor or platform.
Viewed this way, an MCP server becomes more than a tool endpoint—it becomes a distribution platform for reusable AI capabilities, allowing organizations to publish living skill packs that are always current while enabling users to execute them securely within their own AI environments.
## Current Status
This is an evolving personal framework, not a polished product.
The repo is useful today as:
- a prompt-design reference
- a skill-writing template
- a thinking framework for AI workflows
- a foundation for more formal agent systems
Expect the documents to change as the framework is used on real work and improved through the same ratchet process it recommends.
@@ -1,939 +0,0 @@
# Advanced AI Agent Design Framework
This document is a practical framework for designing advanced autonomous AI agents: agents that can run in loops, call tools, manage context, maintain memory, use permissions, leave receipts, and improve over time.
It extends the prompt-skill-template repo from single reusable skills into a full agent system architecture.
This is not just a checklist. It is a system for building agents that can be handed over, inspected, improved, and operated by someone else.
The core idea:
```text
Intent
-> Identity and permissions
-> Orchestration
-> Context routing
-> Harness loop
-> Skill reasoning
-> Tool execution
-> Output routing
-> Memory and audit trail
-> Evaluation and improvement
```
The short version:
- Skills = thinking
- Resolvers = routing
- Harness = running
- Tools = doing
An advanced agent builder should be able to:
1. map a business process end to end
2. spot where an agent can replace or relieve a bottleneck
3. build the agent, tools, harness, routing, and memory around that bottleneck
4. measure whether the agent actually moved the pipeline
## System Layers
### Design Layer
Design defines what the agent is meant to accomplish before code or files are created.
Key questions:
- What outcome should exist when the task is complete?
- What artifact should be produced: Markdown, JSON, database row, alert, dashboard update, code change, or something else?
- What does "done" mean?
- Who owns the agent?
- What authority does the agent have?
- Can the agent transact, publish, message, schedule, delete, or modify records?
- Who is responsible when it acts?
Typical artifacts:
- `objective.md`
- `agent_identity.json`
- `permissions.json`
- `success_criteria.md`
### Runtime Layer: Harness
The harness is the execution engine.
It answers:
```text
How does this run?
```
The harness:
- runs the control loop
- calls models
- calls tools
- assembles context
- enforces constraints
- validates tool calls
- logs decisions and actions
- determines when the task is complete
Think of the harness as factory machinery. It does not define the agent's judgment. It executes the workflow.
The harness should be thin and tightly scoped to a specific task. It sits between the working system and the AI. It activates the AI to operate inside a controlled area, such as a repo, service folder, data pipeline, or workspace.
In a repo-style system, the harness may:
- run the model in a loop
- read specs, tasks, and data-operation files
- write controlled outputs into a service or working directory
- manage context loaded from specs and memory
- enforce safety and permission rules
Deterministic code still matters. Cron jobs, if/then rules, validators, parsers, and scripts should continue to handle deterministic work. The harness adds AI as the intelligence layer on top of that deterministic substrate.
Before any tool execution, the harness should:
- verify agent credentials
- check permission scope
- attach an identity signature or audit record
- enforce sandbox rules
- reject actions outside authority
Good article on current state of harnesses (July 2026): https://x.com/aparnadhinak/status/2073079029624943040?utm_source=tldrai
### Deterministic Layer: Tools
Tools are reliable capabilities the agent can call.
They answer:
```text
What can the agent do repeatably?
```
Examples:
- ingest email, files, API data, or calendar data
- search and filter records
- write or update files
- create database rows
- call external APIs
- run code
- send notifications
- record payments or identity attestations
Tools should be deterministic, testable, and constrained. A tool should not be a vague instruction. It should have clear inputs, outputs, errors, and permissions.
Tools do the work. If skills are thinking, tools are doing.
### Cognitive Layer: Skills
Skills define how the agent thinks.
They answer:
```text
How should the agent interpret, decide, and communicate?
```
Skills include:
- role and behavior rules
- task methodology
- domain-specific judgment
- context-management rules
- output formats
- validation criteria
- escalation rules
Skills should be modular and reusable. A good skill can move across models, harnesses, and tool stacks.
Skills are procedural cognition. They encode how the agent should reason, judge, format, validate, and communicate.
### Identity And Personality Documents
Advanced agents often need more than a system prompt. Three durable documents are especially useful:
#### `SOUL.md`
`SOUL.md` defines who the agent is.
It can include:
- voice
- values
- operating principles
- what good output looks like
- what bad output looks like
- tone rules
- judgment rules
- behavioral preferences
This is not a task prompt. It is a constitution. Write it like you are briefing your smartest friend on how to represent a particular mind, taste, and standard of work.
#### `USER.md`
`USER.md` defines who the user is.
It is not a short bio. It is a deep user model.
It can include:
- how the user thinks
- what the user is building
- strengths
- blind spots
- temperament
- preferences
- important relationships and context
- what the user cares about
- what triggers frustration or trust
The better the agent understands the user, the better it can prioritize, communicate, and serve.
#### `AGENTS.md`
`AGENTS.md` defines operational rules.
It can include:
- what to check on every message or run
- what never to do
- how to handle failures
- lookup chains
- path rules
- escalation rules
- brain-first protocols
- multi-agent routing rules
`SOUL.md` says who the agent is. `USER.md` says who the agent serves. `AGENTS.md` says how the agent operates.
### Context Routing Layer: Resolvers
Resolvers decide what to load and where outputs go.
They answer:
```text
What context should be loaded?
Where should the result be stored or routed?
```
Context resolvers select:
- identity credentials
- permissions
- trust attestations
- relevant files
- prior summaries
- memory entries
- related receipts
- relevant tools and skills
Output resolvers route results to:
- Markdown
- JSON
- database rows
- dashboards
- audit logs
- memory stores
- optional signed or immutable records
Whenever a new skill or tool is added, the resolver layer must know how to find it. A capability exists only if the system can route work to it.
Resolvers route. They decide which context, skills, tools, memory, and output destinations are relevant to the current task.
### When A Resolver Should Be Markdown
Use Markdown when:
- routing requires judgment
- categories are fuzzy
- logic evolves often
- an LLM should interpret the routing rule
Example:
```markdown
# context_resolver.md
If the task involves analyzing a person, load:
- person identity document
- relevant social posts
- prior summaries
- recent interaction history
If the task involves documents, load:
- source documents
- prior chunk outputs
- related receipts
```
Markdown resolvers are flexible, easy to modify, and LLM-readable.
### When A Resolver Should Be Code
Use code when:
- rules are strict
- performance matters
- logic must be exact and repeatable
Example:
```python
def resolve_context(task_type):
if task_type == "diarization":
return ["pid.json", "activity.json"]
```
Code resolvers are fast, predictable, and testable.
### System Orchestration Layer
System orchestration defines who handles the work and how workflows are composed.
Typical artifact:
- `AGENTS.md`
This layer handles:
- task routing
- multi-agent coordination
- escalation logic
- agent role definitions
- workflow composition
Think of it as the org chart. It decides who does what, where work goes, and how specialized agents interact.
### State Layer: Memory
Memory defines what persists across steps, runs, and long-running workflows.
It answers:
```text
What must the agent remember?
How should that memory be retrieved?
How can we trust it later?
```
Memory can include:
- current task state
- full transcripts
- historical outputs
- prior receipts
- trends over time
- source references
- timestamps
- signatures or provenance records
Advanced agents need memory as an audit trail, not just storage.
### Infrastructure Layer
Infrastructure defines where and how the agent runs.
Questions:
- Does it run locally, in WSL, in Docker, in a VM, in a microVM, or in the cloud?
- Does each agent need its own sandbox?
- What filesystem, network, and credential access does it have?
- How are secrets stored?
- What happens when a run fails halfway?
### Evolution Layer
The system should be modular enough to improve without being rebuilt from scratch.
Ask whether you can swap:
- the model
- tools
- prompts
- skills
- resolvers
- memory backend
- sandbox runtime
- evaluation harness
Future-proofing means every layer has a boundary and a contract.
## Agent Flow
```text
Trigger
-> AGENTS.md selects agent or workflow
-> context resolver loads relevant context
-> harness executes loop
-> skill performs reasoning
-> tools execute actions
-> output resolver routes result
-> memory is updated
-> receipt is written
-> evaluator checks completion
-> ratchet improves the system when failures are found
```
Triggers can be:
- cron jobs
- manual starts
- API calls
- webhooks
- file changes
- incoming emails or messages
- scheduled monitors
## Process Discovery And Handoff
Before building an autonomous agent, map the human process.
A useful agent design should identify:
- the current business process from start to finish
- where work waits, repeats, or gets dropped
- which bottleneck the agent should replace, relieve, or accelerate
- what the agent must read
- what the agent must decide
- what the agent must do
- what the agent must produce
- how success will be measured
- who owns the result after the agent acts
The goal is not only to build an impressive agent. The goal is to move a real pipeline.
Useful measurements:
- cycle time reduced
- handoffs reduced
- manual steps removed
- error rate lowered
- response time improved
- more opportunities processed
- more work completed with the same team
- better follow-through on previously dropped tasks
If the agent cannot be connected to a bottleneck and a measurement, the design is probably still too abstract.
## Monetization Lens
When designing an agent, ask whether the system could eventually be sold, rented, or reused by someone else.
Possible sources of value:
- proprietary data collected during use
- a specialized workflow for a niche domain
- reusable skill packs
- deterministic tools
- receipts and eval cases produced over time
- domain-specific memory and context
- integrations that are painful to rebuild
## Suggested Folder Structure
```text
/agent-system
/harness
main.py
loop.py
config.yaml
/identity
SOUL.md
USER.md
agent_id.json
permissions.json
/skills
summarize.md
diarize.md
match.md
chunk_enrich.md
/resolvers
context_resolver.md
output_resolver.md
/agents
AGENTS.md
/tools
io.py
search.py
db.py
identity.py
wallet.py
attestation.py
/memory
/working
/persistent
/data
/inputs
/outputs
/logs
/sandbox
/runs
/evals
test_cases.md
failure_log.md
regression_checks.md
```
## Agent Build Checklist
Layer mapping:
1. Define objective -> design layer
2. Choose model -> harness
3. Define tools -> tools
4. Define data sources -> tools and resolvers
5. Write prompt or skill -> skills
6. Build harness loop -> harness
7. Add memory -> harness, tools, and skills
8. Add context control -> resolvers and harness
9. Define output -> skills and tools
10. Set trigger -> harness
11. Add logging -> harness
12. Add constraints -> harness and skills
13. Make it modular -> all layers
### 0. Identity And Trust Layer
This sits above every other layer.
Define:
- principal: the human or organization that owns the agent
- agent identity: DID, wallet, key, service account, or other identifier
- permissions: allowed actions, denied actions, approval thresholds
- attestations: reputation, certifications, provenance, prior actions
- payment layer: wallet, billing, payment endpoints, spending limits
- governance guarantees: immutable configs, version control, audit logs
Possible artifacts:
```text
/identity
agent_id.json
permissions.json
attestations.json
wallet.json
```
Design rule:
The agent should never act without knowing who it represents, what it is allowed to do, and how its actions will be audited.
### 1. Objective And Intent
Start here. Do not skip this layer.
Define:
- the job to be done
- the final output artifact
- the success criteria
- what "done" looks like
- what is explicitly out of scope
If the objective is fuzzy, the agent will wander.
### 2. LLM Selection
Choose the model strategy based on task requirements.
Decide:
- fast model or deeper reasoning model
- single model or multi-model architecture
- planner/executor split
- critic or evaluator model
- context window requirements
- cost constraints
- latency constraints
- privacy constraints
Advanced agents often benefit from model routing: use cheaper models for routine work and stronger models for high-stakes planning, synthesis, or verification.
### 3. Tools Layer
Define the actions the agent must be able to take.
Examples:
- ingest data
- search data
- write summaries
- update files
- call APIs
- run code
- send messages
- schedule events
- verify identity
- record audit events
- send or check payments
Tool design checklist:
- Are inputs constrained?
- Are outputs structured?
- Are errors explicit?
- Are permissions enforced?
- Is the tool deterministic?
- Can the tool be tested without an LLM?
- Does the tool leave a receipt or log entry?
Identity and payment tools may include:
```text
identity.py
verify_signature()
fetch_agent_credentials()
wallet.py
send_payment()
check_balance()
attestation.py
verify_provenance()
record_action()
```
### 4. Data And Context Sources
Define what the agent needs to see.
Examples:
- Markdown files
- JSON files
- databases
- APIs
- repo structure
- prior outputs
- logs
- receipts
- user identity documents
- calendar, email, or CRM data
Decide:
- What is static context?
- What is dynamic context?
- What should never be loaded?
- What requires trust verification?
- What requires human approval?
- What should be summarized before use?
Context is not just data. For advanced agents, context should be trusted, scoped, and traceable.
### 5. Prompt And Instruction Layer
This is the skill layer.
Define:
- system prompt
- role
- rules
- task instructions
- output format
- constraints
- escalation rules
- validation expectations
Example:
```text
You analyze emails for trends.
Only use available tools.
Operate within your permission scope.
Log all actions.
Reject tasks outside authority.
Output JSON with: topics, sentiment, anomalies, sources.
```
Keep prompts modular. A skill should be reusable across workflows.
### 6. Harness And Core Orchestration
The harness is the agent runtime.
It must handle:
- control loop: observe, decide, act, repeat
- tool execution: validate, run, return result
- context assembly: prompt, memory, current inputs, retrieved context
- stop conditions: determine when the task is complete
- error handling: retry, escalate, or stop
- logging: record decisions, tool calls, and results
- permissions: reject actions outside scope
The harness is procedural. It makes the agent run.
### 7. Memory System
Define two memory layers.
Working memory:
- current task state
- temporary notes
- active plan
- intermediate outputs
Persistent memory:
- full transcripts
- prior outputs
- historical receipts
- long-term trends
- user preferences
- reusable lessons
Memory storage can be:
- JSON files
- Markdown logs
- SQLite
- Postgres
- vector store
- graph database
Advanced memory should include:
- content
- timestamp
- source
- run ID
- agent ID
- signature or provenance record
- confidence or verification state
Memory should be treated as an audit trail, not just a pile of notes.
### 8. Context Management
Context management prevents agents from failing quietly.
Common failures:
- token overflow
- noisy context
- stale summaries
- duplicated data
- untrusted content
- missing source references
- irrelevant memory retrieval
Implement:
- clipping large outputs
- summarizing history
- deduplicating repeated data
- ranking context by relevance
- loading only verified or trusted sources when risk is high
- separating user instructions from untrusted retrieved content
- preserving source references
Advanced rule:
Context should be selected, scoped, and trusted. Loading more is not automatically better.
### 9. Output Handling
Define where outputs go and what form they take.
Possible destinations:
- Markdown
- JSON
- database
- dashboard
- audit log
- memory store
- external API
- human review queue
Output checklist:
- Is it human-readable?
- Is it machine-readable?
- Does it include sources?
- Does it include assumptions?
- Does it include validation status?
- Does it update memory?
- Does it create a receipt?
Prefer structured outputs for downstream automation, with optional Markdown for human review.
### 9.1. Sandbox
Define where the work happens in isolation.
Sandbox options:
- local folder sandbox
- WSL
- Docker
- VM
- microVM
- isolated cloud runner
Sandbox checklist:
- What files can be read?
- What files can be written?
- Is network access allowed?
- Are secrets available?
- Can subprocesses run?
- Are destructive actions blocked?
- Are credentials scoped per agent?
Identity isolation:
- each agent should run with its own credentials
- each agent should have its own permission scope
- high-risk agents should have separate sandboxes
- credentials should not be shared casually across workflows
### 10. Execution Layer
Define how the agent is triggered.
Trigger types:
- manual trigger
- cron job
- event-driven trigger
- webhook
- API call
- message queue
- file watcher
Authenticated triggers should verify:
- token
- signature
- agent identity
- user authorization
- spending or action limits
This layer is outside the harness, but required for real autonomous operation.
### 11. Observability, Checks, And Balances
The system must make agent behavior inspectable.
Log:
- who initiated the run
- what agent executed
- what model was used
- what tools were called
- what actions were taken
- what files or records changed
- what errors occurred
- what validation ran
- whether completion criteria were met
- signed proof or audit metadata where appropriate
Ask:
- Can you replay a run?
- Can you explain why the agent acted?
- Can you see what context it used?
- Can you detect incomplete work?
- Can you compare runs over time?
Advanced checker pattern:
- generator proposes or acts
- critic attacks assumptions
- synthesizer resolves conflicts
- monitor checks constraints, ethics, and scope
- evaluator checks the final artifact against success criteria
For high-stakes actions, require consensus or explicit approval before:
- financial transactions
- external communications
- data deletion
- permission changes
- strategic pivots
- irreversible writes
Adding independent checkers can improve:
- error detection
- hallucination suppression
- blind spot coverage
- policy compliance
- task completion reliability
### 12. Safety, Constraints, And Governance
Define what the agent is not allowed to do.
Controls:
- tool permissions
- read/write limits
- file path restrictions
- network restrictions
- spending limits
- approval gates
- immutable agent instructions
- versioned prompts
- external policy enforcement
- sandbox enforcement
- audit logging
Safety should not live only in the prompt. The harness, tools, filesystem, and execution environment should enforce constraints externally.
### 13. Modularity And Future-Proofing
Design every layer so it can be replaced.
Can you swap:
- model
- tool
- prompt
- skill
- resolver
- memory backend
- evaluation method
- sandbox
- trigger mechanism
- payment or identity provider
Future-proofing checklist:
- Each layer has a clear responsibility.
- Each artifact has a clear contract.
- Skills do not assume one specific model forever.
- Tools are callable outside the LLM.
- Context routing is separate from reasoning.
- Memory is separate from current task context.
- Receipts survive model and harness changes.
- Failures become regression cases or checklist updates.
The goal is a system where better models, better tools, and better infrastructure can be plugged in without throwing away the framework.
## Modularity
Build the pieces in this framework so that you can easily replace them and swap in updated components. The only component that might become long-lived are skills, but even they can be upated as the template in this repo is updated.
-19
View File
@@ -1,19 +0,0 @@
# Description
As AI may run sub-agents, this document defines the personas for those sub-agents. Set up clear path where AI agents orchestrate other AI agents. This is where it is done.
# Sub-Agent Personas
Each of these "owns" a portion of the docs, and reviews against their own documentation, including suggesting where their own docs need to be adapted.
## Designer
## Architect
## Domain Expert
## Code Expert
## Performance Expert
## Human Advocate
File diff suppressed because it is too large. Load diff