opencastle 0.8.0 → 0.8.1

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 (87) hide show
  1. package/README.md +27 -0
  2. package/bin/cli.mjs +2 -0
  3. package/dist/cli/adapters/claude-code.d.ts +2 -5
  4. package/dist/cli/adapters/claude-code.d.ts.map +1 -1
  5. package/dist/cli/adapters/claude-code.js +12 -251
  6. package/dist/cli/adapters/claude-code.js.map +1 -1
  7. package/dist/cli/adapters/cursor.d.ts.map +1 -1
  8. package/dist/cli/adapters/cursor.js +3 -17
  9. package/dist/cli/adapters/cursor.js.map +1 -1
  10. package/dist/cli/adapters/frontmatter.d.ts +26 -0
  11. package/dist/cli/adapters/frontmatter.d.ts.map +1 -0
  12. package/dist/cli/adapters/frontmatter.js +40 -0
  13. package/dist/cli/adapters/frontmatter.js.map +1 -0
  14. package/dist/cli/adapters/index.d.ts +5 -0
  15. package/dist/cli/adapters/index.d.ts.map +1 -0
  16. package/dist/cli/adapters/index.js +9 -0
  17. package/dist/cli/adapters/index.js.map +1 -0
  18. package/dist/cli/adapters/opencode.d.ts +2 -5
  19. package/dist/cli/adapters/opencode.d.ts.map +1 -1
  20. package/dist/cli/adapters/opencode.js +12 -250
  21. package/dist/cli/adapters/opencode.js.map +1 -1
  22. package/dist/cli/adapters/single-file-base.d.ts +40 -0
  23. package/dist/cli/adapters/single-file-base.d.ts.map +1 -0
  24. package/dist/cli/adapters/single-file-base.js +246 -0
  25. package/dist/cli/adapters/single-file-base.js.map +1 -0
  26. package/dist/cli/dashboard.d.ts.map +1 -1
  27. package/dist/cli/dashboard.js +3 -2
  28. package/dist/cli/dashboard.js.map +1 -1
  29. package/dist/cli/detect.d.ts.map +1 -1
  30. package/dist/cli/detect.js +13 -11
  31. package/dist/cli/detect.js.map +1 -1
  32. package/dist/cli/doctor.d.ts +3 -0
  33. package/dist/cli/doctor.d.ts.map +1 -0
  34. package/dist/cli/doctor.js +205 -0
  35. package/dist/cli/doctor.js.map +1 -0
  36. package/dist/cli/init.d.ts.map +1 -1
  37. package/dist/cli/init.js +31 -19
  38. package/dist/cli/init.js.map +1 -1
  39. package/dist/cli/run/schema.d.ts +1 -5
  40. package/dist/cli/run/schema.d.ts.map +1 -1
  41. package/dist/cli/run/schema.js +6 -330
  42. package/dist/cli/run/schema.js.map +1 -1
  43. package/dist/cli/run.d.ts.map +1 -1
  44. package/dist/cli/run.js +14 -1
  45. package/dist/cli/run.js.map +1 -1
  46. package/dist/cli/types.d.ts +0 -5
  47. package/dist/cli/types.d.ts.map +1 -1
  48. package/dist/cli/update.d.ts.map +1 -1
  49. package/dist/cli/update.js +4 -17
  50. package/dist/cli/update.js.map +1 -1
  51. package/package.json +7 -2
  52. package/src/cli/adapters/claude-code.ts +13 -304
  53. package/src/cli/adapters/cursor.ts +3 -23
  54. package/src/cli/adapters/frontmatter.ts +47 -0
  55. package/src/cli/adapters/index.ts +13 -0
  56. package/src/cli/adapters/opencode.ts +12 -301
  57. package/src/cli/adapters/single-file-base.ts +320 -0
  58. package/src/cli/dashboard.ts +3 -2
  59. package/src/cli/detect.ts +19 -15
  60. package/src/cli/doctor.ts +235 -0
  61. package/src/cli/init.ts +31 -24
  62. package/src/cli/run/schema.ts +7 -365
  63. package/src/cli/run.ts +17 -1
  64. package/src/cli/types.ts +0 -6
  65. package/src/cli/update.ts +5 -23
  66. package/src/dashboard/dist/_astro/{index.CWVzbF4T.css → index.Bnq19_1M.css} +1 -1
  67. package/src/dashboard/dist/index.html +170 -11
  68. package/src/dashboard/node_modules/.vite/deps/_metadata.json +6 -6
  69. package/src/dashboard/seed-data/reviews.ndjson +6 -0
  70. package/src/dashboard/src/pages/index.astro +213 -10
  71. package/src/dashboard/src/styles/dashboard.css +196 -0
  72. package/src/orchestrator/agent-workflows/bug-fix.md +2 -2
  73. package/src/orchestrator/agent-workflows/data-pipeline.md +8 -8
  74. package/src/orchestrator/agent-workflows/database-migration.md +2 -2
  75. package/src/orchestrator/agent-workflows/feature-implementation.md +2 -2
  76. package/src/orchestrator/agent-workflows/performance-optimization.md +2 -2
  77. package/src/orchestrator/agent-workflows/refactoring.md +2 -2
  78. package/src/orchestrator/agent-workflows/schema-changes.md +2 -2
  79. package/src/orchestrator/agent-workflows/security-audit.md +2 -2
  80. package/src/orchestrator/agents/data-expert.agent.md +2 -2
  81. package/src/orchestrator/agents/researcher.agent.md +0 -16
  82. package/src/orchestrator/agents/team-lead.agent.md +17 -6
  83. package/src/orchestrator/customizations/AGENT-PERFORMANCE.md +1 -3
  84. package/src/orchestrator/prompts/bootstrap-customizations.prompt.md +1 -1
  85. package/src/orchestrator/skills/agent-hooks/SKILL.md +4 -2
  86. package/src/orchestrator/skills/self-improvement/SKILL.md +1 -1
  87. package/src/orchestrator/prompts/metrics-report.prompt.md +0 -144
