subagent-isolation
Clean context boundaries between agents - prevent hallucination cascades, cross-contamination, enforce error isolation.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-10
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- subagent-isolation
- triggers
- Subagent isolation, context boundaries
- changelog
- docs/ciclos/cycle28-20260815.md
- description
- Clean context boundaries between agents - prevent hallucination cascades, cross-contamination, enforce error isolation.
- token_budget
- 3100
02 资源文件 1
- 参考文档references/delegation-template.md869 B
03 SKILL.md 正文
When to Use
Maintain clean context boundaries between delegated agents —
Isolation Rules
Fresh context per delegation
Each delegate starts CLEAN. Include ALL context needed. Reference Engram IDs. File context -> paths + what to look for.
No cross-contamination
| Rule | Why |
|---|---|
| Never share state between subagents | Prevents hallucination cascades |
| Independent tool access per subagent | Error isolation |
| Serialize if B depends on A | Don't parallelize dependent work |
Dependency declaration
Declare what subagent needs (file paths, Engram IDs). NOT: full history, system prompt.
Result isolation
Each delegate returns OWN output. Conflicts -> raise to orchestrator. Subagents NEVER modify global state without explicit instructions.
Preservation contract
Every delegation output MUST include this 4-field block AS-IS (never summarized):
## Decision Taken ## Files Changed
## Key Findings ## Nuance (what detail would be lost if summarized)
Error boundaries
| Error | Action |
|---|---|
| Timeout | Retry once with cleaner prompt, then escalate |
| Wrong output | Log to Engram, re-delegate with corrected context |
| Hallucinates | Flag as contamination -> check isolation rules |
Anti-Rationalization
| Rationalization | Red Flag | Verification |
|---|---|---|
| "compartir contexto entre subagentes ahorra tokens" | Reutilizar historial completo entre delegations | Cada delegate arranca CLEAN: solo paths + Engram IDs necesarios, nunca historial completo |
| "hallucination cascade se detecta sola" | No aislar, asumir errores no se propagan | Aplicar isolation rules: no shared state, error boundaries (timeout→retry once, hallucinate→flag contamination) |
| "un subagente puede editar archivos de otro sin coordinar" | Overlap de escritura sin dependency graph | Verificar no file overlap antes de paralelizar; si B depende de A → serial, conflictos → escalar a orchestrator |
Red Flags
- Doing work without checking output format → STOP, re-read skill
- Second occurrence of same rationalization → force RED zone
Verification
- Output matches skill ## Output contract + file:line citaton
- cross-ref-check.ps1 → SKILL.md OK
Refs
delivery-harness · command-wrapper · lean-context · context-watchdog · execution-mode
Anti-Patterns
Share state between subagents · Parallelize dependent tasks · Skip 4-field contract · Keep full subagent output in context · No error isolation
See reference.md for extended details, examples, and detailed patterns.
04 同仓库更多 Skills
web-quality-audit
Comprehensive web audit: performance, a11y, SEO, responsive, animation, design tokens.
ui-engine
UI system — Grid/Flexbox/@layer/:has(), container queries, compositor-only animation, OKLCH tokens, component patterns
baseline-ui
Anti-slop UI — layout, typography, responsive, animation, tokens. Use for cleanup or polish.
skill-creator
Create new AI agent skills following Agent Skills spec -- auto-bootstrap unknown tasks, define structure, register in AGENTS.md
senior-engineer
Apply senior engineering competencies — system design, trade-off analysis, delegation, mentoring, and tech debt strategy
prompt-engineering
Design effective prompts using SPEARS framework — scope, principles, examples, assertions, refinements, with ReAct and multi-agent patterns