okstra 0.117.0 → 0.118.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.
@@ -1,6 +1,6 @@
1
1
  # Okstra — 폴더 구조 및 기능 요약
2
2
 
3
- > 현재 저장소 기준의 living map입니다. 빠른 사용법은 [`README.kr.md`](../README.kr.md), 내부 실행 계약은 [`docs/kr/architecture.md`](kr/architecture.md), CLI 세부 옵션은 [`docs/kr/cli.md`](kr/cli.md)를 함께 보세요.
3
+ > 현재 저장소 기준의 living map입니다. 빠른 사용법은 [`README.md`](../README.md), 내부 실행 계약은 [`docs/architecture.md`](architecture.md), 저장 구조는 [`docs/architecture/storage-model.md`](architecture/storage-model.md), CLI 세부 옵션은 [`docs/cli.md`](cli.md)를 함께 보세요.
4
4
 
5
5
  ---
6
6
 
@@ -54,19 +54,21 @@ okstra/
54
54
  │ ├── okstra_vendor/ vendored Jinja2 / MarkupSafe + graphify / networkx (okstra-graphify skill)
55
55
  │ ├── lib/okstra/ Bash helpers for okstra.sh
56
56
  │ └── lib/okstra-ctl/ Bash control-center subcommands
57
- ├── skills/ Claude Code skills (10)
57
+ ├── skills/ Claude Code skills (11)
58
58
  ├── agents/ lead SKILL.md + worker agent specs
59
59
  ├── prompts/ launch template, phase profiles, wizard prompt JSON
60
60
  ├── schemas/ JSON schema for final-report data.json
61
61
  ├── templates/ report, setup, PR, project-doc templates/assets
62
62
  ├── validators/ run / brief / schedule / view validators
63
63
  ├── tools/build.mjs source → runtime sync
64
+ ├── tools/docs_publication/ public-manual publication pipeline (build-time only; not shipped)
65
+ ├── config/docs-publication.json publication inventory: every tracked Markdown path + classification
64
66
  ├── runtime/ generated install payload; do not edit directly
65
67
  ├── tests/ pytest unit suite
66
68
  ├── tests-e2e/ Bash end-to-end scenarios
67
69
  ├── docs/ architecture, CLI, plans/specs
68
70
  ├── package.json npm metadata and published file list
69
- ├── README.md / README.kr.md user manuals
71
+ ├── README.md public user manual
70
72
  ├── CHANGES.md / CHANGELOG.md human-authored and generated changelogs
71
73
  └── RELEASING.md release process
