okstra 0.1.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 (106) hide show
  1. package/README.md +36 -0
  2. package/bin/okstra +62 -0
  3. package/package.json +30 -0
  4. package/runtime/.gitkeep +0 -0
  5. package/runtime/BUILD.json +5 -0
  6. package/runtime/agents/SKILL.md +243 -0
  7. package/runtime/agents/TODO.md +168 -0
  8. package/runtime/agents/workers/claude-worker.md +106 -0
  9. package/runtime/agents/workers/codex-worker.md +179 -0
  10. package/runtime/agents/workers/gemini-worker.md +179 -0
  11. package/runtime/agents/workers/report-writer-worker.md +116 -0
  12. package/runtime/bin/okstra-central.sh +152 -0
  13. package/runtime/bin/okstra-codex-exec.sh +53 -0
  14. package/runtime/bin/okstra-error-log.py +295 -0
  15. package/runtime/bin/okstra-gemini-exec.sh +55 -0
  16. package/runtime/bin/okstra-token-usage.py +46 -0
  17. package/runtime/bin/okstra.sh +162 -0
  18. package/runtime/prompts/launch.template.md +52 -0
  19. package/runtime/prompts/profiles/error-analysis.md +43 -0
  20. package/runtime/prompts/profiles/final-verification.md +37 -0
  21. package/runtime/prompts/profiles/implementation-planning.md +85 -0
  22. package/runtime/prompts/profiles/implementation.md +71 -0
  23. package/runtime/prompts/profiles/requirements-discovery.md +43 -0
  24. package/runtime/python/lib/okstra/cli.sh +227 -0
  25. package/runtime/python/lib/okstra/globals.sh +157 -0
  26. package/runtime/python/lib/okstra/interactive.sh +411 -0
  27. package/runtime/python/lib/okstra/project-resolver.sh +57 -0
  28. package/runtime/python/lib/okstra/usage.sh +98 -0
  29. package/runtime/python/lib/okstra-ctl/cmd-batch.sh +59 -0
  30. package/runtime/python/lib/okstra-ctl/cmd-list.sh +35 -0
  31. package/runtime/python/lib/okstra-ctl/cmd-open.sh +36 -0
  32. package/runtime/python/lib/okstra-ctl/cmd-projects.sh +26 -0
  33. package/runtime/python/lib/okstra-ctl/cmd-reconcile.sh +27 -0
  34. package/runtime/python/lib/okstra-ctl/cmd-reindex.sh +38 -0
  35. package/runtime/python/lib/okstra-ctl/cmd-rerun.sh +326 -0
  36. package/runtime/python/lib/okstra-ctl/cmd-show.sh +27 -0
  37. package/runtime/python/lib/okstra-ctl/cmd-tail.sh +76 -0
  38. package/runtime/python/lib/okstra-ctl/main.sh +41 -0
  39. package/runtime/python/lib/okstra-ctl/prepare.sh +29 -0
  40. package/runtime/python/lib/okstra-ctl/usage.sh +23 -0
  41. package/runtime/python/okstra_ctl/__init__.py +125 -0
  42. package/runtime/python/okstra_ctl/backfill.py +253 -0
  43. package/runtime/python/okstra_ctl/batch.py +62 -0
  44. package/runtime/python/okstra_ctl/ids.py +84 -0
  45. package/runtime/python/okstra_ctl/index.py +216 -0
  46. package/runtime/python/okstra_ctl/invocation.py +49 -0
  47. package/runtime/python/okstra_ctl/jsonl.py +84 -0
  48. package/runtime/python/okstra_ctl/listing.py +156 -0
  49. package/runtime/python/okstra_ctl/locks.py +42 -0
  50. package/runtime/python/okstra_ctl/material.py +62 -0
  51. package/runtime/python/okstra_ctl/models.py +63 -0
  52. package/runtime/python/okstra_ctl/path_resolve.py +40 -0
  53. package/runtime/python/okstra_ctl/paths.py +251 -0
  54. package/runtime/python/okstra_ctl/project_meta.py +51 -0
  55. package/runtime/python/okstra_ctl/reconcile.py +166 -0
  56. package/runtime/python/okstra_ctl/render.py +1065 -0
  57. package/runtime/python/okstra_ctl/resolver.py +54 -0
  58. package/runtime/python/okstra_ctl/run.py +674 -0
  59. package/runtime/python/okstra_ctl/run_context.py +166 -0
  60. package/runtime/python/okstra_ctl/seeding.py +97 -0
  61. package/runtime/python/okstra_ctl/sequence.py +53 -0
  62. package/runtime/python/okstra_ctl/session.py +33 -0
  63. package/runtime/python/okstra_ctl/tmux.py +27 -0
  64. package/runtime/python/okstra_ctl/workers.py +64 -0
  65. package/runtime/python/okstra_ctl/workflow.py +182 -0
  66. package/runtime/python/okstra_project/__init__.py +41 -0
  67. package/runtime/python/okstra_project/resolver.py +126 -0
  68. package/runtime/python/okstra_project/state.py +170 -0
  69. package/runtime/python/okstra_token_usage/__init__.py +26 -0
  70. package/runtime/python/okstra_token_usage/blocks.py +62 -0
  71. package/runtime/python/okstra_token_usage/claude.py +97 -0
  72. package/runtime/python/okstra_token_usage/cli.py +84 -0
  73. package/runtime/python/okstra_token_usage/codex.py +80 -0
  74. package/runtime/python/okstra_token_usage/collect.py +161 -0
  75. package/runtime/python/okstra_token_usage/gemini.py +77 -0
  76. package/runtime/python/okstra_token_usage/jsonl_io.py +18 -0
  77. package/runtime/python/okstra_token_usage/paths.py +22 -0
  78. package/runtime/python/okstra_token_usage/pricing.py +71 -0
  79. package/runtime/python/okstra_token_usage/report.py +64 -0
  80. package/runtime/templates/prd/brief.template.md +273 -0
  81. package/runtime/templates/project-docs/task-index.template.md +65 -0
  82. package/runtime/templates/reports/error-analysis-input.template.md +80 -0
  83. package/runtime/templates/reports/final-report.template.md +167 -0
  84. package/runtime/templates/reports/final-verification-input.template.md +67 -0
  85. package/runtime/templates/reports/implementation-input.template.md +81 -0
  86. package/runtime/templates/reports/implementation-planning-input.template.md +93 -0
  87. package/runtime/templates/reports/quick-input.template.md +64 -0
  88. package/runtime/templates/reports/schedule.template.md +168 -0
  89. package/runtime/templates/reports/settings.template.json +101 -0
  90. package/runtime/templates/reports/task-brief.template.md +165 -0
  91. package/runtime/validators/lib/common.sh +44 -0
  92. package/runtime/validators/lib/fixtures.sh +322 -0
  93. package/runtime/validators/lib/paths.sh +44 -0
  94. package/runtime/validators/lib/runners.sh +140 -0
  95. package/runtime/validators/lib/summary.sh +15 -0
  96. package/runtime/validators/lib/validate-assets.sh +44 -0
  97. package/runtime/validators/lib/validate-prompt-metadata.sh +267 -0
  98. package/runtime/validators/lib/validate-tasks.sh +335 -0
  99. package/runtime/validators/validate-run.py +568 -0
  100. package/runtime/validators/validate-schedule.py +665 -0
  101. package/runtime/validators/validate-workflow.sh +190 -0
  102. package/src/doctor.mjs +127 -0
  103. package/src/install.mjs +355 -0
  104. package/src/paths.mjs +132 -0
  105. package/src/uninstall.mjs +122 -0
  106. package/src/version.mjs +20 -0
