opencastle 0.32.12 → 0.33.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.
Files changed (115) hide show
  1. package/LICENSE +21 -93
  2. package/README.md +5 -3
  3. package/package.json +2 -2
  4. package/src/dashboard/dist/data/convoys/demo-api-v2.json +3 -3
  5. package/src/dashboard/dist/data/convoys/demo-auth-revamp.json +4 -4
  6. package/src/dashboard/dist/data/convoys/demo-dashboard-ui.json +12 -12
  7. package/src/dashboard/dist/data/convoys/demo-data-pipeline.json +3 -3
  8. package/src/dashboard/dist/data/convoys/demo-deploy-ci.json +1 -1
  9. package/src/dashboard/dist/data/convoys/demo-docs-update.json +7 -7
  10. package/src/dashboard/dist/data/convoys/demo-perf-opt.json +4 -4
  11. package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
  12. package/src/dashboard/public/data/convoys/demo-api-v2.json +3 -3
  13. package/src/dashboard/public/data/convoys/demo-auth-revamp.json +4 -4
  14. package/src/dashboard/public/data/convoys/demo-dashboard-ui.json +12 -12
  15. package/src/dashboard/public/data/convoys/demo-data-pipeline.json +3 -3
  16. package/src/dashboard/public/data/convoys/demo-deploy-ci.json +1 -1
  17. package/src/dashboard/public/data/convoys/demo-docs-update.json +7 -7
  18. package/src/dashboard/public/data/convoys/demo-perf-opt.json +4 -4
  19. package/src/orchestrator/customizations/stack/sanity-config.md +43 -0
  20. package/src/orchestrator/customizations/stack/supabase-config.md +53 -0
  21. package/src/orchestrator/plugins/astro/REFERENCE.md +5 -0
  22. package/src/orchestrator/plugins/astro/SKILL.md +22 -29
  23. package/src/orchestrator/plugins/chrome-devtools/REFERENCE.md +9 -0
  24. package/src/orchestrator/plugins/chrome-devtools/SKILL.md +10 -55
  25. package/src/orchestrator/plugins/contentful/REFERENCE.md +16 -0
  26. package/src/orchestrator/plugins/contentful/SKILL.md +69 -29
  27. package/src/orchestrator/plugins/convex/REFERENCE.md +9 -0
  28. package/src/orchestrator/plugins/convex/SKILL.md +13 -1
  29. package/src/orchestrator/plugins/cypress/REFERENCE.md +5 -0
  30. package/src/orchestrator/plugins/cypress/SKILL.md +29 -93
  31. package/src/orchestrator/plugins/figma/REFERENCE.md +18 -0
  32. package/src/orchestrator/plugins/figma/SKILL.md +41 -66
  33. package/src/orchestrator/plugins/jira/REFERENCE.md +9 -0
  34. package/src/orchestrator/plugins/jira/SKILL.md +26 -114
  35. package/src/orchestrator/plugins/linear/SKILL.md +42 -109
  36. package/src/orchestrator/plugins/netlify/REFERENCE.md +33 -0
  37. package/src/orchestrator/plugins/netlify/SKILL.md +34 -64
  38. package/src/orchestrator/plugins/nextjs/REFERENCE.md +73 -0
  39. package/src/orchestrator/plugins/nextjs/SKILL.md +49 -138
  40. package/src/orchestrator/plugins/notion/SKILL.md +26 -168
  41. package/src/orchestrator/plugins/notion/TEMPLATES.md +88 -0
  42. package/src/orchestrator/plugins/nx/REFERENCE.md +10 -0
  43. package/src/orchestrator/plugins/nx/SKILL.md +12 -12
  44. package/src/orchestrator/plugins/playwright/REFERENCE.md +12 -0
  45. package/src/orchestrator/plugins/playwright/SKILL.md +33 -98
  46. package/src/orchestrator/plugins/prisma/REFERENCE.md +42 -0
  47. package/src/orchestrator/plugins/prisma/SKILL.md +18 -68
  48. package/src/orchestrator/plugins/resend/REFERENCE.md +61 -0
  49. package/src/orchestrator/plugins/resend/SKILL.md +23 -137
  50. package/src/orchestrator/plugins/sanity/SKILL.md +50 -3
  51. package/src/orchestrator/plugins/slack/REFERENCE.md +24 -0
  52. package/src/orchestrator/plugins/slack/SKILL.md +36 -111
  53. package/src/orchestrator/plugins/strapi/REFERENCE.md +35 -0
  54. package/src/orchestrator/plugins/strapi/SKILL.md +60 -24
  55. package/src/orchestrator/plugins/supabase/REFERENCE.md +9 -0
  56. package/src/orchestrator/plugins/supabase/SKILL.md +44 -16
  57. package/src/orchestrator/plugins/teams/REFERENCE.md +36 -0
  58. package/src/orchestrator/plugins/teams/SKILL.md +35 -85
  59. package/src/orchestrator/plugins/trello/REFERENCE.md +9 -0
  60. package/src/orchestrator/plugins/trello/SKILL.md +25 -97
  61. package/src/orchestrator/plugins/turborepo/REFERENCE.md +9 -0
  62. package/src/orchestrator/plugins/turborepo/SKILL.md +13 -1
  63. package/src/orchestrator/plugins/vercel/SKILL.md +45 -52
  64. package/src/orchestrator/plugins/vitest/SKILL.md +10 -14
  65. package/src/orchestrator/prompts/create-skill.prompt.md +62 -20
  66. package/src/orchestrator/prompts/generate-convoy.prompt.md +6 -0
  67. package/src/orchestrator/prompts/generate-prd.prompt.md +4 -0
  68. package/src/orchestrator/skills/accessibility-standards/REFERENCE.md +34 -0
  69. package/src/orchestrator/skills/accessibility-standards/SKILL.md +6 -3
  70. package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +48 -0
  71. package/src/orchestrator/skills/agent-hooks/SKILL.md +41 -65
  72. package/src/orchestrator/skills/agent-memory/KNOWLEDGE-GRAPH.md +49 -0
  73. package/src/orchestrator/skills/agent-memory/SKILL.md +30 -67
  74. package/src/orchestrator/skills/api-patterns/SKILL.md +29 -1
  75. package/src/orchestrator/skills/backbone-scaffolding/EXAMPLES.md +16 -0
  76. package/src/orchestrator/skills/backbone-scaffolding/SKILL.md +99 -0
  77. package/src/orchestrator/skills/code-commenting/SKILL.md +1 -1
  78. package/src/orchestrator/skills/context-map/REFERENCE.md +70 -0
  79. package/src/orchestrator/skills/context-map/SKILL.md +28 -55
  80. package/src/orchestrator/skills/data-engineering/REFERENCE.md +55 -0
  81. package/src/orchestrator/skills/data-engineering/SKILL.md +40 -34
  82. package/src/orchestrator/skills/decomposition/REFERENCE.md +28 -0
  83. package/src/orchestrator/skills/decomposition/SKILL.md +15 -30
  84. package/src/orchestrator/skills/deployment-infrastructure/SKILL.md +31 -65
  85. package/src/orchestrator/skills/documentation-standards/SKILL.md +31 -50
  86. package/src/orchestrator/skills/documentation-standards/WRITING-GUIDE.md +39 -0
  87. package/src/orchestrator/skills/fast-review/REFERENCE.md +30 -0
  88. package/src/orchestrator/skills/fast-review/SKILL.md +11 -31
  89. package/src/orchestrator/skills/frontend-design/COMPONENTS.md +113 -0
  90. package/src/orchestrator/skills/frontend-design/REFERENCE.md +36 -0
  91. package/src/orchestrator/skills/frontend-design/SKILL.md +36 -85
  92. package/src/orchestrator/skills/git-workflow/SKILL.md +13 -2
  93. package/src/orchestrator/skills/memory-merger/REFERENCE.md +20 -0
  94. package/src/orchestrator/skills/memory-merger/SKILL.md +29 -38
  95. package/src/orchestrator/skills/observability-logging/SKILL.md +5 -12
  96. package/src/orchestrator/skills/orchestration-protocols/REFERENCE.md +42 -0
  97. package/src/orchestrator/skills/orchestration-protocols/SKILL.md +54 -41
  98. package/src/orchestrator/skills/panel-majority-vote/REFERENCE.md +55 -0
  99. package/src/orchestrator/skills/panel-majority-vote/SKILL.md +30 -75
  100. package/src/orchestrator/skills/performance-optimization/SKILL.md +41 -1
  101. package/src/orchestrator/skills/project-consistency/SKILL.md +50 -89
  102. package/src/orchestrator/skills/project-consistency/TEMPLATES.md +39 -0
  103. package/src/orchestrator/skills/react-development/REFERENCE.md +7 -0
  104. package/src/orchestrator/skills/react-development/SKILL.md +50 -42
  105. package/src/orchestrator/skills/security-hardening/SKILL.md +88 -1
  106. package/src/orchestrator/skills/self-improvement/LESSON-CATEGORIES.md +36 -0
  107. package/src/orchestrator/skills/self-improvement/SKILL.md +19 -25
  108. package/src/orchestrator/skills/seo-patterns/REFERENCE.md +54 -0
  109. package/src/orchestrator/skills/seo-patterns/SKILL.md +20 -88
  110. package/src/orchestrator/skills/session-checkpoints/CHECKPOINT-TEMPLATE.md +58 -0
  111. package/src/orchestrator/skills/session-checkpoints/SKILL.md +34 -58
  112. package/src/orchestrator/skills/team-lead-reference/SKILL.md +37 -30
  113. package/src/orchestrator/skills/testing-workflow/SKILL.md +55 -2
  114. package/src/orchestrator/skills/validation-gates/REFERENCE.md +50 -0
  115. package/src/orchestrator/skills/validation-gates/SKILL.md +39 -35
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: agent-hooks
3
- description: "Lifecycle hooks for AI agent sessions reusable actions that run at specific points (session start, session end, pre-delegation, post-delegation). Defines what to do at each lifecycle event so agents behave consistently."
3
+ description: "Four lifecycle hooks every agent runs: on-session-start scans LESSONS-LEARNED.md and resumes checkpoints, on-pre-delegate verifies tracker issues and file partitions, on-post-delegate runs fast-review and CI checks, on-session-end executes the session guard and writes logs. Use when starting a new session, running pre-flight checks before delegation, coordinating between agents, reviewing a completed handoff, or wrapping up a session. Trigger terms: multi-agent setup, delegate tasks, agent coordination, session management, run pre-flight checks, start a new session, coordinate between agents, wrap up session"
4
4
  ---