72
74
  ```
@@ -84,9 +86,13 @@ okstra/
84
86
  - `bin/`
85
87
  - `src/`
86
88
  - `runtime/`
87
- - `docs/`
89
+ - `docs/architecture.md`
90
+ - `docs/architecture/`
91
+ - `docs/cli.md`
92
+ - `docs/container.md`
93
+ - `docs/performance-improvement-plan-v2.md`
94
+ - selected contributor, follow-up, AI, and task-process documentation paths
88
95
  - `README.md`
89
- - `README.kr.md`
90
96
 
91
97
  So `runtime/` is not the only npm-published content. It is the install payload copied into `~/.okstra`.
92
98
 
@@ -142,7 +148,7 @@ Runtime/install asset changes follow this checklist:
142
148
 
143
149
  `bin/okstra` is a thin dynamic-import router. Every command module exports `run(args) -> Promise<number>` or a named install/uninstall runner.
144
150
 
145
- `src/` is layered: the dispatch table (`src/cli-registry.mjs`) stays at the root, shared infrastructure with no command export lives under `src/lib/`, and command modules are grouped by domain under `src/commands/{lifecycle,execute,inspect,report,memory}/`.
151
+ `src/` is layered: the dispatch table (`src/cli-registry.mjs`) stays at the root, shared infrastructure with no command export lives under `src/lib/`, and command modules are grouped by domain under `src/commands/{lifecycle,execute,inspect,report,memory,pr}/`.
146
152
 
147
153
  | Command | Module | Role |
148
154
  |---|---|---|
@@ -175,6 +181,7 @@ Runtime/install asset changes follow this checklist:
175
181
  | `token-usage` | `src/commands/execute/token-usage.mjs` | Wrap installed Python token usage CLI |
176
182
  | `spawn-followups`, `error-log` | `src/commands/execute/*.mjs` | Follow-up task bundle creation and run error-log append helpers |
177
183
  | `memory` | `src/commands/memory/memory.mjs` | Store/find global conversation memory under `~/.okstra/memory-book` |
184
+ | `pr` | `src/commands/pr/pr.mjs` | `okstra pr <template\|branches\|gen>` — PR body template store under `~/.okstra/template/pr/` (bundled fallback `src/commands/pr/default.md`), base-branch recommendation, and the `gen` JSON bundle (template + `<base>..HEAD` commits + `<base>...HEAD` diffstat) backing the okstra-pr-gen skill. Git-only; no project registration required |
178
185
  | `recap` | `src/commands/inspect/recap.mjs` | `okstra recap <assemble\|record>` Node wrapper backing the okstra-inspect `recap` facet |
179
186
  | `rollup` | `src/commands/inspect/rollup.mjs` | `okstra rollup` thin shim into `scripts/okstra_ctl/rollup.py` — read-only cross-task roll-up backing the okstra-rollup skill |
180
187
  | `container` | `src/commands/inspect/container.mjs` | `bin okstra container` thin shim into `scripts/okstra_ctl/container.py` for the okstra-container-build skill |
@@ -313,7 +320,7 @@ Optional (v1.0 하위호환) 최상위 키:
313
320
 
314
321
  ### 4.10 `skills/`
315
322
 
316
- 9 user-facing skills (the only skills `okstra install` copies):
323
+ 11 user-facing skills (the only skills `okstra install` copies). The list SSOT is `USER_SKILL_NAMES` in `src/lib/skill-catalog.mjs`; the Claude plugin manifest and the installer both derive from it:
317
324
 
318
325
  | Skill | User-invocable | Role |
319
326
  |---|---:|---|
@@ -324,6 +331,8 @@ Optional (v1.0 하위호환) 최상위 키:
324
331
  | `okstra-rollup` | yes | Cross-task roll-up — aggregate runs/time/errors across a task-group (or whole project) and synthesize a digest from the report files |
325
332
  | `okstra-schedule` | yes | Generate task-group schedule |
326
333
  | `okstra-container-build` | yes | Non-linear deploy tool — deploy a verified task's code as a docker compose group and watch each container (sub-commands `up` / `status` / `logs` / `stop-watcher` / `down`) |
334
+ | `okstra-graphify` | yes | Knowledge graph over the project's own `.okstra/` memory — final reports, `decisions/*.md`, `glossary.md`; scope restricted to `.okstra/`, output under `.okstra/graph/` (sub-commands `build` / `query` / `path` / `explain` / `mcp` / `wiki`) |
335
+ | `okstra-pr-gen` | yes | Register PR body templates under `~/.okstra/template/pr/` and generate a PR description from a branch diff (drives `okstra pr template` / `branches` / `gen`). **Global skill** — needs a Git repo, not `<PROJECT_ROOT>/.okstra/project.json` |
327
336
  | `okstra-manager` | yes | Coordinate cross-project okstra tasks through manager-owned plans, assignments, sync snapshots, status, and child launch context packets |
328
337
  | `okstra-setup` | yes | Install/check runtime and register project |
329
338
 
@@ -488,11 +497,13 @@ Final report artifacts live under `runs/<task-type>/reports/`. Human responses f
488
497
 
489
498
  When changing code, keep these docs in sync:
490
499
 
491
- - New Node command: update `bin/okstra` usage, `README*`, this file, and `docs/kr/cli.md`.
500
+ - New Node command: update `bin/okstra` usage, `README.md`, this file, and `docs/cli.md`.
492
501
  - New runtime source copied to users: update `tools/build.mjs`, install/uninstall manifests if applicable, and this file.
493
- - New skill/agent: update `README*`, this file, install/uninstall fallback lists, and `CHANGES.md`.
502
+ - New skill/agent: update `README.md`, this file, install/uninstall fallback lists, and `CHANGES.md`.
494
503
  - New report field/section: update schema, template, report-writer worker, validator tests, this file's report model if user-visible.
495
- - New phase/profile behavior: update `prompts/profiles/*`, `docs/kr/architecture.md`, `docs/kr/cli.md`, and `README*` if user-facing.
504
+ - New phase/profile behavior: update `prompts/profiles/*`, `docs/architecture.md`, `docs/cli.md`, and `README.md` if user-facing.
505
+
506
+ `README.md`, `docs/cli.md`, `docs/architecture.md`, `docs/architecture/storage-model.md`, `docs/container.md`, and `docs/performance-improvement-plan-v2.md` are `translated` outputs in `config/docs-publication.json` — do **not** hand-edit them. Author the Korean source under the maintainer's Git-ignored `.project-docs/ko-source/`, then run the publication pipeline (`python3 -m tools.docs_publication prepare|validate|apply|record`), which keeps the source/output hashes in `.project-docs/doc-publishing/state.json` in step. Files classified `pending` — including this one, `CHANGES.md`, and `CHANGELOG.md` — are edited directly.
496
507
 
497
508
  ---
498
509
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "okstra",
3
- "version": "0.117.0",
3
+ "version": "0.118.0",
4
4
  "description": "Multi-agent cross-verification orchestrator runtime + Claude Code skills.",
5
5
  "license": "MIT",
6
6
  "author": "devonshin",
@@ -16,14 +16,18 @@
16
16
  "bin/",
17
17
  "src/",
18
18
  "runtime/",
19
+ "docs/architecture.md",
20
+ "docs/architecture/",
21
+ "docs/cli.md",
22
+ "docs/container.md",
19
23
  "docs/contributor-change-matrix.md",
24
+ "docs/follow-ups/2026-07-10-final-report-option-3.md",
20
25
  "docs/for-ai/",
21
- "docs/kr/",
26
+ "docs/performance-improvement-plan-v2.md",
22
27
  "docs/pr-template-usage.md",
23
28
  "docs/project-structure-overview.md",
24
29
  "docs/task-process/",
25
- "README.md",
26
- "README.kr.md"
30
+ "README.md"
27
31
  ],
28
32
  "engines": {
29
33
  "node": ">=18"
@@ -31,9 +35,10 @@
31
35
  "scripts": {
32
36
  "build": "node tools/build.mjs",
33
37
  "prepack": "node tools/build.mjs",
38
+ "docs:validate": "python3 -m tools.docs_publication validate --repo .",
34
39
  "test:js": "node --test tests-js/*.test.mjs",
35
40
  "test:py": "python3 -m pytest tests/",
36
41
  "test:workflow": "bash validators/validate-workflow.sh",
37
- "check": "npm run build && npm run test:js && npm run test:py && npm run test:workflow"
42
+ "check": "npm run docs:validate && npm run build && npm run test:js && npm run test:py && npm run test:workflow"
38
43
  }
39
44
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "package": "0.117.0",
3
- "builtAt": "2026-07-14T11:54:12.876Z",
2
+ "package": "0.118.0",
3
+ "builtAt": "2026-07-15T06:18:58.589Z",
4
4
  "repoRoot": "/home/runner/work/okstra/okstra"
5
5
  }
@@ -1,6 +1,7 @@
1
- """Read-side recap for a task: assemble run-to-run phase transitions and
2
- append a recap Q&A log. Mutates only <task-root>/recap/recap-log.jsonl;
3
- never touches task-manifest / catalog / timeline.
1
+ """Read-side recap for a task: assemble run-to-run phase transitions, append a
2
+ recap Q&A log, and write agent-authored notes. Writes only under
3
+ <task-root>/recap/recap-log.jsonl and <task-root>/notes/; never touches
4
+ task-manifest / catalog / timeline.
4
5
  """
5
6
  from __future__ import annotations
6
7
 
@@ -10,9 +11,12 @@ import json
10
11
  import sys
11
12
  from pathlib import Path
12
13
 
14
+ from okstra_ctl.ids import slugify_task_segment
13
15
  from okstra_ctl.run_context import dir_flock
14
16
  from okstra_ctl.task_target import resolve_task_root, project_rel
15
17
 
18
+ NOTE_KINDS = ("verification-evidence", "decision-draft", "analysis-note")
19
+
16
20
 
17
21
  def _load_timeline(task_root: Path) -> list[dict]:
18
22
  path = task_root / "history" / "timeline.json"
@@ -91,6 +95,56 @@ def append_recap_entry(task_root, project_root, *, kind, mode, question,
91
95
  return {"logPath": project_rel(log_path, project_root), "entry": entry}
92
96
 
93
97
 
98
+ def _note_path(notes_dir: Path, slug: str, date: str) -> Path:
99
+ # 같은 날 같은 slug 로 노트를 여러 개 남기면 덮어쓰지 않도록 -2, -3 을 붙인다.
100
+ base = notes_dir / f"{slug}-{date}.md"
101
+ if not base.exists():
102
+ return base
103
+ seq = 2
104
+ while (candidate := notes_dir / f"{slug}-{date}-{seq}.md").exists():
105
+ seq += 1
106
+ return candidate
107
+
108
+
109
+ def _note_frontmatter(*, task_key, kind, created_at, purpose, scope_note) -> str:
110
+ return (
111
+ "---\n"
112
+ f"task-key: {task_key}\n"
113
+ f"kind: {kind}\n"
114
+ "author: agent\n"
115
+ f"created-at: {created_at}\n"
116
+ f"purpose: {purpose}\n"
117
+ f"scope-note: {scope_note}\n"
118
+ "---\n\n"
119
+ )
120
+
121
+
122
+ def write_note(task_root, project_root, *, kind, slug, purpose, scope_note,
123
+ body, now) -> dict:
124
+ notes_dir = task_root / "notes"
125
+ notes_dir.mkdir(parents=True, exist_ok=True)
126
+ created_at = now.date().isoformat()
127
+ slug_seg = slugify_task_segment(slug)
128
+ if not slug_seg:
129
+ raise ValueError("slug must contain at least one alphanumeric character")
130
+ path = _note_path(notes_dir, slug_seg, created_at)
131
+ task_key = _task_key(task_root)
132
+ frontmatter = _note_frontmatter(
133
+ task_key=task_key, kind=kind, created_at=created_at,
134
+ purpose=purpose, scope_note=scope_note)
135
+ path.write_text(frontmatter + body.rstrip("\n") + "\n", encoding="utf-8")
136
+ note_rel = project_rel(path, project_root)
137
+ return {
138
+ "notePath": note_rel,
139
+ "taskKey": task_key,
140
+ "kind": kind,
141
+ "createdAt": created_at,
142
+ # 노트는 inert — 다음 run 이 자동으로 읽지 않는다. 이 인자를 그대로
143
+ # `okstra run ...` 에 붙여야만 instruction-set 에 주입된다.
144
+ "clarificationResponseArg": f"--clarification-response {note_rel}",
145
+ }
146
+
147
+
94
148
  def _add_common(sp) -> None:
95
149
  # skill 이 쓰는 `<verb> <target> --project-root <root>` 형태를 받으려면
96
150
  # 공통 옵션을 부모가 아닌 각 서브파서에 등록해야 한다.
@@ -115,12 +169,35 @@ def main(argv: list[str] | None = None) -> int:
115
169
  p_rec.add_argument("--answer", required=True)
116
170
  p_rec.add_argument("--citation", action="append", default=[])
117
171
 
172
+ p_note = sub.add_parser(
173
+ "note", help="write an agent-authored note into <task-root>/notes/")
174
+ p_note.add_argument("target", help="task root path or task-key")
175
+ _add_common(p_note)
176
+ p_note.add_argument("--kind", choices=NOTE_KINDS, required=True)
177
+ p_note.add_argument("--slug", required=True,
178
+ help="short topic slug for the filename")
179
+ p_note.add_argument("--purpose", required=True,
180
+ help="one line — what it is and which run/decision it feeds")
181
+ p_note.add_argument("--scope-note", required=True, dest="scope_note",
182
+ help="one line — what it is NOT (e.g. not a user decision)")
183
+ body_src = p_note.add_mutually_exclusive_group(required=True)
184
+ body_src.add_argument("--body", help="inline markdown body")
185
+ body_src.add_argument("--body-file", dest="body_file",
186
+ help="path to a file holding the markdown body")
187
+
118
188
  args = parser.parse_args(argv)
119
189
  task_root, project_root = resolve_task_root(
120
190
  args.target, args.project_root, args.cwd)
121
191
 
122
192
  if args.command == "assemble":
123
193
  result = assemble_recap(task_root, project_root)
194
+ elif args.command == "note":
195
+ body = (Path(args.body_file).read_text(encoding="utf-8")
196
+ if args.body_file else args.body)
197
+ result = write_note(
198
+ task_root, project_root, kind=args.kind, slug=args.slug,
199
+ purpose=args.purpose, scope_note=args.scope_note, body=body,
200
+ now=dt.datetime.now(dt.timezone.utc))
124
201
  else:
125
202
  result = append_recap_entry(
126
203
  task_root, project_root, kind=args.kind, mode=args.mode,
@@ -18,7 +18,7 @@ Single read-side entry point for okstra runtime inspection plus the one status m
18
18
  | `cost` | Estimate file/read context cost for a task bundle. |
19
19
  | `errors` | Aggregate okstra-run error logs for a task into a timestamped markdown report; print a summary. |
20
20
  | `error-zip` | Collect cross-project okstra error logs into an anonymized zip (report + raw) and summarize clusters. |
21
- | `recap` | Summarize a task's run-to-run phase transitions, then answer free-form questions over its `.okstra` artifacts. Appends each summary/Q&A to `recap/recap-log.jsonl`. |
21
+ | `recap` | Summarize a task's run-to-run phase transitions, then answer free-form questions over its `.okstra` artifacts. Appends each summary/Q&A to `recap/recap-log.jsonl`, and writes agent-authored notes to `notes/` for feeding into later runs. |
22
22
 
23
23
  ## Step 0: Preflight (shared)
24
24
 
@@ -690,7 +690,7 @@ stdout JSON 을 파싱해 보고:
690
690
 
691
691
  Trigger phrases: "okstra recap", "recap", "작업 요약", "이 task 요약", "전후 요약", "이 작업 설명해줘", "task 질문".
692
692
 
693
- task-id 하나에 쌓인 `.okstra` 산출물 위에서 (a) 처리 전/후 요약을 내고, (b) 그 작업에 대한 자유 질문에 답한다. 기본은 `.okstra/` 서브트리만 읽는다(artifact 모드). 사용자가 명시적으로 코드 변경까지 봐 달라고 요청할 때만 code 모드로 확장한다. 이 sub-command 는 `recap/recap-log.jsonl` append 하고 `task-manifest.json` / catalog / timeline 은 절대 mutate 하지 않는다.
693
+ task-id 하나에 쌓인 `.okstra` 산출물 위에서 (a) 처리 전/후 요약을 내고, (b) 그 작업에 대한 자유 질문에 답한다. 기본은 `.okstra/` 서브트리만 읽는다(artifact 모드). 사용자가 명시적으로 코드 변경까지 봐 달라고 요청할 때만 code 모드로 확장한다. 이 sub-command 는 `recap/recap-log.jsonl` append `notes/` 노트 작성(recap.5)만 수행하고 `task-manifest.json` / catalog / timeline 은 절대 mutate 하지 않는다.
694
694
 
695
695
  ### recap.1 — Resolve target
696
696
 
@@ -748,6 +748,41 @@ okstra recap record <resolved-target> --project-root <projectRoot> \
748
748
  <이후 자유 질문을 받습니다. 코드 변경까지 보려면 "diff 까지 봐줘" 라고 요청하세요.>
749
749
  ```
750
750
 
751
+ ### recap.5 — Agent 저작 노트 (`notes/`)
752
+
753
+ recap 중에 네가 **okstra task 를 위해** 만든 산출물 — 검증 증거, 설계·decision 초안, 분석 노트 — 이 앞으로의 run 에 근거로 쓰일 수 있고, 그 내용이 **렌더된 report 도 아니고 사용자 결정도 아닐 때**만 `notes/` 에 남긴다.
754
+
755
+ **소유권으로 라우팅한다.** 지금 쓰려는 것이 아래 어디에 해당하는지 먼저 판별한다:
756
+
757
+ | 내용 | 레인(경로) | 저작 주체 |
758
+ |---|---|---|
759
+ | final report 본문 | `runs/<type>/reports/*.md` (`*.data.json` 에서 렌더) | okstra 렌더러 — 절대 수기 편집 금지 |
760
+ | clarification 에 대한 사용자 답변 | `runs/<type>/user-responses/*.md` (`created-by: user`) | 사용자만 |
761
+ | 확정된 ADR | `.okstra/decisions/NNNN-*.md` | 승격·관리됨 |
762
+ | **Agent 증거 / 설계 초안 / 분석** | **`.okstra/tasks/<group>/<id>/notes/`** | 너(AI) |
763
+
764
+ 렌더 산출물도, 사용자 결정도 아닌 **너 자신의 근거·초안**이면 `notes/` 로 간다. 노트는 손으로 찍지 말고 CLI 로 쓴다 — 경로·frontmatter·날짜를 코드가 보장하고, 다음 run 에 넘길 인자를 출력해 준다:
765
+
766
+ ```bash
767
+ okstra recap note <resolved-target> --project-root <projectRoot> \
768
+ --kind <verification-evidence|decision-draft|analysis-note> \
769
+ --slug <short-topic-slug> \
770
+ --purpose "<한 줄 — 무엇이며 어느 run/decision 에 투입되는지>" \
771
+ --scope-note "<한 줄 — 무엇이 아닌지, 예: C-00x 에 대한 사용자 결정이 아님>" \
772
+ --body-file <노트 본문 마크다운 경로>
773
+ ```
774
+
775
+ 본문은 먼저 scratchpad 에 마크다운으로 쓴 뒤 `--body-file` 로 넘긴다(짧으면 `--body "<md>"` 인라인도 가능). CLI 는 `.okstra/tasks/<group>/<id>/notes/<slug>-<YYYY-MM-DD>.md` 를 생성하고 stdout JSON 으로 `notePath` 와 `clarificationResponseArg` 를 돌려준다.
776
+
777
+ **self-check 규칙 (validator 가 없으니 스스로 지킨다):**
778
+
779
+ 1. **렌더된 report 를 수기 편집하지 않는다** (`runs/*/reports/` 아래 `*.md` / `*.data.json` / `*.html`). `data.json` 에서 재생성되므로 편집은 덮어써지고 SSOT 와 어긋난다. 발견 내용은 `notes/` 에 쓴다.
780
+ 2. **`user-responses/` 파일을 작성하거나 `created-by: user` 를 달지 않는다.** 그건 사용자의 결정이며, 대신 쓰면 사용자가 내리지 않은 결정을 위조하는 것이다. 네 증거가 특정 답을 뒷받침하면 `notes/` 에 그렇게 적고 결정은 사용자에게 맡긴다.
781
+ 3. **okstra 관리 디렉토리에 쓰지 않는다** (`runs/`, `instruction-set/`, `history/`, `recap/`, `.okstra/decisions/`). `notes/` 만이 agent 소유 레인이다. `recap/recap-log.jsonl` 은 예외적으로 쓰되 손으로 편집하지 말고 `okstra recap record` CLI 로만 남긴다.
782
+ 4. **`notes/` 는 okstra 에 inert 하다** — 어떤 run 도 자동으로 읽지 않는다. 작성 후 CLI 가 출력한 `clarificationResponseArg`(예: `--clarification-response <notePath>`)를 사용자에게 그대로 알려, 다음 run 을 그 인자와 함께 실행해야만 반영된다는 것을 전한다.
783
+
784
+ **Guardrail:** `.okstra/` 는 gitignored 다 — `notes/` 는 로컬 scratch 로 취급하고 절대 `git add` 하지 않는다. 새 노트 생성은 되돌리기 쉬우니(파일 삭제), 생성물이나 사용자 소유 파일을 편집하는 것보다 항상 이쪽을 택한다.
785
+
751
786
  ---
752
787
 
753
788
  ## Output Rules (shared)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: okstra-pr-gen
3
- description: Use when the user wants to register a PR body template or generate a PR description from a branch diff using a stored (or default) template. Manages templates under ~/.okstra/template/pr and drives okstra pr {template,branches,gen}. Trigger words include "okstra pr", "PR 템플릿 등록", "PR 본문 생성", "PR 메시지 만들어", "generate PR", "pr gen", "템플릿 등록".
3
+ description: Use when the user wants to register a PR body template or generate a PR description from a branch diff using a stored (or default) template. Manages templates under ~/.okstra/template/pr and drives okstra pr {template,branches,gen}. Trigger words include "okstra pr", "register PR template", "generate PR body", "generate PR message", "generate PR", "pr gen", and "register template".
4
4
  ---
5
5
 
6
6
  # okstra-pr-gen
@@ -31,11 +31,11 @@ If `okstra` is not on PATH, tell the user:
31
31
 
32
32
  Present a 3-option picker (`AskUserQuestion`):
33
33
 
34
- 1. `PR 생성` — generate a PR body from a branch diff.
35
- 2. `템플릿 등록` — save a new PR body template.
36
- 3. `직접 입력` — always the last option (okstra picker convention).
34
+ 1. `Generate PR` — generate a PR body from a branch diff.
35
+ 2. `Register template` — save a new PR body template.
36
+ 3. `Enter manually` — always the last option (okstra picker convention).
37
37
 
38
- ## Mode A — PR 생성
38
+ ## Mode A — Generate PR
39
39
 
40
40
  ### A1. Pick a template
41
41
 
@@ -44,7 +44,8 @@ okstra pr template list --json
44
44
  ```