@@ -1337,3 +1337,199 @@ body {
1337
1337
  display: none;
1338
1338
  }
1339
1339
  }
1340
+
1341
+ /* ---------- Filter Bar ---------- */
1342
+ .filter-bar {
1343
+ display: flex;
1344
+ flex-wrap: wrap;
1345
+ gap: 12px;
1346
+ align-items: flex-end;
1347
+ padding: 16px 20px;
1348
+ background: var(--bg-secondary);
1349
+ border: 1px solid var(--border-color);
1350
+ border-radius: 12px;
1351
+ }
1352
+
1353
+ .filter-group {
1354
+ display: flex;
1355
+ flex-direction: column;
1356
+ gap: 4px;
1357
+ min-width: 0;
1358
+ }
1359
+
1360
+ .filter-label {
1361
+ font-size: 0.6875rem;
1362
+ font-weight: 500;
1363
+ color: var(--text-tertiary);
1364
+ text-transform: uppercase;
1365
+ letter-spacing: 0.05em;
1366
+ }
1367
+
1368
+ .filter-input,
1369
+ .filter-select {
1370
+ height: 34px;
1371
+ padding: 0 10px;
1372
+ font-size: 0.8125rem;
1373
+ color: var(--text-primary);
1374
+ background: var(--bg-tertiary);
1375
+ border: 1px solid var(--border-color);
1376
+ border-radius: 8px;
1377
+ outline: none;
1378
+ transition: border-color var(--transition-fast);
1379
+ font-family: inherit;
1380
+ }
1381
+
1382
+ .filter-input:focus,
1383
+ .filter-select:focus {
1384
+ border-color: var(--border-accent);
1385
+ }
1386
+
1387
+ .filter-input {
1388
+ width: 140px;
1389
+ color-scheme: dark;
1390
+ }
1391
+
1392
+ .filter-select {
1393
+ min-width: 140px;
1394
+ cursor: pointer;
1395
+ appearance: none;
1396
+ -webkit-appearance: none;
1397
+ background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235a5a6e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
1398
+ background-repeat: no-repeat;
1399
+ background-position: right 10px center;
1400
+ padding-right: 28px;
1401
+ }
1402
+
1403
+ .filter-reset {
1404
+ height: 34px;
1405
+ font-size: 0.75rem;
1406
+ }
1407
+
1408
+ /* ---------- Dashboard Buttons ---------- */
1409
+ .dash-btn {
1410
+ display: inline-flex;
1411
+ align-items: center;
1412
+ gap: 6px;
1413
+ padding: 6px 14px;
1414
+ font-size: 0.8125rem;
1415
+ font-weight: 500;
1416
+ font-family: inherit;
1417
+ border: none;
1418
+ border-radius: 8px;
1419
+ cursor: pointer;
1420
+ transition: background var(--transition-fast), color var(--transition-fast);
1421
+ }
1422
+
1423
+ .dash-btn--ghost {
1424
+ color: var(--text-secondary);
1425
+ background: rgba(255, 255, 255, 0.06);
1426
+ }
1427
+
1428
+ .dash-btn--ghost:hover {
1429
+ color: var(--text-primary);
1430
+ background: rgba(255, 255, 255, 0.10);
1431
+ }
1432
+
1433
+ .dash-header__actions {
1434
+ display: flex;
1435
+ align-items: center;
1436
+ gap: 8px;
1437
+ }
1438
+
1439
+ /* ---------- Mobile Dashboard Responsive ---------- */
1440
+ @media (max-width: 480px) {
1441
+ .dash-header__inner {
1442
+ padding: 0 12px;
1443
+ }
1444
+
1445
+ .dash-main {
1446
+ padding: 12px;
1447
+ gap: 12px;
1448
+ }
1449
+
1450
+ .kpi-card {
1451
+ padding: 14px 16px;
1452
+ }
1453
+
1454
+ .chart-card__header {
1455
+ padding: 14px 16px;
1456
+ }
1457
+
1458
+ .chart-card__body {
1459
+ padding: 12px 16px 16px;
1460
+ }
1461
+
1462
+ .filter-bar {
1463
+ padding: 12px;
1464
+ gap: 8px;
1465
+ }
1466
+
1467
+ .filter-input,
1468
+ .filter-select {
1469
+ width: 100%;
1470
+ min-width: unset;
1471
+ }
1472
+
1473
+ .filter-group {
1474
+ flex: 1 1 calc(50% - 4px);
1475
+ }
1476
+
1477
+ .filter-reset {
1478
+ width: 100%;
1479
+ }
1480
+
1481
+ .dash-header__title {
1482
+ font-size: 0.875rem;
1483
+ }
1484
+
1485
+ .exec-step__meta {
1486
+ flex-direction: column;
1487
+ gap: 2px;
1488
+ }
1489
+
1490
+ .sessions-table th:nth-child(5),
1491
+ .sessions-table td:nth-child(5),
1492
+ .sessions-table th:nth-child(6),
1493
+ .sessions-table td:nth-child(6),
1494
+ .sessions-table th:nth-child(7),
1495
+ .sessions-table td:nth-child(7),
1496
+ .sessions-table th:nth-child(8),
1497
+ .sessions-table td:nth-child(8) {
1498
+ display: none;
1499
+ }
1500
+ }
1501
+
1502
+ @media (max-width: 768px) {
1503
+ .charts-row {
1504
+ grid-template-columns: 1fr;
1505
+ }
1506
+
1507
+ .pipeline {
1508
+ flex-wrap: wrap;
1509
+ gap: 8px;
1510
+ }
1511
+
1512
+ .pipeline-arrow {
1513
+ display: none;
1514
+ }
1515
+
1516
+ .pipeline-stage {
1517
+ flex: 1 1 calc(50% - 4px);
1518
+ min-width: 100px;
1519
+ }
1520
+
1521
+ .tier-chart .donut-container,
1522
+ .donut-container {
1523
+ flex-direction: column;
1524
+ align-items: center;
1525
+ }
1526
+
1527
+ .sessions-table {
1528
+ font-size: 0.75rem;
1529
+ }
1530
+
1531
+ .sessions-table th,
1532
+ .sessions-table td {
1533
+ padding: 8px 6px;
1534
+ }
1535
+ }
@@ -11,7 +11,7 @@ Phase 1: Triage & Reproduce (sub-agent, inline)
11
11
  Phase 2: Root Cause Analysis (sub-agent, inline)