5
5
 
6
6
  # Agent Lifecycle Hooks
@@ -15,88 +15,64 @@ on-session-start → [work loop] → on-session-end
15
15
 
16
16
  ---
17
17
 
18
- ## on-session-start — First action in any session
19
18
 
20
- | # | Action | Detail |
21
- |---|--------|--------|
22
- | 1 | Read lessons | Scan `.opencastle/LESSONS-LEARNED.md` for task-relevant entries. |
23
- | 2 | Check checkpoint | If `.opencastle/SESSION-CHECKPOINT.md` exists, resume from it. |
24
- | 3 | Check pending approvals | If checkpoint has `## Pending Approvals`, check replies via messaging provider (`stack.teamTools` in `.opencastle.json`). Skip if no messaging configured. |
25
- | 4 | Check DLQ | Scan `.opencastle/AGENT-FAILURES.md` for failures in current scope. |
26
- | 5 | Validate skill-matrix | Open `.opencastle/agents/skill-matrix.json` — if all `bindings` entries are empty, **warn** user to run *"Bootstrap Customizations"* prompt first. |
27
- | 6 | Check project context | If `.opencastle/project.instructions.md` has only empty template rows, warn bootstrap hasn't run. |
28
- | 7 | Load domain skills | Load appropriate skills before writing code. |
19
+ ## on-session-start
29
20
 
