opencastle 1.6.3 → 1.7.0
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 +9 -9
- package/bin/cli.mjs +6 -4
- package/dist/cli/adapters/adapter-contract.test.js +1 -1
- package/dist/cli/adapters/single-file-base.d.ts.map +1 -1
- package/dist/cli/adapters/single-file-base.js +2 -12
- package/dist/cli/adapters/single-file-base.js.map +1 -1
- package/dist/cli/bootstrap.d.ts.map +1 -1
- package/dist/cli/bootstrap.js +32 -10
- package/dist/cli/bootstrap.js.map +1 -1
- package/dist/cli/bootstrap.test.js +10 -0
- package/dist/cli/bootstrap.test.js.map +1 -1
- package/dist/cli/command-namespace.test.js +4 -21
- package/dist/cli/command-namespace.test.js.map +1 -1
- package/dist/cli/convoy/engine.js +2 -2
- package/dist/cli/convoy/engine.js.map +1 -1
- package/dist/cli/convoy/read-model.d.ts +8 -15
- package/dist/cli/convoy/read-model.d.ts.map +1 -1
- package/dist/cli/convoy/read-model.js +9 -68
- package/dist/cli/convoy/read-model.js.map +1 -1
- package/dist/cli/convoy/read-model.test.js +6 -25
- package/dist/cli/convoy/read-model.test.js.map +1 -1
- package/dist/cli/convoy/spec-builder.d.ts +2 -2
- package/dist/cli/convoy/spec-builder.d.ts.map +1 -1
- package/dist/cli/convoy/spec-builder.js +1 -1
- package/dist/cli/dashboard.js +1 -1
- package/dist/cli/dashboard.test.js +10 -2
- package/dist/cli/dashboard.test.js.map +1 -1
- package/dist/cli/detect.d.ts.map +1 -1
- package/dist/cli/detect.js +32 -0
- package/dist/cli/detect.js.map +1 -1
- package/dist/cli/detect.test.js +23 -0
- package/dist/cli/detect.test.js.map +1 -1
- package/dist/cli/dispatcher.test.js +5 -2
- package/dist/cli/dispatcher.test.js.map +1 -1
- package/dist/cli/docs-accuracy.test.js +5 -1
- package/dist/cli/docs-accuracy.test.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +0 -25
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/init.js +3 -3
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/layers.d.ts.map +1 -1
- package/dist/cli/layers.js +3 -1
- package/dist/cli/layers.js.map +1 -1
- package/dist/cli/pipeline.d.ts +1 -1
- package/dist/cli/pipeline.flow.test.js +77 -77
- package/dist/cli/pipeline.flow.test.js.map +1 -1
- package/dist/cli/pipeline.js +24 -24
- package/dist/cli/pipeline.js.map +1 -1
- package/dist/cli/plan.d.ts +8 -2
- package/dist/cli/plan.d.ts.map +1 -1
- package/dist/cli/plan.js +18 -12
- package/dist/cli/plan.js.map +1 -1
- package/dist/cli/plan.test.js +17 -19
- package/dist/cli/plan.test.js.map +1 -1
- package/dist/cli/project-facts-lang.d.ts +36 -0
- package/dist/cli/project-facts-lang.d.ts.map +1 -0
- package/dist/cli/project-facts-lang.js +323 -0
- package/dist/cli/project-facts-lang.js.map +1 -0
- package/dist/cli/project-facts.d.ts +5 -0
- package/dist/cli/project-facts.d.ts.map +1 -1
- package/dist/cli/project-facts.js +28 -11
- package/dist/cli/project-facts.js.map +1 -1
- package/dist/cli/project-facts.test.js +70 -0
- package/dist/cli/project-facts.test.js.map +1 -1
- package/dist/cli/stack-config-update.test.js +21 -1
- package/dist/cli/stack-config-update.test.js.map +1 -1
- package/dist/cli/stack-config.d.ts +20 -0
- package/dist/cli/stack-config.d.ts.map +1 -1
- package/dist/cli/stack-config.js +36 -0
- package/dist/cli/stack-config.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +4 -61
- package/dist/cli/update.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/adapters/adapter-contract.test.ts +1 -1
- package/src/cli/adapters/single-file-base.ts +2 -11
- package/src/cli/bootstrap.test.ts +11 -0
- package/src/cli/bootstrap.ts +32 -10
- package/src/cli/command-namespace.test.ts +5 -22
- package/src/cli/convoy/engine.ts +2 -2
- package/src/{orchestrator/prompts/assess-complexity.prompt.md → cli/convoy/prompts/convoy-assess.prompt.md} +0 -3
- package/src/{orchestrator/prompts/fix-convoy.prompt.md → cli/convoy/prompts/convoy-plan-fix.prompt.md} +0 -3
- package/src/{orchestrator/prompts/validate-convoy.prompt.md → cli/convoy/prompts/convoy-plan-review.prompt.md} +0 -3
- package/src/{orchestrator/prompts/generate-convoy.prompt.md → cli/convoy/prompts/convoy-plan.prompt.md} +0 -2
- package/src/{orchestrator/prompts/fix-prd.prompt.md → cli/convoy/prompts/convoy-prd-fix.prompt.md} +0 -3
- package/src/{orchestrator/prompts/validate-prd.prompt.md → cli/convoy/prompts/convoy-prd-review.prompt.md} +0 -3
- package/src/{orchestrator/prompts/generate-prd.prompt.md → cli/convoy/prompts/convoy-prd.prompt.md} +0 -3
- package/src/cli/convoy/read-model.test.ts +5 -29
- package/src/cli/convoy/read-model.ts +11 -71
- package/src/cli/convoy/spec-builder.ts +2 -2
- package/src/cli/dashboard/dashboard.js +2 -4
- package/src/cli/dashboard.test.ts +10 -2
- package/src/cli/dashboard.ts +1 -1
- package/src/cli/detect.test.ts +27 -0
- package/src/cli/detect.ts +29 -0
- package/src/cli/dispatcher.test.ts +6 -2
- package/src/cli/docs-accuracy.test.ts +5 -1
- package/src/cli/doctor.ts +0 -26
- package/src/cli/init.ts +3 -3
- package/src/cli/layers.ts +2 -1
- package/src/cli/pipeline.flow.test.ts +78 -78
- package/src/cli/pipeline.ts +25 -25
- package/src/cli/plan.test.ts +18 -20
- package/src/cli/plan.ts +18 -12
- package/src/cli/project-facts-lang.ts +338 -0
- package/src/cli/project-facts.test.ts +75 -0
- package/src/cli/project-facts.ts +31 -11
- package/src/cli/stack-config-update.test.ts +25 -1
- package/src/cli/stack-config.ts +36 -0
- package/src/cli/update.ts +4 -70
- package/src/orchestrator/agent-workflows/README.md +10 -18
- package/src/orchestrator/agent-workflows/data-pipeline.md +7 -140
- package/src/orchestrator/agent-workflows/database-migration.md +7 -153
- package/src/orchestrator/agent-workflows/performance-optimization.md +6 -119
- package/src/orchestrator/agent-workflows/refactoring.md +8 -137
- package/src/orchestrator/agent-workflows/schema-changes.md +8 -159
- package/src/orchestrator/agent-workflows/security-audit.md +7 -142
- package/src/orchestrator/agent-workflows/shared-delivery-phase.md +8 -25
- package/src/orchestrator/agents/architect.agent.md +2 -14
- package/src/orchestrator/agents/content-engineer.agent.md +8 -10
- package/src/orchestrator/agents/data-engineer.agent.md +8 -8
- package/src/orchestrator/agents/developer.agent.md +3 -10
- package/src/orchestrator/agents/devops-expert.agent.md +0 -3
- package/src/orchestrator/agents/performance-expert.agent.md +2 -3
- package/src/orchestrator/agents/security-expert.agent.md +10 -12
- package/src/orchestrator/agents/team-lead.agent.md +31 -75
- package/src/orchestrator/agents/testing-expert.agent.md +3 -6
- package/src/orchestrator/agents/ui-ux-expert.agent.md +1 -4
- package/src/orchestrator/agents/writer.agent.md +0 -3
- package/src/orchestrator/customizations/README.md +3 -4
- package/src/orchestrator/customizations/agents/agent-registry.md +3 -3
- package/src/orchestrator/customizations/agents/skill-matrix.json +6 -42
- package/src/orchestrator/instructions/general.instructions.md +10 -37
- package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +4 -6
- package/src/orchestrator/prompts/brainstorm.prompt.md +7 -12
- package/src/orchestrator/prompts/bug-fix.prompt.md +19 -100
- package/src/orchestrator/prompts/convoy.prompt.md +20 -0
- package/src/orchestrator/prompts/create-skill.prompt.md +1 -5
- package/src/orchestrator/prompts/implement-feature.prompt.md +22 -93
- package/src/orchestrator/prompts/resolve-pr-comments.prompt.md +1 -5
- package/src/orchestrator/skills/api-patterns/SKILL.md +21 -18
- package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +1 -1
- package/src/orchestrator/skills/fast-review/SKILL.md +28 -65
- package/src/orchestrator/skills/frontend-design/REFERENCE.md +0 -1
- package/src/orchestrator/skills/frontend-design/SKILL.md +3 -1
- package/src/orchestrator/skills/git-workflow/SKILL.md +18 -34
- package/src/orchestrator/skills/panel-majority-vote/SKILL.md +16 -46
- package/src/orchestrator/skills/security-hardening/SKILL.md +20 -19
- package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +2 -2
- package/src/orchestrator/skills/self-improvement/SKILL.md +21 -46
- package/src/orchestrator/skills/technical-writing/SKILL.md +3 -1
- package/src/orchestrator/skills/technical-writing/TEMPLATES.md +23 -0
- package/src/orchestrator/skills/testing-workflow/SKILL.md +21 -23
- package/src/orchestrator/skills/validation-gates/REFERENCE.md +2 -14
- package/src/orchestrator/skills/validation-gates/SKILL.md +10 -88
- package/dist/cli/log.d.ts +0 -44
- package/dist/cli/log.d.ts.map +0 -1
- package/dist/cli/log.js +0 -336
- package/dist/cli/log.js.map +0 -1
- package/dist/cli/log.test.d.ts +0 -2
- package/dist/cli/log.test.d.ts.map +0 -1
- package/dist/cli/log.test.js +0 -208
- package/dist/cli/log.test.js.map +0 -1
- package/src/cli/log.test.ts +0 -228
- package/src/cli/log.ts +0 -374
- package/src/orchestrator/agent-workflows/bug-fix.md +0 -130
- package/src/orchestrator/agent-workflows/feature-implementation.md +0 -232
- package/src/orchestrator/instructions/ai-optimization.instructions.md +0 -17
- package/src/orchestrator/prompts/quick-refinement.prompt.md +0 -110
- package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +0 -44
- package/src/orchestrator/skills/agent-hooks/SKILL.md +0 -80
- package/src/orchestrator/skills/agent-memory/KNOWLEDGE-GRAPH.md +0 -49
- package/src/orchestrator/skills/agent-memory/SKILL.md +0 -50
- package/src/orchestrator/skills/code-commenting/SKILL.md +0 -18
- package/src/orchestrator/skills/context-map/REFERENCE.md +0 -67
- package/src/orchestrator/skills/context-map/SKILL.md +0 -71
- package/src/orchestrator/skills/decomposition/SKILL.md +0 -103
- package/src/orchestrator/skills/documentation-standards/SKILL.md +0 -33
- package/src/orchestrator/skills/fast-review/REFERENCE.md +0 -28
- package/src/orchestrator/skills/memory-merger/SKILL.md +0 -77
- package/src/orchestrator/skills/observability-logging/LOG-SCHEMA.md +0 -238
- package/src/orchestrator/skills/observability-logging/SKILL.md +0 -73
- package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +0 -38
- package/src/orchestrator/skills/orchestration-protocols/SKILL.md +0 -120
- package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +0 -49
- package/src/orchestrator/skills/panel-majority-vote/panel-report.template.md +0 -38
- package/src/orchestrator/skills/performance-optimization/SKILL.md +0 -23
- package/src/orchestrator/skills/project-consistency/SKILL.md +0 -80
- package/src/orchestrator/skills/project-consistency/TEMPLATES.md +0 -35
- package/src/orchestrator/skills/react-development/SKILL.md +0 -24
- package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +0 -56
- package/src/orchestrator/skills/session-checkpoints/SKILL.md +0 -40
- package/src/orchestrator/skills/team-lead-reference/SKILL.md +0 -126
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
2
|
-
|
|
3
|
-
# Workflow: Bug Fix
|
|
4
|
-
|
|
5
|
-
Structured workflow for investigating and fixing reported bugs.
|
|
6
|
-
|
|
7
|
-
## Phases
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
Phase 1: Triage & Reproduce (sub-agent, inline)
|
|
11
|
-
Phase 2: Root Cause Analysis (sub-agent, inline)
|
|
12
|
-
Phase 3: Fix Implementation (sub-agent or background)
|
|
13
|
-
Phase 4: Verification (sub-agent, inline)
|
|
14
|
-
Phase 5: Delivery (direct, Team Lead)
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Branch & Delivery Strategy
|
|
20
|
-
|
|
21
|
-
The Team Lead creates the branch before any delegation and delivers it as the Delivery phase below describes. Branch naming: `fix/<ticket-id>-<short-description>`.
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Phase 1: Triage & Reproduce
|
|
26
|
-
|
|
27
|
-
**Agent:** Team Lead (self)
|
|
28
|
-
**Type:** Direct research
|
|
29
|
-
|
|
30
|
-
### Steps
|
|
31
|
-
|
|
32
|
-
1. Check `.opencastle/KNOWN-ISSUES.md` for existing entry
|
|
33
|
-
2. Check tracker for existing bug ticket
|
|
34
|
-
3. Read `.opencastle/LESSONS-LEARNED.md` for related pitfalls
|
|
35
|
-
4. **Reproduce the bug** — this is mandatory before any fix attempt:
|
|
36
|
-
a. Start the dev server (see the **codebase-tool** skill for the serve command)
|
|
37
|
-
b. Navigate to the affected page in Chrome
|
|
38
|
-
c. Follow the reproduction steps from the bug report
|
|
39
|
-
d. **Confirm the failure** — screenshot the broken state as evidence
|
|
40
|
-
e. If the bug **cannot be reproduced**, document what was tried and ask the reporter for more detail. Do NOT proceed to Phase 2 without reproduction
|
|
41
|
-
5. Assess severity (Critical/High/Medium/Low)
|
|
42
|
-
6. Create tracker issue with `[Bug]` prefix and `bug` label, including reproduction steps and screenshot
|
|
43
|
-
|
|
44
|
-
### Exit Criteria
|
|
45
|
-
|
|
46
|
-
- [ ] Bug **confirmed reproduced** with screenshot evidence (or documented as non-reproducible with investigation notes)
|
|
47
|
-
- [ ] Severity assessed
|
|
48
|
-
- [ ] Tracker issue created with reproduction steps and screenshot
|
|
49
|
-
- [ ] Affected apps identified (see `.opencastle/project.instructions.md` for inventory)
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## Phase 2: Root Cause Analysis
|
|
54
|
-
|
|
55
|
-
**Agent:** Specialist (based on bug domain — Developer, Security Expert, etc.)
|
|
56
|
-
**Type:** Sub-agent (inline, result needed for Phase 3)
|
|
57
|
-
|
|
58
|
-
### Steps
|
|
59
|
-
|
|
60
|
-
1. Search codebase for components, queries, and logic involved
|
|
61
|
-
2. Trace data flow from source → query → component → render
|
|
62
|
-
3. Check `git log` on suspected files for recent changes
|
|
63
|
-
4. Identify root cause category:
|
|
64
|
-
- Code bug (logic error, missing null check)
|
|
65
|
-
- Data issue (unexpected shape, missing field)
|
|
66
|
-
- Race condition (timing, hydration mismatch)
|
|
67
|
-
- CSS/Layout (specificity, overflow, responsive)
|
|
68
|
-
- Integration (API contract mismatch, schema drift)
|
|
69
|
-
5. Update tracker issue with root cause and affected files
|
|
70
|
-
|
|
71
|
-
### Exit Criteria
|
|
72
|
-
|
|
73
|
-
- [ ] Root cause identified and documented
|
|
74
|
-
- [ ] Affected files listed (defines the fix partition)
|
|
75
|
-
- [ ] Fix approach decided
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## Phase 3: Fix Implementation
|
|
80
|
-
|
|
81
|
-
**Agent:** Specialist (same as Phase 2)
|
|
82
|
-
**Type:** Sub-agent (simple fix) or Background (complex fix)
|
|
83
|
-
|
|
84
|
-
### Steps
|
|
85
|
-
|
|
86
|
-
1. Implement the fix within the identified file partition
|
|
87
|
-
2. Add or update tests covering the bug scenario
|
|
88
|
-
3. Run lint + test + build for affected projects
|
|
89
|
-
4. Return output contract
|
|
90
|
-
|
|
91
|
-
### Exit Criteria
|
|
92
|
-
|
|
93
|
-
- [ ] Fix implemented
|
|
94
|
-
- [ ] Test covering the bug added
|
|
95
|
-
- [ ] Lint + test + build pass
|
|
96
|
-
- [ ] Output contract returned
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
## Phase 4: Verification
|
|
101
|
-
|
|
102
|
-
**Agent:** Team Lead (self)
|
|
103
|
-
**Type:** Direct verification
|
|
104
|
-
|
|
105
|
-
### Steps
|
|
106
|
-
|
|
107
|
-
1. Review the output contract
|
|
108
|
-
2. Start dev server with clean cache
|
|
109
|
-
3. Verify the bug is fixed in Chrome (screenshot the working state)
|
|
110
|
-
4. Test adjacent features for regressions
|
|
111
|
-
5. If security-related: schedule panel review
|
|
112
|
-
6. Move tracker issue to Done
|
|
113
|
-
7. Update `.opencastle/KNOWN-ISSUES.md` if the bug was listed there
|
|
114
|
-
8. Commit and push
|
|
115
|
-
|
|
116
|
-
### Exit Criteria
|
|
117
|
-
|
|
118
|
-
- [ ] Bug confirmed fixed with screenshot
|
|
119
|
-
- [ ] No regressions introduced
|
|
120
|
-
- [ ] Tracker issue moved to Done
|
|
121
|
-
- [ ] Known issues updated (if applicable)
|
|
122
|
-
- [ ] Delivery phase completed — branch pushed, PR opened (not merged), tracker linked
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
### Phase 5: Delivery
|
|
127
|
-
|
|
128
|
-
> **See [shared-delivery-phase.md](shared-delivery-phase.md) for the standard delivery steps.**
|
|
129
|
-
>
|
|
130
|
-
> Commit → Push → PR → tracker linkage. Team Lead owns delivery.
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
2
|
-
|
|
3
|
-
# Workflow: Feature Implementation
|
|
4
|
-
|
|
5
|
-
Standard execution plan for multi-layer features. Customize file paths, agents, and criteria per task.
|
|
6
|
-
|
|
7
|
-
## Phases
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
Phase 0: Brainstorm (sub-agent or direct, optional)
|
|
11
|
-
Phase 1: Research (sub-agent, inline)
|
|
12
|
-
Phase 2: Foundation (background agents, parallel)
|
|
13
|
-
Phase 3: Integration (sub-agent, sequential)
|
|
14
|
-
Phase 4: Validation (background agents, parallel)
|
|
15
|
-
Phase 5: QA Gate (sub-agent, inline)
|
|
16
|
-
Phase 6: Delivery (direct, Team Lead)
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## State Tracking
|
|
22
|
-
|
|
23
|
-
Every Team Lead response during feature work **must** end with a state block. This enables context recovery after interruption and keeps the user informed:
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
📍 Phase 2/6 — Foundation | Progress: 3/7 issues | Budget: 2/7 delegations
|
|
27
|
-
Last: ✅ TAS-42 schema deployed (Content Engineer)
|
|
28
|
-
Next: Delegate TAS-43 migration (DB Engineer)
|
|
29
|
-
Cost: ~45K tokens (Standard×2)
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Fields: current phase, issues completed/total, delegations used/budget, last completed action, next planned action, running estimated token cost.
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Branch Strategy
|
|
37
|
-
|
|
38
|
-
1. **Team Lead creates the feature branch** in Phase 1 before any delegation: `git checkout -b feat/<ticket-id>-<short-description>`
|
|
39
|
-
2. **Sub-agents** work directly on the feature branch (they share the Team Lead’s working tree)
|
|
40
|
-
3. **Background agents** work in isolated worktrees branched from the feature branch
|
|
41
|
-
4. **Team Lead merges worktrees back** in Phase 5 (QA Gate) after verifying each background agent’s output
|
|
42
|
-
5. **Only the Team Lead pushes** to the feature branch and opens the PR
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## Phase 0: Brainstorm (Optional)
|
|
47
|
-
|
|
48
|
-
**Agent:** Team Lead (self)
|
|
49
|
-
**Type:** Direct or sub-agent
|
|
50
|
-
**Blocking:** No — skip when the approach is obvious
|
|
51
|
-
|
|
52
|
-
Run the `brainstorm` prompt when the task has ambiguity, multiple valid approaches, or significant design decisions. Skip for well-defined tasks with obvious implementation paths.
|
|
53
|
-
|
|
54
|
-
### Steps
|
|
55
|
-
|
|
56
|
-
1. Clarify the problem — restate, surface assumptions
|
|
57
|
-
2. Explore solution space — search existing code, check docs
|
|
58
|
-
3. Generate 2-3 alternative approaches with trade-offs
|
|
59
|
-
4. Recommend an approach with rationale
|
|
60
|
-
5. Define scope boundaries (in/out/deferred)
|
|
61
|
-
|
|
62
|
-
### Exit Criteria
|
|
63
|
-
|
|
64
|
-
- [ ] Problem clearly understood
|
|
65
|
-
- [ ] Alternatives explored
|
|
66
|
-
- [ ] Approach chosen with rationale
|
|
67
|
-
- [ ] Scope boundaries defined
|
|
68
|
-
- [ ] Brainstorm report produced (feeds into Phase 1)
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Phase 1: Research & Planning
|
|
73
|
-
|
|
74
|
-
**Agent:** Team Lead (self)
|
|
75
|
-
**Type:** Sub-agent or direct
|
|
76
|
-
**Blocking:** Yes — all other phases depend on this
|
|
77
|
-
|
|
78
|
-
### Steps
|
|
79
|
-
|
|
80
|
-
1. Read `.opencastle/project.instructions.md`, `.opencastle/KNOWN-ISSUES.md`, `.opencastle/LESSONS-LEARNED.md`
|
|
81
|
-
2. Search codebase for existing implementations
|
|
82
|
-
3. Identify affected apps, libs, and layers
|
|
83
|
-
4. **Spec flow analysis** — Trace the complete user flow end-to-end and identify:
|
|
84
|
-
- All user-visible states (loading, empty, populated, error, partial)
|
|
85
|
-
- State transitions and what triggers them
|
|
86
|
-
- Edge cases (network failure, invalid data, concurrent access, empty collections)
|
|
87
|
-
- Missing paths in the spec ("what happens when X?")
|
|
88
|
-
- Accessibility flows (keyboard navigation, screen reader announcements)
|
|
89
|
-
- Document findings as acceptance criteria on the tracker issues
|
|
90
|
-
5. Decompose into tracker issues with file partitions
|
|
91
|
-
6. **Surface Open Questions** — Collect ambiguities, design choices, and assumptions that need user input. Present as a structured list for approval before proceeding.
|
|
92
|
-
7. Create session checkpoint
|
|
93
|
-
|
|
94
|
-
### Open Questions Gate
|
|
95
|
-
|
|
96
|
-
> **MANDATORY STOP.** Do not proceed to Phase 2 until the user has answered all open questions.
|
|
97
|
-
|
|
98
|
-
After decomposition, present a structured list of open questions. Each question should:
|
|
99
|
-
- State the decision needed clearly
|
|
100
|
-
- Offer 2-3 concrete options with brief trade-offs
|
|
101
|
-
- Flag a recommended option if one is obvious
|
|
102
|
-
|
|
103
|
-
```markdown
|
|
104
|
-
**Open Questions (answer before implementation begins):**
|
|
105
|
-
1. [Question]? Option A (trade-off) / Option B (trade-off) / **Recommended: A**
|
|
106
|
-
2. [Question]? Option A / Option B
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
If there are no open questions, explicitly state: "No open questions — plan is unambiguous."
|
|
110
|
-
|
|
111
|
-
### Exit Criteria
|
|
112
|
-
|
|
113
|
-
- [ ] All relevant docs read
|
|
114
|
-
- [ ] **User flow traced** — all states, transitions, and edge cases documented
|
|
115
|
-
- [ ] Tracker issues created for every subtask (including edge case coverage)
|
|
116
|
-
- [ ] File partitions mapped (no overlaps)
|
|
117
|
-
- [ ] Dependencies identified
|
|
118
|
-
- [ ] **Open questions answered** by user (or none identified)
|
|
119
|
-
- [ ] Session checkpoint saved
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
## Phase 2: Foundation (Parallel)
|
|
124
|
-
|
|
125
|
-
**Agents:** Varies by task (DB Engineer, Content Engineer, UI Expert)
|
|
126
|
-
**Type:** Background agents (parallel)
|
|
127
|
-
**Blocking:** Phase 3 depends on this
|
|
128
|
-
|
|
129
|
-
### Typical Partitions
|
|
130
|
-
|
|
131
|
-
> For project-specific paths, see `.opencastle/project.instructions.md` and the relevant `.opencastle/stack/` files.
|
|
132
|
-
|
|
133
|
-
| Track | Agent | Files | Purpose |
|
|
134
|
-
|-------|-------|-------|----------|
|
|
135
|
-
| A: Schema | Content Engineer | CMS schema directory | CMS schema changes |
|
|
136
|
-
| B: Database | Data Engineer | Database migrations directory | Migration + RLS policies |
|
|
137
|
-
| C: Components | UI/UX Expert | Shared component library | New UI components |
|
|
138
|
-
|
|
139
|
-
### Exit Criteria (per track)
|
|
140
|
-
|
|
141
|
-
- [ ] Schema deployed or migration applied
|
|
142
|
-
- [ ] Type definitions generated
|
|
143
|
-
- [ ] Lint + test pass
|
|
144
|
-
- [ ] Output contract returned
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## Phase 3: Integration (Sequential)
|
|
149
|
-
|
|
150
|
-
**Agent:** Developer
|
|
151
|
-
**Type:** Sub-agent (needs Phase 2 results)
|
|
152
|
-
**Blocking:** Phase 4 depends on this
|
|
153
|
-
|
|
154
|
-
### Steps
|
|
155
|
-
|
|
156
|
-
1. Wire new components to data queries
|
|
157
|
-
2. Update data queries (see relevant skill for query library location)
|
|
158
|
-
3. Integrate into page routes
|
|
159
|
-
4. Add loading/error states
|
|
160
|
-
5. Run lint + test + build
|
|
161
|
-
|
|
162
|
-
### Exit Criteria
|
|
163
|
-
|
|
164
|
-
- [ ] Feature works end-to-end (data → query → component → page)
|
|
165
|
-
- [ ] Loading and error states implemented
|
|
166
|
-
- [ ] All affected projects build
|
|
167
|
-
- [ ] Output contract returned
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## Phase 4: Validation (Parallel)
|
|
172
|
-
|
|
173
|
-
**Agents:** Testing Expert, Security Expert, Writer
|
|
174
|
-
**Type:** Background agents (parallel)
|
|
175
|
-
|
|
176
|
-
### Tracks
|
|
177
|
-
|
|
178
|
-
| Track | Agent | Focus |
|
|
179
|
-
|-------|-------|-------|
|
|
180
|
-
| A: Tests | Testing Expert | Unit tests, E2E browser tests |
|
|
181
|
-
| B: Security | Security Expert | RLS audit, input validation, auth check |
|
|
182
|
-
| C: Docs | Writer | Roadmap, ADRs, known issues |
|
|
183
|
-
|
|
184
|
-
### Exit Criteria (per track)
|
|
185
|
-
|
|
186
|
-
- [ ] New code meets the coverage threshold in the project's test config
|
|
187
|
-
- [ ] Browser screenshots at all breakpoints
|
|
188
|
-
- [ ] Security audit passes (or panel review scheduled)
|
|
189
|
-
- [ ] Documentation updated
|
|
190
|
-
- [ ] Output contracts returned
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
## Phase 5: QA Gate
|
|
195
|
-
|
|
196
|
-
**Agent:** Team Lead (self)
|
|
197
|
-
**Type:** Sub-agent (inline)
|
|
198
|
-
**Blocking:** Must pass before merge
|
|
199
|
-
|
|
200
|
-
### Steps
|
|
201
|
-
|
|
202
|
-
1. Review all output contracts from Phases 2-4
|
|
203
|
-
2. Run full lint + test + build across all affected projects
|
|
204
|
-
3. Verify no files outside partitions were modified
|
|
205
|
-
4. Check all tracker issue acceptance criteria
|
|
206
|
-
5. Run panel review if high-stakes (security, DB, architecture)
|
|
207
|
-
6. **Final Smoke Test (Gate 10)** — verify the complete feature end-to-end:
|
|
208
|
-
- Full clean build of all affected projects (not incremental)
|
|
209
|
-
- End-to-end browser walkthrough of the complete user flow
|
|
210
|
-
- Verify all states: loading, empty, populated, error, partial
|
|
211
|
-
- Cross-task integration check (e.g., migration + component + page compose correctly)
|
|
212
|
-
- Final responsive sweep at all breakpoints (if UI changes)
|
|
213
|
-
7. Move all issues to Done
|
|
214
|
-
8. Update session checkpoint → delete checkpoint
|
|
215
|
-
9. Update `.opencastle/project/roadmap.md`, when the project keeps one
|
|
216
|
-
|
|
217
|
-
### Exit Criteria
|
|
218
|
-
|
|
219
|
-
- [ ] All phases verified
|
|
220
|
-
- [ ] All tracker issues Done
|
|
221
|
-
- [ ] Full build passes
|
|
222
|
-
- [ ] **Final smoke test passed** — complete user flow verified end-to-end
|
|
223
|
-
- [ ] Roadmap updated
|
|
224
|
-
- [ ] Delivery phase completed — branch pushed, PR opened (not merged), tracker linked
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
### Phase 6: Delivery
|
|
229
|
-
|
|
230
|
-
> **See [shared-delivery-phase.md](shared-delivery-phase.md) for the standard delivery steps.**
|
|
231
|
-
>
|
|
232
|
-
> Commit → Push → PR → tracker linkage. Team Lead owns delivery.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'AI assistant optimization patterns for efficient context usage and tool calls'
|
|
3
|
-
applyTo: '**'
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
7
|
-
|
|
8
|
-
# AI Optimization
|
|
9
|
-
|
|
10
|
-
- **Batch what is independent** — reads, searches and checks that do not depend on each other go in one turn; what depends on an earlier result waits for it.
|
|
11
|
-
- **Read in large ranges** — search to locate, then read the range you need, not many small slices of one file.
|
|
12
|
-
- **Do not re-read** — a file or a sub-agent's result already in context is used as it is.
|
|
13
|
-
- **Verify once per phase** — run tests, lint and build after a batch of edits, not after each one.
|
|
14
|
-
- **Scale planning to the change** — one or two files: act; ten or more: decompose first.
|
|
15
|
-
- **Hand over what you know** — a delegation prompt names the files and facts the agent would otherwise rediscover.
|
|
16
|
-
|
|
17
|
-
<!-- End of AI Optimization Instructions -->
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 'Handle follow-up refinements after a roadmap task — bug fixes, UI tweaks, polish, adjustments too small for issue tracking.'
|
|
3
|
-
agent: 'Team Lead (OpenCastle)'
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->
|
|
7
|
-
|
|
8
|
-
# Follow-Up Refinement
|
|
9
|
-
|
|
10
|
-
You are the Team Lead. Handle the follow-up refinement described below. This is **post-task adjustment** — a bug fix, UI tweak, or polish item that came up after reviewing a completed roadmap task. Does NOT require issue tracking.
|
|
11
|
-
|
|
12
|
-
## Request
|
|
13
|
-
|
|
14
|
-
{{followUpRequest}}
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## How Follow-Ups Differ from Roadmap Tasks
|
|
19
|
-
|
|
20
|
-
| Aspect | Roadmap Task | Follow-Up |
|
|
21
|
-
|--------|-------------|-----------|
|
|
22
|
-
| Tracker issues | Required (hard gate) | Depends on scope (see triage) |
|
|
23
|
-
| Panel review | For high-stakes changes | Only if security/data-related |
|
|
24
|
-
| Documentation updates | Roadmap + known issues + ADRs | Only if behavior changes significantly |
|
|
25
|
-
| Scope | Multi-step feature | Focused fix or adjustment |
|
|
26
|
-
| Branch strategy | Dedicated feature branch | Current branch (already in progress) |
|
|
27
|
-
|
|
28
|
-
**Despite being lighter-weight, follow-ups still require same code quality and verification standards.** Never skip linting, testing, or browser checks just because change is "small."
|
|
29
|
-
|
|
30
|
-
## Workflow
|
|
31
|
-
|
|
32
|
-
### 1. Triage: Decide Tracking Level
|
|
33
|
-
|
|
34
|
-
**Create a tracker issue if ANY of these are true:**
|
|
35
|
-
- Affects user-visible behavior, touches >2–3 files, or modifies `libs/`, queries, API routes, or Server Actions
|
|
36
|
-
- Could introduce regressions in other features
|
|
37
|
-
- You want record for future reference
|
|
38
|
-
|
|
39
|
-
**Skip tracking if ALL of these are true:**
|
|
40
|
-
- Pure cosmetic/spacing/copy change with no behavioral impact
|
|
41
|
-
- Isolated to single component or page
|
|
42
|
-
- Trivial to verify visually
|
|
43
|
-
|
|
44
|
-
If creating: title `[Follow-up] Short description`, label `follow-up`, priority Low/Medium, description: what changed, why, files
|
|
45
|
-
|
|
46
|
-
### 2. Understand the Request
|
|
47
|
-
|
|
48
|
-
1. **Clarify scope** — Identify exactly which pages, components, or behaviors need to change
|
|
49
|
-
2. **Find affected files** — Search the codebase for the relevant components, styles, queries, and tests
|
|
50
|
-
3. **Check known issues** — Scan `.opencastle/KNOWN-ISSUES.md` in case this is a documented limitation
|
|
51
|
-
4. **Read lessons learned** — Check `.opencastle/LESSONS-LEARNED.md` for relevant pitfalls before starting
|
|
52
|
-
5. **Assess complexity** — If larger than expected (>5 files, migration, or auth/security), inform the user, create a tracker issue, and switch to the `implement-feature` workflow
|
|
53
|
-
|
|
54
|
-
### 3. Plan the Fix
|
|
55
|
-
|
|
56
|
-
1. **Identify root cause** — For bugs, find why; for UI tweaks, understand the styling/layout chain
|
|
57
|
-
2. **Assess shared impact** — Will the fix affect other pages or apps? Check component usage across the codebase
|
|
58
|
-
3. **Minimal change** — Reuse existing components, utilities, and styles. Never introduce a new pattern for a one-off fix
|
|
59
|
-
|
|
60
|
-
### 4. Implement
|
|
61
|
-
|
|
62
|
-
#### Delegation Prompt Must Include
|
|
63
|
-
|
|
64
|
-
- What to fix, exact file paths, how to verify result
|
|
65
|
-
- Boundaries: "Only modify files listed above. Do not refactor unrelated code."
|
|
66
|
-
- Self-improvement reminder (see **self-improvement** skill)
|
|
67
|
-
|
|
68
|
-
#### Implementation Rules
|
|
69
|
-
|
|
70
|
-
- **No scope creep** — Fix only what was asked; note but don't fix adjacent issues
|
|
71
|
-
- **DRY + Visual consistency** — Reuse existing components, utilities, design system patterns
|
|
72
|
-
- **Cross-app + Accessibility** — Verify `libs/` changes across apps; don't regress keyboard nav/contrast
|
|
73
|
-
|
|
74
|
-
### 5. Validate
|
|
75
|
-
|
|
76
|
-
> Load **validation-gates** skill for detailed steps on each gate.
|
|
77
|
-
|
|
78
|
-
Every follow-up, no matter how small, must pass these gates:
|
|
79
|
-
|
|
80
|
-
1. **Secret Scanning** — block if API keys/tokens/passwords found in diff
|
|
81
|
-
2. **Deterministic Checks** — lint, test, build — zero errors (see **codebase-tool** skill)
|
|
82
|
-
3. **Blast Radius** — ≤100 lines / ≤3 files for follow-ups; if larger, escalate to `implement-feature`
|
|
83
|
-
4. **Dependency Audit** — when `package.json` or lockfiles change
|
|
84
|
-
5. **Fast Review** (MANDATORY) — single reviewer sub-agent
|
|
85
|
-
6. **Browser Testing** (MANDATORY for visual changes) — clear cache, verify + responsive + screenshots
|
|
86
|
-
7. **Regression Testing** — if shared component/library modified, test all consuming projects
|
|
87
|
-
|
|
88
|
-
### 6. Delivery
|
|
89
|
-
|
|
90
|
-
If tracked: follow the **Delivery Checklist** in the **git-workflow** skill — commit, push, open PR (not merged), tracker linked.
|
|
91
|
-
|
|
92
|
-
If untracked: commit to current branch; Team Lead includes in parent task's existing PR.
|
|
93
|
-
|
|
94
|
-
### 7. Escalation Triggers
|
|
95
|
-
|
|
96
|
-
- Requires database migration or data model changes (CMS schemas, tables)
|
|
97
|
-
- Involves auth/authorization changes
|
|
98
|
-
- Touches >5 files across multiple libraries
|
|
99
|
-
- Introduces new dependency or API endpoint
|
|
100
|
-
- Systemic issue requiring architectural changes
|
|
101
|
-
- Decomposes into 3+ subtasks → switch to `implement-feature`
|
|
102
|
-
|
|
103
|
-
### 8. Completion
|
|
104
|
-
|
|
105
|
-
- [ ] Specific request is resolved
|
|
106
|
-
- [ ] Tracker issue created, moved to Done (if triage determined tracking was needed)
|
|
107
|
-
- [ ] **Visual changes verified in Chrome with screenshot as proof**
|
|
108
|
-
- [ ] Shared component changes tested across all consuming apps
|
|
109
|
-
- [ ] Delivery Checklist completed if tracked (see the **git-workflow** skill) — branch pushed, PR opened (not merged), tracker linked
|
|
110
|
-
- [ ] Lessons learned captured, known issues updated if applicable
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# Agent Hooks — Detailed Reference
|
|
2
|
-
|
|
3
|
-
## on-session-start (extended checks)
|
|
4
|
-
|
|
5
|
-
In addition to the four checks in SKILL.md:
|
|
6
|
-
|
|
7
|
-
| # | Action |
|
|
8
|
-
|---|--------|
|
|
9
|
-
| 5 | `rg -n "Pending Approvals" .opencastle/SESSION-CHECKPOINT.md || true` |
|
|
10
|
-
| 6 | `jq '.bindings' .opencastle/agents/skill-matrix.json` — verify bindings present, then load domain skills before writing code |
|
|
11
|
-
|
|
12
|
-
## on-pre-delegate (example commands)
|
|
13
|
-
|
|
14
|
-
| # | Check | Example Command |
|
|
15
|
-
|---|-------|-----------------|
|
|
16
|
-
| 1 | Tracker issue | Look it up in the tracker (its skill), or `gh issue view <number>` for GitHub Issues; create it if missing |
|
|
17
|
-
| 2 | File partition | `rg -n "path:" prompts/* | cut -d: -f2 | sort | uniq -d` |
|
|
18
|
-
| 3 | Upstream deps | Verify upstream tasks are marked Done in tracker |
|
|
19
|
-
| 4 | Paths + AC | Include exact file paths (not globs) and acceptance criteria in prompt |
|
|
20
|
-
| 5 | Self-improvement | Add `Read .opencastle/LESSONS-LEARNED.md` to prompt text |
|
|
21
|
-
| 6 | Context map | Load the **context-map** skill for 5+ files |
|
|
22
|
-
|
|
23
|
-
The delegation is logged once, when it finishes (on-post-delegate) — a delegation record carries its outcome.
|
|
24
|
-
|
|
25
|
-
## on-post-delegate (detailed verification)
|
|
26
|
-
|
|
27
|
-
| # | Action | Command |
|
|
28
|
-
|---|--------|---------|
|
|
29
|
-
| 1 | Log completion | `opencastle log --type delegation …` — the delegation record in the **observability-logging** skill |
|
|
30
|
-
| 2 | Fast review | `opencastle log --type review …` — the review record in the **observability-logging** skill |
|
|
31
|
-
| 3 | CI checks | Lint, typecheck, and test (commands via the **codebase-tool** slot) |
|
|
32
|
-
| 4 | Verify ACs | Check each acceptance criterion against tracker issue |
|
|
33
|
-
| 5 | Track issues | `rg -n "Discovered issue" .opencastle/KNOWN-ISSUES.md`, else open a tracker issue |
|
|
34
|
-
| 6 | Lesson check | If agent retried, verify lesson added via **self-improvement** |
|
|
35
|
-
| 7 | Close/retry | Move the issue to Done in the project's tracker (its skill: linear/jira/trello), or `gh issue close <number>` for GitHub Issues; on FAIL follow **fast-review**'s Handle Verdict table |
|
|
36
|
-
|
|
37
|
-
## on-session-end (detailed)
|
|
38
|
-
|
|
39
|
-
| # | Action | Who |
|
|
40
|
-
|---|--------|-----|
|
|
41
|
-
| 1 | `opencastle doctor` | Team Lead |
|
|
42
|
-
| 2 | `opencastle log --type session ...` | All |
|
|
43
|
-
| 3 | Write `.opencastle/SESSION-CHECKPOINT.md` if incomplete | Team Lead |
|
|
44
|
-
| 4 | `ls .opencastle/lessons/ \| wc -l` — flag a memory-merger pass if more than 50 | All |
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: agent-hooks
|
|
3
|
-
description: "Checklists every agent runs at session start and session end, plus the Team Lead's pre- and post-delegation checks. Use when starting, resuming or wrapping up a session."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Agent Lifecycle Hooks
|
|
7
|
-
|
|
8
|
-
Conventions (not auto-triggers) agents execute at specific lifecycle points. Team Lead includes hook reminders in delegation prompts; specialists follow them in their own workflow.
|
|
9
|
-
|
|
10
|
-
```
|
|
11
|
-
on-session-start → [work loop] → on-session-end
|
|
12
|
-
↓ ↑
|
|
13
|
-
on-pre-delegate → on-post-delegate
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
The tracker is the project's own: its skill (Linear, Jira, Trello) or `gh issue` for GitHub Issues.
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## on-session-start
|
|
22
|
-
|
|
23
|
-
| # | Action |
|
|
24
|
-
|---|--------|
|
|
25
|
-
| 1 | Read `.opencastle/LESSONS-LEARNED.md`, then `rg -n "keyword" .opencastle/lessons/` |
|
|
26
|
-
| 2 | `cat .opencastle/SESSION-CHECKPOINT.md` (resume if exists) |
|
|
27
|
-
| 3 | `rg -n "ERROR\|FAIL" .opencastle/AGENT-FAILURES.md \|\| true` |
|
|
28
|
-
| 4 | `cat .opencastle/agents/skill-matrix.json \| jq '.bindings'` — load domain skills |
|
|
29
|
-
|
|
30
|
-
See [HOOKS-REFERENCE.md](HOOKS-REFERENCE.md) for extended startup checks (approval polling, skill-matrix verification).
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## on-session-end
|
|
35
|
-
|
|
36
|
-
> **HARD GATE** — every session gets a record in `.opencastle/logs/events.ndjson`,
|
|
37
|
-
> written before you yield, one per task, never batched retrospectively. Load
|
|
38
|
-
> **observability-logging** for the Pre-Response Quality Gate.
|
|
39
|
-
|
|
40
|
-
| # | Action |
|
|
41
|
-
|---|--------|
|
|
42
|
-
| 1 | `opencastle doctor` |
|
|
43
|
-
| 2 | `opencastle log --type session ...` |
|
|
44
|
-
| 3 | Write `.opencastle/SESSION-CHECKPOINT.md` if work is incomplete |
|
|
45
|
-
| 4 | More than 50 lessons in `.opencastle/lessons/` → flag a **memory-merger** pass |
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## on-pre-delegate — Team Lead only
|
|
50
|
-
|
|
51
|
-
| # | Check |
|
|
52
|
-
|---|-------|
|
|
53
|
-
| 1 | Tracker issue exists for the task |
|
|
54
|
-
| 2 | File partition clean (`comm -12 <(sort agent1-files) <(sort agent2-files)` = empty) |
|
|
55
|
-
| 3 | Upstream issues are Done in the tracker |
|
|
56
|
-
| 4 | Prompt has exact file paths + acceptance criteria |
|
|
57
|
-
| 5 | Prompt includes "Read LESSONS-LEARNED.md first" |
|
|
58
|
-
| 6 | 5+ files → load **context-map** skill |
|
|
59
|
-
|
|
60
|
-
All 6 must pass before the sub-agent is dispatched. See [HOOKS-REFERENCE.md](HOOKS-REFERENCE.md) for example commands per check.
|
|
61
|
-
|
|
62
|
-
## on-post-delegate — Team Lead only
|
|
63
|
-
|
|
64
|
-
| # | Action |
|
|
65
|
-
|---|--------|
|
|
66
|
-
| 1 | **⛔** `opencastle log --type delegation …` (the record in **observability-logging**) |
|
|
67
|
-
| 2 | Run **fast-review** skill |
|
|
68
|
-
| 3 | Lint, typecheck, and test (commands via the **codebase-tool** slot) |
|
|
69
|
-
| 4 | Verify each acceptance criterion on the tracker issue is met |
|
|
70
|
-
| 5 | If agent retried → verify lesson added via **self-improvement** |
|
|
71
|
-
| 6 | Move the issue to Done in the tracker, or follow **fast-review**'s Handle Verdict table |
|
|
72
|
-
|
|
73
|
-
See [HOOKS-REFERENCE.md](HOOKS-REFERENCE.md) for detailed verification commands.
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## Anti-Patterns
|
|
78
|
-
|
|
79
|
-
- Batch-logging retrospectively — loses per-task provenance.
|
|
80
|
-
- Running only part of on-post-delegate — build passes while ACs fail.
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
> Parent: [SKILL.md](./SKILL.md)
|
|
2
|
-
|
|
3
|
-
# Knowledge Graph Reference
|
|
4
|
-
|
|
5
|
-
File dependency graph and cross-agent relationships stored in `.opencastle/KNOWLEDGE-GRAPH.md`, which the first entry creates: a `# Knowledge Graph` heading and a `| Source | Relationship | Target | Added | Context |` table.
|
|
6
|
-
|
|
7
|
-
## Entity Types
|
|
8
|
-
|
|
9
|
-
| Entity | Format | Example |
|
|
10
|
-
|--------|--------|---------|
|
|
11
|
-
| **File** | `[file:path/to/file.ts]` | `[file:src/components/Button.tsx]` |
|
|
12
|
-
| **Agent** | `[agent:Name]` | `[agent:Developer]` |
|
|
13
|
-
| **Task** | `[task:TAS-XX]` | `[task:TAS-42]` |
|
|
14
|
-
|
|
15
|
-
## Relationship Types
|
|
16
|
-
|
|
17
|
-
| Relationship | Meaning |
|
|
18
|
-
|-------------|---------|
|
|
19
|
-
| `imports` | File A imports from File B |
|
|
20
|
-
| `renders` | Component A renders Component B |
|
|
21
|
-
| `queries` | File reads from data source |
|
|
22
|
-
| `mutates` | File writes to data source |
|
|
23
|
-
| `tested-by` | Source file tested by test file |
|
|
24
|
-
| `owned-by` | File primarily maintained by agent |
|
|
25
|
-
|
|
26
|
-
## Entry Template
|
|
27
|
-
|
|
28
|
-
```markdown
|
|
29
|
-
## [file:src/components/PriceFilter.tsx]
|
|
30
|
-
- imports: [file:src/hooks/useFilters.ts], [file:src/lib/api.ts]
|
|
31
|
-
- renders: [file:src/components/ui/Slider.tsx]
|
|
32
|
-
- tested-by: [file:src/components/PriceFilter.test.tsx]
|
|
33
|
-
- owned-by: [agent:Developer] (TAS-42, 2026-03-30)
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Triggers
|
|
37
|
-
|
|
38
|
-
| Event | Action |
|
|
39
|
-
|-------|--------|
|
|
40
|
-
| New file created | Add node + import edges |
|
|
41
|
-
| File deleted | Remove node + all edges |
|
|
42
|
-
| Agent completes task | Update `owned-by` with task ID and date |
|
|
43
|
-
| Delegation | Query graph for related files to include in prompt |
|
|
44
|
-
|
|
45
|
-
## Queries
|
|
46
|
-
|
|
47
|
-
- **What depends on X?** — Find all files with `imports: [file:X]`
|
|
48
|
-
- **Who last touched X?** — Check `owned-by` for the most recent task
|
|
49
|
-
- **What's the blast radius?** — Traverse `imports`/`renders` edges transitively
|