shift-ax 0.3.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 (148) hide show
  1. package/LICENSE +21 -0
  2. package/README.ko.md +145 -0
  3. package/README.md +143 -0
  4. package/dist/adapters/claude-code/adapter.js +90 -0
  5. package/dist/adapters/codex/adapter.js +94 -0
  6. package/dist/adapters/contracts.js +7 -0
  7. package/dist/adapters/index.js +12 -0
  8. package/dist/core/context/context-bundle.js +300 -0
  9. package/dist/core/context/discovery.js +82 -0
  10. package/dist/core/context/global-index-authoring.js +199 -0
  11. package/dist/core/context/global-knowledge-updates.js +116 -0
  12. package/dist/core/context/glossary.js +73 -0
  13. package/dist/core/context/guided-onboarding.js +233 -0
  14. package/dist/core/context/index-authoring.js +47 -0
  15. package/dist/core/context/index-resolver.js +78 -0
  16. package/dist/core/context/onboarding.js +186 -0
  17. package/dist/core/diagnostics/doctor.js +154 -0
  18. package/dist/core/finalization/commit-message.js +76 -0
  19. package/dist/core/finalization/commit-workflow.js +131 -0
  20. package/dist/core/memory/consolidation.js +99 -0
  21. package/dist/core/memory/decision-register.js +141 -0
  22. package/dist/core/memory/entity-memory.js +25 -0
  23. package/dist/core/memory/learned-debug.js +52 -0
  24. package/dist/core/memory/summary-checkpoints.js +9 -0
  25. package/dist/core/memory/thread-promotion.js +22 -0
  26. package/dist/core/memory/threads.js +66 -0
  27. package/dist/core/memory/topic-recall.js +52 -0
  28. package/dist/core/observability/context-health.js +15 -0
  29. package/dist/core/observability/context-monitor.js +29 -0
  30. package/dist/core/observability/state-handoff.js +78 -0
  31. package/dist/core/observability/topic-status.js +40 -0
  32. package/dist/core/observability/topics-status.js +26 -0
  33. package/dist/core/observability/verification-debt.js +82 -0
  34. package/dist/core/planning/brainstorm.js +120 -0
  35. package/dist/core/planning/escalation.js +69 -0
  36. package/dist/core/planning/execution-handoff.js +61 -0
  37. package/dist/core/planning/execution-launch.js +156 -0
  38. package/dist/core/planning/execution-orchestrator.js +87 -0
  39. package/dist/core/planning/feedback-reactions.js +75 -0
  40. package/dist/core/planning/lifecycle-events.js +45 -0
  41. package/dist/core/planning/plan-review.js +76 -0
  42. package/dist/core/planning/policy-context-sync.js +154 -0
  43. package/dist/core/planning/request-pipeline.js +386 -0
  44. package/dist/core/planning/workflow-state.js +18 -0
  45. package/dist/core/policies/project-profile.js +28 -0
  46. package/dist/core/policies/team-preferences.js +17 -0
  47. package/dist/core/review/aggregate-reviews.js +129 -0
  48. package/dist/core/review/run-lanes.js +376 -0
  49. package/dist/core/settings/global-context-home.js +28 -0
  50. package/dist/core/settings/project-settings.js +37 -0
  51. package/dist/core/shell/platform-shell.js +144 -0
  52. package/dist/core/topics/bootstrap.js +119 -0
  53. package/dist/core/topics/topic-artifacts.js +36 -0
  54. package/dist/core/topics/worktree-runtime.js +141 -0
  55. package/dist/core/topics/worktree.js +8 -0
  56. package/dist/platform/claude-code/bootstrap.js +66 -0
  57. package/dist/platform/claude-code/execution.js +157 -0
  58. package/dist/platform/claude-code/scaffold/CLAUDE.template.md +40 -0
  59. package/dist/platform/claude-code/scaffold/commands/doctor.template.md +11 -0
  60. package/dist/platform/claude-code/scaffold/commands/export-context.template.md +20 -0
  61. package/dist/platform/claude-code/scaffold/commands/onboard.template.md +43 -0
  62. package/dist/platform/claude-code/scaffold/commands/onboarding.template.md +43 -0
  63. package/dist/platform/claude-code/scaffold/commands/request.template.md +19 -0
  64. package/dist/platform/claude-code/scaffold/commands/resume.template.md +12 -0
  65. package/dist/platform/claude-code/scaffold/commands/review.template.md +10 -0
  66. package/dist/platform/claude-code/scaffold/commands/status.template.md +14 -0
  67. package/dist/platform/claude-code/scaffold/commands/topics.template.md +10 -0
  68. package/dist/platform/claude-code/scaffold/hooks/shift-ax-session-start.template.md +29 -0
  69. package/dist/platform/claude-code/tmux.js +35 -0
  70. package/dist/platform/claude-code/upstream/tmux/imported/detached-session.js +40 -0
  71. package/dist/platform/claude-code/upstream/tmux/imported/session-name.js +19 -0
  72. package/dist/platform/claude-code/upstream/worktree/imported/get-worktree-root.js +39 -0
  73. package/dist/platform/claude-code/upstream/worktree/imported/managed-worktree.js +77 -0
  74. package/dist/platform/claude-code/worktree.js +79 -0
  75. package/dist/platform/codex/bootstrap.js +69 -0
  76. package/dist/platform/codex/execution.js +163 -0
  77. package/dist/platform/codex/scaffold/AGENTS.template.md +40 -0
  78. package/dist/platform/codex/scaffold/prompts/doctor.template.md +11 -0
  79. package/dist/platform/codex/scaffold/prompts/export-context.template.md +20 -0
  80. package/dist/platform/codex/scaffold/prompts/onboard.template.md +43 -0
  81. package/dist/platform/codex/scaffold/prompts/onboarding.template.md +43 -0
  82. package/dist/platform/codex/scaffold/prompts/request.template.md +19 -0
  83. package/dist/platform/codex/scaffold/prompts/resume.template.md +14 -0
  84. package/dist/platform/codex/scaffold/prompts/review.template.md +10 -0
  85. package/dist/platform/codex/scaffold/prompts/shift-ax-bootstrap.template.md +23 -0
  86. package/dist/platform/codex/scaffold/prompts/status.template.md +14 -0
  87. package/dist/platform/codex/scaffold/prompts/topics.template.md +10 -0
  88. package/dist/platform/codex/scaffold/skills/doctor/SKILL.template.md +11 -0
  89. package/dist/platform/codex/scaffold/skills/export-context/SKILL.template.md +20 -0
  90. package/dist/platform/codex/scaffold/skills/onboard/SKILL.template.md +43 -0
  91. package/dist/platform/codex/scaffold/skills/request/SKILL.template.md +19 -0
  92. package/dist/platform/codex/scaffold/skills/resume/SKILL.template.md +14 -0
  93. package/dist/platform/codex/scaffold/skills/review/SKILL.template.md +10 -0
  94. package/dist/platform/codex/scaffold/skills/status/SKILL.template.md +14 -0
  95. package/dist/platform/codex/scaffold/skills/topics/SKILL.template.md +10 -0
  96. package/dist/platform/codex/tmux.js +45 -0
  97. package/dist/platform/codex/upstream/tmux/imported/resize-hook-registration.js +37 -0
  98. package/dist/platform/codex/upstream/tmux/imported/resize-hooks.js +29 -0
  99. package/dist/platform/codex/upstream/tmux/imported/sanitize-team-name.js +18 -0
  100. package/dist/platform/codex/upstream/worktree/imported/managed-worktree.js +208 -0
  101. package/dist/platform/codex/upstream/worktree/imported/resolve-repo-root.js +14 -0
  102. package/dist/platform/codex/worktree.js +99 -0
  103. package/dist/platform/index.js +10 -0
  104. package/dist/platform/product-shell-commands.js +17 -0
  105. package/dist/platform/scaffold.js +16 -0
  106. package/dist/platform/upstream-imports.js +5 -0
  107. package/dist/scripts/ax-approve-plan.js +30 -0
  108. package/dist/scripts/ax-bootstrap-assets.js +19 -0
  109. package/dist/scripts/ax-bootstrap-topic.js +24 -0
  110. package/dist/scripts/ax-build-context-bundle.js +35 -0
  111. package/dist/scripts/ax-checkpoint-context.js +22 -0
  112. package/dist/scripts/ax-consolidate-memory.js +7 -0
  113. package/dist/scripts/ax-context-health.js +26 -0
  114. package/dist/scripts/ax-decisions.js +32 -0
  115. package/dist/scripts/ax-doctor.js +25 -0
  116. package/dist/scripts/ax-entity-memory.js +19 -0
  117. package/dist/scripts/ax-export-context.js +8 -0
  118. package/dist/scripts/ax-finalize-commit.js +23 -0
  119. package/dist/scripts/ax-init-context.js +41 -0
  120. package/dist/scripts/ax-launch-execution.js +24 -0
  121. package/dist/scripts/ax-learned-debug-save.js +30 -0
  122. package/dist/scripts/ax-learned-debug.js +12 -0
  123. package/dist/scripts/ax-monitor-context.js +28 -0
  124. package/dist/scripts/ax-onboard-context.js +112 -0
  125. package/dist/scripts/ax-pause-work.js +33 -0
  126. package/dist/scripts/ax-platform-manifest.js +19 -0
  127. package/dist/scripts/ax-promote-thread.js +20 -0
  128. package/dist/scripts/ax-react-feedback.js +28 -0
  129. package/dist/scripts/ax-recall-topics.js +20 -0
  130. package/dist/scripts/ax-recall.js +58 -0
  131. package/dist/scripts/ax-refresh-state.js +15 -0
  132. package/dist/scripts/ax-resolve-context.js +34 -0
  133. package/dist/scripts/ax-review.js +24 -0
  134. package/dist/scripts/ax-run-request.js +198 -0
  135. package/dist/scripts/ax-scaffold-build.js +19 -0
  136. package/dist/scripts/ax-shell.js +123 -0
  137. package/dist/scripts/ax-sync-policy-context.js +40 -0
  138. package/dist/scripts/ax-team-preferences.js +20 -0
  139. package/dist/scripts/ax-thread-save.js +26 -0
  140. package/dist/scripts/ax-threads.js +11 -0
  141. package/dist/scripts/ax-topic-status.js +18 -0
  142. package/dist/scripts/ax-topics-status.js +22 -0
  143. package/dist/scripts/ax-verification-debt.js +22 -0
  144. package/dist/scripts/ax-worktree-create.js +22 -0
  145. package/dist/scripts/ax-worktree-plan.js +18 -0
  146. package/dist/scripts/ax-worktree-remove.js +18 -0
  147. package/dist/scripts/ax.js +132 -0
  148. package/package.json +71 -0