30
- **Delegation reminder:**
31
- ```
32
- Session Start: Read `.opencastle/LESSONS-LEARNED.md`. Check `.opencastle/SESSION-CHECKPOINT.md` for prior state and pending approvals. Validate `.opencastle/agents/skill-matrix.json` — warn if bindings empty. Load relevant skills before coding.
33
- ```
21
+ | # | Action |
22
+ |---|--------|
23
+ | 1 | `rg -n "keyword" .opencastle/LESSONS-LEARNED.md` |
24
+ | 2 | `cat .opencastle/SESSION-CHECKPOINT.md` (resume if exists) |
25
+ | 3 | `rg -n "ERROR\|FAIL" .opencastle/AGENT-FAILURES.md \|\| true` |
26
+ | 4 | `cat .opencastle/agents/skill-matrix.json \| jq '.bindings'` — load domain skills |
34
27
 
35
- ---
28
+ See [HOOKS-REFERENCE.md](HOOKS-REFERENCE.md) for extended startup checks (approval polling, skill-matrix verification).
36
29
 
37
- ## on-session-end — Before yielding control, every time unconditionally
30
+ ---
38
31
 
39
- > **⛔ HARD GATE** — See [logging-mandatory](../../snippets/logging-mandatory.md). Run the Pre-Response Quality Gate from the **observability-logging** skill.
32
+ ## on-session-end
40
33
 
41
- | # | Action | Who |
42
- |---|--------|-----|
43
- | 1 | Call Session Guard with session summary; execute fix commands it returns | Team Lead only |
44
- | 2 | Run Pre-Response Quality Gate checklist from **observability-logging** skill | Specialists only |
45
- | 3 | Write `.opencastle/SESSION-CHECKPOINT.md` if work is incomplete (load **session-checkpoints** skill) | Team Lead only |
46
- | 4 | Flag for memory merge if 5+ new lessons this session | All |
47
- | 5 | Remove temp files created during session | All |
34
+ > **⛔ HARD GATE** See [logging-mandatory](../../snippets/logging-mandatory.md). Load **observability-logging** for the Pre-Response Quality Gate.
48
35
 
49
- **Delegation reminder (specialists):**
50
- ```
51
- Session End: Log session via observability-logging skill (Constitution rule #6). Add lesson via self-improvement if retried. Track discovered issues in KNOWN-ISSUES.md or tracker. Clean up temp files.
52
- ```
36
+ | # | Action |
37
+ |---|--------|
38
+ | 1 | `opencastle doctor --fix` (session guard) |
39
+ | 2 | `opencastle log --type session ...` |
40
+ | 3 | Write `.opencastle/SESSION-CHECKPOINT.md` if work is incomplete |
41
+ | 4 | Flag for memory merge if 5+ new lessons |
53
42
 
54
43
  ---
55
44
 
