opencastle 1.6.3 → 1.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/README.md +9 -9
  2. package/bin/cli.mjs +6 -4
  3. package/dist/cli/adapters/adapter-contract.test.js +1 -1
  4. package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
  5. package/dist/cli/adapters/single-file-base.js +2 -12
  6. package/dist/cli/adapters/single-file-base.js.map +1 -1
  7. package/dist/cli/bootstrap.js +1 -1
  8. package/dist/cli/bootstrap.js.map +1 -1
  9. package/dist/cli/command-namespace.test.js +4 -21
  10. package/dist/cli/command-namespace.test.js.map +1 -1
  11. package/dist/cli/convoy/engine.js +2 -2
  12. package/dist/cli/convoy/engine.js.map +1 -1
  13. package/dist/cli/convoy/read-model.d.ts +8 -15
  14. package/dist/cli/convoy/read-model.d.ts.map +1 -1
  15. package/dist/cli/convoy/read-model.js +9 -68
  16. package/dist/cli/convoy/read-model.js.map +1 -1
  17. package/dist/cli/convoy/read-model.test.js +6 -25
  18. package/dist/cli/convoy/read-model.test.js.map +1 -1
  19. package/dist/cli/convoy/spec-builder.d.ts +2 -2
  20. package/dist/cli/convoy/spec-builder.d.ts.map +1 -1
  21. package/dist/cli/convoy/spec-builder.js +1 -1
  22. package/dist/cli/dashboard.js +1 -1
  23. package/dist/cli/dashboard.test.js +10 -2
  24. package/dist/cli/dashboard.test.js.map +1 -1
  25. package/dist/cli/dispatcher.test.js +5 -2
  26. package/dist/cli/dispatcher.test.js.map +1 -1
  27. package/dist/cli/docs-accuracy.test.js +5 -1
  28. package/dist/cli/docs-accuracy.test.js.map +1 -1
  29. package/dist/cli/doctor.d.ts.map +1 -1
  30. package/dist/cli/doctor.js +0 -25
  31. package/dist/cli/doctor.js.map +1 -1
  32. package/dist/cli/pipeline.d.ts +1 -1
  33. package/dist/cli/pipeline.flow.test.js +77 -77
  34. package/dist/cli/pipeline.flow.test.js.map +1 -1
  35. package/dist/cli/pipeline.js +24 -24
  36. package/dist/cli/pipeline.js.map +1 -1
  37. package/dist/cli/plan.d.ts +8 -2
  38. package/dist/cli/plan.d.ts.map +1 -1
  39. package/dist/cli/plan.js +18 -12
  40. package/dist/cli/plan.js.map +1 -1
  41. package/dist/cli/plan.test.js +17 -19
  42. package/dist/cli/plan.test.js.map +1 -1
  43. package/dist/cli/update.d.ts.map +1 -1
  44. package/dist/cli/update.js +1 -58
  45. package/dist/cli/update.js.map +1 -1
  46. package/package.json +1 -1
  47. package/src/cli/adapters/adapter-contract.test.ts +1 -1
  48. package/src/cli/adapters/single-file-base.ts +2 -11
  49. package/src/cli/bootstrap.ts +1 -1
  50. package/src/cli/command-namespace.test.ts +5 -22
  51. package/src/cli/convoy/engine.ts +2 -2
  52. package/src/{orchestrator/prompts/assess-complexity.prompt.md → cli/convoy/prompts/convoy-assess.prompt.md} +0 -3
  53. package/src/{orchestrator/prompts/fix-convoy.prompt.md → cli/convoy/prompts/convoy-plan-fix.prompt.md} +0 -3
  54. package/src/{orchestrator/prompts/validate-convoy.prompt.md → cli/convoy/prompts/convoy-plan-review.prompt.md} +0 -3
  55. package/src/{orchestrator/prompts/generate-convoy.prompt.md → cli/convoy/prompts/convoy-plan.prompt.md} +0 -2
  56. package/src/{orchestrator/prompts/fix-prd.prompt.md → cli/convoy/prompts/convoy-prd-fix.prompt.md} +0 -3
  57. package/src/{orchestrator/prompts/validate-prd.prompt.md → cli/convoy/prompts/convoy-prd-review.prompt.md} +0 -3
  58. package/src/{orchestrator/prompts/generate-prd.prompt.md → cli/convoy/prompts/convoy-prd.prompt.md} +0 -3
  59. package/src/cli/convoy/read-model.test.ts +5 -29
  60. package/src/cli/convoy/read-model.ts +11 -71
  61. package/src/cli/convoy/spec-builder.ts +2 -2
  62. package/src/cli/dashboard/dashboard.js +2 -4
  63. package/src/cli/dashboard.test.ts +10 -2
  64. package/src/cli/dashboard.ts +1 -1
  65. package/src/cli/dispatcher.test.ts +6 -2
  66. package/src/cli/docs-accuracy.test.ts +5 -1
  67. package/src/cli/doctor.ts +0 -26
  68. package/src/cli/pipeline.flow.test.ts +78 -78
  69. package/src/cli/pipeline.ts +25 -25
  70. package/src/cli/plan.test.ts +18 -20
  71. package/src/cli/plan.ts +18 -12
  72. package/src/cli/update.ts +1 -66
  73. package/src/orchestrator/agent-workflows/README.md +10 -18
  74. package/src/orchestrator/agent-workflows/data-pipeline.md +7 -140
  75. package/src/orchestrator/agent-workflows/database-migration.md +7 -153
  76. package/src/orchestrator/agent-workflows/performance-optimization.md +6 -119
  77. package/src/orchestrator/agent-workflows/refactoring.md +8 -137
  78. package/src/orchestrator/agent-workflows/schema-changes.md +8 -159
  79. package/src/orchestrator/agent-workflows/security-audit.md +7 -142
  80. package/src/orchestrator/agent-workflows/shared-delivery-phase.md +8 -25
  81. package/src/orchestrator/agents/architect.agent.md +2 -14
  82. package/src/orchestrator/agents/content-engineer.agent.md +8 -10
  83. package/src/orchestrator/agents/data-engineer.agent.md +8 -8
  84. package/src/orchestrator/agents/developer.agent.md +3 -10
  85. package/src/orchestrator/agents/devops-expert.agent.md +0 -3
  86. package/src/orchestrator/agents/performance-expert.agent.md +2 -3
  87. package/src/orchestrator/agents/security-expert.agent.md +10 -12
  88. package/src/orchestrator/agents/team-lead.agent.md +31 -75
  89. package/src/orchestrator/agents/testing-expert.agent.md +3 -6
  90. package/src/orchestrator/agents/ui-ux-expert.agent.md +1 -4
  91. package/src/orchestrator/agents/writer.agent.md +0 -3
  92. package/src/orchestrator/customizations/README.md +3 -4
  93. package/src/orchestrator/customizations/agents/agent-registry.md +3 -3
  94. package/src/orchestrator/customizations/agents/skill-matrix.json +6 -42
  95. package/src/orchestrator/instructions/general.instructions.md +10 -37
  96. package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +4 -6
  97. package/src/orchestrator/prompts/brainstorm.prompt.md +7 -12
  98. package/src/orchestrator/prompts/bug-fix.prompt.md +19 -100
  99. package/src/orchestrator/prompts/convoy.prompt.md +20 -0
  100. package/src/orchestrator/prompts/create-skill.prompt.md +1 -5
  101. package/src/orchestrator/prompts/implement-feature.prompt.md +22 -93
  102. package/src/orchestrator/prompts/resolve-pr-comments.prompt.md +1 -5
  103. package/src/orchestrator/skills/api-patterns/SKILL.md +21 -18
  104. package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +1 -1
  105. package/src/orchestrator/skills/fast-review/SKILL.md +28 -65
  106. package/src/orchestrator/skills/frontend-design/REFERENCE.md +0 -1
  107. package/src/orchestrator/skills/frontend-design/SKILL.md +3 -1
  108. package/src/orchestrator/skills/git-workflow/SKILL.md +18 -34
  109. package/src/orchestrator/skills/panel-majority-vote/SKILL.md +16 -46
  110. package/src/orchestrator/skills/security-hardening/SKILL.md +20 -19
  111. package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +2 -2
  112. package/src/orchestrator/skills/self-improvement/SKILL.md +21 -46
  113. package/src/orchestrator/skills/technical-writing/SKILL.md +3 -1
  114. package/src/orchestrator/skills/technical-writing/TEMPLATES.md +23 -0
  115. package/src/orchestrator/skills/testing-workflow/SKILL.md +21 -23
  116. package/src/orchestrator/skills/validation-gates/REFERENCE.md +2 -14
  117. package/src/orchestrator/skills/validation-gates/SKILL.md +10 -88
  118. package/dist/cli/log.d.ts +0 -44
  119. package/dist/cli/log.d.ts.map +0 -1
  120. package/dist/cli/log.js +0 -336
  121. package/dist/cli/log.js.map +0 -1
  122. package/dist/cli/log.test.d.ts +0 -2
  123. package/dist/cli/log.test.d.ts.map +0 -1
  124. package/dist/cli/log.test.js +0 -208
  125. package/dist/cli/log.test.js.map +0 -1
  126. package/src/cli/log.test.ts +0 -228
  127. package/src/cli/log.ts +0 -374
  128. package/src/orchestrator/agent-workflows/bug-fix.md +0 -130
  129. package/src/orchestrator/agent-workflows/feature-implementation.md +0 -232
  130. package/src/orchestrator/instructions/ai-optimization.instructions.md +0 -17
  131. package/src/orchestrator/prompts/quick-refinement.prompt.md +0 -110
  132. package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +0 -44
  133. package/src/orchestrator/skills/agent-hooks/SKILL.md +0 -80
  134. package/src/orchestrator/skills/agent-memory/KNOWLEDGE-GRAPH.md +0 -49
  135. package/src/orchestrator/skills/agent-memory/SKILL.md +0 -50
  136. package/src/orchestrator/skills/code-commenting/SKILL.md +0 -18
  137. package/src/orchestrator/skills/context-map/REFERENCE.md +0 -67
  138. package/src/orchestrator/skills/context-map/SKILL.md +0 -71
  139. package/src/orchestrator/skills/decomposition/SKILL.md +0 -103
  140. package/src/orchestrator/skills/documentation-standards/SKILL.md +0 -33
  141. package/src/orchestrator/skills/fast-review/REFERENCE.md +0 -28
  142. package/src/orchestrator/skills/memory-merger/SKILL.md +0 -77
  143. package/src/orchestrator/skills/observability-logging/LOG-SCHEMA.md +0 -238
  144. package/src/orchestrator/skills/observability-logging/SKILL.md +0 -73
  145. package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +0 -38
  146. package/src/orchestrator/skills/orchestration-protocols/SKILL.md +0 -120
  147. package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +0 -49
  148. package/src/orchestrator/skills/panel-majority-vote/panel-report.template.md +0 -38
  149. package/src/orchestrator/skills/performance-optimization/SKILL.md +0 -23
  150. package/src/orchestrator/skills/project-consistency/SKILL.md +0 -80
  151. package/src/orchestrator/skills/project-consistency/TEMPLATES.md +0 -35
  152. package/src/orchestrator/skills/react-development/SKILL.md +0 -24
  153. package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +0 -56
  154. package/src/orchestrator/skills/session-checkpoints/SKILL.md +0 -40
  155. package/src/orchestrator/skills/team-lead-reference/SKILL.md +0 -126
