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.
- 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.js +1 -1
- package/dist/cli/bootstrap.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/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/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/update.d.ts.map +1 -1
- package/dist/cli/update.js +1 -58
- 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.ts +1 -1
- 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/dispatcher.test.ts +6 -2
- package/src/cli/docs-accuracy.test.ts +5 -1
- package/src/cli/doctor.ts +0 -26
- 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/update.ts +1 -66
- 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,50 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: agent-memory
|
|
3
|
-
description: "Creates, queries agent expertise profiles in AGENT-EXPERTISE.md; increments file-familiarity counters after each task; ranks candidate agents by recency, task-area match. Use when deciding which agent should handle a file, checking who last worked on a module, recording task outcomes, or assigning work based on past performance."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Agent Memory Protocol
|
|
7
|
-
|
|
8
|
-
## Expertise File
|
|
9
|
-
|
|
10
|
-
**Location:** `.opencastle/AGENT-EXPERTISE.md`, created on the first update. One `## <Agent>` section per agent that has worked here, each with `### Strong Areas`, `### Weak Areas` and `### File Familiarity`; add the file, then the section, when they are missing.
|
|
11
|
-
|
|
12
|
-
Entry format: `| Area | Evidence | Last Updated |` — e.g. `| Server Components | Built TAS-42 | 2026-03-15 |`. File familiarity: `- src/lib/search/ — 3 tasks`.
|
|
13
|
-
|
|
14
|
-
## Update Triggers
|
|
15
|
-
|
|
16
|
-
| Trigger | Action |
|
|
17
|
-
|---------|--------|
|
|
18
|
-
| First-attempt success | Update Strong |
|
|
19
|
-
| 2+ retries | Update Weak |
|
|
20
|
-
| File modified | Increment familiarity |
|
|
21
|
-
| DLQ failure | Add Weak with ref |
|
|
22
|
-
| >3 months stale | Mark as "stale" |
|
|
23
|
-
|
|
24
|
-
## Retrieval & Delegation
|
|
25
|
-
|
|
26
|
-
Query before delegating — there is nothing to read until the file exists — and include a concise context block in the prompt:
|
|
27
|
-
|
|
28
|
-
```sh
|
|
29
|
-
grep -A12 "^## Developer" .opencastle/AGENT-EXPERTISE.md 2>/dev/null
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Example prompt block: `Agent Context: Strong — Server Components (3 tasks); Weak — Component styling (2 retries); Familiar — src/lib/search/ (2 tasks)`
|
|
33
|
-
|
|
34
|
-
**After task completion,** edit the agent's section with your file-editing tool: add the row under the right table, or raise the task count on the familiarity line. Appending with `>>` puts the row at the end of the file, under whichever agent's section happens to be last.
|
|
35
|
-
|
|
36
|
-
After each task also add file relationships to `.opencastle/KNOWLEDGE-GRAPH.md`, created the same way. On DLQ failure, the Weak Area entry must carry the failure ID and a link to its logs.
|
|
37
|
-
|
|
38
|
-
## Validation Checkpoints
|
|
39
|
-
|
|
40
|
-
- Before delegating: chosen agent has a Strong area matching the task and no conflicting Weak entry.
|
|
41
|
-
- After completion: expertise file has the new entry, timestamped today.
|
|
42
|
-
- After pruning: every path on a familiarity line still exists.
|
|
43
|
-
|
|
44
|
-
## Pruning
|
|
45
|
-
|
|
46
|
-
Prune entries older than 6 months; remove familiarity for deleted paths; consolidate duplicates.
|
|
47
|
-
|
|
48
|
-
## Knowledge Graph
|
|
49
|
-
|
|
50
|
-
File dependency graph, cross-agent relationships. See [KNOWLEDGE-GRAPH.md](./KNOWLEDGE-GRAPH.md) for entity types, templates, triggers, queries.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: code-commenting
|
|
3
|
-
description: "When and how to comment code: the why over the what, annotation tags, public API docs and anti-patterns. Use when writing or reviewing comments, docstrings or TODO/FIXME tags."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Code Commenting
|
|
7
|
-
|
|
8
|
-
Comment WHY, not WHAT. When a bad name is the real problem, rename instead of commenting. Do comment: non-obvious algorithm choices, regexes, external API constraints, and the rationale behind every magic number or config constant. JSDoc every public API function.
|
|
9
|
-
|
|
10
|
-
## Annotation Tags
|
|
11
|
-
|
|
12
|
-
`TODO` planned work · `FIXME` known bug · `HACK` workaround (say why and when it can go) · `NOTE` non-obvious constraint · `WARNING` side effect / mutation risk · `PERF` hot path · `SECURITY` security-sensitive · `DEPRECATED` (name the replacement and removal version).
|
|
13
|
-
|
|
14
|
-
## Never
|
|
15
|
-
|
|
16
|
-
- Leave commented-out code — delete it; git has the history.
|
|
17
|
-
- Keep a changelog in comments — that is `git log`.
|
|
18
|
-
- Add decorative divider comments.
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
Full context-map template, partition derivation, and Team Lead integration.
|
|
2
|
-
|
|
3
|
-
## Context Map Template
|
|
4
|
-
|
|
5
|
-
## Context Map: [Task Name]
|
|
6
|
-
|
|
7
|
-
### Entry Points (MUST change)
|
|
8
|
-
| File | Reason | Owner |
|
|
9
|
-
|------|--------|-------|
|
|
10
|
-
| `libs/queries/src/lib/places.ts` | Add query field | Content Engineer |
|
|
11
|
-
| `libs/ui-kit/.../PlaceCard/` | Display new field | UI/UX Expert |
|
|
12
|
-
|
|
13
|
-
### Cascade Effects (WILL change)
|
|
14
|
-
| File | Triggered By | Reason | Owner |
|
|
15
|
-
|------|-------------|--------|-------|
|
|
16
|
-
| `apps/web-app/places/page.tsx` | PlaceCard | Update props | Frontend Dev |
|
|
17
|
-
| `libs/queries/src/lib/__tests__/places.test.ts` | Query | Update test | Testing Expert |
|
|
18
|
-
|
|
19
|
-
### Shared Boundaries (WATCH)
|
|
20
|
-
| File | Risk | Mitigation |
|
|
21
|
-
|------|------|------------|
|
|
22
|
-
| `libs/ui-kit/src/lib/index.ts` | Barrel export conflict | Merge sequentially |
|
|
23
|
-
|
|
24
|
-
### Unaffected (optional)
|
|
25
|
-
| Area | Why |
|
|
26
|
-
|------|-----|
|
|
27
|
-
| `db/migrations/` | No DB changes |
|
|
28
|
-
| `libs/auth/` | No auth changes |
|
|
29
|
-
|
|
30
|
-
### 4b — Validate Map
|
|
31
|
-
- [ ] Every file appears in exactly one section (Entry/Cascade/Shared/Unaffected)
|
|
32
|
-
- [ ] No file appears in two agents' partitions
|
|
33
|
-
- [ ] Test files are listed for every changed source file
|
|
34
|
-
- [ ] Shared boundaries have explicit mitigation strategies
|
|
35
|
-
|
|
36
|
-
### 5 — Derive File Partitions
|
|
37
|
-
|
|
38
|
-
Assign ownership — no file in two partitions; shared boundaries to one agent (merged first); test files to Testing Expert unless tightly coupled.
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
Agent A: libs/queries/src/lib/places.ts
|
|
42
|
-
Agent B: libs/ui-kit/.../PlaceCard/
|
|
43
|
-
Agent C: apps/web-app/places/, apps/admin-panel/places/
|
|
44
|
-
Agent D: **/*test*, **/*spec*
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Depth Levels
|
|
48
|
-
|
|
49
|
-
| Complexity | Files | Depth |
|
|
50
|
-
|------------|-------|-------|
|
|
51
|
-
| Small | 1–3 | Entry points + direct imports |
|
|
52
|
-
| Medium | 4–8 | Entry + 1-hop cascade |
|
|
53
|
-
| Large | 9+ | Full dependency graph |
|
|
54
|
-
|
|
55
|
-
## Team Lead Integration
|
|
56
|
-
|
|
57
|
-
Produced in **Phase 1**; consumed by:
|
|
58
|
-
- **Decomposition** — informs file partitions
|
|
59
|
-
- **Delegation prompts** — agents receive their map section
|
|
60
|
-
- **QA Gate** — compare actual changes against map to detect scope creep
|
|
61
|
-
|
|
62
|
-
Delegation prompt snippet:
|
|
63
|
-
```markdown
|
|
64
|
-
## Your File Partition
|
|
65
|
-
Modify only: `libs/queries/src/lib/places.ts`, `libs/queries/src/lib/__tests__/places.test.ts`
|
|
66
|
-
Do NOT modify: `libs/ui-kit/` (UI/UX Expert), `apps/` (Developer)
|
|
67
|
-
```
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: context-map
|
|
3
|
-
description: "Maps which files a change touches, their importers and shared dependencies, and groups them for safe parallel editing. Use when planning a refactor or a change across 5+ files, or partitioning files between agents."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Skill: Context Map
|
|
7
|
-
|
|
8
|
-
Generate **file impact map** before code changes to identify affected files, relationships, cascades — improves agent file partitions for parallel work.
|
|
9
|
-
|
|
10
|
-
## When to Use
|
|
11
|
-
|
|
12
|
-
| Use | Skip |
|
|
13
|
-
|-----|------|
|
|
14
|
-
| Feature implementation (Phase 1) | Isolated bug fixes ≤2 files |
|
|
15
|
-
| Refactoring (Phase 1 Scope) | |
|
|
16
|
-
| Schema changes cascading through queries/components | |
|
|
17
|
-
| Any task touching `libs/` | |
|
|
18
|
-
|
|
19
|
-
## Steps
|
|
20
|
-
|
|
21
|
-
### 1 — Entry Points
|
|
22
|
-
Identify files that MUST change from task description.
|
|
23
|
-
|
|
24
|
-
### 2 — Trace Outward (dependents)
|
|
25
|
-
Find consumers of entry-point exports:
|
|
26
|
-
```bash
|
|
27
|
-
rg -n "import .*from .*libs/auth" # find importers
|
|
28
|
-
rg -n "\bAuthCard\b" --type ts # find component consumers (ts covers .tsx)
|
|
29
|
-
rg -n "auth.*route|/auth" # find route references
|
|
30
|
-
```
|
|
31
|
-
If the assistant exposes a code-usage lookup (find-references), prefer it for
|
|
32
|
-
symbols: it resolves re-exports and aliases that a text search misses.
|
|
33
|
-
|
|
34
|
-
### 3 — Trace Inward (sources)
|
|
35
|
-
Find what entry points depend on:
|
|
36
|
-
```bash
|
|
37
|
-
rg -n "from .*libs/" src/auth/ # shared lib deps
|
|
38
|
-
rg -n "from .*config" src/auth/ # config deps
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### 4 — Build the Map
|
|
42
|
-
|
|
43
|
-
Produce a compact map for Team Lead and downstream agents:
|
|
44
|
-
|
|
45
|
-
```markdown
|
|
46
|
-
Context Map — Feature: Add priceRange
|
|
47
|
-
|
|
48
|
-
- Entry points:
|
|
49
|
-
- src/lib/place/schema.ts
|
|
50
|
-
- src/components/PriceRangeFilter/PriceRangeFilter.tsx
|
|
51
|
-
|
|
52
|
-
- Dependents (trace outward):
|
|
53
|
-
- src/pages/places/page.tsx
|
|
54
|
-
- src/components/PlacesList/PlaceCard.tsx
|
|
55
|
-
|
|
56
|
-
- Sources (trace inward):
|
|
57
|
-
- src/lib/filters.ts
|
|
58
|
-
- src/shared/types/place.ts
|
|
59
|
-
|
|
60
|
-
- Unaffected (optional):
|
|
61
|
-
- src/components/Account/**
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Validation checkpoint: every search hit lands in the map; all listed files open without errors (typecheck via the **codebase-tool** slot). Full template, depth levels, partition derivation, Team Lead integration: see [REFERENCE.md](./REFERENCE.md).
|
|
65
|
-
|
|
66
|
-
## Anti-Patterns
|
|
67
|
-
|
|
68
|
-
- Skipping for "obvious" tasks — shared libs cascade unexpectedly
|
|
69
|
-
- Guessing dependencies instead of searching for them
|
|
70
|
-
- Over-mapping a 2-file fix
|
|
71
|
-
- Using a stale map after plan changes
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: decomposition
|
|
3
|
-
description: "Breaks a feature into phased subtasks by dependency and writes the delegation spec for each. Use when planning delegations for multi-agent work, ordering dependent tasks, or splitting a feature into parallel phases."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Task Decomposition
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Dependency Resolution
|
|
10
|
-
|
|
11
|
-
`TaskB → TaskA` = B depends on A (must finish first).
|
|
12
|
-
|
|
13
|
-
**Topological sort:** No-dep tasks → Phase 1. Tasks depending only on Phase N → Phase N+1. Same-phase tasks with no mutual deps run in parallel.
|
|
14
|
-
|
|
15
|
-
**Cycle detection:** If A → B → C → A, split one task into independent part + dependent part.
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
Graph: Plan:
|
|
19
|
-
E → C → A Phase 1: A, B (parallel)
|
|
20
|
-
D → B Phase 2: C, D (parallel)
|
|
21
|
-
F → C, D Phase 3: E, F (parallel)
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Delegation Spec
|
|
25
|
-
|
|
26
|
-
For score 1-3, objective + files + criteria is sufficient. Full template:
|
|
27
|
-
|
|
28
|
-
```markdown
|
|
29
|
-
## Delegation Spec: [Task Title]
|
|
30
|
-
**Tracker Issue:** TAS-XX — [Title]
|
|
31
|
-
**Complexity:** [score]/13 → [tier] tier
|
|
32
|
-
**Agent:** [Agent Name]
|
|
33
|
-
|
|
34
|
-
### Objective
|
|
35
|
-
1-3 sentences: what to build/change and why.
|
|
36
|
-
|
|
37
|
-
### Context
|
|
38
|
-
- Key files: [list]
|
|
39
|
-
- Related patterns: [file:line references]
|
|
40
|
-
- Prior phase output: [compacted summary if applicable]
|
|
41
|
-
- Relevant lessons: [ids from LESSONS-LEARNED.md]
|
|
42
|
-
|
|
43
|
-
### Constraints
|
|
44
|
-
- File partition: Only modify files under [paths]
|
|
45
|
-
- Do NOT modify: [explicit exclusions]
|
|
46
|
-
- Dependencies: Requires [TAS-XX] Done first
|
|
47
|
-
|
|
48
|
-
### Acceptance Criteria
|
|
49
|
-
- [ ] Criterion 1
|
|
50
|
-
|
|
51
|
-
### Expected Output
|
|
52
|
-
Files changed · Verification (lint/test/build) · AC status (✅/❌) · Discovered issues · Lessons applied
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Read `.opencastle/LESSONS-LEARNED.md` before starting. Add lesson if you retry any approach.
|
|
56
|
-
|
|
57
|
-
## Prompt Quality
|
|
58
|
-
|
|
59
|
-
| Quality | Example |
|
|
60
|
-
|---------|---------|
|
|
61
|
-
| Strong (score 2) | "**TAS-42** — Fix token refresh. Users get 'Invalid token' after 30 min. JWT 1h expiry in `libs/auth/src/server.ts`. Fix refresh logic. Only `libs/auth/`. Run auth tests." |
|
|
62
|
-
| Strong (score 8) | Use Delegation Spec Template above (all sections). |
|
|
63
|
-
| Weak | "Fix the authentication bug." |
|
|
64
|
-
|
|
65
|
-
## Delegation Mechanism
|
|
66
|
-
|
|
67
|
-
```
|
|
68
|
-
Need result immediately?
|
|
69
|
-
YES → Is dependency for next step?
|
|
70
|
-
YES → Sub-Agent (inline)
|
|
71
|
-
NO → Sub-Agent or Background (if large)
|
|
72
|
-
NO → Expected > 5 min?
|
|
73
|
-
YES → Background Agent
|
|
74
|
-
NO → Sub-Agent (sequential)
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Mixed Delegation
|
|
78
|
-
|
|
79
|
-
| Phase | Mode | Work |
|
|
80
|
-
|-------|------|------|
|
|
81
|
-
| 1 | sub-agent | Research — context, patterns, file map |
|
|
82
|
-
| 2 | background | Foundation — DB migration + scaffolding (parallel) |
|
|
83
|
-
| 3 | sub-agent | Integration — wire components to data |
|
|
84
|
-
| 4 | background | Validation — security audit + tests + docs (parallel) |
|
|
85
|
-
| 5 | sub-agent | QA gate — verify phases, run builds |
|
|
86
|
-
| 6 | sub-agent | Panel review — load panel-majority-vote skill |
|
|
87
|
-
|
|
88
|
-
## Foundation-First Pattern
|
|
89
|
-
|
|
90
|
-
Apply when: 2+ pages/views/UI sections · multiple agents produce visual output · no existing design system.
|
|
91
|
-
|
|
92
|
-
Phase 1 `foundation-setup` is sequential; every visual task gets `depends_on: [foundation-setup]` and the 5 Foundation References in its prompt.
|
|
93
|
-
|
|
94
|
-
**Partition rules:**
|
|
95
|
-
- Foundation owns: `src/styles/`, `src/components/Layout.*`, `src/components/ui/`
|
|
96
|
-
- Page tasks own: their page file + page-specific components only
|
|
97
|
-
- No page task may list a foundation-owned path in its `files[]`
|
|
98
|
-
|
|
99
|
-
**Common mistake:** Decomposing pages as independent Phase 1 tasks → each agent invents its own design.
|
|
100
|
-
|
|
101
|
-
Specs must be paste-ready for a sub-agent: exact paths, line ranges, forbidden files — no human translation step.
|
|
102
|
-
|
|
103
|
-
> Load **project-consistency** skill for full Foundation Phase pattern, prompt templates, anti-patterns.
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: documentation-standards
|
|
3
|
-
description: "Templates for issue docs, ADRs, roadmap entries, changelogs and Mermaid diagrams. Use when drafting an ADR, a changelog entry or a known-issue doc, updating the roadmap after a feature ships, or diagramming a system."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Documentation Standards
|
|
7
|
-
|
|
8
|
-
The project's own documents are listed under Key Documentation in `.opencastle/project.instructions.md`.
|
|
9
|
-
|
|
10
|
-
## Templates
|
|
11
|
-
|
|
12
|
-
Write the prose in each by the **technical-writing** and **unslop** skills.
|
|
13
|
-
|
|
14
|
-
**Issue doc** — `### ISSUE-ID: Brief Description`, then: Issue ID, Status (Known Limitation | Fixed | Workaround Available), Severity (Critical | High | Medium | Low), Impact, Problem, Root Cause, Solution Options (numbered, each with Pros/Cons), Related Files (path — what it does).
|
|
15
|
-
|
|
16
|
-
**ADR** — `## ADR-NNN: Decision Title`, then: Date, Status (Accepted | Superseded | Deprecated), Context, Decision, Consequences, Alternatives Considered.
|
|
17
|
-
|
|
18
|
-
**Roadmap completion** — add a `COMPLETE` row: feature, `Completed: YYYY-MM-DD | Owner: @handle`, files changed with rationale, validation command plus exit status. Then move it to the `Completed` section with a one-line release note.
|
|
19
|
-
|
|
20
|
-
**Changelog** — under a `## [1.2.0] - YYYY-MM-DD` heading, group changes as Added / Changed / Fixed / Removed, one imperative line per change with its PR or issue number, most recent version first. Breaking changes lead their group.
|
|
21
|
-
|
|
22
|
-
## Mermaid Diagrams
|
|
23
|
-
|
|
24
|
-
One concern per diagram, max 10–12 nodes. `flowchart TD` for pipelines, `LR` for request flows, `sequenceDiagram` for API flows, `erDiagram` for data models. Verb labels on arrows; `%% Title: ...` on complex diagrams.
|
|
25
|
-
|
|
26
|
-
## Validate
|
|
27
|
-
|
|
28
|
-
Check links and formatting before committing docs. Resolve the formatter
|
|
29
|
-
command via the **codebase-tool** slot; the link checker is standalone:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npx markdown-link-check docs/**/*.md
|
|
33
|
-
```
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# Fast Review — Reviewer Prompt Template
|
|
2
|
-
|
|
3
|
-
```markdown
|
|
4
|
-
You are a code reviewer. Be concise and specific.
|
|
5
|
-
|
|
6
|
-
## Task: [ID] — [Title]
|
|
7
|
-
Acceptance Criteria: [list]
|
|
8
|
-
|
|
9
|
-
## File Partition: [allowed dirs/files]
|
|
10
|
-
## Changed Files: [path + key diff]
|
|
11
|
-
## Deterministic: Lint: [P/F] | Tests: [P/F] | Build: [P/F]
|
|
12
|
-
|
|
13
|
-
## Checklist
|
|
14
|
-
1. Acceptance criteria met?
|
|
15
|
-
2. Partition respected?
|
|
16
|
-
3. No regressions?
|
|
17
|
-
4. Errors surfaced (no swallowed exceptions)?
|
|
18
|
-
5. Type safety (no `as any`)?
|
|
19
|
-
6. No secrets/injection vectors?
|
|
20
|
-
7. Edge cases handled?
|
|
21
|
-
|
|
22
|
-
## Prior Feedback (retry only): [previous FAIL]
|
|
23
|
-
|
|
24
|
-
VERDICT: PASS | FAIL
|
|
25
|
-
ISSUES: - [severity:critical|major|minor] Description
|
|
26
|
-
FEEDBACK: [Actionable feedback.]
|
|
27
|
-
CONFIDENCE: low | medium | high
|
|
28
|
-
```
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: memory-merger
|
|
3
|
-
description: "Graduates mature lessons from .opencastle/lessons/ into permanent rules in skill or instruction files, then archives them. Use when the lessons index grows past 50, or a lesson has proven itself and belongs in a skill."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Memory Merger
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Run Criteria
|
|
10
|
-
|
|
11
|
-
Run a pass when `.opencastle/lessons/` holds more than 50 lessons. A lesson is a merge candidate when it meets one or more of these, each checkable from its file:
|
|
12
|
-
|
|
13
|
-
| Criterion | Check |
|
|
14
|
-
|-----------|-------|
|
|
15
|
-
| Age | `added:` more than 60 days ago, and the lesson still holds |
|
|
16
|
-
| Valid citation | Its cited files still exist and `opencastle doctor` reports no changed citation (or `verified:` is recent) |
|
|
17
|
-
| Recurrence | Two or more lessons describe the same problem, or 5+ share a category |
|
|
18
|
-
| Severity | `severity: high`, or the lesson blocked work |
|
|
19
|
-
|
|
20
|
-
## Workflow (numbered)
|
|
21
|
-
|
|
22
|
-
1. Scan `.opencastle/lessons/` for candidate lessons by the criteria above.
|
|
23
|
-
2. Map each candidate to target file, section.
|
|
24
|
-
3. Draft exact edit (concise rule or example).
|
|
25
|
-
4. Apply edit with attribution comment.
|
|
26
|
-
5. Archive the lesson with `opencastle lesson archive`.
|
|
27
|
-
6. Run validation checks.
|
|
28
|
-
|
|
29
|
-
## Merge Protocol
|
|
30
|
-
|
|
31
|
-
### 3 — Draft Edit
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
Lesson: <id> — [title]
|
|
35
|
-
Target: [file path]
|
|
36
|
-
Section: [section name]
|
|
37
|
-
Edit: [exact text]
|
|
38
|
-
```
|
|
39
|
-
Strategies: add rule, add anti-pattern, add code example, expand existing rule, add table row.
|
|
40
|
-
|
|
41
|
-
### 4 — Apply & Attribute
|
|
42
|
-
|
|
43
|
-
Edit target file; add `<!-- Merged from <id> -->` attribution inline.
|
|
44
|
-
|
|
45
|
-
### 5 — Archive
|
|
46
|
-
|
|
47
|
-
```sh
|
|
48
|
-
opencastle lesson archive <id> --into <target file>
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
The lesson keeps its file, is marked archived with where it went, and moves to the index's **Archived** section — out of the list agents read before work. Never edit `LESSONS-LEARNED.md` by hand: it is rewritten from the lesson files.
|
|
52
|
-
|
|
53
|
-
**Never delete lessons** — archive for traceability.
|
|
54
|
-
|
|
55
|
-
### Automating the scan
|
|
56
|
-
|
|
57
|
-
```sh
|
|
58
|
-
# Oldest lessons first — candidates once past 60 days
|
|
59
|
-
rg -H '^added:' .opencastle/lessons/ | sort -t'"' -k2 | head -20
|
|
60
|
-
|
|
61
|
-
# Categories with 5+ lessons
|
|
62
|
-
rg -o --no-filename '^category: *.*' .opencastle/lessons/ | sort | uniq -c | awk '$1 >= 5'
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Quality Gates (validation checkpoints)
|
|
66
|
-
|
|
67
|
-
- [ ] No duplicate rules created in target files or other skills
|
|
68
|
-
- [ ] Archived lesson references target file and date
|
|
69
|
-
- [ ] Target file still passes lint/markdown checks (if applicable)
|
|
70
|
-
- [ ] Keyword search in the target file confirms the merge applied
|
|
71
|
-
|
|
72
|
-
## Anti-Patterns
|
|
73
|
-
|
|
74
|
-
- Merge too eagerly — a lesson younger than 60 days needs recurrence or high severity to qualify
|
|
75
|
-
- Copy verbatim — rewrite as rules/guidelines, not incident reports
|
|
76
|
-
- Merge conflicting lessons — resolve conflict first
|
|
77
|
-
- Create new files for merged content — merge INTO existing files only
|