56
- ## on-pre-delegate — Team Lead only, before every delegation
45
+ ## on-pre-delegate — Team Lead only
46
+
47
+ | # | Check |
48
+ |---|-------|
49
+ | 1 | Tracker issue exists (`gh issue view TAS-XX`) |
50
+ | 2 | File partition clean (`comm -12 <(sort agent1-files) <(sort agent2-files)` = empty) |
51
+ | 3 | Upstream deps Done (`gh issue view TAS-XX --json state -q '.state'` = CLOSED) |
52
+ | 4 | Prompt has exact file paths + acceptance criteria |
53
+ | 5 | Prompt includes "Read LESSONS-LEARNED.md first" |
54
+ | 6 | 5+ files → load **context-map** skill |
57
55
 
58
- Run the 5-point Pre-Delegation Checks from the Team Lead agent file: (1) Tracker issue exists, (2) File partition clean, (3) Dependencies verified Done, (4) Prompt has file paths + acceptance criteria, (5) Self-improvement reminder included. For 5+ files, generate a context map.
56
+ All 6 must pass before `runSubagent`. See [HOOKS-REFERENCE.md](HOOKS-REFERENCE.md) for example commands per check.
59
57
 
60
- ## on-post-delegate — Team Lead only, after receiving delegation results
58
+ ## on-post-delegate — Team Lead only
61
59
 
62
60
  | # | Action |
63
61
  |---|--------|
64
- | 0 | **⛔ Log delegation** via observability-logging skill — BLOCKING |
65
- | 1 | **Fast review (mandatory)** — run `fast-review` skill; **⛔ log review** — BLOCKING. Escalate to panel if needed; **⛔ log panel** — BLOCKING |
66
- | 2 | Read changed files; verify within file partition |
67
- | 3 | Run lint, type-check, tests |
68
- | 4 | Verify each acceptance criterion against tracker issue |
69
- | 5 | Confirm Discovered Issues Policy followed (KNOWN-ISSUES.md or tracker ticket) |
70
- | 6 | If agent retried, verify lesson added via **self-improvement** skill |
71
- | 7 | Move issue to Done or re-delegate; on 3rd failure → log to `.opencastle/AGENT-FAILURES.md` |
72
- | 8 | Update `.opencastle/AGENT-EXPERTISE.md` (strong/weak area + file familiarity) |
73
- | 9 | Append file relationships to `.opencastle/KNOWLEDGE-GRAPH.md` |
74
-
75
- **Quick checklist:**
76
- ```
77
- ☐ ⛔ Delegation logged (verify: tail -1 events.ndjson) — BLOCKING
78
- ☐ Changed files reviewed; within partition
79
- ☐ Lint/test/build passes
80
- ☐ Fast review PASS; ⛔ Review logged — BLOCKING
81
- ☐ ⛔ Panel logged if escalated — BLOCKING
82
- ☐ Acceptance criteria met
83
- ☐ Discovered issues tracked
84
- ☐ Lessons captured (if retries)
85
- ☐ Issue updated
86
- ☐ AGENT-EXPERTISE.md updated
87
- ☐ KNOWLEDGE-GRAPH.md appended
88
- ```
62
+ | 1 | **⛔** `opencastle log --type=delegation --issue=TAS-XX --status=complete` |
63
+ | 2 | Run **fast-review** skill |
64
+ | 3 | `pnpm lint && pnpm typecheck && pnpm test` |
65
+ | 4 | `gh issue view TAS-XX --json body -q '.body'` — verify each AC met |
66
+ | 5 | If agent retried verify lesson added via **self-improvement** |
67
+ | 6 | Move to Done or re-delegate; 3rd failure → `.opencastle/AGENT-FAILURES.md` |
68
+
69
+ See [HOOKS-REFERENCE.md](HOOKS-REFERENCE.md) for detailed verification commands.
89
70
 
90
71
  ---
91
72
 
92
73
  ## Anti-Patterns
93
74
 
94
- | Anti-pattern | Why it matters |
75
+ | Anti-pattern | Impact |
95
76
  |---|---|
