@zerwiz/ymir 0.1.16 → 0.1.18
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/.agents/config/app-repos.yaml +38 -0
- package/.claude/settings.json +31 -0
- package/.codex/hooks.json +43 -0
- package/.cursor/hooks.json +33 -0
- package/.pi/extensions/README.md +39 -0
- package/.pi/extensions/gna-pi-watch.ts +15 -0
- package/.pi/extensions/lib/ro-assistant-layout.ts +96 -0
- package/.pi/extensions/lib/ro-operational-user-layout.ts +145 -0
- package/.pi/extensions/lib/ro-visibility.ts +99 -0
- package/.pi/extensions/lib/ro-working-ship.ts +243 -0
- package/.pi/extensions/lib/rodd-operational-input.ts +62 -0
- package/.pi/extensions/lib/skuld-branch-dispatch.ts +252 -0
- package/.pi/extensions/lib/skuld-branch-model-picker.ts +77 -0
- package/.pi/extensions/lib/vordr-sessionstart-supervisor.mjs +48 -0
- package/.pi/extensions/ro.ts +11 -0
- package/.pi/extensions/skuld-branch-supervision.ts +11 -0
- package/.pi/extensions/syn-turnend-guard.ts +11 -0
- package/.pi/mcp.json +16 -0
- package/.pi/mcp.json.example +11 -0
- package/.pi/npm/.gitignore +2 -0
- package/.pi/settings.json +8 -0
- package/.pi/shared/extensions/gna-pi-watch.ts +750 -0
- package/.pi/shared/extensions/herdr-agent-state.ts +257 -0
- package/.pi/shared/extensions/open-editor.ts +509 -0
- package/.pi/shared/extensions/ro.ts +504 -0
- package/.pi/shared/extensions/skuld-branch-supervision.ts +1535 -0
- package/.pi/shared/extensions/syn-turnend-guard.ts +683 -0
- package/.pi/shared/extensions/todo.ts +133 -0
- package/.pi/shared/extensions/ymir-subagents.ts +287 -0
- package/.pi/shared/extensions/ymir-well.ts +130 -0
- package/CHANGELOG.md +23 -0
- package/assets/Ymir.md +4654 -0
- package/assets/healer.html +717 -0
- package/assets/icon-family/family-sheet.png +0 -0
- package/assets/icon-family/hlidskjalf.svg +1 -0
- package/assets/icon-family/sessrumnir.svg +1 -0
- package/assets/icon-family/smidja.svg +1 -0
- package/assets/icon-family/ymir.svg +1 -0
- package/assets/mimirswell.html +880 -0
- package/assets/mock/README.md +16 -0
- package/assets/mock/feeds.ts +175 -0
- package/assets/mock/mock.ts +408 -0
- package/assets/reference/docs/agent-control.md +122 -0
- package/assets/reference/docs/apodex/Appdex_as_Orchestrator_Planner_Reviewer_Assessment.md +176 -0
- package/assets/reference/docs/apodex/Final Report(1).md +198 -0
- package/assets/reference/docs/apodex/Final Report(2).md +54 -0
- package/assets/reference/docs/apodex/Final Report(3).md +40 -0
- package/assets/reference/docs/apodex/Final Report(4).md +234 -0
- package/assets/reference/docs/apodex/Final Report(5).md +13 -0
- package/assets/reference/docs/apodex/Final Report.md +82 -0
- package/assets/reference/docs/architecture.md +392 -0
- package/assets/reference/docs/arm-pretool-check.md +247 -0
- package/assets/reference/docs/calm-mode-feasibility.md +541 -0
- package/assets/reference/docs/calm.md +59 -0
- package/assets/reference/docs/captain-hold-lifecycle.md +96 -0
- package/assets/reference/docs/cd-guard.md +165 -0
- package/assets/reference/docs/cmux-backend.md +133 -0
- package/assets/reference/docs/codex-app-backend.md +57 -0
- package/assets/reference/docs/configuration.md +924 -0
- package/assets/reference/docs/documentation-audiences.json +468 -0
- package/assets/reference/docs/documentation-audiences.md +28 -0
- package/assets/reference/docs/examples/crew-dispatch.json +26 -0
- package/assets/reference/docs/examples/process-event-extension/file-signal.mjs +96 -0
- package/assets/reference/docs/examples/process-event-extension/firstmate-extension.json +15 -0
- package/assets/reference/docs/examples/watched-tools.json +24 -0
- package/assets/reference/docs/examples/wedge-alarm +22 -0
- package/assets/reference/docs/extension-bindings.md +237 -0
- package/assets/reference/docs/fm-test-isolation-proof.json +37 -0
- package/assets/reference/docs/fm-test-isolation-proof.md +149 -0
- package/assets/reference/docs/fm-test-portable-shards.md +118 -0
- package/assets/reference/docs/gitlab-merge-watch.md +275 -0
- package/assets/reference/docs/herdr-backend.md +346 -0
- package/assets/reference/docs/orca-backend.md +84 -0
- package/assets/reference/docs/pi-supervision-branch-poster.svg +125 -0
- package/assets/reference/docs/pi-supervision-branch.md +96 -0
- package/assets/reference/docs/plans/agentic-engineering-workflow.md +395 -0
- package/assets/reference/docs/plans/agentic-factory-implementation-plan.md +615 -0
- package/assets/reference/docs/plans/command-factory-enhancement-plan.md +420 -0
- package/assets/reference/docs/plans/phase-1-layer3-program-design.md +134 -0
- package/assets/reference/docs/plans/phase-2-vertical-slices.md +100 -0
- package/assets/reference/docs/plans/phase-3-measurable-goals.md +106 -0
- package/assets/reference/docs/plans/phase-4-context-budget.md +106 -0
- package/assets/reference/docs/plans/phase-5-pre-mortem-confidence.md +100 -0
- package/assets/reference/docs/plans/phase-6-incident-to-agent.md +109 -0
- package/assets/reference/docs/remote-secondmates.md +268 -0
- package/assets/reference/docs/scripts.md +146 -0
- package/assets/reference/docs/sessionstart-nudge.md +115 -0
- package/assets/reference/docs/subagent-guard.md +383 -0
- package/assets/reference/docs/supervision-protocols/claude.md +27 -0
- package/assets/reference/docs/supervision-protocols/codex.md +16 -0
- package/assets/reference/docs/supervision-protocols/cursor.md +31 -0
- package/assets/reference/docs/supervision-protocols/grok.md +39 -0
- package/assets/reference/docs/supervision-protocols/opencode.md +17 -0
- package/assets/reference/docs/supervision-protocols/pi.md +33 -0
- package/assets/reference/docs/supervision-protocols/unknown.md +13 -0
- package/assets/reference/docs/tmux-backend.md +115 -0
- package/assets/reference/docs/trace-context.md +117 -0
- package/assets/reference/docs/turnend-guard.md +170 -0
- package/assets/reference/docs/verification/dispatch-auth.md +204 -0
- package/assets/reference/docs/verification/muse.md +221 -0
- package/assets/reference/docs/verification/process-event-sources.md +208 -0
- package/assets/reference/docs/verification/public-followup.md +119 -0
- package/assets/reference/docs/verification/runtime-backends.md +1022 -0
- package/assets/reference/docs/verification/stow-memory.md +53 -0
- package/assets/reference/docs/verification/supervision.md +534 -0
- package/assets/reference/docs/verification/trace-context.md +31 -0
- package/assets/reference/docs/voice-relay.md +295 -0
- package/assets/reference/docs/watcher-continuity.md +119 -0
- package/assets/reference/docs/wedge-alarm.md +39 -0
- package/assets/reference/docs/zellij-backend.md +114 -0
- package/assets/reference/index.html +1172 -0
- package/assets/reference/skills/afk/SKILL.md +241 -0
- package/assets/reference/skills/ahoy/SKILL.md +56 -0
- package/assets/reference/skills/ask-user-authority/SKILL.md +56 -0
- package/assets/reference/skills/bearings/SKILL.md +161 -0
- package/assets/reference/skills/bearings/assets/board-template.html +731 -0
- package/assets/reference/skills/bootstrap-diagnostics/SKILL.md +68 -0
- package/assets/reference/skills/captain-hold-lifecycle/SKILL.md +54 -0
- package/assets/reference/skills/decision-hold-lifecycle/SKILL.md +15 -0
- package/assets/reference/skills/diagnostic-reasoning/SKILL.md +53 -0
- package/assets/reference/skills/firstmate-codexapp/SKILL.md +110 -0
- package/assets/reference/skills/firstmate-codexapp/agents/openai.yaml +4 -0
- package/assets/reference/skills/firstmate-coding-guidelines/SKILL.md +127 -0
- package/assets/reference/skills/firstmate-orca/SKILL.md +92 -0
- package/assets/reference/skills/fmx-respond/SKILL.md +283 -0
- package/assets/reference/skills/harness-adapters/SKILL.md +95 -0
- package/assets/reference/skills/harness-adapters/references/common/control-and-recovery.md +37 -0
- package/assets/reference/skills/harness-adapters/references/common/dispatch.md +32 -0
- package/assets/reference/skills/harness-adapters/references/common/model-and-effort.md +42 -0
- package/assets/reference/skills/harness-adapters/references/common/primary-hooks.md +40 -0
- package/assets/reference/skills/harness-adapters/references/harness/claude.md +55 -0
- package/assets/reference/skills/harness-adapters/references/harness/codex.md +43 -0
- package/assets/reference/skills/harness-adapters/references/harness/cursor.md +75 -0
- package/assets/reference/skills/harness-adapters/references/harness/grok.md +69 -0
- package/assets/reference/skills/harness-adapters/references/harness/kimi.md +51 -0
- package/assets/reference/skills/harness-adapters/references/harness/muse.md +70 -0
- package/assets/reference/skills/harness-adapters/references/harness/opencode.md +42 -0
- package/assets/reference/skills/harness-adapters/references/harness/pi.md +56 -0
- package/assets/reference/skills/process-event-sources/SKILL.md +137 -0
- package/assets/reference/skills/project-management/SKILL.md +92 -0
- package/assets/reference/skills/quota-array-dispatch/SKILL.md +131 -0
- package/assets/reference/skills/secondmate-provisioning/SKILL.md +254 -0
- package/assets/reference/skills/stow/SKILL.md +309 -0
- package/assets/reference/skills/stuck-crewmate-recovery/SKILL.md +54 -0
- package/assets/reference/skills/updatefirstmate/SKILL.md +64 -0
- package/assets/skills/README.md +5 -0
- package/assets/yggdrasil.html +649 -0
- package/assets/ymir-banner-01.png +0 -0
- package/assets/ymir-banner-02.png +0 -0
- package/assets/ymir-banner-03.png +0 -0
- package/assets/ymir-banner-04.png +0 -0
- package/assets/ymir-banner-05.png +0 -0
- package/assets/ymir-banner-06.png +0 -0
- package/assets/ymir-emblem-darksteel.svg +63 -0
- package/assets/ymir-emblem-forged.svg +55 -0
- package/assets/ymir-emblem-slate.svg +55 -0
- package/assets/ymir-mark-algiz-anvil.svg +9 -0
- package/assets/ymir-stave.svg +53 -0
- package/assets/ymir.html +563 -0
- package/bin/ymir-install.sh +6 -1
- package/data/learnings.md +33 -0
- package/data/local-models.md +34 -0
- package/data/operator.md +15 -0
- package/data/projects.md +28 -0
- package/data/realm.md +1 -0
- package/deploy/Containerfile +27 -0
- package/deploy/README.md +104 -0
- package/deploy/compose/compose.yaml +45 -0
- package/deploy/env.example +30 -0
- package/deploy/quadlet/ymir.container +57 -0
- package/package.json +10 -8
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
# Command Factory Enhancement Plan
|
|
2
|
+
|
|
3
|
+
**Date**: September 2026
|
|
4
|
+
**Scope**: Visualizer (frontend) + Factory Backend (Python)
|
|
5
|
+
**Purpose**: Comprehensive roadmap for extending the software factory observability and execution capabilities
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Executive Summary
|
|
10
|
+
|
|
11
|
+
The smithy (Smíðja) is an **agent + code pipeline** — deterministic Python scripts own sequencing/retries/acceptance; coding agents (Pi/opencode) work inside bounded phases; typed JSON envelopes carry context; everything streams into SQLite for the polled visualizer.
|
|
12
|
+
|
|
13
|
+
This plan identifies high-value enhancements across both surfaces, organized by impact and implementation complexity.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Current Architecture Snapshot
|
|
18
|
+
|
|
19
|
+
### Visualizer (`apps/visualizer/`)
|
|
20
|
+
| Layer | Technology | Key Files |
|
|
21
|
+
|-------|------------|-----------|
|
|
22
|
+
| UI Framework | Vue 3 + TypeScript + Vite | `src/App.vue`, `src/components/*.vue` |
|
|
23
|
+
| State | Pinia-style composables | `src/lib/chat-store.ts`, `src/lib/api.ts` |
|
|
24
|
+
| Server | Bun HTTP + SQLite (readonly) | `server/index.ts`, `server/db.ts` |
|
|
25
|
+
| Real-time | 500ms polling + cursor pagination | `SessionTrace.vue` tick loop |
|
|
26
|
+
| Themes | CSS custom properties | `neutral` (default) + `classic` (deep-space) |
|
|
27
|
+
| Desktop | Electron (preload + main) | `desktop/main.js`, `desktop/preload.js` |
|
|
28
|
+
| Memory | Kaia engram bridge (Python) | `/api/memory/*` proxy to `:4602` |
|
|
29
|
+
|
|
30
|
+
**Current Views**: Sessions → Session Trace (lanes + waterfall) → Phase Detail + Envelopes + Gates + Thinking + Tool calls; Memory; Decisions (self-improving surface); Stats (tokens/cost/cache/savings); Orchestrator Chat (Kaia + session launch); Settings
|
|
31
|
+
|
|
32
|
+
### Factory Backend (`templates/factory/`)
|
|
33
|
+
| Layer | Technology | Key Files |
|
|
34
|
+
|-------|------------|-----------|
|
|
35
|
+
| Orchestration | Python 3.11+ (uv scripts) | `factory_*.py` |
|
|
36
|
+
| Data Contracts | Pydantic v2 | `factory_modules/data_types.py` |
|
|
37
|
+
| Agent Runtime | `agent_pi.py` (Pi), `agent_opencode.py` (opencode) | |
|
|
38
|
+
| Tracing | SQLite WAL + JSONL events | `factory_modules/tracer.py` |
|
|
39
|
+
| Quality Gates | Deterministic subprocess runs | `factory_modules/quality.py` |
|
|
40
|
+
| Permissions | Path-based write enforcement | `factory_modules/permissions.py` |
|
|
41
|
+
| Context Handoff | File-based `context_handoff/` dir | `factory_modules/agents.py` |
|
|
42
|
+
| Sub-agents | Task-tool lane materialization (G2) | `factory_modules/agents.py` |
|
|
43
|
+
|
|
44
|
+
**Current Factories**: `factory_scout`, `factory_simple_sdlc`, `factory_plan_build`, `factory_build_test`, `factory_plan_build_test`, `factory_plan_build_test_quality`, `factory_build_review`, `factory_document`, `factory_orchestrate`, `factory_recon_iv`, `factory_prompt`, `factory_quality`
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Enhancement Categories
|
|
49
|
+
|
|
50
|
+
### A. Visualizer — Observability & UX
|
|
51
|
+
|
|
52
|
+
#### A.1 Live Collaboration & Multi-User
|
|
53
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
54
|
+
|----|-------------|-------------|--------|----------|
|
|
55
|
+
| A.1.1 | **Presence indicators** | Show other engineers viewing the same session (WebSocket presence) | Medium | High |
|
|
56
|
+
| A.1.2 | **Shared steer annotations** | Steer messages attributed to author, visible to all viewers | Medium | High |
|
|
57
|
+
| A.1.3 | **Session handoff** | "Take over" a paused run from another engineer's steer context | Medium | Medium |
|
|
58
|
+
| A.1.4 | **Comment threads on phases** | Pin discussion to specific phase blocks (like GitHub PR comments) | Medium | Medium |
|
|
59
|
+
|
|
60
|
+
#### A.2 Advanced Trace Analysis
|
|
61
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
62
|
+
|----|-------------|-------------|--------|----------|
|
|
63
|
+
| A.2.1 | **Comparative trace diff** | Side-by-side waterfall of two runs (baseline vs current) | Large | High |
|
|
64
|
+
| A.2.2 | **Token flow Sankey** | Visualize input→cache→output→reasoning token flow per agent/phase | Medium | High |
|
|
65
|
+
| A.2.3 | **Failure pattern miner** | Auto-cluster similar failures across runs with suggested fixes | Medium | High |
|
|
66
|
+
| A.2.4 | **Critical path highlighter** | Auto-detect and highlight the longest dependency chain in waterfall | Small | Medium |
|
|
67
|
+
| A.2.5 | **Phase duration heatmap** | Calendar view of phase durations across runs (CI-style) | Small | Medium |
|
|
68
|
+
|
|
69
|
+
#### A.3 Kaia Memory & Knowledge
|
|
70
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
71
|
+
|----|-------------|-------------|--------|----------|
|
|
72
|
+
| A.3.1 | **Memory graph explorer** | Interactive entity-relationship graph from engram facts/episodes | Large | Medium |
|
|
73
|
+
| A.3.2 | **Cross-project memory search** | Query Kaia memory across all factory repos from one UI | Medium | Medium |
|
|
74
|
+
| A.3.3 | **Memory decay visualization** | Show salience/confidence decay over time per fact/episode | Small | Low |
|
|
75
|
+
| A.3.4 | **Admission timeline** | Visualize Kaia's admission pipeline: prompt → recall → admit → dispatch | Small | Medium |
|
|
76
|
+
|
|
77
|
+
#### A.4 Orchestrator Chat Enhancements
|
|
78
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
79
|
+
|----|-------------|-------------|--------|----------|
|
|
80
|
+
| A.4.1 | **Inline tool result preview** | Expand tool calls in chat to show args/result without leaving thread | Small | High |
|
|
81
|
+
| A.4.2 | **Chat-to-factory trace linking** | Click a launched session in chat → jump to its trace (exists) + back-link | Small | High |
|
|
82
|
+
| A.4.3 | **Structured task templates** | Quick-insert templates for common tasks (bug fix, feature, refactor) | Small | Medium |
|
|
83
|
+
| A.4.4 | **Multi-model chat** | Switch Kaia's model mid-conversation; show model badge per message | Small | Medium |
|
|
84
|
+
| A.4.5 | **Chat export / session resume** | Export chat + launched sessions as portable bundle; resume later | Medium | Low |
|
|
85
|
+
|
|
86
|
+
#### A.5 Settings & Configuration UI
|
|
87
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
88
|
+
|----|-------------|-------------|--------|----------|
|
|
89
|
+
| A.5.1 | **Visual roster editor** | Drag-and-drop agent roster builder (replaces YAML editing) | Large | High |
|
|
90
|
+
| A.5.2 | **Model tier picker** | Visual model catalog with tier badges, pricing, local/online toggle | Medium | High |
|
|
91
|
+
| A.5.3 | **Factory chain builder** | Visual pipeline editor for creating custom factory scripts | Large | Medium |
|
|
92
|
+
| A.5.4 | **Theme builder** | Custom CSS variable editor with live preview + export/import | Medium | Low |
|
|
93
|
+
|
|
94
|
+
#### A.6 Mobile & Accessibility
|
|
95
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
96
|
+
|----|-------------|-------------|--------|----------|
|
|
97
|
+
| A.6.1 | **Responsive waterfall** | Horizontal scroll + collapsed lanes for mobile viewport | Medium | Medium |
|
|
98
|
+
| A.6.2 | **Screen reader support** | ARIA labels, live regions for polling updates, keyboard nav | Medium | High |
|
|
99
|
+
| A.6.3 | **High contrast theme** | WCAG AAA compliant theme variant | Small | Medium |
|
|
100
|
+
| A.6.4 | **PWA installability** | Service worker + manifest for offline session browsing | Medium | Low |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
### B. Visualizer — Data & API
|
|
105
|
+
|
|
106
|
+
#### B.1 API Extensions
|
|
107
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
108
|
+
|----|-------------|-------------|--------|----------|
|
|
109
|
+
| B.1.1 | **WebSocket event stream** | Replace polling with server-sent events for live updates | Medium | High |
|
|
110
|
+
| B.1.2 | **GraphQL endpoint** | Flexible queries for custom dashboards / external tools | Large | Medium |
|
|
111
|
+
| B.1.3 | **Batch session export** | `/api/sessions/export?ids=...` → NDJSON/CSV/Parquet | Small | Medium |
|
|
112
|
+
| B.1.4 | **Run comparison API** | `/api/compare?a=<id>&b=<id>` → structured diff | Medium | High |
|
|
113
|
+
|
|
114
|
+
#### B.2 Data Enrichment
|
|
115
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
116
|
+
|----|-------------|-------------|--------|----------|
|
|
117
|
+
| B.2.1 | **GitHub PR linking** | Auto-link sessions to PRs via commit messages / branch names | Medium | High |
|
|
118
|
+
| B.2.2 | **Jira/Linear ticket sync** | Bidirectional sync: session ↔ ticket (status, comments, links) | Large | Medium |
|
|
119
|
+
| B.2.3 | **Cost allocation tags** | Tag runs by project/team/feature for cost center reporting | Small | Medium |
|
|
120
|
+
| B.2.4 | **Custom metric ingestion** | POST `/api/metrics` for arbitrary KPI tracking (deployment freq, etc.) | Small | Low |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
### C. Factory Backend — Execution & Orchestration
|
|
125
|
+
|
|
126
|
+
#### C.1 New Factory Chains (Templates)
|
|
127
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
128
|
+
|----|-------------|-------------|--------|----------|
|
|
129
|
+
| C.1.1 | **`factory_security_audit`** | Scout → threat model → code review → fix → retest → document | Medium | High |
|
|
130
|
+
| C.1.2 | **`factory_perf_optimize`** | Benchmark → profile → optimize → benchmark → regression test | Medium | High |
|
|
131
|
+
| C.1.3 | **`factory_migration`** | Analyze → plan migration → execute → verify → rollback plan | Medium | Medium |
|
|
132
|
+
| C.1.3 | **`factory_dependency_update`** | Scan → plan updates → test → staged rollout → verify | Small | Medium |
|
|
133
|
+
| C.1.4 | **`factory_incident_response`** | Triage → diagnose → fix → verify → postmortem → Kaia memory | Medium | High |
|
|
134
|
+
| C.1.5 | **`factory_feature_flag_rollout`** | Gradual rollout with metric gates + automatic rollback | Medium | Medium |
|
|
135
|
+
|
|
136
|
+
#### C.2 Agent Capability Extensions
|
|
137
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
138
|
+
|----|-------------|-------------|--------|----------|
|
|
139
|
+
| C.2.1 | **Multi-modal agents** | Vision input (screenshots, diagrams) for UI builder / documenter | Large | High |
|
|
140
|
+
| C.2.2 | **Agent skill marketplace** | Pluggable agent capabilities (npm-style packages with prompts + tools) | Large | Medium |
|
|
141
|
+
| C.2.3 | **Agent sandbox profiles** | Per-agent filesystem/network caps (beyond `writes:`) via WASM/deno | Large | Medium |
|
|
142
|
+
| C.2.4 | **Reasoning budget control** | Per-phase token/$$ ceiling; auto-escalate to stronger model if needed | Medium | High |
|
|
143
|
+
| C.2.5 | **Agent spec compliance** | Validate agent output against OpenAPI/AsyncAPI/GraphQL schemas | Medium | Medium |
|
|
144
|
+
|
|
145
|
+
#### C.3 Quality & Gates
|
|
146
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
147
|
+
|----|-------------|-------------|--------|----------|
|
|
148
|
+
| C.3.1 | **Property-based test gate** | Generate + run quickcheck-style tests from type signatures | Medium | High |
|
|
149
|
+
| C.3.2 | **Contract test gate** | Consumer-driven contracts (Pact) for API changes | Medium | Medium |
|
|
150
|
+
| C.3.3 | **Security gate (SAST/DAST)** | Integrate Semgrep/CodeQL/Trivy as deterministic quality blocks | Small | High |
|
|
151
|
+
| C.3.4 | **Performance regression gate** | Compare benchmarks against baseline; fail on >5% regression | Medium | High |
|
|
152
|
+
| C.3.5 | **Accessibility gate** | axe-core / lighthouse CI as quality block | Small | Medium |
|
|
153
|
+
| C.3.6 | **License/compliance gate** | FOSSA / SPDX license check on dependency changes | Small | Low |
|
|
154
|
+
|
|
155
|
+
#### C.4 Context & Handoff
|
|
156
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
157
|
+
|----|-------------|-------------|--------|----------|
|
|
158
|
+
| C.4.1 | **Semantic context compression** | LLM-based summarization of handoff files (not truncation) | Medium | High |
|
|
159
|
+
| C.4.2 | **Cross-repo context sharing** | Shared `context_handoff/` across monorepo factories | Medium | Medium |
|
|
160
|
+
| C.4.3 | **Context versioning** | Git-like history for handoff files with diff/blame | Small | Medium |
|
|
161
|
+
| C.4.4 | **Structured checkpoint format** | Replace markdown checkpoints with typed `Checkpoint` envelopes | Medium | Medium |
|
|
162
|
+
|
|
163
|
+
#### C.5 Orchestration & Scheduling
|
|
164
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
165
|
+
|----|-------------|-------------|--------|----------|
|
|
166
|
+
| C.5.1 | **Parallel phase execution** | DAG-based phase scheduler (independent phases run concurrently) | Large | High |
|
|
167
|
+
| C.5.2 | **Cron / scheduled factories** | `factory schedule "0 2 * * *" factory_simple_sdlc "nightly refactor"` | Medium | Medium |
|
|
168
|
+
| C.5.3 | **Event-driven factories** | `process-event-sources` → factory trigger (GitHub webhook, cron, etc.) | Medium | High |
|
|
169
|
+
| C.5.4 | **Factory composition** | `factory_chain: [factory_plan, factory_build_test, factory_document]` | Medium | Medium |
|
|
170
|
+
| C.5.5 | **Distributed execution** | Offload agent phases to remote workers (Kubernetes, modal, fly.io) | Large | Low |
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
### D. Factory Backend — Developer Experience
|
|
175
|
+
|
|
176
|
+
#### D.1 Configuration & Onboarding
|
|
177
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
178
|
+
|----|-------------|-------------|--------|----------|
|
|
179
|
+
| D.1.1 | **`factory init --interactive`** | Guided setup: language, test runner, agents, models, quality blocks | Small | High |
|
|
180
|
+
| D.1.2 | **Config validation CLI** | `factory doctor` — full preflight (models, tools, prompts, perms) | Small | High |
|
|
181
|
+
| D.1.3 | **Config schema docs generator** | Auto-generate markdown from `factoryConfig` Pydantic model | Small | Medium |
|
|
182
|
+
| D.1.4 | **Roster inheritance** | `extends: base-roster` in YAML for shared agent definitions | Small | Medium |
|
|
183
|
+
|
|
184
|
+
#### D.2 Debugging & Diagnostics
|
|
185
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
186
|
+
|----|-------------|-------------|--------|----------|
|
|
187
|
+
| D.2.1 | **`factory replay <session>`** | Re-run a session from any phase with same context (deterministic replay) | Medium | High |
|
|
188
|
+
| D.2.2 | **`factory diagnose <session>`** | Auto-analyze failure: root cause, suggested fix, similar past failures | Medium | High |
|
|
189
|
+
| D.2.3 | **Live agent REPL** | `factory shell <session> <agent>` — interactive prompt in agent's context | Large | Medium |
|
|
190
|
+
| D.2.4 | **Phase time-travel** | `factory phase <session> <phase> --at <timestamp>` — inspect state at point | Medium | Low |
|
|
191
|
+
|
|
192
|
+
#### D.3 Testing & Validation
|
|
193
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
194
|
+
|----|-------------|-------------|--------|----------|
|
|
195
|
+
| D.3.1 | **Factory contract tests** | Test factory scripts against known-good fixtures (golden runs) | Medium | High |
|
|
196
|
+
| D.3.2 | **Agent prompt regression suite** | Test agent prompts against model versions for drift detection | Medium | Medium |
|
|
197
|
+
| D.3.3 | **Chaos testing harness** | Inject faults (network, model errors, OOM) into factory runs | Large | Low |
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
### E. Infrastructure & Platform
|
|
202
|
+
|
|
203
|
+
#### E.1 Deployment & Operations
|
|
204
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
205
|
+
|----|-------------|-------------|--------|----------|
|
|
206
|
+
| E.1.1 | **Docker/OCI images** | Pre-built images for factory runner + visualizer + Kaia bridge | Medium | High |
|
|
207
|
+
| E.1.2 | **Kubernetes operator** | `FactoryRun` CRD for cluster-native execution + visualizer ingress | Large | Medium |
|
|
208
|
+
| E.1.3 | **GitHub App integration** | Installable app: PR checks, status checks, auto-factory on labels | Large | High |
|
|
209
|
+
| E.1.4 | **Self-hosted telemetry** | OpenTelemetry export (traces/metrics/logs) to Tempo/Prometheus/Loki | Medium | Medium |
|
|
210
|
+
|
|
211
|
+
#### E.2 Multi-Tenancy & Teams
|
|
212
|
+
| ID | Enhancement | Description | Effort | Priority |
|
|
213
|
+
|----|-------------|-------------|--------|----------|
|
|
214
|
+
| E.2.1 | **Team workspaces** | Isolated factory configs, visualizer instances, Kaia memory per team | Large | Medium |
|
|
215
|
+
| E.2.2 | **RBAC for visualizer** | Viewer/Operator/Admin roles per workspace | Medium | Medium |
|
|
216
|
+
| E.2.3 | **Audit log** | Immutable log of all factory runs, steers, stops, config changes | Medium | High |
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Implementation Roadmap
|
|
221
|
+
|
|
222
|
+
### Phase 1: Quick Wins (Weeks 1-2)
|
|
223
|
+
**Goal**: High-impact, low-effort improvements to daily workflow
|
|
224
|
+
|
|
225
|
+
| Task | Owner | Deliverable |
|
|
226
|
+
|------|-------|-------------|
|
|
227
|
+
| A.2.4 Critical path highlighter | Visualizer | Waterfall shows longest dependency chain |
|
|
228
|
+
| A.4.1 Inline tool result preview | Visualizer | Expandable tool cards in chat |
|
|
229
|
+
| A.4.2 Chat↔trace back-links | Visualizer | Bidirectional navigation |
|
|
230
|
+
| B.1.3 Batch session export | API | `/api/sessions/export` endpoint |
|
|
231
|
+
| B.2.1 GitHub PR linking | Backend | Auto-link via commit message parsing |
|
|
232
|
+
| C.3.3 Security gate (SAST) | Backend | Semgrep integration in `quality.py` |
|
|
233
|
+
| C.3.5 Accessibility gate | Backend | axe-core in `quality.py` |
|
|
234
|
+
| D.1.1 `factory init --interactive` | Backend | Guided setup wizard |
|
|
235
|
+
| D.1.2 `factory doctor` | Backend | Full preflight validation |
|
|
236
|
+
|
|
237
|
+
### Phase 2: Core Enhancements (Weeks 3-6)
|
|
238
|
+
**Goal**: Substantial new capabilities for power users
|
|
239
|
+
|
|
240
|
+
| Task | Owner | Deliverable |
|
|
241
|
+
|------|-------|-------------|
|
|
242
|
+
| A.1.1 Presence indicators | Visualizer | WebSocket presence in SessionTrace |
|
|
243
|
+
| A.1.2 Shared steer annotations | Visualizer | Attributed steer messages |
|
|
244
|
+
| A.2.1 Comparative trace diff | Visualizer | Side-by-side waterfall view |
|
|
245
|
+
| A.2.2 Token flow Sankey | Visualizer | Interactive token flow diagram |
|
|
246
|
+
| A.2.3 Failure pattern miner | Visualizer + Backend | Clustered failures with fix suggestions |
|
|
247
|
+
| A.3.1 Memory graph explorer | Visualizer | Kaia engram entity graph |
|
|
248
|
+
| A.5.1 Visual roster editor | Visualizer | Drag-drop agent config UI |
|
|
249
|
+
| A.5.2 Model tier picker | Visualizer | Visual model catalog |
|
|
250
|
+
| B.1.1 WebSocket event stream | Visualizer + API | Replace 500ms polling |
|
|
251
|
+
| B.1.4 Run comparison API | API | Structured diff endpoint |
|
|
252
|
+
| C.1.1 Security audit factory | Backend | New `factory_security_audit.py` |
|
|
253
|
+
| C.1.2 Perf optimize factory | Backend | New `factory_perf_optimize.py` |
|
|
254
|
+
| C.1.5 Incident response factory | Backend | New `factory_incident_response.py` |
|
|
255
|
+
| C.2.4 Reasoning budget control | Backend | Per-phase token/$$ ceilings |
|
|
256
|
+
| C.3.1 Property-based test gate | Backend | Hypothesis/quickcheck integration |
|
|
257
|
+
| C.3.4 Perf regression gate | Backend | Benchmark comparison gate |
|
|
258
|
+
| C.4.1 Semantic context compression | Backend | LLM summarization of handoffs |
|
|
259
|
+
| C.5.3 Event-driven factories | Backend | `process-event-sources` integration |
|
|
260
|
+
| D.2.1 `factory replay` | Backend | Deterministic session replay |
|
|
261
|
+
| D.2.2 `factory diagnose` | Backend | Auto failure analysis |
|
|
262
|
+
| E.1.1 Docker images | Infra | Published OCI images |
|
|
263
|
+
| E.1.3 GitHub App | Infra | Installable PR integration |
|
|
264
|
+
|
|
265
|
+
### Phase 3: Platform Maturity (Weeks 7-12)
|
|
266
|
+
**Goal**: Enterprise readiness, extensibility, scale
|
|
267
|
+
|
|
268
|
+
| Task | Owner | Deliverable |
|
|
269
|
+
|------|-------|-------------|
|
|
270
|
+
| A.1.3 Session handoff | Visualizer | Take over paused runs |
|
|
271
|
+
| A.1.4 Comment threads | Visualizer | Phase-pinned discussions |
|
|
272
|
+
| A.2.5 Phase duration heatmap | Visualizer | Calendar view |
|
|
273
|
+
| A.3.2 Cross-project memory | Visualizer | Multi-repo Kaia query |
|
|
274
|
+
| A.5.3 Factory chain builder | Visualizer | Visual pipeline editor |
|
|
275
|
+
| A.6.1-6.3 Mobile + a11y | Visualizer | Responsive, WCAG AAA, PWA |
|
|
276
|
+
| B.1.2 GraphQL endpoint | API | Flexible query layer |
|
|
277
|
+
| B.2.2 Jira/Linear sync | Backend | Bidirectional ticket sync |
|
|
278
|
+
| C.1.3 Migration factory | Backend | `factory_migration.py` |
|
|
279
|
+
| C.1.4 Dependency update factory | Backend | `factory_dependency_update.py` |
|
|
280
|
+
| C.1.5 Feature flag rollout | Backend | `factory_feature_flag_rollout.py` |
|
|
281
|
+
| C.2.1 Multi-modal agents | Backend | Vision input support |
|
|
282
|
+
| C.2.2 Agent skill marketplace | Backend | Pluggable capability packages |
|
|
283
|
+
| C.4.2 Cross-repo context | Backend | Shared handoff in monorepo |
|
|
284
|
+
| C.4.3 Context versioning | Backend | Git-like handoff history |
|
|
285
|
+
| C.4.4 Typed checkpoints | Backend | `Checkpoint` envelope type |
|
|
286
|
+
| C.5.1 Parallel phase execution | Backend | DAG scheduler |
|
|
287
|
+
| C.5.2 Cron scheduled factories | Backend | `factory schedule` command |
|
|
288
|
+
| C.5.4 Factory composition | Backend | Chain factory scripts |
|
|
289
|
+
| D.1.3 Config docs generator | Backend | Auto-generated schema docs |
|
|
290
|
+
| D.1.4 Roster inheritance | Backend | YAML `extends:` support |
|
|
291
|
+
| D.2.3 Live agent REPL | Backend | Interactive agent shell |
|
|
292
|
+
| D.3.1 Factory contract tests | Backend | Golden run test suite |
|
|
293
|
+
| D.3.2 Agent prompt regression | Backend | Model drift detection |
|
|
294
|
+
| E.1.2 K8s operator | Infra | `FactoryRun` CRD |
|
|
295
|
+
| E.1.4 OTel export | Infra | Tempo/Prometheus/Loki |
|
|
296
|
+
| E.2.1 Team workspaces | Infra | Multi-tenant isolation |
|
|
297
|
+
| E.2.2 RBAC | Infra | Role-based access |
|
|
298
|
+
| E.2.3 Audit log | Infra | Immutable operation log |
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Technical Considerations
|
|
303
|
+
|
|
304
|
+
### Visualizer Tech Debt to Address
|
|
305
|
+
1. **Polling → WebSocket**: Current 500ms polling is simple but scales poorly; SSE/WebSocket for live updates
|
|
306
|
+
2. **State management**: Migrate from composables to Pinia for devtools + persistence
|
|
307
|
+
3. **Bundle size**: Code-split views (Memory, Decisions, Stats, Chat) — lazy load
|
|
308
|
+
4. **Type safety**: Strict TypeScript + `vue-tsc --noEmit` in CI (already configured)
|
|
309
|
+
5. **Test coverage**: Add Vitest unit tests for components + Playwright e2e for critical flows
|
|
310
|
+
|
|
311
|
+
### Backend Tech Debt to Address
|
|
312
|
+
1. **Plugin architecture**: Factory modules should be discoverable plugins, not hardcoded imports
|
|
313
|
+
2. **Async execution**: `agent_pi.run` is synchronous; move to `asyncio` for parallel phases
|
|
314
|
+
3. **Config hot-reload**: Watch `factory.config.yaml` for changes without restart
|
|
315
|
+
4. **Structured logging**: Replace `console.py` Rich output with structured JSON logs + OTel
|
|
316
|
+
5. **Migration system**: Versioned DB migrations for `factory.db` schema changes
|
|
317
|
+
|
|
318
|
+
### Data Model Extensions Needed
|
|
319
|
+
```python
|
|
320
|
+
# New types for enhancement support
|
|
321
|
+
class Checkpoint(EnvelopeBase): # C.4.4
|
|
322
|
+
phase: str
|
|
323
|
+
summary: str
|
|
324
|
+
artifacts: list[str]
|
|
325
|
+
context_summary: str
|
|
326
|
+
|
|
327
|
+
class MetricPoint(BaseModel): # B.2.4
|
|
328
|
+
name: str
|
|
329
|
+
value: float
|
|
330
|
+
timestamp: str
|
|
331
|
+
tags: dict[str, str]
|
|
332
|
+
|
|
333
|
+
class TeamWorkspace(BaseModel): # E.2.1
|
|
334
|
+
id: str
|
|
335
|
+
name: str
|
|
336
|
+
factory_config: str
|
|
337
|
+
visualizer_url: str
|
|
338
|
+
kaia_bridge_url: str
|
|
339
|
+
members: list[str]
|
|
340
|
+
rbac: dict[str, list[str]] # role → permissions
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
## Risk Assessment
|
|
346
|
+
|
|
347
|
+
| Risk | Likelihood | Impact | Mitigation |
|
|
348
|
+
|------|------------|--------|------------|
|
|
349
|
+
| WebSocket complexity breaks polling fallback | Medium | High | Keep polling as fallback; feature flag WebSocket |
|
|
350
|
+
| Multi-modal agents need new harness support | High | Medium | Start with Pi vision extensions; opencode later |
|
|
351
|
+
| Parallel phases break context handoff assumptions | Medium | High | Design DAG with explicit data dependencies |
|
|
352
|
+
| Kaia memory bridge becomes bottleneck | Medium | Medium | Add caching layer; async proxy |
|
|
353
|
+
| Docker images bloat with all model deps | Low | Medium | Multi-stage builds; optional model layers |
|
|
354
|
+
| GitHub App permissions scope creep | Medium | High | Minimal permissions; user-granted per repo |
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## Success Metrics
|
|
359
|
+
|
|
360
|
+
| Metric | Baseline | Target (6mo) | Target (12mo) |
|
|
361
|
+
|--------|----------|--------------|---------------|
|
|
362
|
+
| Mean time to detect failure | ~5 min (polling) | <30 sec (WebSocket) | <10 sec |
|
|
363
|
+
| Factory script authoring time | ~2 hours | <30 min (visual builder) | <15 min |
|
|
364
|
+
| Cross-run failure correlation | Manual | Auto-clustered | Auto-fix suggested |
|
|
365
|
+
| Agent context window utilization | Unknown | Tracked + visualized | Optimized via compression |
|
|
366
|
+
| Factory adoption (repos stamped) | ~5 | 25 | 100+ |
|
|
367
|
+
| Visualizer daily active users | ~3 | 15 | 50+ |
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
## Appendix: Quick Reference — Current Commands
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
# Visualizer
|
|
375
|
+
just ui # Start visualizer (API :4600, UI :4601)
|
|
376
|
+
bun run server/index.ts # API only
|
|
377
|
+
bun run dev # Vite dev server (proxies /api)
|
|
378
|
+
|
|
379
|
+
# Factory
|
|
380
|
+
uv run factory/factory_simple_sdlc.py "add health endpoint"
|
|
381
|
+
uv run factory/factory_orchestrate.py "refactor auth" --factory-id a1b2c3d4
|
|
382
|
+
factory doctor # Preflight check
|
|
383
|
+
factory team list # Show rosters
|
|
384
|
+
factory mission T1 # Bench missions
|
|
385
|
+
|
|
386
|
+
# Kaia Memory
|
|
387
|
+
just kaia # CLI memory interface
|
|
388
|
+
# UI: http://localhost:4601/#/memory
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
## Appendix: Key Files to Modify per Enhancement
|
|
394
|
+
|
|
395
|
+
| Enhancement Area | Primary Files |
|
|
396
|
+
|------------------|---------------|
|
|
397
|
+
| Visualizer views | `apps/visualizer/src/components/*.vue` |
|
|
398
|
+
| Visualizer API | `apps/visualizer/server/index.ts`, `server/db.ts` |
|
|
399
|
+
| Visualizer types | `apps/visualizer/shared/types.ts`, `src/lib/types.ts` |
|
|
400
|
+
| Factory chains | `templates/factory/factory_*.py` |
|
|
401
|
+
| Factory modules | `templates/factory/factory_modules/*.py` |
|
|
402
|
+
| Data contracts | `templates/factory/factory_modules/data_types.py` |
|
|
403
|
+
| Agent prompts | `templates/prompt_engineering/<agent>/system.md`, `user.md` |
|
|
404
|
+
| Config schema | `templates/factory.config.yaml`, `references/config.md` |
|
|
405
|
+
| Observability spec | `references/observability.md` |
|
|
406
|
+
| Handoff protocol | `references/handoff.md` |
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
## Next Steps
|
|
411
|
+
|
|
412
|
+
1. **Captain reviews and prioritizes** — Select Phase 1 items for immediate sprint
|
|
413
|
+
2. **Create implementation tickets** — Use `ticket-create` with measurable goals
|
|
414
|
+
3. **Assign workstreams** — Visualizer vs Backend vs Infra tracks
|
|
415
|
+
4. **Weekly sync** — Track progress against roadmap
|
|
416
|
+
5. **Retrospective at Phase 1 end** — Adjust priorities based on learnings
|
|
417
|
+
|
|
418
|
+
---
|
|
419
|
+
|
|
420
|
+
*This plan is a living document. Update as enhancements are completed, new needs emerge, or priorities shift.*
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Phase 1: Add Layer 3 (Program Design) to create-plan Skill
|
|
2
|
+
|
|
3
|
+
**Project**: command (COM)
|
|
4
|
+
**Priority**: Critical
|
|
5
|
+
**Estimated Effort**: 5 days
|
|
6
|
+
**Status**: ✅ COMPLETED (2026-09-10)
|
|
7
|
+
**Measurable Goal**: `plan_layer3_compliance:100%:mcp_validation:30d:90%`
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Problem Statement
|
|
12
|
+
|
|
13
|
+
The current `create-plan` skill template does not enforce **Layer 3 (Program Design)** from Dex Horthy's four-layer framework. This is "the layer everyone skips" — where the agent makes silent structural decisions (file locations, type signatures, call stack, test shapes) that you later dislike. Per the research: "A good plan ends with the tests and the call stack. The point is that these are decisions the agent will otherwise make silently, and that you may not like."
|
|
14
|
+
|
|
15
|
+
## Current State
|
|
16
|
+
|
|
17
|
+
- `create-plan` skill at `~/.config/opencode/skills/create-plan/SKILL.md` has template with Overview, Current State, Desired End State, Implementation Approach, Phases, Testing Strategy
|
|
18
|
+
- **Missing**: File Map, Type Signatures, Call Stack Visualization, Test Shapes (signatures only)
|
|
19
|
+
- `validate-plan` skill checks completeness, paths, rules, feasibility, risks — but **does not validate Layer 3 exists**
|
|
20
|
+
|
|
21
|
+
## What Was Implemented
|
|
22
|
+
|
|
23
|
+
### 1. Updated `create-plan` Skill Template
|
|
24
|
+
**Location**: `~/.config/opencode/skills/create-plan/SKILL.md` (opencode config)
|
|
25
|
+
|
|
26
|
+
Added mandatory **Program Design (Layer 3)** section to the plan template:
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
## Program Design (Layer 3 — MANDATORY)
|
|
30
|
+
|
|
31
|
+
### File Map
|
|
32
|
+
| Component | Path | Responsibility |
|
|
33
|
+
|-----------|------|----------------|
|
|
34
|
+
| | | |
|
|
35
|
+
|
|
36
|
+
### Type Signatures
|
|
37
|
+
```typescript
|
|
38
|
+
// Exact interfaces before implementation
|
|
39
|
+
interface X { }
|
|
40
|
+
type Y = ;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Call Stack Visualization
|
|
44
|
+
```mermaid
|
|
45
|
+
graph TD
|
|
46
|
+
A[Entry] --> B[Handler]
|
|
47
|
+
B --> C[Service]
|
|
48
|
+
C --> D[Repository]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Test Shapes (Signatures Only)
|
|
52
|
+
```typescript
|
|
53
|
+
describe('Feature', () => {
|
|
54
|
+
it('should do X', () => { /* shape */ })
|
|
55
|
+
it('should handle Y', () => { /* shape */ })
|
|
56
|
+
})
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 2. Updated `validate-plan` Skill
|
|
60
|
+
**Location**: `~/.config/opencode/skills/validate-plan/SKILL.md`
|
|
61
|
+
|
|
62
|
+
Added validation checks for Layer 3 (section 1e):
|
|
63
|
+
- Program Design section exists
|
|
64
|
+
- File Map has at least 1 entry
|
|
65
|
+
- Type Signatures section has code block
|
|
66
|
+
- Call Stack Visualization has mermaid diagram
|
|
67
|
+
- Test Shapes section has at least 2 test signatures
|
|
68
|
+
|
|
69
|
+
Verdict: ❌ REJECTED if Layer 3 missing or incomplete.
|
|
70
|
+
|
|
71
|
+
### 3. Updated Global Plan Template
|
|
72
|
+
**Location**: `/home/zerwiz/CodeP/wayofmono/thoughts/global/templates/plan-template.md` (rewritten)
|
|
73
|
+
|
|
74
|
+
Complete rewrite including:
|
|
75
|
+
- Linked Ticket section
|
|
76
|
+
- Measurable Goal (from Ticket) section
|
|
77
|
+
- Program Design (Layer 3 — MANDATORY) section
|
|
78
|
+
- Phase 0: Vertical Slice Definition section
|
|
79
|
+
|
|
80
|
+
### 4. Integration with `ticket-executor`
|
|
81
|
+
**Location**: `~/.config/opencode/skills/ticket-executor/SKILL.md`
|
|
82
|
+
|
|
83
|
+
Phase 0 Validation Gate now also requires Layer 3 present; refuses to start if missing.
|
|
84
|
+
|
|
85
|
+
## Implementation Approach
|
|
86
|
+
|
|
87
|
+
Edited skills directly in opencode config (`~/.config/opencode/skills/`), then copied new skills to `command` project for MCP registration.
|
|
88
|
+
|
|
89
|
+
1. Edited `create-plan/SKILL.md`: Inserted Layer 3 section after Architecture, before Pre-Mortem; reordered so pre-mortem follows Layer 3
|
|
90
|
+
2. Edited `validate-plan/SKILL.md`: Added section 1e Layer 3 validation (REJECTED if missing/incomplete) + output format
|
|
91
|
+
3. Rewrote global `plan-template.md` at `CodeP/wayofmono/thoughts/global/templates/plan-template.md`: Full template with Linked Ticket, Measurable Goal, Layer 3, Phase 0
|
|
92
|
+
4. Edited `ticket-executor/SKILL.md`: Phase 0 gate now requires Layer 3 present
|
|
93
|
+
|
|
94
|
+
## Phases
|
|
95
|
+
|
|
96
|
+
- [x] Phase 1.1: Update create-plan skill template (1 day)
|
|
97
|
+
- [x] Phase 1.2: Update validate-plan skill validation (1 day)
|
|
98
|
+
- [x] Phase 1.3: Update global plan template (0.5 day)
|
|
99
|
+
- [x] Phase 1.4: Update ticket-executor Phase 0 gate (0.5 day)
|
|
100
|
+
- [x] Phase 1.5: Documentation (0.5 day)
|
|
101
|
+
|
|
102
|
+
## Success Criteria
|
|
103
|
+
|
|
104
|
+
### Automated Verification:
|
|
105
|
+
- [x] `create-plan` produces plans with Layer 3 section
|
|
106
|
+
- [x] `validate-plan` rejects plans without Layer 3 (section 1e)
|
|
107
|
+
- [x] `validate-plan` approves plans with complete Layer 3
|
|
108
|
+
- [x] `ticket-executor` Phase 0 gate blocks if Layer 3 missing
|
|
109
|
+
|
|
110
|
+
### Manual Verification:
|
|
111
|
+
- [ ] Layer 3 section guides implementation correctly
|
|
112
|
+
- [ ] Reviewers can verify file map, types, call stack, test shapes before code
|
|
113
|
+
|
|
114
|
+
## Acceptance Criteria
|
|
115
|
+
|
|
116
|
+
- [x] Every new plan created via `create-plan` has Layer 3 section
|
|
117
|
+
- [x] `validate-plan` blocks implementation if Layer 3 missing/incomplete
|
|
118
|
+
- [x] `ticket-executor` refuses to start if Layer 3 missing
|
|
119
|
+
- [ ] Measurable goal: 100% of plans in `command` project have Layer 3 within 30 days
|
|
120
|
+
- [ ] Rollback threshold: < 90% compliance triggers review
|
|
121
|
+
|
|
122
|
+
## Risk Assessment
|
|
123
|
+
|
|
124
|
+
| Risk | Likelihood | Impact | Mitigation |
|
|
125
|
+
|------|------------|--------|------------|
|
|
126
|
+
| Template breakage | Medium | High | Test with existing plans first |
|
|
127
|
+
| Validation too strict | Low | Medium | Allow iterative refinement |
|
|
128
|
+
| Resistance to new section | Medium | Low | Clear examples in template |
|
|
129
|
+
|
|
130
|
+
## References
|
|
131
|
+
|
|
132
|
+
- Research: `docs/agentic-engineering-workflow.md` (Layer 3 section)
|
|
133
|
+
- Dex Horthy interview: YouTube `xgkjtF89-44`
|
|
134
|
+
- Dylan Mulroy (Cloudflare): "A good plan ends with the tests and the call stack"
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Phase 2: Add Layer 4 (Vertical Slices) to ticket-executor Skill
|
|
2
|
+
|
|
3
|
+
**Project**: command (COM)
|
|
4
|
+
**Priority**: Critical
|
|
5
|
+
**Estimated Effort**: 5 days
|
|
6
|
+
**Measurable Goal**: `vertical_slice1_first:100%:validation_gate:30d:95%`
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Problem Statement
|
|
11
|
+
|
|
12
|
+
Models default to building **horizontally** — entire database layer → entire service layer → entire API → entire frontend — leaving **nothing testable until thousands of lines are done**. Dex Horthy: "I have never seen a model do this without a human telling it the order." The `ticket-executor` skill currently executes plans phase-by-phase but has no enforcement of **vertical slices** (thin end-to-end first).
|
|
13
|
+
|
|
14
|
+
## Current State
|
|
15
|
+
|
|
16
|
+
- `ticket-executor` skill at `.config/opencode/skills/ticket-executor/SKILL.md` executes phases sequentially
|
|
17
|
+
- Phases are arbitrary — no enforcement of "Slice 1 = tracer bullet (mock API → stub FE → wire → test)"
|
|
18
|
+
- `validate-implementation` checks automated verification, rules compliance, code review — but **does not verify vertical slice order**
|
|
19
|
+
|
|
20
|
+
## Requirements
|
|
21
|
+
|
|
22
|
+
### 1. Add Phase 0 to `ticket-executor`
|
|
23
|
+
**Phase 0: Vertical Slice Definition (MANDATORY, before any implementation)**
|
|
24
|
+
|
|
25
|
+
```markdown
|
|
26
|
+
## Phase 0: Vertical Slice Definition (MUST COMPLETE FIRST)
|
|
27
|
+
|
|
28
|
+
### Slice 1 (Tracer Bullet) — MUST BE FIRST
|
|
29
|
+
- Mock API endpoint: `POST /api/v1/feature`
|
|
30
|
+
- Stub frontend: minimal UI component
|
|
31
|
+
- Wire together: testable e2e path
|
|
32
|
+
- Success criteria: `curl` returns 200 + expected JSON
|
|
33
|
+
- **No horizontal work (DB layer, service layer, etc.) before Slice 1 passes**
|
|
34
|
+
|
|
35
|
+
### Subsequent Slices (in priority order)
|
|
36
|
+
- Slice 2: Add migrations + business logic
|
|
37
|
+
- Slice 3: Error handling + validation
|
|
38
|
+
- Slice 4: Polish + edge cases
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 2. Update `validate-implementation` Skill
|
|
42
|
+
Add validation gate:
|
|
43
|
+
- [ ] Phase 0 (Vertical Slice Definition) exists in plan
|
|
44
|
+
- [ ] Slice 1 defined with mock API + stub FE + wire + success criteria
|
|
45
|
+
- [ ] **First implementation phase targets Slice 1 only**
|
|
46
|
+
- [ ] Slice 1 passes e2e test before any horizontal expansion
|
|
47
|
+
- [ ] Measurable goal tracked per slice
|
|
48
|
+
|
|
49
|
+
### 3. Update `validate-plan` Skill
|
|
50
|
+
Add check: "Plan defines vertical slices with Slice 1 as tracer bullet"
|
|
51
|
+
|
|
52
|
+
## Implementation Approach
|
|
53
|
+
|
|
54
|
+
**Use MCP for all ticket/plan operations** — never hand-write markdown or git-push to f-rr-d. The MCP keeps DB row + canonical markdown + collision-safe numbering in sync.
|
|
55
|
+
|
|
56
|
+
1. **Edit `ticket-executor/SKILL.md`**: Insert Phase 0 before current phases; update workflow diagram
|
|
57
|
+
2. **Edit `validate-implementation/SKILL.md`**: Add vertical slice validation to Step 2 (Systematic Validation)
|
|
58
|
+
3. **Edit `validate-plan/SKILL.md`**: Add vertical slice check to Feasibility Check
|
|
59
|
+
4. **Test via MCP**: Execute plan with `implement_plan` skill, verify vertical slice gate via `validate_implementation`
|
|
60
|
+
5. **Update ticket via MCP**: `tickets_update` with phase completion status
|
|
61
|
+
|
|
62
|
+
## Phases
|
|
63
|
+
|
|
64
|
+
- [ ] Phase 2.1: Update ticket-executor skill with Phase 0 (1.5 days)
|
|
65
|
+
- [ ] Phase 2.2: Update validate-implementation with slice validation (1.5 days)
|
|
66
|
+
- [ ] Phase 2.3: Update validate-plan with slice check (0.5 day)
|
|
67
|
+
- [ ] Phase 2.4: Integration test with sample ticket (1 day)
|
|
68
|
+
- [ ] Phase 2.5: Update brief scaffold if needed (0.5 day)
|
|
69
|
+
|
|
70
|
+
## Success Criteria
|
|
71
|
+
|
|
72
|
+
### Automated Verification:
|
|
73
|
+
- [ ] `ticket-executor` requires Phase 0 before Phase 1
|
|
74
|
+
- [ ] `validate-implementation` fails if Slice 1 not testable e2e
|
|
75
|
+
- [ ] Horizontal work blocked until Slice 1 passes
|
|
76
|
+
|
|
77
|
+
### Manual Verification:
|
|
78
|
+
- [ ] First deliverable is always a thin end-to-end path
|
|
79
|
+
- [ ] No "database layer first" or "all services then API" patterns
|
|
80
|
+
|
|
81
|
+
## Acceptance Criteria
|
|
82
|
+
|
|
83
|
+
- [ ] Every executed plan has Phase 0 (Vertical Slice Definition)
|
|
84
|
+
- [ ] Slice 1 (tracer bullet) implemented and tested first
|
|
85
|
+
- [ ] Measurable goal: 100% of implementations start with vertical slice within 30 days
|
|
86
|
+
- [ ] Rollback threshold: < 95% compliance triggers process review
|
|
87
|
+
|
|
88
|
+
## Risk Assessment
|
|
89
|
+
|
|
90
|
+
| Risk | Likelihood | Impact | Mitigation |
|
|
91
|
+
|------|------------|--------|------------|
|
|
92
|
+
| Existing plans don't have slices | High | Medium | Migration script for in-flight plans |
|
|
93
|
+
| Slice 1 too vague | Medium | High | Template with concrete examples |
|
|
94
|
+
| Slowdown perception | High | Low | Measure: slice 1 typically < 2 hours |
|
|
95
|
+
|
|
96
|
+
## References
|
|
97
|
+
|
|
98
|
+
- Research: `docs/agentic-engineering-workflow.md` (Layer 4 section)
|
|
99
|
+
- Dex Horthy: "Models default to building horizontally... Vertical slice is thin and end-to-end"
|
|
100
|
+
- OpenClawDatabase: "Mock the API endpoint, stub the front end, wire them together, and only then add migrations, business logic and error handling"
|