12
12
  Phase 3: Fix Implementation (sub-agent or background)
13
13
  Phase 4: Verification (sub-agent, inline)
14
- Phase 5: Compound (direct, Team Lead)
14
+ Phase 5: Delivery (direct, Team Lead)
15
15
  ```
16
16
 
17
17
  ---
@@ -123,7 +123,7 @@ Follow the **Delivery Outcome** in `general.instructions.md` and the **Branch Ow
123
123
 
124
124
  ---
125
125
 
126
- ### Phase 5: Delivery (Compound)
126
+ ### Phase 5: Delivery
127
127
 
128
128
  > **See [shared-delivery-phase.md](shared-delivery-phase.md) for the standard delivery steps.**
129
129
  >
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Workflow: Data Pipeline
4
4
 
5
- Standard execution plan for crowling, processing, and importing data.
5
+ Standard execution plan for crawling, processing, and importing data.
6
6
 
7
7
  > **Project config:** For project-specific paths, data schema, CLI commands, and processing rules, see `data-pipeline-config.md`. For data model docs, see `docs-structure.md`.
8
8
 
@@ -10,11 +10,11 @@ Standard execution plan for crowling, processing, and importing data.
10
10
 
11
11
  ```
12
12
  Phase 1: Source Analysis (sub-agent, inline)
13
- Phase 2: Crowling (background agent)
13
+ Phase 2: Crawling (background agent)
14
14
  Phase 3: Processing (sub-agent, sequential)