96
- | Skipping on-session-start | Repeated mistakes already in lessons learned |
97
- | Forgetting session logging | Observability dashboard empty; #1 most common failure |
98
- | Treating logging as optional | Every session logged — no threshold, no exceptions |
99
- | Batch-logging retrospectively | Log each task as it completes, not all at end |
100
- | Partial post-delegate checks | Must verify acceptance criteria, not just "it compiled" |
101
- | No cleanup | Temp files accumulate and confuse future sessions |
102
- | Hooks as blockers | Hooks add ~2 min overhead — skip optional parts if needed |
77
+ | Batch-logging retrospectively | Loses per-task provenance |
78
+ | Partial post-delegate checks | False positives build passes but ACs fail |
@@ -0,0 +1,49 @@
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`.
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
@@ -1,97 +1,60 @@
1
1
  ---
2
2
  name: agent-memory
3
- description: "Agent expertise tracking and cross-session knowledge graph. Use when delegating tasks to track agent strengths/weaknesses, or when building context about file relationships and patterns."
3
+ description: "Creates and queries agent expertise profiles in AGENT-EXPERTISE.md, increments file-familiarity counters after each task, and ranks candidate agents by recency and 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
4
  ---
5
5
 
6
6
  # Agent Memory Protocol
7
7
 
8
8
  ## Expertise File
9
9
 
10
- **Location:** `.opencastle/AGENT-EXPERTISE.md`
10
+ **Location:** `.opencastle/AGENT-EXPERTISE.md` — one section per agent with Strong Areas, Weak Areas, and File Familiarity tables.
11
11
 
12
- ```markdown
13
- # Agent Expertise Registry
14
-
15
- ## Developer
16
- ### Strong Areas
17
- | Area | Evidence | Last Updated |
18
- |------|----------|-------------|
19
- | Feature implementation | Built 5 pages (TAS-XX, TAS-YY) | YYYY-MM-DD |
20
-
21
- ### Weak Areas
22
- | Area | Evidence | Last Updated |
23
- |------|----------|-------------|
24
- | Styling | 2 retries on TAS-AA | YYYY-MM-DD |
25
-
26
- ### File Familiarity
27
- - `apps/web-app/places/` — 3 tasks
28
- ```
12
+ Entry format: `Area | Evidence | Last Updated` — e.g. `Server Components | Built TAS-42 | 2026-03-15`. File familiarity: `- src/lib/search/ — 3 tasks`.
29
13
 
30
14
  ## Update Triggers
31
15
 
32
16
  | Trigger | Action |
33
17
  |---------|--------|
34
- | First-attempt success | Add/update Strong Area |
35
- | 2+ retries | Add/update Weak Area |
36
- | File modified | Increment File Familiarity |
37
- | DLQ failure | Add Weak Area with ref |
18
+ | First-attempt success | Update Strong |
19
+ | 2+ retries | Update Weak |
20
+ | File modified | Increment familiarity |
21
+ | DLQ failure | Add Weak with ref |
38
22
  | >3 months stale | Mark as "stale" |
39
23
 
40
24
  ## Retrieval & Delegation
41
25
 
42
- Check `.opencastle/AGENT-EXPERTISE.md` before delegating. Add to prompt:
26
+ Query before delegating, then include a concise context block in the prompt:
43
27
 
28
+ ```sh
29
+ grep -A5 "## Developer" .opencastle/AGENT-EXPERTISE.md
44
30
  ```
45
- ### Agent Context
46
- - Strong: Server Components, CMS queries (3 tasks) → "Prior experience from TAS-XX."
47
- - Weak: Component styling (retry TAS-AA) → add context or reassign
48
- - Familiar: libs/queries/src/lib/search/ (2 tasks) → "You've worked on [file] in TAS-XX."
49
- ```
50
-
51
- ## Pruning
52
31
 
53
- - Remove entries >6 months old; consolidate repetitive entries; remove familiarity for deleted files
54
- - Prune at start of major feature work
32
+ Example prompt block: `Agent Context: Strong — Server Components (3 tasks); Weak Component styling (2 retries); Familiar src/lib/search/ (2 tasks)`
55
33
 
56
- ## Knowledge Graph
34
+ **Update after task completion:**
57
35
 