@@ -1,35 +0,0 @@
1
- ## Prompt Templates — Foundation & Page Tasks
2
-
3
- ### Foundation Setup — Prompt (copy-paste)
4
-
5
- ````markdown
6
- ## Foundation Setup — [project description]
7
-
8
- **Aesthetic:** [2-3 word direction] — [one sentence]
9
-
10
- Create `[path]/tokens.css`: palette (intent-named), fluid typography (clamp()), spacing (4px base), motion, shadows, radius, breakpoints.
11
- Create `[path]/Layout.[tsx|astro|vue]`: responsive container, site header (nav: [labels]), footer, document head.
12
- Create `[path]/ui/`: Button, Card, Heading, Text, Link, Section, Container, Grid — tokens only, zero hardcoded values; `variant`/`size`/`className` API.
13
-
14
- **Style Guide:** Tone: [formal/casual]. Terminology: [key terms]. Page structure: [hero → ... → CTA].
15
-
16
- **Acceptance Criteria:** Zero hardcoded hex/px · Layout responsive at 320/768/1280px · Fluid typography via clamp() · Fonts loaded efficiently
17
- ````
18
-
19
- ### Page Task — Prompt (copy-paste)
20
-
21
- ````markdown
22
- ## Build [Page Name] Page — [purpose, audience, primary action]
23
-
24
- **MANDATORY refs:** tokens: `[path]/tokens.css` (no new values) · Layout: `[path]/Layout.[ext]` (wrap all content) · UI: `[path]/ui/` (import, don't recreate) · Aesthetic: [2-3 words] · Tone: [tone] · Terms: [glossary]
25
-
26
- **Content:** [sections, copy direction, media] **Structure:** [hero → ... → CTA]
27
-
28
- **Acceptance Criteria:** Shared Layout used · Zero hardcoded values · UI components imported · Tone/terminology match · Responsive 320/768/1280px · [page-specific]
29
- ````
30
-
31
- ### How to use
32
-
33
- - Copy the appropriate template into the foundation or page task tracker issue.
34
- - Replace bracketed placeholders (`[path]`, `[Aesthetic]`) with exact values from the foundation task outputs.
35
- - Attach paths to tokens, Layout, and UI component library explicitly in the prompt.
@@ -1,24 +0,0 @@
1
- ---
2
- name: react-development
3
- description: "React conventions for components, hooks, prop types, styling and React Testing Library tests. Use when creating or changing React components or hooks, or writing their tests."
4
- ---
5
-
6
- # React Development Standards
7
-
8
- ## Conventions
9
-
10
- - One component per file: `ComponentName.tsx` inside its feature folder, co-located with its styles and `ComponentName.test.tsx`.
11
- - Export the props type as `ComponentNameProps`; PascalCase component names.
12
- - Styling: follow the project's approach (CSS Modules, Tailwind, …), its shared tokens, and CSS custom properties for theming.
13
- - `strict` stays enabled in `tsconfig.json`; no `as` casts.
14
- - Tests: React Testing Library on the runner bound to the **testing** capability slot, mocking external deps and API calls.
15
-
16
- ## Verification
17
-
18
- Lint, typecheck, test, and build must all exit zero. Resolve the exact commands
19
- via the **codebase-tool** slot; `.opencastle/project.instructions.md` records the
20
- project's package manager and script names.
21
-
22
- ## Security
23
-
24
- Sanitize user-supplied HTML (e.g. `dompurify`) before rendering. Client-side validation is never sufficient on its own — see **api-patterns** for server validation.
@@ -1,56 +0,0 @@
1
- # Session Checkpoint Template
2
-
3
- **Last Updated:** YYYY-MM-DD HH:MM
4
- **Feature:** Short feature name
5
- **Branch:** git branch name
6
- **Tracker Issues:** TAS-XX, TAS-YY
7
-
8
- ## Current Phase
9
-
10
- ## Completed Work
11
-
12
- | Task | Tracker | Agent | Status | Files |
13
- |------|---------|-------|--------|-------|
14
- | Description | TAS-XX | Agent | ✅ Done | file1.ts |
15
-
16
- ## In Progress
17
-
18
- | Task | Tracker | Agent | Status | Notes |
19
- |------|---------|-------|--------|-------|
20
- | Description | TAS-ZZ | Agent | 🔄 In Progress | what's done |
21
-
22
- ## Remaining Work
23
-
24
- | Task | Tracker | Agent | Dependencies | Files |
25
- |------|---------|-------|-------------|-------|
26
- | Description | TAS-AA | Agent | TAS-ZZ | file4.ts |
27
-
28
- ## Pending Approvals
29
-
30
- | Provider | Channel | Thread ID | Question | Posted At |
31
- |----------|---------|-----------|----------|-----------|
32
- | slack | C0AHAQFJ7C1 | 1772393542.345149 | Run migration on production? | 2026-03-01 14:30 |
33
-
34
- Remove row once answered (a reply in chat counts as resolved).
35
-
36
- ## Decisions & Blockers
37
-
38
- - Decision: rationale
39
- - Blocker: what's needed to unblock
40
-
41
- ## Delegation Cost Log
42
-
43
- | # | Agent | Tracker | Model Tier | Est. Tokens | Duration | Status |
44
- |---|-------|---------|------------|-------------|----------|--------|
45
- | 1 | Content Engineer | TAS-XX | Standard | ~20K | 8 min | ✅ Done |
46
-
47
- ## File Partitions
48
-
49
- Agent A: dir1/, dir2/
50
- Agent B: dir3/
51
-
52
- ## Resume Instructions
53
-
54
- 1. Check out branch `feat/xxx`
55
- 2. Read tracker issues TAS-XX for context
56
- 3. Start Phase N+1: [specific instructions]
@@ -1,40 +0,0 @@
1
- ---
2
- name: session-checkpoints
3
- description: "Saves and restores session state: task progress, file changes and delegation history. Use when saving progress before risky work or at session end, or resuming interrupted work."
4
- ---
5
-
6
- # Skill: Session Checkpoints
7
-
8
- ## When to Checkpoint
9
-
10
- | Trigger | Action |
11
- |---------|--------|
12
- | Before first delegation | After decomposition, before agents start |
13
- | After each phase | When a parallel batch completes |
14
- | Before risky work | DB migrations, large refactors, security changes |
15
- | Session end | Any session with incomplete work |
16
- | Context running low | Checkpoint immediately |
17
-
18
- Phase boundaries that warrant a checkpoint: load the **decomposition** skill.
19
-
20
- ## Creating a Checkpoint
21
-
22
- 1. Write `.opencastle/SESSION-CHECKPOINT.md` from the canonical [CHECKPOINT-TEMPLATE.md](./CHECKPOINT-TEMPLATE.md).
23
- 2. Commit it or save to workspace; attach to the tracker issue.
24
- 3. Verify: `cat .opencastle/SESSION-CHECKPOINT.md`; confirm listed files exist.
25
-
26
- ## Resuming
27
-
28
- 1. Read `.opencastle/SESSION-CHECKPOINT.md`
29
- 2. Run `git status`, `git branch` — confirm you are on correct branch
30
- 3. Check In Progress tasks — if stale (>1 session old), verify files match expected state
31
- 4. Check Pending Approvals — remove rows for questions the user has since answered in chat
32
- 5. Read tracker issues for tasks marked In Progress or Todo
33
- 6. Follow Resume Instructions section in checkpoint
34
- 7. Update checkpoint progress after each completed task
35
-
36
- **If checkpoint missing or corrupt:** Rebuild from `git log --oneline -20`, tracker state.
37
-
38
- ## Cleanup & Team Lead
39
-
40
- When all issues Done: archive to tracker; delete `.opencastle/SESSION-CHECKPOINT.md`.
@@ -1,126 +0,0 @@
1
- ---
2
- name: team-lead-reference
3
- description: "Team Lead delegation reference: complexity scoring, model tier routing, pre-delegation checks, the delegation envelope, dead-letter queue and disputes. Use when planning delegations, choosing a model tier, or handling a failed delegation."
4
- ---
5
-
6
- # Team Lead Reference
7
-
8
- ## Delegation Sequence
9
-
10
- 1. **Score** task complexity (table below) → determines tier
11
- 2. **Route** to model tier via Cost-Aware Routing
12
- 3. **Deepen** plan if 3+ subtasks (Deepen-Plan Protocol)
13
- 4. **Check** pre-delegation policy (5-point checklist below)
14
- 5. **Delegate** using Compact Delegation Envelope
15
- 6. **Handle** output per Status Handling table
16
- 7. **Log** via **observability-logging** skill
17
-
18
- For specialist agent registry, model assignments, see `.opencastle/agents/agent-registry.md`.
19
-
20
- ## Cost-Aware Model Routing
21
-
22
- | Tier | Use For |
23
- |------|---------|
24
- | **Premium** | Orchestration, architecture, security review — the hardest reasoning |
25
- | **Standard** | Feature work, schemas, UI, tests — the bulk of the work |
26
- | **Economy** | Review passes, docs, copy — high volume, low ambiguity |
27
-
28
- A tier names the kind of model, not a model: the assistant picks one it can reach.
29
-
30
- **Selection:** Default to the agent's registry tier. Never Premium for boilerplate. 3+ parallel agents → prefer Standard/Economy. Per-task overrides below.
31
-
32
- ## Complexity-Based Task Scoring
33
-
34
- | Factor | Low → High |
35
- |--------|------------|
36
- | **Files touched** | 1–2 → 3–5 → 6+ / cross-library |
37
- | **Reasoning depth** | Boilerplate → pattern matching → architecture/security/tradeoffs |
38
- | **Ambiguity** | Clear spec → some judgment → multiple valid approaches |
39
- | **Risk** | Reversible → moderate impact → DB/auth/breaking |
40
- | **Dependencies** | None → 1–2 upstream → complex chain |
41
-
42
- | Score | Tier | Examples |
43
- |-------|------|----------|
44
- | 1–2 | Economy | Docs update, config tweak, rename, simple test |
45
- | 3–5 | Standard | Component, CMS query, API route, migration |
46
- | 8 | Premium | Architecture decision, security audit, complex refactor |
47
- | 13 | Premium + Panel | DB migration with data transform, auth flow redesign |
48
-
49
- **Overrides:** Blocker (blocking 2+ downstream) → upgrade one tier. Security-touching or architecture ambiguity → Premium. Pure docs/config → Economy. Registry default takes precedence unless complexity clearly warrants change.
50
-
51
- ## Deepen-Plan Protocol
52
-
53
- | Plan Complexity | Action |
54
- |----------------|--------|
55
- | 1–2 subtasks, familiar | Skip — delegate directly |
56
- | 3–5 subtasks, mixed | Quick deepen — single Researcher sub-agent |
57
- | 6+ subtasks, unfamiliar | Full deepen — parallel Researcher sub-agents |
58
-
59
- **Quick deepen:** Fire one Researcher for exact file paths + line ranges, patterns to follow (file:line examples), relevant lessons from `LESSONS-LEARNED.md`, risks/blockers per subtask, dependencies verified against exact imports.
60
- **Full deepen:** Split by domain into parallel Researchers. See `.opencastle/agents/agent-registry.md` for scope examples.
61
-
62
- Deepen is done when no field is still a guess — "some component" → exact path + line range, "follow existing style" → specific file:line.
63
-
64
- ## Agent Output Status Handling
65
-
66
- | Status | Action |
67
- |--------|--------|
68
- | Complete | Fast review |
69
- | Complete with concerns | Resolve before review |
70
- | Needs context | Provide info; re-dispatch |
71
- | Blocked | Upgrade model/escalate; never re-dispatch unchanged |
72
-
73
- ## Pre-Delegation Policy Checks
74
-
75
- 1. Tracker issue exists for this task
76
- 2. File partition clean (no overlap with parallel agents)
77
- 3. All dependency tasks Done
78
- 4. Delegation prompt has file paths + acceptance criteria
79
- 5. Self-improvement reminder included (`Read LESSONS-LEARNED.md first`)
80
-
81
- **Feature work** adds: (6) Known issues reviewed, (7) Architecture docs read, (8) Existing code searched.
82
- **High-risk work** adds: (9) Panel review planned, (10) Rollback path identified.
83
-
84
- ## Compact Delegation Envelope
85
-
86
- ```json
87
- {
88
- "tracker": "TAS-XX",
89
- "agent": "Agent Name",
90
- "objective": "One sentence: what to do and why.",
91
- "files": ["path/to/file.ts", "path/to/other.ts"],
92
- "acceptance_criteria": ["AC 1", "AC 2"],
93
- "constraints": "Only modify listed files. Read LESSONS-LEARNED.md first.",
94
- "output_contract": "Return: files changed, lint/type/test pass/fail, discovered issues."
95
- }
96
- ```
97
-
98
- `tracker` required; `acceptance_criteria` verbatim from tracker; `files` = exact resolved paths (not globs); `output_contract` = agent's Base Output Contract. Maintain running delegation log in session checkpoint (see **session-checkpoints** skill).
99
-
100
- ## Context Source Tagging
101
-
102
- Prefix each agent's output summary `### [Agent Name] TAS-XX Description`. Never merge outputs from different agents. Cite source agent when referencing prior output. Include Agent column in checkpoint "Completed Work" tables.
103
-
104
- ## Dead Letter Queue Format
105
-
106
- Log to `.opencastle/AGENT-FAILURES.md` — create it on the first entry — when agent fails 2+ attempts, background output fails all gates, or unrecoverable error occurs. Panel 3x BLOCK → create dispute instead.
107
-
108
- Entry (`DLQ-XXX: Short description`): **Date**, **Agent**, **Tracker Issue**, **Failure Type** (`verification-fail` / `tool-error` / `panel-block` / `timeout` / `scope-creep`), **Attempts**, **Task**, **Failure Details**, **Resolution**. Scan DLQ for pending retries at session start.
109
-
110
- ## Error Recovery
111
-
112
- For common failure modes, recovery procedures, load **orchestration-protocols** skill.
113
-
114
- ## Dispute Protocol
115
-
116
- Triggers: Panel 3× BLOCK, agent-reviewer disagreement, criteria contradictions, no convergence, needs human input.
117
-
118
- Create in `.opencastle/DISPUTES.md` (create the file on the first dispute). Entry (`DSP-XXX: Short description`): **Date**, **Priority** (`critical`/`high`/`medium`/`low`), **Tracker Issue**, **Trigger** (`panel-3x-block` / `approach-conflict` / `criteria-conflict` / `architectural-ambiguity` / `external-dependency`), **Implementing Agent**, **Reviewing Agent(s)**, **Attempts**, **Status** (`pending`/`resolved`/`deferred`); then Context, Agent's Position, Reviewer's Position, Attempt History (# · type · verdict · key feedback), 2–3 Resolution Options with rationale and risk, Recommended Action, Artifacts.
119
- 1. Number (`DSP-XXX`), set priority, document both perspectives with file references
120
- 2. Build attempt history; present ≥2 options with rationale/risk
121
- 3. Link panel reports, DLQ entries, changed files
122
- 4. Log with **observability-logging** dispute command
123
-
124
- **After resolution:** `resolved` → re-delegate with decision as constraint. `deferred` → follow-up issue.
125
-
126
-