15
15
  Phase 4: Validation (sub-agent, inline)
16
16
  Phase 5: Import (sub-agent, inline)
17
- Phase 6: Compound (direct, Team Lead)
17
+ Phase 6: Delivery (direct, Team Lead)
18
18
  ```
19
19
 
20
20
  ---
@@ -49,22 +49,22 @@ Follow the **Delivery Outcome** in `general.instructions.md` and the **Branch Ow
49
49
 
50
50
  ---
51
51
 
52
- ## Phase 2: Crowling
52
+ ## Phase 2: Crawling
53
53
 
54
54
  **Agent:** Data Expert
55
55
  **Type:** Background agent (may be long-running)
56
56
 
57
57
  ### Steps
58
58
 
59
- 1. Implement crowler following existing patterns (see `data-pipeline-config.md`)
59
+ 1. Implement crawler following existing patterns (see `data-pipeline-config.md`)
60
60
  2. Output raw data as NDJSON
61
61
  3. Handle pagination, rate limiting, and error recovery
62
- 4. Log crowling statistics (pages visited, records extracted, errors)
62
+ 4. Log crawling statistics (pages visited, records extracted, errors)
63
63
 
64
64
  ### Exit Criteria
65
65
 
66
66
  - [ ] Raw NDJSON file produced
67
- - [ ] Crowling statistics logged
67
+ - [ ] Crawling statistics logged
68
68
  - [ ] No duplicate records
69
69
  - [ ] Output contract returned
70
70
 
@@ -141,7 +141,7 @@ Follow the **Delivery Outcome** in `general.instructions.md` and the **Branch Ow
141
141
 
142
142
  ---
143
143
 
144
- ### Phase 6: Delivery (Compound)
144
+ ### Phase 6: Delivery
145
145
 
146
146
  > **See [shared-delivery-phase.md](shared-delivery-phase.md) for the standard delivery steps.**
147
147
  >
@@ -14,7 +14,7 @@ Phase 2: Migration Implementation (sub-agent or background)
14
14
  Phase 3: Type Generation (sub-agent, sequential)
15
15
  Phase 4: Code Integration (sub-agent, sequential)
16
16
  Phase 5: Verification & Rollback Test (sub-agent, inline)
17
- Phase 6: Compound (direct, Team Lead)
17
+ Phase 6: Delivery (direct, Team Lead)
18
18
  ```
19
19
 
20
20
  ---
@@ -154,7 +154,7 @@ Follow the **Delivery Outcome** in `general.instructions.md` and the **Branch Ow
154
154
 
155
155
  ---
156
156
 
157
- ### Phase 6: Delivery (Compound)
157
+ ### Phase 6: Delivery
158
158
 
159
159
  > **See [shared-delivery-phase.md](shared-delivery-phase.md) for the standard delivery steps.**
160
160
  >
@@ -13,7 +13,7 @@ Phase 2: Foundation (background agents, parallel)
13
13
  Phase 3: Integration (sub-agent, sequential)
14
14
  Phase 4: Validation (background agents, parallel)
15
15
  Phase 5: QA Gate (sub-agent, inline)
16
- Phase 6: Compound (direct, Team Lead)
16
+ Phase 6: Delivery (direct, Team Lead)
17
17
  ```
18
18
 
19
19
  ---
@@ -225,7 +225,7 @@ If there are no open questions, explicitly state: "No open questions — plan is
225
225
 
226
226
  ---
227
227
 
228
- ### Phase 6: Delivery (Compound)
228
+ ### Phase 6: Delivery
229
229
 
230
230
  > **See [shared-delivery-phase.md](shared-delivery-phase.md) for the standard delivery steps.**
231
231
  >
@@ -11,7 +11,7 @@ Phase 1: Baseline Measurement (sub-agent, inline)
11
11
  Phase 2: Analysis (sub-agent, inline)
12
12
  Phase 3: Optimization (background agents, parallel)
13
13
  Phase 4: Verification (sub-agent, inline)
14
- Phase 5: Compound (direct, Team Lead)
14
+ Phase 5: Delivery (direct, Team Lead)
15
15
  ```
16
16
 
17
17
  ---
@@ -120,7 +120,7 @@ Follow the **Delivery Outcome** in `general.instructions.md` and the **Branch Ow
120
120
 
121
121
  ---
122
122
 
123
- ### Phase 5: Delivery (Compound)
123
+ ### Phase 5: Delivery
124
124
 
125
125
  > **See [shared-delivery-phase.md](shared-delivery-phase.md) for the standard delivery steps.**
126
126
  >
@@ -12,7 +12,7 @@ Phase 2: Test Coverage Gap (sub-agent or background)
12
12
  Phase 3: Refactor Implementation (sub-agent or background)