58
- **Location:** `.opencastle/KNOWLEDGE-GRAPH.md` (append-only)
36
+ ```bash
37
+ # Append a Strong Area entry
38
+ printf '| %s | %s | %s |\n' "Server Components" "Built TAS-42" "$(date +%Y-%m-%d)" >> .opencastle/AGENT-EXPERTISE.md
59
39
 
60
- ### Entities & Relationships
61
-
62
- | Entity | Notation | Relationships |
63
- |--------|----------|--------------|
64
- | File | `F:path` | `depends-on`, `blocks` |
65
- | Agent | `A:name` | `expert-in` |
66
- | Pattern/Decision | `P:name` / `D:name` | `related-to`, `obsoletes` |
67
- | Bug/Lesson | `B:id` / `L:id` | `caused-by`, `related-to` |
68
-
69
- ### Graph Template
70
-
71
- ```markdown
72
- # Knowledge Graph
73
- ## Relationships
74
- | Source | Relationship | Target | Added | Context |
75
- |--------|-------------|--------|-------|---------|
76
- | A:Content Engineer | expert-in | P:CMS-queries | 2026-02-23 | 3 tasks |
77
- | F:searchModule.ts | depends-on | F:cms-client.ts | 2026-02-23 | |
40
+ # Increment file familiarity
41
+ awk '/src\/lib\/search\// { if (match($0, /[0-9]+/)) { n = substr($0, RSTART, RLENGTH) + 1; sub(/[0-9]+[[:space:]]*tasks?/, n " tasks") } found=1 } {print} END { if(!found) print "- `src/lib/search/` — 1 task" }' \
42
+ .opencastle/AGENT-EXPERTISE.md > tmp && mv tmp .opencastle/AGENT-EXPERTISE.md
78
43
  ```
79
44
 
80
- ### Add Relationships When
45
+ ## Workflow
81
46
 
82
- | Trigger | Record |
83
- |---------|--------|
84
- | Task touches multiple files | `depends-on` |
85
- | Lesson relates to a pattern | `related-to` |
86
- | Agent demonstrates expertise | `expert-in` |
87
- | Decision causes known issue | `caused-by` |
88
- | Pattern supersedes old approach | `obsoletes` |
47
+ 1. **Before delegating:** Read `.opencastle/AGENT-EXPERTISE.md`, check Strong/Weak areas, add concise `Agent Context` to the prompt.
48
+ - Validate: the selected agent has a Strong area matching the task or no conflicting Weak entries.
49
+ 2. **After task completes:** Update expertise (success → Strong, 2+ retries → Weak, files Familiarity) and append file relationships to `.opencastle/KNOWLEDGE-GRAPH.md`.
50
+ - Validate: the expertise file contains the new entry and the timestamp is today's date.
51
+ 3. **On DLQ failure:** Add Weak Area with reference to the failure ID and link to logs.
52
+ - Validate: failure ID and link appear in the Weak Area entry.
89
53
 
90
- ### Pre-Delegation Queries
91
-
92
- Follow `depends-on` for related reads, `expert-in` to confirm agent, `related-to` for patterns, `blocks` for known issues.
54
+ ## Pruning
93
55
 
94
- ### Maintenance
56
+ Prune entries older than 6 months, remove familiarity for deleted paths, and consolidate duplicates.
57
+ - Validate: run `rg "— [0-9]+ tasks" .opencastle/AGENT-EXPERTISE.md` after pruning to confirm no stale paths remain.
58
+ ## Knowledge Graph
95
59
 
96
- - Add as discovered; prune between sessions
97
- - Max ~100 active relationships; archive quarterly
60
+ File dependency graph and cross-agent relationships. See [KNOWLEDGE-GRAPH.md](./KNOWLEDGE-GRAPH.md) for entity types, templates, triggers, and queries.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: api-patterns
3
- description: "API design patterns for route handlers, Server Actions, Zod validation, and external API integration. Use when creating API routes, Server Actions, or integrating external services."
3
+ description: "Creates API route handlers, implements Server Actions with Zod schema validation, and integrates external REST APIs with error handling. Use when adding endpoints, building request handlers, or wiring external services (endpoint, REST API, request handling, fetch, .ts route files)."
4
4
  ---
5
5
 
6
6
  # API Patterns
@@ -30,6 +30,23 @@ export async function GET(request: NextRequest) {
30
30
  if (!result.success) return NextResponse.json({ error: 'Invalid input' }, { status: 400 });
31
31
  return NextResponse.json(data);
32
32
  }
33
+
34
+ ```
35
+
36
+ ### Fetching external APIs — example with retry and error handling
37
+
38
+ ```ts
39
+ import fetch from 'node-fetch';
40
+ async function fetchWithRetry(url:string, opts={}, retries=2){
41
+ for(let i=0;i<=retries;i++){
42
+ try{ const res = await fetch(url, opts); if(!res.ok) throw new Error(`HTTP ${res.status}`); return await res.json(); }
43
+ catch(e){ if(i===retries) throw e; await new Promise(r=>setTimeout(r, 500*(i+1))); }
44
+ }
45
+ }
46
+
47
+ // usage
48
+ const data = await fetchWithRetry('https://api.example.com/data');
49
+ ```
33
50
  ```
34
51
 
35
52
  ### Server Action
@@ -47,6 +64,17 @@ export async function submitAction(formData: FormData) {
47
64
  }
48
65
  ```
49
66
 
67
+ ## Quick Workflow
68
+ 1. Create route file: `app/api/<name>/route.ts` or `app/<segment>/route.ts`
69
+ 2. Add a Zod schema and validate input at the top of the handler
70
+ 3. Implement handler logic with explicit error/response shapes
71
+ 4. Add unit/integration tests for validation and happy/error paths
72
+ 5. Verification: run a quick smoke test (example):
73
+
74
+ ```bash
75
+ curl -fsS "http://localhost:3000/api/<name>?query=test" || (echo "route failed" && exit 1)
76
+ ```
77
+
50
78
  ## Design Rules
51
79
 
52
80
  - Server Actions for mutations; Route Handlers for external/public endpoints