@@ -0,0 +1,40 @@
1
+ # Shift AX Codex Bootstrap
2
+
3
+ You are running inside a Shift AX Codex build.
4
+
5
+ ## Bootstrap Mode
6
+
7
+ - This build uses AGENTS.md bootstrap.
8
+ - Before planning or implementation, resolve context from {{GLOBAL_CONTEXT_INDEX}}.
9
+ - If the global index is missing, recommend `$onboard` before `$request`. Do not pretend the missing context does not matter.
10
+ - Use `shift-ax doctor` when setup, launcher availability, or topic state looks unhealthy.
11
+ - Use `shift-ax resolve-context` before answering when relevant documents may exist.
12
+ - Use `shift-ax run-request` to create the request-scoped topic/worktree, run the planning interview, write brainstorming/spec/plan artifacts plus `execution-handoff.json`, and pause at the human planning-review gate.
13
+ - Use `shift-ax approve-plan` after the human reviewer signs off.
14
+ - If the reviewed plan requires shared policy or base-context doc changes, record them first with `shift-ax sync-policy-context --topic <dir> --summary "<what changed>" [--path <doc>]... [--entry "Label -> path"]...`.
15
+ - Then resume with `shift-ax run-request --topic <dir> --resume` for automatic review and commit. Use `--no-auto-commit` only when a human explicitly wants the final commit step held back.
16
+ - If downstream review or CI fails after the topic looked ready, use `shift-ax react-feedback --topic <dir> --kind <review-changes-requested|ci-failed> --summary "<text>"` to reopen implementation with a file-backed reaction trail.
17
+ - Use `shift-ax launch-execution --platform codex --topic <dir> [--task-id <id>] [--dry-run]` when you need the concrete Codex or tmux launch commands from `execution-handoff.json`.
18
+ - Use `shift-ax topic-status --topic <dir>` when you need a compact summary of phase, review gate, execution state, and last failure.
19
+ - Use `shift-ax topics-status [--root DIR] [--limit N]` when you need a compact multi-topic view without leaving the CLI.
20
+ - If a reviewed request hits a mandatory escalation trigger, persist that stop with `shift-ax run-request --topic <dir> --resume --escalation <kind>:<summary>` and resume only after human review with `--clear-escalations`.
21
+ - Use `shift-ax worktree-plan` to inspect the preferred branch/worktree path for the topic.
22
+ - Use `shift-ax worktree-create` before implementation begins and `shift-ax worktree-remove` when the topic worktree should be torn down.
23
+ - Worktree runtime provenance is tracked in `platform/codex/upstream/worktree/provenance.md`.
24
+ - Active imported worktree helpers currently include `resolveRepoRoot`, `ensureCodexManagedWorktree`, and `removeCodexManagedWorktree`.
25
+ - Use `shift-ax review --run` before finalization and `shift-ax finalize-commit` only after the review gate allows commit.
26
+ - Natural language is the primary user surface. Internal AX commands exist to support the flow, not replace the conversation.
27
+ - In Shift AX Codex sessions, prefer `$onboard`, `$request <text>`, `$export-context`, `$doctor`, `$status`, `$topics`, `$resume <topic>`, `$review <topic>`, and `$help` as the visible product-shell commands.
28
+ - Native product-shell skill files are installed under `.codex/skills/<name>/SKILL.md` for: `onboard`, `request`, `export-context`, `doctor`, `status`, `topics`, `resume`, and `review`.
29
+
30
+ ## Product-shell aliases
31
+
32
+ Treat these as explicit Shift AX commands inside the session:
33
+
34
+ - `$onboard` -> onboarding flow
35
+ - `$doctor` -> repo/topic health
36
+ - `$request <text>` -> new request-to-commit flow
37
+ - `$status` -> current topic or repo status
38
+ - `$topics` -> recent topics list
39
+ - `$resume <topic>` -> resume a topic
40
+ - `$review <topic>` -> run structured review
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: Run Shift AX health checks for the current repository.
3
+ argument_hint: "[--topic <dir>]"
4
+ ---
5
+
6
+ Run Shift AX doctor for the current repository.
7
+
8
+ - If arguments specify a topic, use `shift-ax doctor --topic <dir>`.
9
+ - Otherwise use `shift-ax doctor`.
10
+
11
+ Summarize the repo health, base-context health, and any launcher warnings.
@@ -0,0 +1,20 @@
1
+ ---
2
+ description: Explain how to share the user's Shift AX global knowledge base.
3
+ argument_hint: ""
4
+ ---
5
+
6
+ Do not build an archive.
7
+
8
+ Explain that the user should share:
9
+
10
+ - `~/.shift-ax/`
11
+
12
+ And tell the recipient to place the shared files at the same location on their machine:
13
+
14
+ - `~/.shift-ax/`
15
+
16
+ Mention that the most important file is:
17
+
18
+ - `~/.shift-ax/index.md`
19
+
20
+ If useful, remind them that `$onboard` can refresh the profile before sharing.
@@ -0,0 +1,43 @@
1
+ ---
2
+ description: Capture or refresh the user's global Shift AX knowledge base.
3
+ argument_hint: "[optional note]"
4
+ ---
5
+
6
+ This command is the most important setup step.
7
+
8
+ Start by saying:
9
+
10
+ > This step matters most. Please invest 10 minutes so Shift AX can understand how you work.
11
+
12
+ Then run a conversational interview that captures:
13
+
14
+ 1. primary role summary
15
+ 2. work types
16
+ 3. related repositories for each work type
17
+ 4. per-repository working methods
18
+ 5. company/domain language
19
+
20
+ For each work type and repository:
21
+
22
+ - ask which directories matter
23
+ - inspect the repository when a path is available
24
+ - infer likely workflow details from real files
25
+ - present your inferred workflow back to the user
26
+ - ask them to correct anything wrong or missing
27
+
28
+ When you have enough information:
29
+
30
+ 1. write `.ax/onboarding-input.json`
31
+ 2. if `{{GLOBAL_CONTEXT_INDEX}}` or other global knowledge files already exist, ask whether to overwrite them first
32
+ 3. persist with:
33
+ - `shift-ax onboard-context --root "<repo>" --input .ax/onboarding-input.json`
34
+ - add `--overwrite` only if the user explicitly agreed
35
+
36
+ Keep the top-level knowledge base in `~/.shift-ax/` with:
37
+
38
+ - `index.md` listing only titles and linked pages
39
+ - linked work type pages
40
+ - linked repository/procedure pages
41
+ - linked domain-language pages
42
+
43
+ After completion, remind the user to share `~/.shift-ax/` with teammates who do similar work.
@@ -0,0 +1,43 @@
1
+ ---
2
+ description: Capture or refresh the user's global Shift AX knowledge base.
3
+ argument_hint: "[optional note]"
4
+ ---
5
+
6
+ This command is the most important setup step.
7
+
8
+ Start by saying:
9
+
10
+ > This step matters most. Please invest 10 minutes so Shift AX can understand how you work.
11
+
12
+ Then run a conversational interview that captures:
13
+
14
+ 1. primary role summary
15
+ 2. work types
16
+ 3. related repositories for each work type
17
+ 4. per-repository working methods
18
+ 5. company/domain language
19
+
20
+ For each work type and repository:
21
+
22
+ - ask which directories matter
23
+ - inspect the repository when a path is available
24
+ - infer likely workflow details from real files
25
+ - present your inferred workflow back to the user
26
+ - ask them to correct anything wrong or missing
27
+
28
+ When you have enough information:
29
+
30
+ 1. write `.ax/onboarding-input.json`
31
+ 2. if `{{GLOBAL_CONTEXT_INDEX}}` or other global knowledge files already exist, ask whether to overwrite them first
32
+ 3. persist with:
33
+ - `shift-ax onboard-context --root "<repo>" --input .ax/onboarding-input.json`
34
+ - add `--overwrite` only if the user explicitly agreed
35
+
36
+ Keep the top-level knowledge base in `~/.shift-ax/` with:
37
+
38
+ - `index.md` listing only titles and linked pages
39
+ - linked work type pages
40
+ - linked repository/procedure pages
41
+ - linked domain-language pages
42
+
43
+ After completion, remind the user to share `~/.shift-ax/` with teammates who do similar work.
@@ -0,0 +1,19 @@
1
+ ---
2
+ description: Start a new Shift AX request-to-commit flow.
3
+ argument_hint: "<request>"
4
+ ---
5
+
6
+ Treat everything after this command as the raw request text.
7
+
8
+ If no request text was provided, ask for it before doing anything else.
9
+
10
+ Then:
11
+
12
+ 1. resolve context from `{{GLOBAL_CONTEXT_INDEX}}` first
13
+ 2. if the global index is missing, stop and tell the user onboarding should come first because accuracy will drop
14
+ 3. ask whether they want to continue anyway
15
+ 4. only if they explicitly agree, bootstrap with `shift-ax run-request --request "<request>" --allow-missing-global-context`
16
+ 5. otherwise bootstrap with `shift-ax run-request --request "<request>"`
17
+ 6. explain the resulting topic path and that the workflow pauses at human plan review
18
+
19
+ Never skip context grounding or the planning/review gates.
@@ -0,0 +1,14 @@
1
+ ---
2
+ description: Resume an approved Shift AX topic.
3
+ argument_hint: "<topic-dir> [--verify-command <cmd> ...]"
4
+ ---
5
+
6
+ Treat the first argument as the topic directory.
7
+
8
+ Resume with:
9
+
10
+ `shift-ax run-request --topic <topic-dir> --resume`
11
+
12
+ If extra verification commands are given, append them as `--verify-command`.
13
+
14
+ Explain whether the topic is blocked by escalation or policy sync if resume cannot continue.
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Run structured Shift AX review for a topic.
3
+ argument_hint: "<topic-dir>"
4
+ ---
5
+
6
+ Run:
7
+
8
+ `shift-ax review --topic <topic-dir> --run`
9
+
10
+ Then summarize the review lanes, aggregate verdict, and remaining blockers.
@@ -0,0 +1,23 @@
1
+ # Shift AX Codex Prompt Bootstrap
2
+
3
+ - Before planning or implementation, resolve context from {{GLOBAL_CONTEXT_INDEX}}.
4
+ - If the global index is missing, recommend `$onboard` before `$request`. Do not fake certainty.
5
+ - Use `shift-ax doctor` when setup, launcher availability, or topic state looks unhealthy.
6
+ - Use `shift-ax resolve-context` before answering when relevant documents may exist.
7
+ - Use `shift-ax run-request` to create the request-scoped topic/worktree, run the planning interview, write brainstorming/spec/plan artifacts plus `execution-handoff.json`, and pause at the human planning-review gate.
8
+ - Use `shift-ax approve-plan` after the human reviewer signs off.
9
+ - If the reviewed plan requires shared policy or base-context doc changes, record them first with `shift-ax sync-policy-context --topic <dir> --summary "<what changed>" [--path <doc>]... [--entry "Label -> path"]...`.
10
+ - Then resume with `shift-ax run-request --topic <dir> --resume` for automatic review and commit. Use `--no-auto-commit` only when a human explicitly wants the final commit step held back.
11
+ - If downstream review or CI fails after the topic looked ready, use `shift-ax react-feedback --topic <dir> --kind <review-changes-requested|ci-failed> --summary "<text>"` to reopen implementation with a file-backed reaction trail.
12
+ - Use `shift-ax launch-execution --platform codex --topic <dir> [--task-id <id>] [--dry-run]` when you need the concrete Codex or tmux launch commands from `execution-handoff.json`.
13
+ - Use `shift-ax topic-status --topic <dir>` when you need a compact summary of phase, review gate, execution state, and last failure.
14
+ - Use `shift-ax topics-status [--root DIR] [--limit N]` when you need a compact multi-topic view without leaving the CLI.
15
+ - If a reviewed request hits a mandatory escalation trigger, persist that stop with `shift-ax run-request --topic <dir> --resume --escalation <kind>:<summary>` and resume only after human review with `--clear-escalations`.
16
+ - Use `shift-ax worktree-plan` to inspect the preferred branch/worktree path for the topic.
17
+ - Use `shift-ax worktree-create` before implementation begins and `shift-ax worktree-remove` when the topic worktree should be torn down.
18
+ - Worktree runtime provenance is tracked in `platform/codex/upstream/worktree/provenance.md`.
19
+ - Active imported worktree helpers currently include `resolveRepoRoot`, `ensureCodexManagedWorktree`, and `removeCodexManagedWorktree`.
20
+ - Use `shift-ax review --run` before finalization and `shift-ax finalize-commit` only after the review gate allows commit.
21
+ - Natural language is the primary user surface. Internal AX commands exist to support the flow, not replace the conversation.
22
+ - In Shift AX Codex sessions, prefer `$onboard`, `$request <text>`, `$export-context`, `$doctor`, `$status`, `$topics`, `$resume <topic>`, `$review <topic>`, and `$help` as the visible product-shell commands.
23
+ - Native product-shell skill files are installed under `.codex/skills/<name>/SKILL.md` for: `onboard`, `request`, `export-context`, `doctor`, `status`, `topics`, `resume`, and `review`.
@@ -0,0 +1,14 @@
1
+ ---
2
+ description: Show Shift AX status for one topic or the repo.
3
+ argument_hint: "[<topic-dir>]"
4
+ ---
5
+
6
+ If a topic directory is provided, run:
7
+
8
+ `shift-ax topic-status --topic <topic-dir>`
9
+
10
+ Otherwise run:
11
+
12
+ `shift-ax topics-status`
13
+
14
+ Summarize the current phase, review gate, execution status, and blockers.
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: List recent Shift AX topics for the current repository.
3
+ argument_hint: "[--limit N]"
4
+ ---
5
+
6
+ List recent topics with:
7
+
8
+ `shift-ax topics-status`
9
+
10
+ If the user supplied a limit, include it.
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: Run Shift AX health checks for the current repository.
3
+ argument_hint: "[--topic <dir>]"
4
+ ---
5
+
6
+ Run Shift AX doctor for the current repository.
7
+
8
+ - If arguments specify a topic, use `shift-ax doctor --topic <dir>`.
9
+ - Otherwise use `shift-ax doctor`.
10
+
11
+ Summarize the repo health, base-context health, and any launcher warnings.
@@ -0,0 +1,20 @@
1
+ ---
2
+ description: Explain how to share the user's Shift AX global knowledge base.
3
+ argument_hint: ""
4
+ ---
5
+
6
+ Do not build an archive.
7
+
8
+ Explain that the user should share:
9
+
10
+ - `~/.shift-ax/`
11
+
12
+ And tell the recipient to place the shared files at the same location on their machine:
13
+
14
+ - `~/.shift-ax/`
15
+
16
+ Mention that the most important file is:
17
+
18
+ - `~/.shift-ax/index.md`
19
+
20
+ If useful, remind them that `$onboard` can refresh the profile before sharing.
@@ -0,0 +1,43 @@
1
+ ---
2
+ description: Capture or refresh the user's global Shift AX knowledge base.
3
+ argument_hint: "[optional note]"
4
+ ---
5
+
6
+ This command is the most important setup step.
7
+
8
+ Start by saying:
9
+
10
+ > This step matters most. Please invest 10 minutes so Shift AX can understand how you work.
11
+
12
+ Then run a conversational interview that captures:
13
+
14
+ 1. primary role summary
15
+ 2. work types
16
+ 3. related repositories for each work type
17
+ 4. per-repository working methods
18
+ 5. company/domain language
19
+
20
+ For each work type and repository:
21
+
22
+ - ask which directories matter
23
+ - inspect the repository when a path is available
24
+ - infer likely workflow details from real files
25
+ - present your inferred workflow back to the user
26
+ - ask them to correct anything wrong or missing
27
+
28
+ When you have enough information:
29
+
30
+ 1. write `.ax/onboarding-input.json`
31
+ 2. if `{{GLOBAL_CONTEXT_INDEX}}` or other global knowledge files already exist, ask whether to overwrite them first
32
+ 3. persist with:
33
+ - `shift-ax onboard-context --root "<repo>" --input .ax/onboarding-input.json`
34
+ - add `--overwrite` only if the user explicitly agreed
35
+
36
+ Keep the top-level knowledge base in `~/.shift-ax/` with:
37
+
38
+ - `index.md` listing only titles and linked pages
39
+ - linked work type pages
40
+ - linked repository/procedure pages
41
+ - linked domain-language pages
42
+
43
+ After completion, remind the user to share `~/.shift-ax/` with teammates who do similar work.
@@ -0,0 +1,19 @@
1
+ ---
2
+ description: Start a new Shift AX request-to-commit flow.
3
+ argument_hint: "<request>"
4
+ ---
5
+
6
+ Treat everything after this command as the raw request text.
7
+
8
+ If no request text was provided, ask for it before doing anything else.
9
+
10
+ Then:
11
+
12
+ 1. resolve context from `{{GLOBAL_CONTEXT_INDEX}}` first
13
+ 2. if the global index is missing, stop and tell the user onboarding should come first because accuracy will drop
14
+ 3. ask whether they want to continue anyway
15
+ 4. only if they explicitly agree, bootstrap with `shift-ax run-request --request "<request>" --allow-missing-global-context`
16
+ 5. otherwise bootstrap with `shift-ax run-request --request "<request>"`
17
+ 6. explain the resulting topic path and that the workflow pauses at human plan review
18
+
19
+ Never skip context grounding or the planning/review gates.
@@ -0,0 +1,14 @@
1
+ ---
2
+ description: Resume an approved Shift AX topic.
3
+ argument_hint: "<topic-dir> [--verify-command <cmd> ...]"
4
+ ---
5
+
6
+ Treat the first argument as the topic directory.
7
+
8
+ Resume with:
9
+
10
+ `shift-ax run-request --topic <topic-dir> --resume`
11
+
12
+ If extra verification commands are given, append them as `--verify-command`.
13
+
14
+ Explain whether the topic is blocked by escalation or policy sync if resume cannot continue.
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Run structured Shift AX review for a topic.
3
+ argument_hint: "<topic-dir>"
4
+ ---
5
+
6
+ Run:
7
+
8
+ `shift-ax review --topic <topic-dir> --run`
9
+
10
+ Then summarize the review lanes, aggregate verdict, and remaining blockers.
@@ -0,0 +1,14 @@
1
+ ---
2
+ description: Show Shift AX status for one topic or the repo.
3
+ argument_hint: "[<topic-dir>]"
4
+ ---
5
+
6
+ If a topic directory is provided, run:
7
+
8
+ `shift-ax topic-status --topic <topic-dir>`
9
+
10
+ Otherwise run:
11
+
12
+ `shift-ax topics-status`
13
+
14
+ Summarize the current phase, review gate, execution status, and blockers.
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: List recent Shift AX topics for the current repository.
3
+ argument_hint: "[--limit N]"
4
+ ---
5
+
6
+ List recent topics with:
7
+
8
+ `shift-ax topics-status`
9
+
10
+ If the user supplied a limit, include it.
@@ -0,0 +1,45 @@
1
+ import { dirname, join } from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { readImportedUpstreamSlice } from '../upstream-imports.js';
4
+ import { buildCodexResizeHookName, buildCodexResizeHookTarget, } from './upstream/tmux/imported/resize-hooks.js';
5
+ import { buildCodexRegisterResizeHookArgs, buildCodexUnregisterResizeHookArgs, } from './upstream/tmux/imported/resize-hook-registration.js';
6
+ const HERE = dirname(fileURLToPath(import.meta.url));
7
+ export function getCodexTmuxRuntime(rootDir) {
8
+ return {
9
+ support: 'imported-helpers',
10
+ multiplexer: 'tmux',
11
+ workspace_mode: 'leader-attached-layout',
12
+ naming: {
13
+ imported_helpers: [
14
+ 'sanitizeCodexTeamName',
15
+ 'buildCodexResizeHookTarget',
16
+ 'buildCodexResizeHookName',
17
+ ],
18
+ },
19
+ upstream_boundary: {
20
+ import_root: join(rootDir, 'platform', 'codex', 'upstream', 'tmux'),
21
+ provenance_doc: join(rootDir, 'platform', 'codex', 'upstream', 'tmux', 'provenance.md'),
22
+ planned_upstream_modules: ['oh-my-codex/src/team/tmux-session.ts'],
23
+ active_imports: [
24
+ readImportedUpstreamSlice(join(HERE, 'upstream', 'tmux', 'imported', 'provenance.json')),
25
+ readImportedUpstreamSlice(join(HERE, 'upstream', 'tmux', 'imported', 'resize-hooks.provenance.json')),
26
+ readImportedUpstreamSlice(join(HERE, 'upstream', 'tmux', 'imported', 'resize-hook-registration.provenance.json')),
27
+ ],
28
+ },
29
+ };
30
+ }
31
+ export function buildCodexLeaderAttachedHookIdentity(teamName, sessionName, windowIndex, hudPaneId) {
32
+ return {
33
+ target: buildCodexResizeHookTarget(sessionName, windowIndex),
34
+ hookName: buildCodexResizeHookName(teamName, sessionName, windowIndex, hudPaneId),
35
+ };
36
+ }
37
+ export function buildCodexResizeHookRegistration(sessionName, windowIndex, teamName, hudPaneId) {
38
+ const identity = buildCodexLeaderAttachedHookIdentity(teamName, sessionName, windowIndex, hudPaneId);
39
+ return {
40
+ target: identity.target,
41
+ hookName: identity.hookName,
42
+ registerArgs: buildCodexRegisterResizeHookArgs(identity.target, identity.hookName, hudPaneId),
43
+ unregisterArgs: buildCodexUnregisterResizeHookArgs(identity.target, identity.hookName),
44
+ };
45
+ }
@@ -0,0 +1,37 @@
1
+ const HUD_TMUX_TEAM_HEIGHT_LINES = 3;
2
+ const TMUX_HOOK_INDEX_MAX = 2147483647;
3
+ function shellQuoteSingle(value) {
4
+ return `'${value.replace(/'/g, `'\\''`)}'`;
5
+ }
6
+ function buildBestEffortShellCommand(command) {
7
+ return `${command} >/dev/null 2>&1 || true`;
8
+ }
9
+ function buildNestedTmuxShellCommand(command) {
10
+ return `tmux ${command}`;
11
+ }
12
+ function buildHudPaneTarget(hudPaneId) {
13
+ const trimmed = hudPaneId.trim();
14
+ return trimmed.startsWith('%') ? trimmed : `%${trimmed}`;
15
+ }
16
+ function buildHudResizeCommand(hudPaneId, heightLines = HUD_TMUX_TEAM_HEIGHT_LINES) {
17
+ return `resize-pane -t ${buildHudPaneTarget(hudPaneId)} -y ${heightLines}`;
18
+ }
19
+ function buildResizeHookSlot(hookName) {
20
+ let hash = 0;
21
+ for (let i = 0; i < hookName.length; i++) {
22
+ hash = (hash * 31 + hookName.charCodeAt(i)) | 0;
23
+ }
24
+ return `client-resized[${Math.abs(hash) % TMUX_HOOK_INDEX_MAX}]`;
25
+ }
26
+ /**
27
+ * Imported from oh-my-codex.
28
+ * Source: oh-my-codex/src/team/tmux-session.ts
29
+ * Commit: fabb3ce0b96e42c20feb2940c74f2aa5addb8cee
30
+ */
31
+ export function buildCodexRegisterResizeHookArgs(hookTarget, hookName, hudPaneId, heightLines = HUD_TMUX_TEAM_HEIGHT_LINES) {
32
+ const resizeCommand = shellQuoteSingle(buildBestEffortShellCommand(buildNestedTmuxShellCommand(buildHudResizeCommand(hudPaneId, heightLines))));
33
+ return ['set-hook', '-t', hookTarget, buildResizeHookSlot(hookName), `run-shell -b ${resizeCommand}`];
34
+ }
35
+ export function buildCodexUnregisterResizeHookArgs(hookTarget, hookName) {
36
+ return ['set-hook', '-u', '-t', hookTarget, buildResizeHookSlot(hookName)];
37
+ }
@@ -0,0 +1,29 @@
1
+ function normalizeTmuxHookToken(value) {
2
+ const normalized = value
3
+ .replace(/[^A-Za-z0-9_-]+/g, '_')
4
+ .replace(/_+/g, '_')
5
+ .replace(/^_+|_+$/g, '');
6
+ return normalized === '' ? 'unknown' : normalized;
7
+ }
8
+ function normalizeHudPaneToken(hudPaneId) {
9
+ const trimmed = hudPaneId.trim();
10
+ const withoutPrefix = trimmed.startsWith('%') ? trimmed.slice(1) : trimmed;
11
+ return normalizeTmuxHookToken(withoutPrefix);
12
+ }
13
+ /**
14
+ * Imported from oh-my-codex.
15
+ * Source: oh-my-codex/src/team/tmux-session.ts
16
+ * Commit: fabb3ce0b96e42c20feb2940c74f2aa5addb8cee
17
+ */
18
+ export function buildCodexResizeHookTarget(sessionName, windowIndex) {
19
+ return `${sessionName}:${windowIndex}`;
20
+ }
21
+ export function buildCodexResizeHookName(teamName, sessionName, windowIndex, hudPaneId) {
22
+ return [
23
+ 'omx_resize',
24
+ normalizeTmuxHookToken(teamName),
25
+ normalizeTmuxHookToken(sessionName),
26
+ normalizeTmuxHookToken(windowIndex),
27
+ normalizeHudPaneToken(hudPaneId),
28
+ ].join('_');
29
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Imported from oh-my-codex.
3
+ * Source: oh-my-codex/src/team/tmux-session.ts
4
+ * Commit: fabb3ce0b96e42c20feb2940c74f2aa5addb8cee
5
+ */
6
+ export function sanitizeCodexTeamName(name) {
7
+ const lowered = name.toLowerCase();
8
+ const replaced = lowered
9
+ .replace(/[^a-z0-9]+/g, '-')
10
+ .replace(/-+/g, '-')
11
+ .replace(/^-/, '')
12
+ .replace(/-$/, '');
13
+ const truncated = replaced.slice(0, 30).replace(/-$/, '');
14
+ if (truncated.trim() === '') {
15
+ throw new Error('sanitizeTeamName: empty after sanitization');
16
+ }
17
+ return truncated;
18
+ }