13
13
  Phase 4: Verification (sub-agent, inline)
14
14
  Phase 5: Panel Review (sub-agent, for large refactors)
15
- Phase 6: Compound (direct, Team Lead)
15
+ Phase 6: Delivery (direct, Team Lead)
16
16
  ```
17
17
 
18
18
  ---
@@ -137,7 +137,7 @@ The refactoring agent owns only the scoped files. No changes outside the partiti
137
137
 
138
138
  ---
139
139
 
140
- ### Phase 6: Delivery (Compound)
140
+ ### Phase 6: Delivery
141
141
 
142
142
  > **See [shared-delivery-phase.md](shared-delivery-phase.md) for the standard delivery steps.**
143
143
  >
@@ -14,7 +14,7 @@ Phase 2: Schema Implementation (sub-agent or background)
14
14
  Phase 3: Query Updates (sub-agent, sequential)
15
15
  Phase 4: Page Integration (sub-agent, sequential)
16
16
  Phase 5: Verification (sub-agent, inline)
17
- Phase 6: Compound (direct, Team Lead)
17
+ Phase 6: Delivery (direct, Team Lead)
18
18
  ```
19
19
 
20
20
  ---
@@ -159,7 +159,7 @@ Follow the **Delivery Outcome** in `general.instructions.md` and the **Branch Ow
159
159
 
160
160
  ---
161
161
 
162
- ### Phase 6: Delivery (Compound)
162
+ ### Phase 6: Delivery
163
163
 
164
164
  > **See [shared-delivery-phase.md](shared-delivery-phase.md) for the standard delivery steps.**
165
165
  >
@@ -12,7 +12,7 @@ Phase 2: Automated Checks (sub-agent, inline)
12
12
  Phase 3: Manual Review (background agent)
13
13
  Phase 4: Panel Review (sub-agent, inline)
14
14
  Phase 5: Remediation (sub-agent or background)
