opencastle 0.32.5 → 0.32.6
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.
- package/README.md +13 -3
- package/bin/cli.mjs +2 -0
- package/package.json +1 -1
- package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
- package/src/orchestrator/agents/api-designer.agent.md +25 -34
- package/src/orchestrator/agents/architect.agent.md +40 -84
- package/src/orchestrator/agents/content-engineer.agent.md +29 -31
- package/src/orchestrator/agents/copywriter.agent.md +35 -60
- package/src/orchestrator/agents/data-expert.agent.md +24 -30
- package/src/orchestrator/agents/database-engineer.agent.md +26 -31
- package/src/orchestrator/agents/developer.agent.md +32 -34
- package/src/orchestrator/agents/devops-expert.agent.md +31 -26
- package/src/orchestrator/agents/documentation-writer.agent.md +29 -29
- package/src/orchestrator/agents/performance-expert.agent.md +36 -33
- package/src/orchestrator/agents/release-manager.agent.md +25 -34
- package/src/orchestrator/agents/researcher.agent.md +41 -95
- package/src/orchestrator/agents/reviewer.agent.md +24 -34
- package/src/orchestrator/agents/security-expert.agent.md +35 -39
- package/src/orchestrator/agents/seo-specialist.agent.md +25 -32
- package/src/orchestrator/agents/session-guard.agent.md +20 -79
- package/src/orchestrator/agents/team-lead.agent.md +50 -254
- package/src/orchestrator/agents/testing-expert.agent.md +37 -49
- package/src/orchestrator/agents/ui-ux-expert.agent.md +33 -39
- package/src/orchestrator/customizations/KNOWN-ISSUES.md +0 -1
- package/src/orchestrator/customizations/agents/skill-matrix.json +12 -0
- package/src/orchestrator/instructions/general.instructions.md +24 -84
- package/src/orchestrator/plugins/astro/SKILL.md +23 -179
- package/src/orchestrator/plugins/convex/SKILL.md +38 -12
- package/src/orchestrator/plugins/netlify/SKILL.md +17 -13
- package/src/orchestrator/plugins/nextjs/SKILL.md +55 -261
- package/src/orchestrator/plugins/nx/SKILL.md +20 -72
- package/src/orchestrator/plugins/playwright/SKILL.md +5 -17
- package/src/orchestrator/plugins/slack/SKILL.md +28 -190
- package/src/orchestrator/plugins/teams/SKILL.md +10 -140
- package/src/orchestrator/plugins/vitest/SKILL.md +2 -2
- package/src/orchestrator/prompts/bug-fix.prompt.md +25 -63
- package/src/orchestrator/prompts/implement-feature.prompt.md +29 -66
- package/src/orchestrator/prompts/quick-refinement.prompt.md +31 -66
- package/src/orchestrator/skills/accessibility-standards/SKILL.md +50 -105
- package/src/orchestrator/skills/agent-hooks/SKILL.md +60 -110
- package/src/orchestrator/skills/agent-memory/SKILL.md +44 -93
- package/src/orchestrator/skills/api-patterns/SKILL.md +20 -68
- package/src/orchestrator/skills/code-commenting/SKILL.md +49 -101
- package/src/orchestrator/skills/context-map/SKILL.md +47 -88
- package/src/orchestrator/skills/data-engineering/SKILL.md +27 -74
- package/src/orchestrator/skills/decomposition/SKILL.md +50 -98
- package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +44 -107
- package/src/orchestrator/skills/documentation-standards/SKILL.md +28 -89
- package/src/orchestrator/skills/fast-review/SKILL.md +51 -276
- package/src/orchestrator/skills/frontend-design/SKILL.md +53 -163
- package/src/orchestrator/skills/git-workflow/SKILL.md +18 -54
- package/src/orchestrator/skills/memory-merger/SKILL.md +51 -88
- package/src/orchestrator/skills/observability-logging/SKILL.md +29 -75
- package/src/orchestrator/skills/orchestration-protocols/SKILL.md +58 -117
- package/src/orchestrator/skills/panel-majority-vote/SKILL.md +65 -140
- package/src/orchestrator/skills/performance-optimization/SKILL.md +21 -85
- package/src/orchestrator/skills/project-consistency/SKILL.md +62 -281
- package/src/orchestrator/skills/react-development/SKILL.md +38 -86
- package/src/orchestrator/skills/security-hardening/SKILL.md +40 -84
- package/src/orchestrator/skills/self-improvement/SKILL.md +26 -60
- package/src/orchestrator/skills/seo-patterns/SKILL.md +40 -105
- package/src/orchestrator/skills/session-checkpoints/SKILL.md +26 -68
- package/src/orchestrator/skills/team-lead-reference/SKILL.md +66 -206
- package/src/orchestrator/skills/testing-workflow/SKILL.md +42 -112
- package/src/orchestrator/skills/validation-gates/SKILL.md +39 -170
- package/src/orchestrator/snippets/base-output-contract.md +14 -0
- package/src/orchestrator/snippets/discovered-issues-policy.md +15 -0
- package/src/orchestrator/snippets/logging-mandatory.md +11 -0
- package/src/orchestrator/snippets/never-expose-secrets.md +22 -0
|
@@ -5,68 +5,32 @@ description: "Git branching, PR workflow, delivery requirements, discovered issu
|
|
|
5
5
|
|
|
6
6
|
# Git Workflow & Delivery
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
**NEVER push directly to `main`.** All changes go through a feature/fix branch → PR.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Branch & Commit Rules
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
| Rule | Detail |
|
|
13
|
+
|------|--------|
|
|
14
|
+
| Branch from `main` | `git checkout -b <type>/<ticket-id>-<slug>` |
|
|
15
|
+
| Types | `fix`, `feat`, `chore`, `refactor`, `perf`, `docs` |
|
|
16
|
+
| Commit messages | Must reference issue ID — `TAS-42: Fix token refresh` |
|
|
17
|
+
| No force-push | Never `--force` or `--amend` on shared branches; `--force-with-lease` on personal only |
|
|
18
|
+
| No secrets | No tokens/keys in commits, PR descriptions, or output (rotate immediately if leaked) |
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
## Delivery Checklist (Every Task)
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- **Never** expose secrets in commits, PR descriptions, or terminal output (per Constitution #1)
|
|
26
|
-
- Use `git push --force-with-lease` only when explicitly asked and on personal branches
|
|
27
|
-
- If a secret is accidentally committed, immediately rotate it — git history is permanent
|
|
28
|
-
|
|
29
|
-
### Delivery Outcome (Required for Every Task)
|
|
30
|
-
|
|
31
|
-
Every task that produces code changes — whether a roadmap feature, bug fix, follow-up, data pipeline, or refactor — must deliver:
|
|
32
|
-
|
|
33
|
-
1. **Dedicated branch** — `<type>/<ticket-id>-<short-description>` created from `main`
|
|
34
|
-
2. **Atomic commits** — Each commit references the issue ID (e.g., `TAS-42: Add filter component`)
|
|
35
|
-
3. **Pushed branch** — Branch pushed to origin
|
|
36
|
-
4. **Open PR** — Use `gh` CLI to create the PR. **Do NOT merge** — PRs are opened for review only:
|
|
37
|
-
```bash
|
|
38
|
-
GH_PAGER=cat gh pr create --base main --title "TAS-XX: Short description" --body "Resolves TAS-XX"
|
|
39
|
-
```
|
|
40
|
-
5. **Task tracker linkage** — The issue is updated with the PR URL, and the PR description references the issue ID
|
|
22
|
+
1. Branch `<type>/<ticket-id>-<slug>` from `main`
|
|
23
|
+
2. Atomic commits referencing issue ID
|
|
24
|
+
3. Push branch to origin
|
|
25
|
+
4. Open PR (do NOT merge): `GH_PAGER=cat gh pr create --base main --title "TAS-XX: …" --body "Resolves TAS-XX"`
|
|
26
|
+
5. Update issue with PR URL
|
|
41
27
|
|
|
42
28
|
## Discovered Issues Policy
|
|
43
29
|
|
|
44
|
-
>
|
|
45
|
-
|
|
46
|
-
When you encounter a bug, error, or unexpected behavior that is unrelated to the current task:
|
|
47
|
-
|
|
48
|
-
1. **Check if already tracked:**
|
|
49
|
-
- Search `.opencastle/KNOWN-ISSUES.md` for a matching entry
|
|
50
|
-
- If you have task tracker tools available, also search for open bugs (use `search_issues` or `list_issues` with bug label)
|
|
51
|
-
2. **If found tracked** — skip it, continue with your current work
|
|
52
|
-
3. **If NOT tracked** — you must act:
|
|
53
|
-
- **Unfixable limitation** (third-party constraint, platform restriction, upstream dependency) → add it to `.opencastle/KNOWN-ISSUES.md` with: Issue ID, Status, Severity, Evidence, Root Cause, Solution Options
|
|
54
|
-
- **Fixable bug** → if you have task tracker tools, create a ticket with label `bug`, appropriate priority, and a clear description of the symptoms, reproduction steps, and affected files. If you do NOT have task tracker tools, add a `**Discovered Issues**` section to your output listing the bug details so the Team Lead can track it.
|
|
55
|
-
|
|
56
|
-
Never assume a pre-existing issue is somebody else's problem. If it's not tracked, track it.
|
|
30
|
+
> Inherits: [discovered-issues-policy](../../snippets/discovered-issues-policy.md)
|
|
57
31
|
|
|
58
32
|
## Task Tracking
|
|
59
33
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
### When Task Tracker MCP Tools Are Unavailable
|
|
63
|
-
|
|
64
|
-
If task tracker MCP tools are not available in the current session, do NOT block on issue creation. Instead:
|
|
34
|
+
Tracked in the **task tracker** (`tracker-config.md`). Team Lead creates/updates issues via MCP. Load **task-management** skill for conventions.
|
|
65
35
|
|
|
66
|
-
|
|
67
|
-
2. **Proceed with implementation** — the work is still valuable without a ticket number
|
|
68
|
-
3. **Placeholder value for `tracker_issue`:**
|
|
69
|
-
- **No tracker configured** (no `task-management` slot bound in `skill-matrix.json`) → use `"N/A"`
|
|
70
|
-
- **Tracker configured but tools unavailable** → use the project prefix + `PENDING` (e.g., `"TAS-PENDING"`)
|
|
71
|
-
4. **Ask the user** to create the issues manually if tracking is critical for the task
|
|
72
|
-
5. After implementation, update commit messages and PR descriptions when issue IDs become available
|
|
36
|
+
**If MCP tools unavailable:** Document planned issues (title + AC) in output, use `"N/A"` (no tracker) or `"TAS-PENDING"` (tracker configured), proceed with work, update IDs when available.
|
|
@@ -3,123 +3,86 @@ name: memory-merger
|
|
|
3
3
|
description: "Protocol for graduating mature lessons from LESSONS-LEARNED.md into permanent instruction and skill files. Closes the self-improvement loop by codifying validated knowledge at the source level."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# Memory Merger
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
This skill automates the final step of the self-improvement cycle: promoting validated lessons into the instruction and skill files where they have structural, permanent impact.
|
|
11
|
-
|
|
12
|
-
## Why Merge?
|
|
13
|
-
|
|
14
|
-
`.opencastle/LESSONS-LEARNED.md` is a flatfile that grows over time. Lessons buried in a 400+ line file lose their impact — agents skim past them or miss relevant entries. The most valuable lessons should **graduate** into the instruction/skill files where they're encountered naturally during every task.
|
|
8
|
+
Promotes validated lessons from `.opencastle/LESSONS-LEARNED.md` into instruction/skill files where they have permanent impact.
|
|
15
9
|
|
|
16
10
|
## When to Run
|
|
17
11
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
| Trigger | Threshold |
|
|
13
|
+
|---------|-----------|
|
|
14
|
+
| File size | >50 entries |
|
|
15
|
+
| Citation count | Cited 3+ times |
|
|
16
|
+
| Age | >60 days old |
|
|
17
|
+
| Category cluster | 5+ lessons in same category |
|
|
18
|
+
| Discretionary | Lessons file feels stale |
|
|
25
19
|
|
|
26
20
|
## Merge Protocol
|
|
27
21
|
|
|
28
|
-
###
|
|
29
|
-
|
|
30
|
-
Read `.opencastle/LESSONS-LEARNED.md` and identify lessons that meet any of these criteria:
|
|
22
|
+
### 1 — Scan Candidates
|
|
31
23
|
|
|
32
24
|
| Criterion | Signal |
|
|
33
25
|
|-----------|--------|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
40
|
-
###
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
|
45
|
-
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `cms` | The skill mapped by the `cms` slot in the skill matrix |
|
|
50
|
-
| `database` | The skill mapped by the `database` slot in the skill matrix |
|
|
51
|
-
| `browser-testing` | The skill mapped by the `e2e-testing` slot in the skill matrix |
|
|
26
|
+
| Frequency | Cited/re-discovered 3+ times |
|
|
27
|
+
| Severity | Marked `high` |
|
|
28
|
+
| Age | >60 days, still relevant |
|
|
29
|
+
| Concentration | 5+ in same category → extract pattern |
|
|
30
|
+
| Tool-specific | MCP tool, codebase-tool command, or framework pattern |
|
|
31
|
+
|
|
32
|
+
### 2 — Map to Target File
|
|
33
|
+
|
|
34
|
+
| Category | Target |
|
|
35
|
+
|----------|--------|
|
|
36
|
+
| `task-management` | skill-matrix `task-management` slot |
|
|
37
|
+
| `mcp-tools` | agent/skill that uses the tool |
|
|
38
|
+
| `codebase-tool` | skill-matrix `codebase-tool` slot |
|
|
39
|
+
| `cms` / `database` | respective skill-matrix slots |
|
|
40
|
+
| `browser-testing` | skill-matrix `e2e-testing` slot |
|
|
52
41
|
| `git-workflow` | `.github/skills/git-workflow/SKILL.md` |
|
|
53
42
|
| `deployment` | `.github/skills/deployment-infrastructure/SKILL.md` |
|
|
54
|
-
| `delegation` | `.github/agents/team-lead.agent.md` or
|
|
43
|
+
| `delegation` | `.github/agents/team-lead.agent.md` or `team-lead-reference` skill |
|
|
55
44
|
| `testing` | `.github/skills/testing-workflow/SKILL.md` |
|
|
56
|
-
| `ui` / `framework` |
|
|
57
|
-
| Cross-cutting
|
|
58
|
-
|
|
59
|
-
### Step 3: Draft the Merge
|
|
45
|
+
| `ui` / `framework` | `framework` slot or `react-development` skill |
|
|
46
|
+
| Cross-cutting | `.github/instructions/general.instructions.md` |
|
|
60
47
|
|
|
61
|
-
|
|
48
|
+
### 3 — Draft Edit
|
|
62
49
|
|
|
63
|
-
```markdown
|
|
64
|
-
**Lesson:** LES-XXX — [title]
|
|
65
|
-
**Target:** [target file path]
|
|
66
|
-
**Section:** [which section to add to or modify]
|
|
67
|
-
**Edit:** [exact text to add or modify]
|
|
68
|
-
**Rationale:** [why this belongs here rather than staying in lessons]
|
|
69
50
|
```
|
|
51
|
+
Lesson: LES-XXX — [title]
|
|
52
|
+
Target: [file path]
|
|
53
|
+
Section: [section name]
|
|
54
|
+
Edit: [exact text]
|
|
55
|
+
```
|
|
56
|
+
Strategies: add rule, add anti-pattern, add code example, expand existing rule, add table row.
|
|
70
57
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
- **Add a rule** — if the lesson reveals a new "always do X" or "never do Y", add it to the target file's rules section
|
|
74
|
-
- **Add an anti-pattern** — if the lesson describes a common mistake, add it to an anti-patterns or "Common Mistakes" section
|
|
75
|
-
- **Add a code example** — if the lesson includes a correct approach with a code block, add it as a documented pattern
|
|
76
|
-
- **Expand existing rule** — if a rule already exists but the lesson adds nuance (edge case, exception), update the rule
|
|
77
|
-
- **Add a table row** — if the target has a reference table, add the lesson as a new row
|
|
78
|
-
|
|
79
|
-
### Step 4: Apply Edits
|
|
58
|
+
### 4 — Apply & Attribute
|
|
80
59
|
|
|
81
|
-
|
|
82
|
-
2. Add a comment or note attributing the source: `<!-- Merged from LES-XXX -->`
|
|
83
|
-
3. Verify the edit reads naturally in context (not just pasted in)
|
|
60
|
+
Edit target file; add `<!-- Merged from LES-XXX -->` attribution inline.
|
|
84
61
|
|
|
85
|
-
###
|
|
62
|
+
### 5 — Archive
|
|
86
63
|
|
|
87
|
-
Move merged lessons
|
|
64
|
+
Move merged lessons to `## Archived (Merged)` at the bottom of `LESSONS-LEARNED.md`:
|
|
88
65
|
|
|
89
66
|
```markdown
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
Lessons below have been merged into instruction/skill files. They are kept here for historical reference.
|
|
93
|
-
|
|
94
|
-
### LES-XXX: [title] → Merged to `[target file]` on YYYY-MM-DD
|
|
67
|
+
### LES-XXX: [title] → Merged to `[target]` on YYYY-MM-DD
|
|
95
68
|
```
|
|
96
69
|
|
|
97
|
-
**
|
|
70
|
+
**Never delete lessons** — archive for traceability.
|
|
98
71
|
|
|
99
|
-
###
|
|
72
|
+
### 6 — Update Index
|
|
100
73
|
|
|
101
|
-
Update
|
|
74
|
+
Update `## Index by Category` in `LESSONS-LEARNED.md` to mark archived lessons.
|
|
102
75
|
|
|
103
76
|
## Quality Gates
|
|
104
77
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
- [ ]
|
|
108
|
-
- [ ]
|
|
109
|
-
- [ ] No duplicate information created (check if a similar rule already exists)
|
|
110
|
-
- [ ] The archived lesson references the target file
|
|
111
|
-
- [ ] The lesson's core insight is preserved — don't lose nuance when summarizing
|
|
78
|
+
- [ ] Merged content reads naturally (not copy-pasted)
|
|
79
|
+
- [ ] No duplicate rules created
|
|
80
|
+
- [ ] Archived lesson references target file
|
|
81
|
+
- [ ] Core insight preserved — no loss of nuance
|
|
112
82
|
|
|
113
83
|
## Anti-Patterns
|
|
114
84
|
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
- **Don't create new files for merged content** — merge INTO existing files; only create new skills if a genuinely new domain emerges
|
|
120
|
-
|
|
121
|
-
## Frequency
|
|
122
|
-
|
|
123
|
-
- **Quarterly review** — schedule a full scan of LESSONS-LEARNED.md every ~3 months
|
|
124
|
-
- **Post-feature review** — after major features ship, scan for relevant lessons
|
|
125
|
-
- **Ad-hoc** — any time an agent notices "this lesson should be a permanent rule"
|
|
85
|
+
- Merge too eagerly — must meet 3+ citations or 60+ day threshold
|
|
86
|
+
- Copy verbatim — rewrite as rules/guidelines, not incident reports
|
|
87
|
+
- Merge conflicting lessons — resolve conflict first
|
|
88
|
+
- Create new files for merged content — merge INTO existing files only
|
|
@@ -5,125 +5,79 @@ description: "Session logging, delegation records, review/panel/dispute NDJSON l
|
|
|
5
5
|
|
|
6
6
|
# Observability Logging
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
> **⛔ HARD GATE.** Every agent MUST log every session to `events.ndjson` before responding. No exceptions. A session without logs is a failed session.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
| File | Event types | Who | When |
|
|
11
|
+
|------|------------|-----|------|
|
|
12
|
+
| `events.ndjson` | `session`, `delegation`, `review`, `panel`, `dispute` | All agents / Team Lead / Panel runner | After each applicable event |
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
See `.opencastle/logs/README.md` for full schema.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Use `opencastle log` CLI. One record per task; never batch-log retrospectively.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|------|------------|------------|------|
|
|
20
|
-
| `events.ndjson` | `session`, `delegation`, `review`, `panel`, `dispute` | All agents / Team Lead / Panel runner | After every applicable event — use `--type` to discriminate |
|
|
21
|
-
|
|
22
|
-
See `.opencastle/logs/README.md` for the full schema of each record type.
|
|
23
|
-
|
|
24
|
-
### How to log
|
|
25
|
-
|
|
26
|
-
Use the `opencastle log` CLI to append events to `.opencastle/logs/events.ndjson`. When the Team Lead works directly, use the agent role that best describes the work (e.g., `--agent Developer`, `--agent "UI-UX Expert"`). If a single conversation involves multiple distinct tasks, log one record per task.
|
|
27
|
-
|
|
28
|
-
**Session record** (ALL agents, EVERY session):
|
|
18
|
+
**Session** (ALL agents, EVERY session):
|
|
29
19
|
```sh
|
|
30
20
|
opencastle log --type session --agent Developer --model claude-opus-4-6 \
|
|
31
21
|
--task "Fix login redirect bug" --outcome success --duration_min 15 \
|
|
32
22
|
--files_changed 3 --retries 0
|
|
33
23
|
```
|
|
34
24
|
|
|
35
|
-
**Delegation
|
|
25
|
+
**Delegation** (Team Lead — immediately after each delegation, not at session end):
|
|
36
26
|
```sh
|
|
37
27
|
opencastle log --type delegation --session_id feat/prj-57 --agent Developer \
|
|
38
28
|
--model claude-sonnet-4-6 --tier quality --mechanism sub-agent \
|
|
39
29
|
--tracker_issue PRJ-57 --outcome success --retries 0 --phase 2 \
|
|
40
30
|
--file_partition "src/components/"
|
|
41
31
|
```
|
|
42
|
-
Verify: `tail -1 .opencastle/logs/events.ndjson`
|
|
43
32
|
|
|
44
|
-
>
|
|
33
|
+
> `model` and `tier` must reflect the delegated agent's assignment from the agent registry.
|
|
45
34
|
|
|
46
|
-
**
|
|
35
|
+
**Review** (Team Lead — immediately after each fast review):
|
|
47
36
|
```sh
|
|
48
37
|
opencastle log --type review --tracker_issue PRJ-42 --agent Developer \
|
|
49
38
|
--reviewer_model gpt-5-mini --verdict pass --attempt 1 \
|
|
50
39
|
--issues_critical 0 --issues_major 0 --issues_minor 2 \
|
|
51
40
|
--confidence high --escalated false --duration_sec 45
|
|
52
41
|
```
|
|
53
|
-
Verify: `tail -1 .opencastle/logs/events.ndjson`
|
|
54
42
|
|
|
55
|
-
**Panel
|
|
43
|
+
**Panel** (Panel runner — immediately after each panel vote):
|
|
56
44
|
```sh
|
|
57
45
|
opencastle log --type panel --panel_key auth-review --verdict pass \
|
|
58
46
|
--pass_count 3 --block_count 0 --must_fix 0 --should_fix 3 \
|
|
59
47
|
--reviewer_model claude-opus-4-6 --weighted false --attempt 1 \
|
|
60
48
|
--tracker_issue PRJ-42 --artifacts_count 5
|
|
61
49
|
```
|
|
62
|
-
Verify: `tail -1 .opencastle/logs/events.ndjson`
|
|
63
50
|
|
|
64
|
-
**Dispute
|
|
51
|
+
**Dispute** (Team Lead — immediately after each dispute):
|
|
65
52
|
```sh
|
|
66
53
|
opencastle log --type dispute --dispute_id DSP-001 --tracker_issue PRJ-42 \
|
|
67
54
|
--priority high --trigger panel-3x-block --implementing_agent Developer \
|
|
68
55
|
--reviewing_agents "Reviewer,Panel (3x)" --total_attempts 6 --status pending
|
|
69
56
|
```
|
|
70
|
-
Verify: `tail -1 .opencastle/logs/events.ndjson`
|
|
71
57
|
|
|
72
|
-
|
|
58
|
+
Verify any append: `tail -1 .opencastle/logs/events.ndjson`
|
|
73
59
|
|
|
74
|
-
|
|
60
|
+
## Pre-Response Checklist
|
|
75
61
|
|
|
76
|
-
|
|
77
|
-
- [ ] **Delegations logged** — `events.ndjson` has a `delegation` record for **each** delegation (Team Lead only). Count delegations → count records → must match
|
|
78
|
-
- [ ] **Reviews logged** — `events.ndjson` has a `review` record for **each** fast review performed. Count reviews → count records → must match
|
|
79
|
-
- [ ] **Panels logged** — `events.ndjson` has a `panel` record for **each** panel review performed. Count panels → count records → must match
|
|
80
|
-
- [ ] **Disputes logged** — `events.ndjson` has a `dispute` record for **each** dispute created. Count disputes → count records → must match
|
|
62
|
+
**⛔ STOP.** Verify before responding — fix any missing log NOW.
|
|
81
63
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
64
|
+
- [ ] **Lessons read** — `.opencastle/LESSONS-LEARNED.md` read at session start
|
|
65
|
+
- [ ] **Lessons captured** — new lesson added via **self-improvement** if any retry occurred
|
|
66
|
+
- [ ] **Discovered issues tracked** — pre-existing bugs added to `KNOWN-ISSUES.md` or tracker
|
|
67
|
+
- [ ] **Lint/type/test pass** — no new errors after code changes
|
|
68
|
+
- [ ] **Session logged** — `events.ndjson` has a `session` record (ALWAYS)
|
|
69
|
+
- [ ] **Delegations logged** — `delegation` record per delegation (Team Lead)
|
|
70
|
+
- [ ] **Reviews logged** — `review` record per fast review (if any)
|
|
71
|
+
- [ ] **Panels logged** — `panel` record per panel vote (if any)
|
|
72
|
+
- [ ] **Disputes logged** — `dispute` record per dispute (if any)
|
|
90
73
|
|
|
91
74
|
## Universal Agent Rules
|
|
92
75
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
3. **Read and update lessons** — Read `.opencastle/LESSONS-LEARNED.md` before starting. If you retry anything with a different approach that works, use the **self-improvement** skill to add a lesson immediately.
|
|
98
|
-
4. **Log every session** — Append to `.opencastle/logs/events.ndjson` after every session using `opencastle log --type session ...`. No exceptions. This is Constitution rule #6 — a blocking gate, not optional.
|
|
76
|
+
1. **Never delegate** — complete own work; document cross-domain needs in output contract.
|
|
77
|
+
2. **Follow Discovered Issues Policy** — See [discovered-issues-policy](../../snippets/discovered-issues-policy.md).
|
|
78
|
+
3. **Read and update lessons** — Read `.opencastle/LESSONS-LEARNED.md` before starting; add lessons after retries via **self-improvement** skill.
|
|
79
|
+
4. **Log every session** — See [logging-mandatory](../../snippets/logging-mandatory.md).
|
|
99
80
|
|
|
100
81
|
## Base Output Contract
|
|
101
82
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
- **Observability Logged** — Confirm ALL applicable log records were appended to `events.ndjson` (Constitution rule #6):
|
|
105
|
-
- `--type session` — ALWAYS (every agent, every session)
|
|
106
|
-
- `--type delegation` — if delegations occurred (Team Lead only)
|
|
107
|
-
- `--type review` — if fast reviews occurred
|
|
108
|
-
- `--type panel` — if panel reviews occurred
|
|
109
|
-
- `--type dispute` — if disputes were created
|
|
110
|
-
- **Discovered Issues** — Pre-existing bugs or anomalies found during work, with tracking action taken per the Discovered Issues Policy
|
|
111
|
-
- **Lessons Applied** — Lessons from `.opencastle/LESSONS-LEARNED.md` that influenced this work, and any new lessons added
|
|
112
|
-
|
|
113
|
-
Agents reference this contract with: `See **Base Output Contract** in the observability-logging skill for the standard closing items.`
|
|
114
|
-
|
|
115
|
-
## Pre-Response Quality Gate
|
|
116
|
-
|
|
117
|
-
> **⛔ STOP before responding to the user.** Run through this checklist. If ANY required item is missing, fix it NOW.
|
|
118
|
-
|
|
119
|
-
This is the single exit gate for every session. All items are mandatory unless marked conditional.
|
|
120
|
-
|
|
121
|
-
- [ ] **Lessons read** — `.opencastle/LESSONS-LEARNED.md` was read at session start (Self-Improvement Protocol)
|
|
122
|
-
- [ ] **Lessons captured** — If any retry occurred, a new lesson was added via the **self-improvement** skill
|
|
123
|
-
- [ ] **Discovered issues tracked** — Any pre-existing bugs found were added to `KNOWN-ISSUES.md` or a tracker ticket was created (Discovered Issues Policy)
|
|
124
|
-
- [ ] **Lint/type/test pass** — No new errors introduced; verification ran after code changes (Constitution rule #5)
|
|
125
|
-
- [ ] **Session logged** — `events.ndjson` has a new `session` record for this session (Constitution rule #6 — ALWAYS required)
|
|
126
|
-
- [ ] **Delegations logged** — `events.ndjson` has a `delegation` record for each delegation (Team Lead only)
|
|
127
|
-
- [ ] **Reviews logged** — `events.ndjson` has a `review` record for each fast review performed (if any)
|
|
128
|
-
- [ ] **Panels logged** — `events.ndjson` has a `panel` record for each panel review performed (if any)
|
|
129
|
-
- [ ] **Disputes logged** — `events.ndjson` has a `dispute` record for each dispute created (if any)
|
|
83
|
+
> Inherits: [base-output-contract](../../snippets/base-output-contract.md)
|