@@ -0,0 +1,16 @@
1
+ # backbone-scaffolding Examples
2
+
3
+ ## Convoy Scaffolding Task
4
+
5
+ ```json
6
+ {
7
+ "id": "scaffolding",
8
+ "description": "Scaffold monorepo with backbone CLI",
9
+ "agent": "developer",
10
+ "complexity": 2,
11
+ "prompt": "Scaffold the project monorepo using the backbone CLI. Ensure Node.js >= 22.5.0 is available. Run: `npx @monkilabs/backbone my-project` and select the following options when prompted:\n- Monorepo: Turborepo\n- Framework: Next.js\n- Backend: Supabase\n- CMS: Sanity\n- Testing: Playwright\n- Deployment: Vercel\n- Mobile: None\n- Packages: Email Library, LLM Library\n\nAfter scaffolding completes, run `npm install` in the generated `my-project/` directory. Then run `npx turbo build` and verify it exits 0.",
12
+ "files": ["my-project/"]
13
+ }
14
+ ```
15
+
16
+ All subsequent tasks should declare `depends_on: ["scaffolding"]` and build on the generated structure.
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: backbone-scaffolding
3
+ description: "Scaffolds production-ready monorepo projects using the backbone CLI: configures workspace packages, wires build tooling, sets up CI pipelines, and initializes framework/backend/CMS integrations. Use when creating, bootstrapping, or initializing a new application, project, starter template, or monorepo from scratch. Trigger terms: scaffold, bootstrap, init, new repo, new app, boilerplate, starter, greenfield."
4
+ ---
5
+
6
+ # backbone-scaffolding Skill
7
+
8
+ ## Requirements
9
+
10
+ - Node.js **>= 22.5.0** must be available in the environment
11
+ - Run backbone with `npx @monkilabs/backbone <project-name>`
12
+
13
+ ## How to Use the CLI
14
+
15
+ Backbone is **interactive** — it uses `@clack/prompts` to ask a series of questions. Agents must run the command and respond to each prompt in sequence.
16
+
17
+ ### Prompt Sequence
18
+
19
+ 1. **Monorepo tool** — `nx` or `turborepo`
20
+ 2. **Framework** — `nextjs` or `astro`
21
+ 3. **Backend** — `convex`, `supabase`, `prisma`, or `none`
22
+ 4. **CMS** — `sanity`, `contentful`, `strapi`, or `none`
23
+ 5. **E2E Testing** — `playwright` or `cypress`
24
+ 6. **Deployment** — `vercel`, `netlify`, or `none`
25
+ 7. **Mobile** — `ionic` or `none` *(only shown for non-Astro frameworks)*
26
+ 8. **Packages** — multi-select: `uiLib`, `emailLib`, `llmLib`
27
+
28
+ ## CLI Options & Constraints
29
+
30
+ | Category | Choices | Notes |
31
+ |-------------|-------------------------------------------|------------------------------------------|
32
+ | Monorepo | `nx`, `turborepo` | Required |
33
+ | Framework | `nextjs`, `astro` | Required |
34
+ | Backend | `convex`, `supabase`, `prisma` | ⛔ `convex` incompatible with `astro` |
35
+ | CMS | `sanity`, `contentful`, `strapi`, `none` | Optional |
36
+ | E2E Testing | `playwright`, `cypress` | Required |
37
+ | Deployment | `vercel`, `netlify`, `none` | Optional |
38
+ | Mobile | `ionic`, `none` | ⛔ `ionic` incompatible with `astro` |
39
+ | Packages | `uiLib`, `emailLib`, `llmLib` | Multi-select; ⛔ `uiLib` incompatible with `astro` |
40
+
41
+ **Astro constraint:** `astro` requires React-free options — never combine with `convex`, `ionic`, or `uiLib`.
42
+
43
+ ## OpenCastle TechTool → Backbone Mapping
44
+
45
+ Most TechTool names map 1:1 to backbone prompt choices (e.g. `nextjs` → select Next.js, `supabase` → select Supabase). Exceptions:
46
+
47
+ | TechTool | Backbone mapping | Notes |
48
+ |----------|-----------------|-------|
49
+ | `resend` | Select `emailLib` in Packages prompt | Only non-obvious mapping |
50
+ | `vitest` | — | Always included automatically |
51
+ | `figma`, `chrome-devtools` | — | Not handled by backbone; configure separately |
52
+
53
+ ## Generated Project Structure
54
+
55
+ After backbone runs, the output directory contains:
56
+
57
+ ```
58
+ <project-name>/
59
+ apps/
60
+ web/ # Next.js or Astro application
61
+ mobile/ # (if ionic selected)
62
+ packages/
63
+ ui/ # (if uiLib selected) shared React component library
64
+ email/ # (if emailLib selected) Resend/React Email package
65
+ llm/ # (if llmLib selected) LLM integration package
66
+ backend/
67
+ convex/ # (if convex selected)
68
+ supabase/ # (if supabase selected)
69
+ e2e/ # Playwright or Cypress tests
70
+ .github/
71
+ workflows/ # GitHub Actions CI pipelines (always included)
72
+ vitest.config.ts # Always included
73
+ tsconfig.base.json # Always included
74
+ package.json # Monorepo root package.json
75
+ turbo.json / nx.json # Monorepo tool config
76
+ ```
77
+
78
+ **Always included regardless of options:** Vitest configuration, GitHub Actions CI workflows, root `tsconfig.base.json`, ESLint, Prettier.
79
+
80
+ Agents working on post-scaffolding tasks must **not recreate** any of these files — they already exist. Build on top of the generated structure.
81
+
82
+ ## Post-Scaffolding Steps
83
+
84
+ After `npx @monkilabs/backbone <project-name>` completes:
85
+
86
+ 1. `cd <project-name>` into the generated directory
87
+ 2. Run `npm install` to install all dependencies
88
+ 3. Verify the project builds: run the monorepo build command (e.g. `npx turbo build` or `npx nx build`)
89
+ 4. All subsequent agent tasks should **import and extend** the generated boilerplate — never overwrite it
90
+
91
+ **If something fails:**
92
+ - `npm install` errors → verify Node.js >= 22.5.0 (`node -v`)
93
+ - Build errors → check that no incompatible options were selected (see Astro constraint above); re-run backbone with corrected choices if needed
94
+ - Wrong option selected → delete the generated directory and re-run `npx @monkilabs/backbone` with the correct selections
95
+
96
+ ## Example Convoy Task
97
+
98
+ See [EXAMPLES.md](EXAMPLES.md) for a complete scaffolding task JSON.
99
+
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: code-commenting
3
- description: "Guidelines for writing self-explanatory code with minimal comments. Covers when to comment (WHY not WHAT), anti-patterns to avoid, annotation tags, and public API documentation. Use when writing or reviewing code comments."
3
+ description: "Guidelines for writing self-explanatory code with minimal comments. Covers when to comment (WHY not WHAT), anti-patterns to avoid, annotation tags, and public API documentation. Use when writing or reviewing code comments, docstrings, TODO/FIXME tags, code readability, or inline comments."
4
4
  ---