15
- Phase 6: Compound (direct, Team Lead)
15
+ Phase 6: Delivery (direct, Team Lead)
16
16
  ```
17
17
 
18
18
  ---
@@ -143,7 +143,7 @@ Follow the **Delivery Outcome** in `general.instructions.md` and the **Branch Ow
143
143
 
144
144
  ---
145
145
 
146
- ### Phase 6: Delivery (Compound)
146
+ ### Phase 6: Delivery
147
147
 
148
148
  > **See [shared-delivery-phase.md](shared-delivery-phase.md) for the standard delivery steps.**
149
149
  >
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: 'Data engineering expert for ETL pipelines, web crowlers, data processors, CLI tools, and CMS data import.'
2
+ description: 'Data engineering expert for ETL pipelines, web crawlers, data processors, CLI tools, and CMS data import.'
3
3
  name: 'Data Expert'
4
4
  model: GPT-5.3-Codex
5
5
  tools: ['search/changes', 'search/codebase', 'edit/editFiles', 'web/fetch', 'read/problems', 'execute/getTerminalOutput', 'execute/runInTerminal', 'read/terminalLastCommand', 'read/terminalSelection', 'search', 'execute/testFailure', 'search/usages']
@@ -32,7 +32,7 @@ Resolve via [skill-matrix.md](.github/customizations/agents/skill-matrix.md).
32
32
  - Idempotent imports with `createOrReplace` and deterministic `_id`
33
33
  - Validate with Zod before importing — never import invalid data
34
34
  - Respect `robots.txt` and rate limit all scraping requests
35
- - Use the project's web crawling library for concurrent crowling (see the **data-pipeline** skill)
35
+ - Use the project's web crawling library for concurrent crawling (see the **data-pipeline** skill)
36
36
  - Handle errors gracefully — skip bad records, don't halt pipeline
37
37
  - Preserve UTF-8 encoding for special characters and diacritics
38
38
  - Backup before bulk operations
@@ -3,22 +3,6 @@ description: 'Codebase exploration specialist for deep research, pattern discove
3
3
  name: 'Researcher'
4
4
  model: GPT-5 mini
5
5
  tools: ['search/codebase', 'search/textSearch', 'search/fileSearch', 'search/usages', 'read/readFile', 'search/listDirectory', 'web/fetch', 'execute/runInTerminal', 'read/terminalLastCommand']
6
- handoffs:
7
- - label: Implement Feature
8
- agent: Team Lead
9
- prompt: 'Use the implement-feature prompt to implement the following task with full orchestration, validation, and traceability:'
10
- - label: Fix Bug
11
- agent: Team Lead
12
- prompt: 'Use the bug-fix prompt to investigate and fix the following bug with triage, root cause analysis, and verification:'
13
- - label: Brainstorm
14
- agent: Team Lead
15
- prompt: 'Use the brainstorm prompt to explore requirements, approaches, and trade-offs before committing to a plan for:'
16
- - label: Quick Refinement
17
- agent: Team Lead
18
- prompt: 'Use the quick-refinement prompt to handle these follow-up refinements (UI tweaks, polish, adjustments):'
19
- - label: Generate Task Spec
20
- agent: Team Lead
21
- prompt: 'Use the generate-task-spec prompt to create an opencastle.tasks.yml spec for autonomous overnight runs based on:'
22
6
  ---
23
7
 
24
8
  <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .github/customizations/ directory instead. -->
@@ -45,16 +45,27 @@ You are a **team lead and task orchestrator**. You do **not** implement code you
45
45
 
46
46
  ### Direct Skills
47
47
 
48
+ Skills are split into two loading tiers to reduce upfront token usage. **Load a skill only when its phase is reached** — do not pre-load on-demand skills at session start.
49
+
50
+ #### Always Load (session start)
51
+
52
+ These skills are needed in every session regardless of workflow:
53
+
48
54
  - **team-lead-reference** — Model routing, agent registry, pre-delegation checks, cost tracking, DLQ format, deepen-plan protocol
49
55
  - **session-checkpoints** — Save and restore session state for multi-session features; enables resume, replay, and fork
50
- - **task-management** — Task tracker conventions, issue naming, labels, priorities, workflow states (resolved via skill-matrix to `linear-task-management` or `jira-management`)
51
- - **validation-gates** — Shared validation gates for all workflows (deterministic checks, browser testing, cache management, regression checks)
52
- - **fast-review** — Mandatory single-reviewer gate after every delegation, with automatic retry and escalation to panel
53
- - **panel-majority-vote** — 3-reviewer quality gate for high-stakes changes
54
- - **context-map** — Generate structured file impact maps before complex changes (5+ files)
55
- - **memory-merger** — Graduate mature lessons from LESSONS-LEARNED.md into permanent skills/instructions
56
56
  - **agent-hooks** — Lifecycle hooks (session-start, session-end, pre-delegate, post-delegate) for consistent agent behavior
57
57
 
58
+ #### On-Demand (load when needed)
59
+
60
+ Load these skills only at the workflow phase that requires them:
61
+
62
+ - **task-management** — Task tracker conventions, issue naming, labels, priorities, workflow states (resolved via skill-matrix). **Load at:** Decompose & Partition phase (Step 2)
63
+ - **context-map** — Generate structured file impact maps before complex changes (5+ files). **Load at:** Decompose & Partition phase, for tasks touching 5+ files
64
+ - **validation-gates** — Shared validation gates for all workflows (deterministic checks, browser testing, cache management, regression checks). **Load at:** Verification phase (Step 4 review loop)
65
+ - **fast-review** — Mandatory single-reviewer gate after every delegation, with automatic retry and escalation to panel. **Load at:** Post-delegation verification
66
+ - **panel-majority-vote** — 3-reviewer quality gate for high-stakes changes. **Load at:** High-stakes verification, or when fast-review fails 3 times
67
+ - **memory-merger** — Graduate mature lessons from LESSONS-LEARNED.md into permanent skills/instructions. **Load at:** Session end, when lessons are ready to merge
68
+
58
69
  ## Specialist Agents
59
70
 
60
71
  Delegate to these agents via `runSubagent` (inline) or background sessions. `agents: ['*']` gives access to all.
@@ -1,8 +1,6 @@
1
1
  ````markdown
2
2
  # Agent Performance Tracking
3
3
 
4
- > **Last Updated:** _(auto-updated by metrics-report prompt)_
5
-
6
4
  Tracks agent success rates across panel reviews and delegated tasks to inform model routing and panel reviewer selection.
7
5
 
8
6
  ## Data Sources
@@ -10,7 +8,7 @@ Tracks agent success rates across panel reviews and delegated tasks to inform mo
10
8
  Performance data is collected automatically via NDJSON session logs:
11
9
  - **Session data:** `.github/customizations/logs/sessions.ndjson` — appended by every agent after each session
12
10
  - **Delegation data:** `.github/customizations/logs/delegations.ndjson` — appended by the Team Lead after each delegation
13
- - **Full reporting:** Run the **metrics-report** prompt to generate a dashboard from all sources
11
+ - **Dashboard:** Run `npx opencastle dashboard` to visualize agent performance
14
12
 
15
13
  ## Quick Queries
16
14
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: 'Bootstrap the .github/customizations/ directory for a new project. Discovers project structure, tech stack, and configuration, then generates all customization files so skills have project-specific context to operate on.'
3
- agent: Researcher
3
+ agent: Team Lead
4
4
  ---
5
5
 
6
6
  <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .github/customizations/ directory instead. -->
@@ -32,7 +32,8 @@ Session Lifecycle:
32
32
  2. **Check for checkpoint** — If `.github/customizations/SESSION-CHECKPOINT.md` exists, read it. Resume from last known state instead of re-analyzing.
33
33
  3. **Check pending approvals** — If the checkpoint has a `## Pending Approvals` section, check for replies using the configured messaging provider's MCP tools (e.g., `conversations_replies` for Slack). Read `.opencastle.json` → `stack.teamTools` to determine the provider. If no messaging is configured, skip this step.