45
45
 
46
46
  - If `templates` is non-empty, present a picker: 1–2 recommended templates from
47
- the list, plus `기본 템플릿`(the bundled default), plus `직접 입력` last.
47
+ the list, plus `Default template` (the bundled default), plus `Enter manually`
48
+ last.
48
49
  - If empty, tell the user the bundled default template will be used.
49
50
 
50
51
  Carry the chosen template name as `<template>` (`default` for the bundled one).
@@ -55,7 +56,7 @@ Carry the chosen template name as `<template>` (`default` for the bundled one).
55
56
  okstra pr branches --json
56
57
  ```
57
58
 
58
- Present a 3-option base picker from `recommended` (top entries) plus `직접 입력`
59
+ Present a 3-option base picker from `recommended` (top entries) plus `Enter manually`
59
60
  last. Carry the choice as `<base>`.
60
61
 
61
62
  ### A3. Build the generation bundle and fill the template
@@ -91,7 +92,7 @@ or not authenticated (`gh auth status` fails), leave the text in chat and tell
91
92
  the user to create the PR manually. Do not push or create the PR without the
92
93
  user's explicit confirmation.
93
94
 
94
- ## Mode B — 템플릿 등록
95
+ ## Mode B — Register template
95
96
 
96
97
  1. Ask for a template name (`AskUserQuestion`, free text). It must match
97
98
  `^[A-Za-z0-9._-]+$`; re-ask on invalid input.
@@ -1,15 +1,20 @@
1
1
  import { runPythonModule } from "../../lib/python-helper.mjs";
2
2
 
3
- const USAGE = `okstra recap — assemble a task's run-to-run phase recap, or append a recap log entry
3
+ const USAGE = `okstra recap — assemble a task's run-to-run phase recap, append a recap log entry, or write an agent note
4
4
 
5
5
  Usage:
6
6
  okstra recap assemble <task-root|task-key> [--project-root <dir>] [--cwd <dir>]
7
7
  okstra recap record <task-root|task-key> --kind <summary|qa> --mode <artifact|code> \\
8
8
  [--question <text>] --answer <text> [--citation <path:line> ...]
9
+ okstra recap note <task-root|task-key> \\
10
+ --kind <verification-evidence|decision-draft|analysis-note> --slug <topic> \\
11
+ --purpose <text> --scope-note <text> (--body <markdown> | --body-file <path>)
9
12
 
10
13
  \`assemble\` is read-only and prints a JSON summary of phase transitions across runs.
11
14
  \`record\` appends one line to <task-root>/recap/recap-log.jsonl; it never mutates
12
15
  other task artifacts.
16
+ \`note\` writes an agent-authored markdown note to <task-root>/notes/ and prints its
17
+ path plus the \`--clarification-response\` argument for feeding it into a later run.
13
18
  `;
14
19
 
15
20
  export async function run(args) {