5
5
 
6
6
  # Code Commenting
@@ -0,0 +1,70 @@
1
+ > Parent: [SKILL.md](./SKILL.md)
2
+
3
+ Context Map REFERENCE: full markdown template, Team Lead integration snippet, and partition examples.
4
+
5
+ Use this file for the verbose context-map template referenced from `SKILL.md`.
6
+ ## Context Map Template
7
+
8
+ ## Context Map: [Task Name]
9
+
10
+ ### Entry Points (MUST change)
11
+ | File | Reason | Owner |
12
+ |------|--------|-------|
13
+ | `libs/queries/src/lib/places.ts` | Add query field | Content Engineer |
14
+ | `libs/ui-kit/.../PlaceCard/` | Display new field | UI/UX Expert |
15
+
16
+ ### Cascade Effects (WILL change)
17
+ | File | Triggered By | Reason | Owner |
18
+ |------|-------------|--------|-------|
19
+ | `apps/web-app/places/page.tsx` | PlaceCard | Update props | Frontend Dev |
20
+ | `libs/queries/src/lib/__tests__/places.test.ts` | Query | Update test | Testing Expert |
21
+
22
+ ### Shared Boundaries (WATCH)
23
+ | File | Risk | Mitigation |
24
+ |------|------|------------|
25
+ | `libs/ui-kit/src/lib/index.ts` | Barrel export conflict | Merge sequentially |
26
+
27
+ ### Unaffected (optional)
28
+ | Area | Why |
29
+ |------|-----|
30
+ | `db/migrations/` | No DB changes |
31
+ | `libs/auth/` | No auth changes |
32
+
33
+ ### 4b — Validate Map
34
+ - [ ] Every file appears in exactly one section (Entry/Cascade/Shared/Unaffected)
35
+ - [ ] No file appears in two agents' partitions
36
+ - [ ] Test files are listed for every changed source file
37
+ - [ ] Shared boundaries have explicit mitigation strategies
38
+
39
+ ### 5 — Derive File Partitions
40
+
41
+ Assign ownership — no file in two partitions; shared boundaries to one agent (merged first); test files to Testing Expert unless tightly coupled.
42
+
43
+ ```
44
+ Agent A: libs/queries/src/lib/places.ts
45
+ Agent B: libs/ui-kit/.../PlaceCard/
46
+ Agent C: apps/web-app/places/, apps/admin-panel/places/
47
+ Agent D: **/*test*, **/*spec*
48
+ ```
49
+
50
+ ## Depth Levels
51
+
52
+ | Complexity | Files | Depth |
53
+ |------------|-------|-------|
54
+ | Small | 1–3 | Entry points + direct imports |
55
+ | Medium | 4–8 | Entry + 1-hop cascade |
56
+ | Large | 9+ | Full dependency graph |
57
+
58
+ ## Team Lead Integration
59
+
60
+ Produced in **Phase 1**; consumed by:
61
+ - **Decomposition** — informs file partitions
62
+ - **Delegation prompts** — agents receive their map section
63
+ - **QA Gate** — compare actual changes against map to detect scope creep
64
+
65
+ Delegation prompt snippet:
66
+ ```markdown
67
+ ## Your File Partition
68
+ Modify only: `libs/queries/src/lib/places.ts`, `libs/queries/src/lib/__tests__/places.test.ts`
69
+ Do NOT modify: `libs/ui-kit/` (UI/UX Expert), `apps/` (Developer)
70
+ ```