34
34
  4. **Check dead letter queue** — Scan `.github/customizations/AGENT-FAILURES.md` for pending failures related to the current scope.
35
- 5. **Load domain skills** — Based on the task description, load the appropriate skills before writing code. Don't start coding without the relevant skill loaded.
35
+ 5. **Validate skill-matrix bindings** — Open `.github/customizations/agents/skill-matrix.md` and check whether the **Primary Stack** and **Tooling** tables have any filled-in rows (non-empty Technology/Skill columns). If all bindings are empty, **warn the user** that the bootstrap hasn't been run and capability slots will not resolve. Suggest running the *"Bootstrap Customizations"* prompt first. Do NOT silently continue with empty bindings.
36
+ 6. **Load domain skills** — Based on the task description, load the appropriate skills before writing code. Don't start coding without the relevant skill loaded.
36
37
 
37
38
  ### Template for Delegation Prompts
38
39
 
@@ -42,6 +43,7 @@ Include this reminder in every delegation:
42
43
  **Session Start:** Read `.github/customizations/LESSONS-LEARNED.md` before starting.
43
44
  Check `.github/customizations/SESSION-CHECKPOINT.md` for prior state and pending approvals.
44
45
  If pending approvals exist, check for replies via the messaging provider.
46
+ Validate `.github/customizations/agents/skill-matrix.md` — warn if skill bindings are empty (bootstrap not run).
45
47
  Load relevant skills before writing code.
46
48
  ```
47
49
 
@@ -149,7 +151,7 @@ Include on-session-start and on-session-end actions in every delegation prompt.
149
151
 
150
152
  ### For Workflow Templates
151
153
 
152
- Each workflow's **Compound phase** naturally serves as the on-session-end hook for that workflow type. The Compound phase steps should include session logging, lesson verification, and memory merge checks.
154
+ Each workflow's **Delivery phase** naturally serves as the on-session-end hook for that workflow type. The Delivery phase steps should include session logging, lesson verification, and memory merge checks.
153
155
 
154
156
  ---
155
157
 
@@ -50,7 +50,7 @@ A lesson MUST be written when **any** of these triggers occur:
50
50
  echo '{"timestamp":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","agent":"Agent Name","model":"model-id","task":"Short description","outcome":"success","files_changed":N,"retries":0}' >> .github/customizations/logs/sessions.ndjson
51
51
  ```
52
52
 
53
- This is **mandatory** — session logging fuels the metrics dashboard (`metrics-report` prompt).
53
+ This is **mandatory** — session logging fuels the observability dashboard (`npx opencastle dashboard`).
54
54
 
55
55
  ## How to Write a Lesson
56
56
 