@@ -0,0 +1,168 @@
1
+ # <Title> — Work Schedule
2
+
3
+ > Generated: <YYYY-MM-DD HH:MM> | Project: <project-id> | Task Group: <task-group>
4
+ > Source: okstra <mode> (<N> tasks included, <M> done excluded)
5
+
6
+ ---
7
+
8
+ ## At a Glance
9
+
10
+ **총 <N>개 task / 예상 소요: <X.X> ~ <Y.Y> days (Effort 합산)**
11
+
12
+ | # | Task ID | Title | Category | Priority | Effort | Days | taskType | Risk | Phase |
13
+ |---|---------|-------|----------|----------|--------|------|----------|------|-------|
14
+ | 1 | <TASK-ID> | <Title> | <category> | <P0~P3> | <S/M/L/XL> | <range> | <taskType> | <risk> | <1/2/3> |
15
+
16
+ **Effort 분포**: S × <n> / M × <n> / L × <n> / XL × <n>
17
+ **Risk 분포**: Very Low × <n> / Low × <n> / Medium × <n> / Med-High × <n> / High × <n>
18
+ **Repo별 영향**: <repo1> (<n>) / <repo2> (<n>)
19
+
20
+ ---
21
+
22
+ ## Executive Summary
23
+
24
+ <2~4 문장 — Phase 분류 요약 + 진행 전략>
25
+
26
+ - **Phase 1 (Critical Fixes)**: <n>개 task — <summary>
27
+ - **Phase 2 (Enhancements)**: <n>개 task — <summary>
28
+ - **Phase 3 (Architecture)**: <n>개 task — <summary>
29
+
30
+ ### Effort Sizing 기준
31
+
32
+ | Size | 기준 | Day(s) |
33
+ |------|------|--------|
34
+ | **S** | 1-2 files, 1 repo, 테스트 수정만, DB 변경 없음 | 0.5 - 1 |
35
+ | **M** | 3-5 files, 1 repo, 신규 테스트 포함, DB 변경 없음 | 2 - 3 |
36
+ | **L** | 5-15 files, 2-3 repos, 순차 배포, 패키지 릴리스 포함 가능 | 3 - 5 |
37
+ | **XL** | 15+ files, 3+ repos + infra, frontend 동시 변경, 아키텍처 전환 | 5 - 10 |
38
+ | **XXL** | 작업 더 세분화 필요 | 10 - |
39
+
40
+ ---
41
+
42
+ ## Task Dependency Graph
43
+
44
+ <!-- Use ONE of:
45
+ (A) literal `_의존 정보 없음_` when no edges exist;
46
+ (B) plain ``` fenced adjacency-list block — see SKILL §"Section: Task Dependency Graph".
47
+ Example (B):
48
+ ```
49
+ DEV-1 -> DEV-2, DEV-3
50
+ DEV-2 -> DEV-4
51
+ ```
52
+ Mermaid / PlantUML / Graphviz / Unicode '→' are all forbidden. -->
53
+ _의존 정보 없음_
54
+
55
+ ---
56
+
57
+ ## Gantt Chart
58
+
59
+ <!-- OPTIONAL: include only when per-task day estimates are available.
60
+ If included, MUST use this exact heading literal `## Gantt Chart`.
61
+ Render as ASCII inside a fenced ``` block with NO language tag.
62
+ Mermaid / PlantUML / Graphviz are forbidden — see SKILL §"ASCII Gantt format".
63
+ The axis is RELATIVE DAY-COUNTS (Day 1 / J1, …) — never calendar dates. -->
64
+
65
+ ```
66
+ Day: 1 5 10 15 20 25 30
67
+ | | | | | | |
68
+ Phase 1
69
+ <TASK-ID> (<size>) ██████ ! crit
70
+ <TASK-ID> (<size>) ████████
71
+ Phase 2
72
+ <TASK-ID> (<size>) ██████░░ est
73
+ Phase 3
74
+ <TASK-ID> (<size>) ████ (after <TASK-ID>)
75
+ ```
76
+
77
+ > 가로축은 **상대 일수** (Day 1 시작 = Phase 1 시작). 오늘 날짜·요일·달력일자 사용 금지.
78
+ > 임계 경로(critical path) 항목은 `! crit` 주석, 추정 배분은 `est` 주석으로 표기.
79
+ > 막대는 `█`(확정) + `░`(상한/불확실) 조합. 단일 mid-point bar 도 허용.
80
+ > 데이터가 없어 이 섹션을 생략할 때는, `## Gantt Chart` 헤딩과 ASCII 블록 전체를
81
+ > 다음 한 줄 blockquote로 대체한다 (SKILL §"MUST — emit a skip-reason note" 참조):
82
+ > `> _Gantt Chart 생략: <구체 사유 — 예: "단일 task (DEV-9187) + XL effort 5–15d 범위로 정밀 day 추정 부재."_`
83
+
84
+ ---
85
+
86
+ ## Phase 1: Critical Fixes
87
+
88
+ ### 1-1. <TASK-ID> — <Title>
89
+
90
+ | Item | Detail |
91
+ |------|--------|
92
+ | **Category** | <category> |
93
+ | **Priority** | <P0~P3> |
94
+ | **Effort** | **<S/M/L/XL>** (<scope summary>) |
95
+ | **Status** | <workStatus + currentPhase summary> |
96
+ | **Risk** | <risk> |
97
+ | **Scope** | <files / repos summary> |
98
+ | **Repo** | <repos> |
99
+
100
+ **Problem**: <…>
101
+
102
+ **Solution**: <…>
103
+
104
+ **Work Breakdown**:
105
+
106
+ | Step | File | Action | Detail |
107
+ |------|------|--------|--------|
108
+ | 1 | <path> | CREATE/MODIFY/VERIFY | <detail> |
109
+
110
+ **Verification Commands**:
111
+ ```bash
112
+ <commands>
113
+ ```
114
+
115
+ **Rollback**: <…>
116
+
117
+ ---
118
+
119
+ ## Phase 2: Enhancements
120
+
121
+ _없음_ <!-- or repeat per-task block -->
122
+
123
+ ---
124
+
125
+ ## Phase 3: Architecture
126
+
127
+ _없음_ <!-- or repeat per-task block -->
128
+
129
+ ---
130
+
131
+ ## Execution Priority Matrix
132
+
133
+ | Priority | Task | Effort | Risk | Next Action |
134
+ |----------|------|--------|------|-------------|
135
+
136
+ ---
137
+
138
+ ## Cross-Task Dependencies & Shared Concerns
139
+
140
+ <free-form prose — inter-task overlap, shared packages, release order>
141
+
142
+ ---
143
+
144
+ ## Risk Mitigation Strategy
145
+
146
+ 1. <…>
147
+ 2. <…>
148
+
149
+ ---
150
+
151
+ ## Recommended Immediate Actions
152
+
153
+ - <action>
154
+ - <action>
155
+
156
+ <!-- OPTIONAL: ## Glossary
157
+ Include ONLY when the body uses opaque codes (FC-N, UC-N, M-N, ...).
158
+ Header literal `| Code | Description |` is required. Every code in body
159
+ MUST have a row. Decision-item letters (A1, B2, C3, D4) are forbidden
160
+ even with a glossary entry — they belong only in internal reports.
161
+
162
+ ## Glossary
163
+
164
+ | Code | Description |
165
+ |------|-------------|
166
+ | FC-5 | 결제 게이트웨이 타임아웃 처리 누락 |
167
+ -->
168
+
@@ -0,0 +1,101 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Read",
5
+ "Glob",
6
+ "Grep",
7
+ "LS",
8
+ "NotebookRead",
9
+ "NotebookEdit",
10
+ "Edit",
11
+ "Write",
12
+ "WebFetch",
13
+ "WebSearch",
14
+ "TodoWrite",
15
+ "Bash(git:*)",
16
+ "Bash(gh:*)",
17
+ "Bash(ls:*)",
18
+ "Bash(cat:*)",
19
+ "Bash(head:*)",
20
+ "Bash(tail:*)",
21
+ "Bash(wc:*)",
22
+ "Bash(jq:*)",
23
+ "Bash(yq:*)",
24
+ "Bash(rg:*)",
25
+ "Bash(grep:*)",
26
+ "Bash(find:*)",
27
+ "Bash(mkdir:*)",
28
+ "Bash(cp:*)",
29
+ "Bash(mv:*)",
30
+ "Bash(rm:*)",
31
+ "Bash(diff:*)",
32
+ "Bash(awk:*)",
33
+ "Bash(sed:*)",
34
+ "Bash(tr:*)",
35
+ "Bash(sort:*)",
36
+ "Bash(uniq:*)",
37
+ "Bash(xargs:*)",
38
+ "Bash(python3:*)",
39
+ "Bash(python:*)",
40
+ "Bash(pip3:*)",
41
+ "Bash(pip:*)",
42
+ "Bash(uv:*)",
43
+ "Bash(poetry:*)",
44
+ "Bash(pytest:*)",
45
+ "Bash(bash:*)",
46
+ "Bash(sh:*)",
47
+ "Bash(printf:*)",
48
+ "Bash(echo:*)",
49
+ "Bash(export:*)",
50
+ "Bash(env:*)",
51
+ "Bash(test:*)",
52
+ "Bash(true:*)",
53
+ "Bash(false:*)",
54
+ "Bash(true)",
55
+ "Bash(false)",
56
+ "Bash(codex:*)",
57
+ "Bash(codex exec:*)",
58
+ "Bash($HOME/.okstra/bin/okstra-codex-exec.sh:*)",
59
+ "Bash(gemini:*)",
60
+ "Bash($HOME/.okstra/bin/okstra-gemini-exec.sh:*)",
61
+ "Bash(claude:*)",
62
+ "Bash(chmod:*)",
63
+ "Bash(node:*)",
64
+ "Bash(npm:*)",
65
+ "Bash(npx:*)",
66
+ "Bash(pnpm:*)",
67
+ "Bash(yarn:*)",
68
+ "Bash(tsc:*)",
69
+ "Bash(go:*)",
70
+ "Bash(cargo:*)",
71
+ "Bash(rustc:*)",
72
+ "Bash(java:*)",
73
+ "Bash(javac:*)",
74
+ "Bash(mvn:*)",
75
+ "Bash(gradle:*)",
76
+ "Bash(./gradlew:*)",
77
+ "Bash(make:*)",
78
+ "Bash(docker:*)",
79
+ "Bash(docker compose:*)",
80
+ "Bash(docker-compose:*)",
81
+ "Bash(kubectl:*)",
82
+ "Bash(helm:*)",
83
+ "Bash(curl:*)",
84
+ "Bash(wget:*)",
85
+ "mcp__test-context7__resolve-library-id",
86
+ "mcp__test-context7__query-docs",
87
+ "mcp__mysql-fontsninja-common__mysql_list_tables",
88
+ "mcp__mysql-fontsninja-common__mysql_describe_table",
89
+ "mcp__mysql-fontsninja-common__mysql_select_data",
90
+ "mcp__mysql-fontsninja-fontradar__mysql_list_tables",
91
+ "mcp__mysql-fontsninja-fontradar__mysql_describe_table",
92
+ "mcp__mysql-fontsninja-fontradar__mysql_select_data",
93
+ "mcp__mysql-fontsninja-fontsninja__mysql_list_tables",
94
+ "mcp__mysql-fontsninja-fontsninja__mysql_describe_table",
95
+ "mcp__mysql-fontsninja-fontsninja__mysql_select_data",
96
+ "mcp__mysql-fontsninja-fonthelper__mysql_list_tables",
97
+ "mcp__mysql-fontsninja-fonthelper__mysql_describe_table",
98
+ "mcp__mysql-fontsninja-fonthelper__mysql_select_data"
99
+ ]
100
+ }
101
+ }
@@ -0,0 +1,165 @@
1
+ # OKSTRA Task Brief
2
+
3
+ ## Identity
4
+
5
+ - Brief Title:
6
+ - Project ID:
7
+ - Task Group:
8
+ - Task ID:
9
+ - Task Key: `<project-id>:<task-group>:<task-id>`
10
+ - Related Tasks:
11
+ - Issue / Ticket:
12
+ - Task Type:
13
+ - Requested Outcome:
14
+ - Owner:
15
+
16
+ ## Request Summary
17
+
18
+ - What is being requested or changed?
19
+ - Why is this work being started now?
20
+ - Is this a new task, a continuation, or a reopened task?
21
+ - What decision should this run help make?
22
+
23
+ ## Current Context
24
+
25
+ - Current behavior or state:
26
+ - Desired behavior or outcome:
27
+ - Existing related implementation:
28
+ - Related code paths:
29
+ - Existing documents, tickets, or prior reports:
30
+
31
+ ## Evidence and Source Materials
32
+
33
+ - Primary problem statement:
34
+ - Existing analysis or notes:
35
+ - Related raw samples or logs:
36
+ - Screenshots or reports:
37
+ - Previous reports in the same task history:
38
+
39
+ ## Task-Type Focus
40
+
41
+ - If `Task Type` is `requirements-discovery`:
42
+ - What classification or routing uncertainty must be resolved?
43
+ - Why might this be a bugfix, feature, refactor, or ops task?
44
+ - What evidence still blocks confident phase selection?
45
+ - If `Task Type` is `error-analysis`:
46
+ - What is the visible symptom?
47
+ - What are the expected vs actual results?
48
+ - What are the current hypotheses and missing evidence?
49
+ - If `Task Type` is `implementation-planning`:
50
+ - What implementation options are under consideration?
51
+ - What trade-offs, dependencies, or migrations matter?
52
+ - What validation and rollback approach is expected?
53
+ - If `Task Type` is `implementation`:
54
+ - Which approved `implementation-planning` final report authorises this run, and where is the explicit user-approval marker quoted?
55
+ - What is the authoritative file list and step order copied from that plan?
56
+ - Which validation, TDD, and rollback commands must be executed and recorded with actual output?
57
+ - If `Task Type` is `final-verification`:
58
+ - What was delivered?
59
+ - What acceptance criteria must pass?
60
+ - What residual risks or blockers remain?
61
+
62
+ ## Constraints and Risks
63
+
64
+ - Business constraints:
65
+ - Technical constraints:
66
+ - Delivery constraints:
67
+ - Approval or review checkpoints:
68
+ - Known risks:
69
+ - Things that are still uncertain:
70
+
71
+ ## Out of Scope
72
+
73
+ - Adjacent areas deliberately excluded from this run:
74
+ - Items that look related but must be handled in a separate task:
75
+ - Reason for exclusion (deadline, risk, separate owner, distinct decision):
76
+
77
+ > Workers MUST NOT expand into items listed here. If a worker believes an excluded item must be addressed to satisfy the requirement, the worker records it as a recommended follow-up task in the final report and stops — it does not silently include the work. If this section is left empty, workers treat any change beyond what `Request Summary` and `Current Context` explicitly demand as out of scope by default.
78
+
79
+ ## Configuration References and Expected Values
80
+
81
+ - Which config files matter for this task?
82
+ - Which current or observed values should be checked?
83
+ - Which expected values or invariants must hold for this task?
84
+ - Which values are still uncertain and must be confirmed?
85
+
86
+ ## Deployment Manifests and Expected Values
87
+
88
+ - Which deployment manifests matter for this task?
89
+ - Which expected image / env / resource / routing values must hold?
90
+ - Which rollout or deployment invariants must be preserved?
91
+ - Which deployment-side values are still uncertain and must be confirmed?
92
+
93
+ ## Questions for Workers
94
+
95
+ 1.
96
+ 2.
97
+ 3.
98
+
99
+ ### Standing Scope-Discipline Questions (always answered by every worker)
100
+
101
+ - Which adjacent changes did you consider and **deliberately exclude** from this run? List each with a one-line reason.
102
+ - Did any part of your output go beyond what `Request Summary` and `Out of Scope` define for this run? If yes, move it to a `Recommended Follow-up Tasks` section and remove it from the main answer.
103
+
104
+ ## Expected Outputs
105
+
106
+ - Root cause candidates / plan options / final blockers:
107
+ - Missing information:
108
+ - Risks:
109
+ - Recommended next actions:
110
+
111
+ ## Task Continuity Notes
112
+
113
+ - Should the same task key continue to be used after this run?
114
+ - What is the likely work category for this task right now?
115
+ - Which lifecycle phase should probably happen next after this run?
116
+ - What prior decision or report should Claude compare against?
117
+ - What related tasks should Claude keep in mind but not merge with this task?
118
+ - Which config files and deployment manifests carry the expected state for this task?
119
+
120
+ ## Phase Boundary
121
+
122
+ - This okstra run executes the lifecycle phase named in `Task Type` and stops there. Outputs that belong to any other phase MUST NOT be produced inside this run.
123
+ - Allowed and forbidden actions for each task type are listed in `Lifecycle Phase Boundaries` of the okstra skill (`agents/SKILL.md`). The lead and every worker stay inside that boundary.
124
+ - "다음 단계 진행해" or any equivalent user phrase is interpreted as "complete the remaining outputs of the current phase," never as "start the next lifecycle phase." The next phase begins only via a fresh okstra invocation with the new `--task-type`.
125
+ - For `implementation-planning` specifically: produce a plan document with the sections listed in `okstra-implementation-planning-input.template.md` `## Required Plan Deliverable`. Do not edit project source code, run builds/migrations/deployments, or write artifacts outside the run's own directories.
126
+ - For `implementation` specifically: edits are bounded by the approved plan's file list (the `--approved-plan` reference). The run MUST refuse to start if the approved plan path is missing or has no explicit user-approval marker. `git push`, publish, deploy, real migrations, and any third-party write API call remain forbidden; only local `git add`/`git commit` are allowed. Verifier roles stay read-only — they record fix recommendations rather than applying edits — and acceptance verdicts belong to `final-verification`, not this phase.
127
+
128
+ ## Available MCP Servers
129
+
130
+ The following MCP servers are registered at the user scope and may be invoked **as needed** during this run by Claude lead, Claude worker, and Report writer worker. The lead is responsible for forwarding this section verbatim into the worker prompts (Phase 2) so workers know they are allowed to call these tools.
131
+
132
+ | Server | Backing data | Mode | Typical use |
133
+ |--------|--------------|------|-------------|
134
+ | `mcp__mysql-fontsninja-common` | local Docker MySQL `common` schema | read-only | shared lookups, code list, reference data |
135
+ | `mcp__mysql-fontsninja-fontradar` | local Docker MySQL `fontradar` schema | read-only | fontradar service data inspection |
136
+ | `mcp__mysql-fontsninja-fontsninja` | local Docker MySQL `fontsninja` schema | read-only | fontsninja service data inspection |
137
+ | `mcp__mysql-fontsninja-fonthelper` | local Docker MySQL `fonthelper` schema | read-only | fonthelper service data inspection |
138
+
139
+ Available tools per server (all read-only — write tools are disabled at the server):
140
+
141
+ - `mysql_list_tables`
142
+ - `mysql_describe_table`
143
+ - `mysql_select_data`
144
+
145
+ How to invoke (worker-by-worker):
146
+
147
+ - **Claude lead / Claude worker / Report writer worker**: invoke the MCP tool **directly by its tool name** (e.g. `mcp__mysql-fontsninja-fontsninja__mysql_list_tables`) through the host's tool interface. **Do NOT call it via `Bash`** — these names are MCP tools, not shell commands; running them in a shell will always fail with `command not found` regardless of permission settings.
148
+ - **Codex worker / Gemini worker**: invoke through the external CLI's own MCP transport (e.g. `codex mcp call <server> <tool> <args>` for Codex CLI; the equivalent Gemini CLI MCP invocation for Gemini). If the worker's CLI has no matching MCP config, treat the server as unavailable for this run and record `MCP not available in this CLI` in `Missing Information or Assumptions` — do **not** attempt a shell fallback such as `mysql -h ...` or piping a tool name into `bash`.
149
+ - All workers: cite the exact server, tool, and SELECT (or `WHERE` filters) used in the result file. Tool-call failures must be logged in the worker's `*-errors.json` (commandKind `mcp_call`) so the lead can decide whether to retry under a different worker.
150
+
151
+ Usage policy:
152
+
153
+ - **Allowed phases**: `requirements-discovery`, `error-analysis`, `implementation-planning`, `final-verification`. Use only when local schema/data evidence improves the answer. Always cite the server, table, and the SELECT used as evidence in worker output.
154
+ - **`implementation` phase**: read-only MCP queries are permitted as cross-checks; MCP MUST NOT be used as a write path even if a write tool becomes available — schema/data mutations belong in the codebase migration files reviewed by humans.
155
+ - **External CLI workers (Codex, Gemini)**: can use these MCP servers ONLY if their CLI's own MCP configuration is set up to mirror the same servers. If not configured, the worker should record `MCP not available in this CLI` in `Missing Information or Assumptions` rather than guessing.
156
+ - **Forbidden**: connecting to non-listed databases, running anything that mutates state (server is read-only — flagged write attempts are a contract violation), persisting query results outside the run's own artifact directories.
157
+ - **Limits**: `maxRows: 1000` per query (server-enforced). For larger scans, page via `WHERE` predicates and document the strategy.
158
+
159
+ If MCP evidence contradicts a claim sourced from documentation, code, or prior reports, flag the conflict explicitly in the final report and prefer the live MCP evidence unless the brief says otherwise.
160
+
161
+ ## Notes for Main Claude
162
+
163
+ - Which workers should be used?
164
+ - Should all workers receive the same brief or different emphasis?
165
+ - What should the final synthesis optimize for?
@@ -0,0 +1,44 @@
1
+ # shellcheck shell=bash
2
+
3
+ step() {
4
+ printf '\n[STEP] %s\n' "$1"
5
+ }
6
+
7
+ pass() {
8
+ printf '[PASS] %s\n' "$1"
9
+ }
10
+
11
+ fail() {
12
+ printf '[FAIL] %s\n' "$1" >&2
13
+ exit 1
14
+ }
15
+
16
+ on_error() {
17
+ fail "Unexpected error at line $1"
18
+ }
19
+
20
+ require_file() {
21
+ local target_path="$1"
22
+
23
+ if [[ ! -f "$target_path" ]]; then
24
+ fail "Expected file not found: $target_path"
25
+ fi
26
+ }
27
+
28
+ assert_contains() {
29
+ local target_path="$1"
30
+ local expected_text="$2"
31
+
32
+ if ! grep -F -- "$expected_text" "$target_path" >/dev/null 2>&1; then
33
+ fail "Expected to find [$expected_text] in $target_path"
34
+ fi
35
+ }
36
+
37
+ assert_not_contains() {
38
+ local target_path="$1"
39
+ local unexpected_text="$2"
40
+
41
+ if grep -F -- "$unexpected_text" "$target_path" >/dev/null 2>&1; then
42
+ fail "Did not expect to find [$unexpected_text] in $target_path"
43
+ fi
44
+ }