@@ -1,144 +0,0 @@
1
- ---
2
- description: 'Collect and report metrics from agent logs, GitHub PRs, tracker issues, and deployments'
3
- agent: Researcher
4
- ---
5
-
6
- <!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .github/customizations/ directory instead. -->
7
-
8
- # Metrics Report
9
-
10
- Generate a comprehensive metrics dashboard from all project data sources.
11
-
12
- ## Data Sources
13
-
14
- Collect data from ALL of these sources. Run collections in parallel where possible.
15
-
16
- ### 1. Agent Session Logs (local)
17
-
18
- Read `.github/customizations/logs/sessions.ndjson` and `.github/customizations/logs/delegations.ndjson`.
19
-
20
- Compute:
21
- - **Total sessions** and **sessions per agent**
22
- - **Success rate** — `outcome` field breakdown (success / partial / failed)
23
- - **Retries per session** — average and total
24
- - **Lessons added** — count and which agents contribute most
25
- - **Delegation stats** — mechanism (sub-agent vs background), tier distribution, success rate per agent
26
- - **Model usage** — which models used how often
27
- - **Activity timeline** — sessions per day/week
28
-
29
- ### 2. GitHub PRs and Commits
30
-
31
- Use `gh` CLI commands (always prefix with `GH_PAGER=cat`):
32
-
33
- ```bash
34
- # All PRs (open + closed + merged)
35
- GH_PAGER=cat gh pr list --state all --limit 100 --json number,title,state,createdAt,mergedAt,closedAt,author,additions,deletions,changedFiles,labels,headRefName
36
-
37
- # Recent commits on main
38
- GH_PAGER=cat gh api repos/{owner}/{repo}/commits --paginate -q '.[0:50] | .[] | {sha: .sha[0:7], date: .commit.author.date, message: .commit.message}' 2>/dev/null || git --no-pager log main --oneline -50
39
- ```
40
-
41
- Compute:
42
- - **PR count** — total, open, merged, closed-without-merge
43
- - **Merge rate** — merged / (merged + closed-without-merge)
44
- - **Time to merge** — median and average (createdAt → mergedAt)
45
- - **PR size** — average additions, deletions, changedFiles
46
- - **Commit frequency** — commits per day/week on main
47
- - **Bogus/closed PRs** — PRs closed without merge (potential failed agent work)
48
-
49
- ### 3. Tracker Issues
50
-
51
- Use tracker MCP tools (`list_issues`, `search_issues`):
52
-
53
- ```
54
- list_issues with status filter for each state: Backlog, Todo, In Progress, Done, Cancelled
55
- ```
56
-
57
- Compute:
58
- - **Issue count by status** — Backlog, Todo, In Progress, Done, Cancelled
59
- - **Completion rate** — Done / (Done + Cancelled + In Progress + Todo)
60
- - **Issues by label** — which areas have the most work
61
- - **Issues by priority** — distribution across Urgent/High/Medium/Low
62
- - **Cycle time** — average time from In Progress → Done (if dates available)
63
- - **Stale issues** — In Progress for >7 days without updates
64
-
65
- ### 4. Deployments
66
-
67
- Use deployment platform tools (if available via MCP or CLI):
68
-
69
- Query deployments for all configured apps (see `project.instructions.md` for the app inventory).
70
-
71
- Compute:
72
- - **Total deployments** — count over last 30 days
73
- - **Deployment success rate** — ready / (ready + error + cancelled)
74
- - **Failure rate** — error / total
75
- - **Build times** — average, median, p95
76
- - **Deployments per day** — activity timeline
77
- - **Failed deployment details** — which commits/branches failed and why
78
-
79
- ### 5. Panel Reviews (local)
80
-
81
- Read `.github/customizations/logs/panels.ndjson`.
82
-
83
- Compute:
84
- - **Total reviews** — count of panel runs
85
- - **Pass rate** — pass / total
86
- - **Must-fix vs should-fix** — average counts per review
87
- - **Retry rate** — reviews with attempt > 1
88
- - **Model usage** — which reviewer models used
89
- - **Reviews by panel key** — what gets reviewed most
90
-
91
- ### 6. Agent Failures (DLQ)
92
-
93
- Read `.github/customizations/AGENT-FAILURES.md`.
94
-
95
- Compute:
96
- - **Total failures** — count of DLQ entries
97
- - **Failures by agent** — which agents fail most
98
- - **Failure status** — pending vs resolved
99
- - **Common root causes** — categorize failure reasons
100
-
101
- ## Report Format
102
-
103
- Present the report as a structured markdown summary with these sections:
104
-
105
- ```markdown
106
- # Project Metrics Dashboard
107
- > Generated: {date} | Period: Last 30 days
108
-
109
- ## Executive Summary
110
- - X agent sessions, Y% success rate
111
- - Z PRs merged, W% merge rate
112
- - N deployments, M% success rate
113
- - P tracker issues completed
114
-
115
- ## Agent Activity
116
- {sessions table, success rates, model usage}
117
-
118
- ## Delegation Performance
119
- {per-agent delegation stats, tier distribution}
120
-
121
- ## GitHub
122
- {PR stats, merge rates, commit frequency}
123
-
124
- ## Task Board
125
- {issue distribution, completion rate, stale issues}
126
-
127
- ## Deployments
128
- {success rate, failure rate, build times}
129
-
130
- ## Panel Reviews
131
- {pass rate, retry rate, must-fix/should-fix stats}
132
-
133
- ## Agent Failures (DLQ)
134
- {failure count, pending items}
135
-
136
- ## Trends & Recommendations
137
- {observations, areas for improvement}
138
- ```
139
-
140
- ## Usage
141
-
142
- Run this prompt periodically (weekly recommended) to track project health. Compare with previous reports to identify trends.
143
-
144
- If session logs are empty (no data yet), still collect GitHub/tracker/deployment data and note that agent logging has just been enabled.