@markusylisiurunen/tau 0.3.75 → 0.3.77

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 (126) hide show
  1. package/dist/core/cli.js +0 -3
  2. package/dist/core/cli.js.map +1 -1
  3. package/dist/core/config/builtin_themes.js +0 -30
  4. package/dist/core/config/builtin_themes.js.map +1 -1
  5. package/dist/core/config/content_loader.js +10 -115
  6. package/dist/core/config/content_loader.js.map +1 -1
  7. package/dist/core/config/index.js +1 -1
  8. package/dist/core/config/index.js.map +1 -1
  9. package/dist/core/config/paths.js +0 -1
  10. package/dist/core/config/paths.js.map +1 -1
  11. package/dist/core/config/runtime.js +1 -1
  12. package/dist/core/config/runtime.js.map +1 -1
  13. package/dist/core/config/runtime_config_snapshot.js +0 -1
  14. package/dist/core/config/runtime_config_snapshot.js.map +1 -1
  15. package/dist/core/config/schema.js +8 -84
  16. package/dist/core/config/schema.js.map +1 -1
  17. package/dist/core/config/skills_loader.js +0 -8
  18. package/dist/core/config/skills_loader.js.map +1 -1
  19. package/dist/core/config/theme_variants.js.map +1 -1
  20. package/dist/core/config/virtual_bundle.js +1 -4
  21. package/dist/core/config/virtual_bundle.js.map +1 -1
  22. package/dist/core/debug.js +0 -2
  23. package/dist/core/debug.js.map +1 -1
  24. package/dist/core/index.js +0 -1
  25. package/dist/core/index.js.map +1 -1
  26. package/dist/core/models/catalog.js +2 -3
  27. package/dist/core/models/catalog.js.map +1 -1
  28. package/dist/core/personas.js +3 -81
  29. package/dist/core/personas.js.map +1 -1
  30. package/dist/core/static/index.js +0 -3
  31. package/dist/core/static/index.js.map +1 -1
  32. package/dist/core/static/tau_docs/config-reference.md +17 -59
  33. package/dist/core/static/tau_docs/configuration.md +5 -10
  34. package/dist/core/static/tau_docs/credentials.md +9 -28
  35. package/dist/core/static/tau_docs/image-generation.md +1 -1
  36. package/dist/core/static/tau_docs/node-sdk.md +1 -1
  37. package/dist/core/static/tau_docs/ownership-and-scope.md +3 -3
  38. package/dist/core/static/tau_docs/pdf-unpacking.md +1 -1
  39. package/dist/core/static/tau_docs/personas.md +3 -1
  40. package/dist/core/static/tau_docs/prompts-and-project-context.md +0 -10
  41. package/dist/core/static/tau_docs/remote-sessions.md +5 -21
  42. package/dist/core/static/tau_docs/session-protocol-methods.md +1 -7
  43. package/dist/core/static/tau_docs/skills.md +0 -22
  44. package/dist/core/static/tau_docs/speech-generation.md +1 -1
  45. package/dist/core/static/tau_docs/telegram.md +15 -17
  46. package/dist/core/static/tau_docs/troubleshooting.md +15 -15
  47. package/dist/core/static/tau_docs/tui.md +9 -24
  48. package/dist/core/telegram/adapter.js +120 -20
  49. package/dist/core/telegram/adapter.js.map +1 -1
  50. package/dist/core/telegram/cli.js +4 -5
  51. package/dist/core/telegram/cli.js.map +1 -1
  52. package/dist/core/telegram/runtime.js +3 -2
  53. package/dist/core/telegram/runtime.js.map +1 -1
  54. package/dist/core/telegram/session_manager.js +14 -0
  55. package/dist/core/telegram/session_manager.js.map +1 -1
  56. package/dist/core/telegram/tts.js +11 -9
  57. package/dist/core/telegram/tts.js.map +1 -1
  58. package/dist/core/tool/image_generate.js +37 -14
  59. package/dist/core/tool/image_generate.js.map +1 -1
  60. package/dist/core/tool/media.js +84 -4
  61. package/dist/core/tool/media.js.map +1 -1
  62. package/dist/core/tool/pdf_unpack.js +17 -10
  63. package/dist/core/tool/pdf_unpack.js.map +1 -1
  64. package/dist/core/tool/speech_generate.js +30 -13
  65. package/dist/core/tool/speech_generate.js.map +1 -1
  66. package/dist/core/utils/gemini_transcription.js +5 -95
  67. package/dist/core/utils/gemini_transcription.js.map +1 -1
  68. package/dist/core/utils/{gemini_speech.js → speech.js} +167 -428
  69. package/dist/core/utils/speech.js.map +1 -0
  70. package/dist/core/utils/speech_to_text.js +24 -52
  71. package/dist/core/utils/speech_to_text.js.map +1 -1
  72. package/dist/core/utils/speech_to_text_keywords.js +65 -0
  73. package/dist/core/utils/speech_to_text_keywords.js.map +1 -1
  74. package/dist/core/version.js +1 -1
  75. package/dist/execution/fly_sprite_execution_environment.js +4 -2
  76. package/dist/execution/fly_sprite_execution_environment.js.map +1 -1
  77. package/dist/main.js +6 -78
  78. package/dist/main.js.map +1 -1
  79. package/dist/protocol/index.d.ts +1 -1
  80. package/dist/protocol/index.js.map +1 -1
  81. package/dist/protocol/session_protocol.d.ts +2 -15
  82. package/dist/protocol/session_protocol.js +1 -20
  83. package/dist/protocol/session_protocol.js.map +1 -1
  84. package/dist/sdk/local_client.js +0 -6
  85. package/dist/sdk/local_client.js.map +1 -1
  86. package/dist/tui/chat_view.js +1 -3
  87. package/dist/tui/chat_view.js.map +1 -1
  88. package/dist/tui/listen_capture.js +7 -26
  89. package/dist/tui/listen_capture.js.map +1 -1
  90. package/dist/tui/session_chat_app.js +3 -19
  91. package/dist/tui/session_chat_app.js.map +1 -1
  92. package/dist/tui/session_chat_controller.js +58 -29
  93. package/dist/tui/session_chat_controller.js.map +1 -1
  94. package/dist/tui/speech_playback.js +10 -8
  95. package/dist/tui/speech_playback.js.map +1 -1
  96. package/dist/tui/ui/pending_messages.js +2 -1
  97. package/dist/tui/ui/pending_messages.js.map +1 -1
  98. package/package.json +3 -3
  99. package/dist/core/install/cli.js +0 -260
  100. package/dist/core/install/cli.js.map +0 -1
  101. package/dist/core/models/tau_model_overrides.js +0 -4
  102. package/dist/core/models/tau_model_overrides.js.map +0 -1
  103. package/dist/core/utils/gemini_speech.js.map +0 -1
  104. package/dist/core/utils/openai_transcription.js +0 -594
  105. package/dist/core/utils/openai_transcription.js.map +0 -1
  106. package/dist/execution/cloudflare_sandbox_execution_environment.js +0 -563
  107. package/dist/execution/cloudflare_sandbox_execution_environment.js.map +0 -1
  108. package/dist/execution/sandbox_tool_helpers.js +0 -30
  109. package/dist/execution/sandbox_tool_helpers.js.map +0 -1
  110. package/dist/starter/prompts/approval-review-branch.md +0 -7
  111. package/dist/starter/prompts/approval-review-current-changes.md +0 -7
  112. package/dist/starter/prompts/approval-review-last-commit.md +0 -7
  113. package/dist/starter/prompts/commit-all.md +0 -9
  114. package/dist/starter/prompts/commit-staged.md +0 -9
  115. package/dist/starter/prompts/guided-review-branch.md +0 -7
  116. package/dist/starter/prompts/guided-review-current-changes.md +0 -7
  117. package/dist/starter/prompts/guided-review-last-commit.md +0 -7
  118. package/dist/starter/prompts/plan.md +0 -7
  119. package/dist/starter/prompts/review-branch.md +0 -7
  120. package/dist/starter/prompts/review-current-changes.md +0 -7
  121. package/dist/starter/prompts/review-last-commit.md +0 -7
  122. package/dist/starter/prompts/rewrite-prompt.md +0 -89
  123. package/dist/starter/skills/approval-review/SKILL.md +0 -219
  124. package/dist/starter/skills/code-review/SKILL.md +0 -102
  125. package/dist/starter/skills/guided-review/SKILL.md +0 -152
  126. package/dist/starter/skills/plan/SKILL.md +0 -53
@@ -1,9 +0,0 @@
1
- ---
2
- id: "commit-all"
3
- label: "commit all changes"
4
- description: "stage and commit all current changes with a concise, well-formed message"
5
- ---
6
-
7
- Run `git status --short` and `git diff HEAD` (set max output tokens to 32768). If the working tree is clean and there are no untracked files, say so and stop.
8
-
9
- Do not explore beyond the diff. Stage and commit all changes. If they span unrelated concerns, split into separate commits. Message style: imperative mood, lowercase, no trailing punctuation, no prefixes like `feat:` or `fix:`, single line under 90 characters.
@@ -1,9 +0,0 @@
1
- ---
2
- id: "commit-staged"
3
- label: "commit staged changes"
4
- description: "commit the current staged changes with a concise, well-formed message"
5
- ---
6
-
7
- Run `git diff --staged` (set max output tokens to 32768). If nothing is staged, say so and stop.
8
-
9
- Do not explore beyond the diff. Commit the staged changes. If they span unrelated concerns, split into separate commits. Message style: imperative mood, lowercase, no trailing punctuation, no prefixes like `feat:` or `fix:`, single line under 90 characters.
@@ -1,7 +0,0 @@
1
- ---
2
- id: "guided-review-branch"
3
- label: "guided review of current branch"
4
- description: "split the current branch diff into natural chunks and guide focused diff reviews"
5
- ---
6
-
7
- Use @@skill:guided-review. Split the current branch diff against main into natural review chunks and guide me through it. First produce the phase 1 orientation brief: write a concise narrative reviewer briefing that explains the change intent, important behavior or contract changes, risk areas, and planned chunks without turning it into a checklist. Do not open the first diff review yet. Ask me whether to start phase 2 in `collect-only` mode or `apply-as-you-go` mode unless I already specified a mode.
@@ -1,7 +0,0 @@
1
- ---
2
- id: "guided-review-current-changes"
3
- label: "guided review of current changes"
4
- description: "split current changes into natural chunks and guide focused diff reviews"
5
- ---
6
-
7
- Use @@skill:guided-review. Split the current changes into natural review chunks and guide me through them. First produce the phase 1 orientation brief: write a concise narrative reviewer briefing that explains the change intent, important behavior or contract changes, risk areas, and planned chunks without turning it into a checklist. Do not open the first diff review yet. Ask me whether to start phase 2 in `collect-only` mode or `apply-as-you-go` mode unless I already specified a mode.
@@ -1,7 +0,0 @@
1
- ---
2
- id: "guided-review-last-commit"
3
- label: "guided review of most recent commit"
4
- description: "split the most recent commit into natural chunks and guide focused diff reviews"
5
- ---
6
-
7
- Use @@skill:guided-review. Split the most recent commit into natural review chunks and guide me through it. First produce the phase 1 orientation brief: write a concise narrative reviewer briefing that explains the change intent, important behavior or contract changes, risk areas, and planned chunks without turning it into a checklist. Do not open the first diff review yet. Ask me whether to start phase 2 in `collect-only` mode or `apply-as-you-go` mode unless I already specified a mode.
@@ -1,7 +0,0 @@
1
- ---
2
- id: "plan"
3
- label: "plan a feature or change"
4
- description: "create a step-by-step plan for implementing a feature or change"
5
- ---
6
-
7
- Use @@skill:plan. What to plan:
@@ -1,7 +0,0 @@
1
- ---
2
- id: "review-branch"
3
- label: "code review of current branch"
4
- description: "ask for a thorough code review for the current branch"
5
- ---
6
-
7
- Use @@skill:code-review. Think hard and be thorough. What to review: the current branch.
@@ -1,7 +0,0 @@
1
- ---
2
- id: "review-current-changes"
3
- label: "code review of current changes"
4
- description: "ask for a thorough code review for the current changes"
5
- ---
6
-
7
- Use @@skill:code-review. Think hard and be thorough. What to review: the current changes.
@@ -1,7 +0,0 @@
1
- ---
2
- id: "review-last-commit"
3
- label: "code review of most recent commit"
4
- description: "ask for a thorough code review for the most recent commit"
5
- ---
6
-
7
- Use @@skill:code-review. Think hard and be thorough. What to review: the most recent commit.
@@ -1,89 +0,0 @@
1
- ---
2
- id: "rewrite-prompt"
3
- label: "help with (re)writing a prompt"
4
- description: "help improve a given prompt"
5
- ---
6
-
7
- You are an expert prompt writer. Your job is to help users craft prompts that feel like guidance from a thoughtful colleague rather than instructions from a manual. Good prompts respect the reader's intelligence while giving them exactly the context they need to succeed.
8
-
9
- ## Reading the task
10
-
11
- Before you start writing, gauge what level of intervention the prompt actually needs. Think of it as a continuum with three useful reference points:
12
-
13
- - **From scratch**: The user has a vague idea or a rough explanation. Your job is to shape it into a well-structured prompt, applying the principles below fully.
14
- - **Restructure**: The user has a working prompt that needs significant reorganization, clearer hierarchy, or better flow. Preserve what already works. Reshape what does not.
15
- - **Polish**: The user has a solid prompt that just needs surgical edits: tighter language, improved tone, or fixes to specific sections. Change as little as possible while hitting the goal.
16
-
17
- Most requests fall somewhere between these points. Infer where you should operate from what the user provides and how they describe the problem. A rough description says "build this for me." A complete prompt with pointed complaints says "fix these specific things." If you are genuinely unsure, ask.
18
-
19
- Keep in mind that many users are not native English speakers. Regardless of where a request falls on the spectrum, elevating the language is part of your responsibility: varied vocabulary, smoother flow, more vivid phrasing, and precise word choices. Take what the user provides and make it shine.
20
-
21
- ## Philosophy
22
-
23
- Assume the reader is smart. Add only what they cannot figure out themselves. Before including any sentence, ask: "Does this earn its place?" Often, one concrete example teaches more than three paragraphs of explanation ever could.
24
-
25
- Think of a prompt as an onboarding guide for a brilliant new teammate. You are not explaining everything from scratch. You are giving them the specific context they lack so they can hit the ground running. Redundancy is debt: every repeated idea costs attention that could go elsewhere.
26
-
27
- ## Hierarchy and flow
28
-
29
- Start with context: what is this, and why does it matter. Then introduce principles that shape how to think about the problem. Follow with structure: what good output looks like. End with process: step-by-step instructions that tie it together. Each layer builds naturally on the one before.
30
-
31
- This layering is called **progressive disclosure**. Lead with essentials. Let details surface when they become relevant. Resist the urge to front-load everything just in case.
32
-
33
- Use H1 for the title only, H2 for major sections, and H3 when you need subsections. If you find yourself reaching for H4, that is usually a sign to flatten or restructure. Headings work best when they are punchy and lowercase: write "Writing style" rather than "Writing Style."
34
-
35
- Favor concise prose, but reach for bullets when they genuinely communicate better.
36
-
37
- ## Degrees of freedom
38
-
39
- Not all instructions need the same level of precision. Match how prescriptive you are to how fragile the task is:
40
-
41
- - **High freedom** (principles, heuristics): use when many approaches could work and the reader should choose based on context.
42
- - **Medium freedom** (patterns, templates): use when a preferred shape exists but the details can vary.
43
- - **Low freedom** (exact steps, rigid sequences): use when the task is brittle and even small deviations cause problems.
44
-
45
- Here is a mental image that helps: an open field lets you wander toward your destination however you like, but a narrow bridge with cliffs on both sides demands careful, specific steps.
46
-
47
- Name which mode you are using and why. This tells the reader when they can improvise and when they really should not.
48
-
49
- ## Writing style
50
-
51
- The best prompts read like they were written by a knowledgeable friend who is trying to help. They are clear without being cold, concise without being curt.
52
-
53
- Lead each paragraph with its main point. Follow with a brief rationale or supporting detail. Close with an example or implication when it helps. Two or three sentences per paragraph is often plenty.
54
-
55
- Vary your rhythm. A long sentence that explains the reasoning behind a principle can be followed by a short one that drives it home. Monotonous cadence puts readers to sleep. Mix it up.
56
-
57
- Favor active voice and direct statements. Use present tense for principles ("Context is limited") and imperative for instructions ("Start with the main point"). Steer clear of hedging: if you catch yourself writing "perhaps," "it might be good to," or "you may want to consider," rewrite with more conviction.
58
-
59
- A few word-choice habits that help:
60
-
61
- - Use "must" for hard requirements, "should" for recommendations, "can" for options.
62
- - Reach for concrete nouns over abstract ones.
63
- - Prefer verbs to nominalizations: write "challenge" rather than "the challenging of."
64
- - Be specific: "under 500 lines" beats "reasonably short."
65
- - Skip em dashes and en dashes. Commas, colons, and periods do the job.
66
- - Choose adjectives with care. One precise modifier paints a sharper picture than two vague ones.
67
-
68
- Structural patterns that make instructions easier to follow:
69
-
70
- - State the rule, then its exception: "Do X. Skip only when Y."
71
- - Use conditionals when context matters: "When X, do Y. When Z, do W instead."
72
- - Ask a rhetorical question now and then to prompt reflection: "Does this earn its place?"
73
- - Keep list items parallel. If one begins with a verb, they all should.
74
-
75
- Analogies can anchor abstract ideas in something concrete, but a little goes a long way. The best analogies invite the reader to extend them on their own: "narrow bridge" versus "open field" immediately signals how much freedom they have.
76
-
77
- ## Formatting
78
-
79
- Formatting should help readers scan, not impress them with structure.
80
-
81
- - **Bold key phrases** when you introduce them to signal importance, then use plain text afterward.
82
- - Use code blocks for commands, syntax, or structured output.
83
- - Bullets suit parallel items of equal weight. Do not use them for prose.
84
- - Numbered lists signal that order matters.
85
- - Introduce lists with a colon instead of burying them in complex sentences.
86
-
87
- ---
88
-
89
- Confirm that you understand these principles, and we can move forward.
@@ -1,219 +0,0 @@
1
- ---
2
- name: "approval-review"
3
- description: "Review a change for someone who has not read it, then guide them through product, architecture, and implementation decisions one contextual question at a time. Trigger: explicit."
4
- ---
5
-
6
- ## Goal
7
-
8
- Help a decision-maker confidently approve, merge, or reject a reviewable change without requiring them to read the implementation.
9
-
10
- First investigate the target with the rigor of a full code review. Then turn that understanding into a guided conversation about the decisions the change embodies. Start with product direction and architecture, move gradually toward operational and implementation details, and ask exactly one question at a time.
11
-
12
- This is not a diff walkthrough. Do not organize the conversation around files, functions, or hunks unless a low-level detail is necessary to explain a material decision.
13
-
14
- ## When to use
15
-
16
- Use this skill only when the user explicitly asks for a decision-oriented review, asks to gain confidence in a change without reading it, or requests this skill by name.
17
-
18
- Suitable targets include pull requests, branches, commits, uncommitted changes, designs, migrations, and other bounded proposals with meaningful decisions to review.
19
-
20
- ## Maintain a lightweight scratchpad
21
-
22
- At the start of the review, create a temporary scratchpad outside the target worktree. Use it as compact working memory across turns, not as a user-facing artifact or a substitute for the final assessment.
23
-
24
- Choose the format that best fits the target, but keep it lightweight. Record enough to resume the review without reconstructing the plan from the conversation, such as:
25
-
26
- - The target identity and last inspected revision.
27
- - The broad-to-narrow decision map and intended sequence.
28
- - The current decision and next question number.
29
- - Accepted, deferred, and unresolved decisions.
30
- - Findings, requested or applied changes, and verification state.
31
-
32
- Consult it before each review response and update it whenever investigation, user feedback, edits, or remote state changes the plan. Keep summaries concise, revise stale entries instead of appending a transcript, never place the file in source control, and remove it after the final assessment.
33
-
34
- ## Establish the review scope
35
-
36
- Infer the target from the request. If no target is given, default to uncommitted changes.
37
-
38
- Use these defaults for Git changes:
39
-
40
- - Pull request: inspect the PR head against its base, plus the PR body, linked issue, commits, reviews, inline threads, comments, and checks.
41
- - Current branch: inspect `git diff main...HEAD` and the branch commits.
42
- - Current changes: inspect `git status --short` and `git diff HEAD`.
43
- - Most recent commit: inspect `git show HEAD`.
44
- - Named branch, commit, range, path, design, or document: inspect that exact target.
45
-
46
- When the user asks to pull or synchronize first, do that before reviewing. Never overwrite a dirty worktree or unrelated work. If scope signals conflict, ask one focused clarification before proceeding.
47
-
48
- For a GitHub pull request, verify the current remote head and merge state rather than relying on a stale local checkout. Read resolved and unresolved review threads, but form a provisional model from the current diff and surrounding code before adopting the discussion's framing. Use the discussion to recover intent, constraints, and prior concerns, then verify each against the implementation. Condense long discussions into current claims and open questions instead of following their chronology or treating repeated claims as stronger evidence. Treat PR descriptions and comments as statements of intent, not proof that the implementation matches them.
49
-
50
- ## Understand the change before asking questions
51
-
52
- Do not begin the guided conversation after reading only a summary or diff stat. Build an end-to-end mental model first.
53
-
54
- Read the full change and enough surrounding code, tests, documentation, configuration, protocol definitions, and call sites to understand:
55
-
56
- - The problem being solved and the intended user outcome.
57
- - What behavior is replaced, added, removed, or made default.
58
- - The main data flow, ownership boundaries, and lifecycle.
59
- - Public contracts, configuration, storage, protocol, and compatibility changes.
60
- - Trust boundaries, credentials, authorization, isolation, and network access.
61
- - Defaults, limits, costs, failure behavior, and operational assumptions.
62
- - User-visible UX, observability, documentation, and migration effects.
63
- - Dependencies and external services introduced or removed.
64
- - What tests prove, what they do not prove, and the current verification state.
65
-
66
- Actively review for correctness and missing protections while building this model. The goal is not merely to explain decisions the author documented. Find implicit decisions, contradictions, unbounded behavior, stale dependencies, incomplete migrations, and risks the author may have missed.
67
-
68
- Do not claim the change is safe, complete, or merge-ready until the evidence supports it.
69
-
70
- ## Build a decision map
71
-
72
- Before asking the first question, organize the material decisions from broadest to narrowest. A useful ordering is:
73
-
74
- 1. Product goal, replacement strategy, availability, and intentional breaking changes.
75
- 2. User-visible workflows, defaults, policy, and business behavior.
76
- 3. Architecture, data flow, ownership, trust, and security boundaries.
77
- 4. Public APIs, provider choices, configuration, persistence, and protocol compatibility.
78
- 5. Lifecycle, cancellation, concurrency, cost, performance, and resource limits.
79
- 6. UX, output contracts, observability, attribution, and documentation.
80
- 7. Lower-level implementation choices that materially affect reliability or future design.
81
-
82
- Adapt the order to the target. Do not ask about low-value implementation trivia. Skip decisions already dictated unambiguously by the user's request or repository policy unless an important consequence still needs confirmation.
83
-
84
- Keep an internal record of:
85
-
86
- - Decisions the user accepted.
87
- - Concerns or changes the user requested.
88
- - Findings discovered during review.
89
- - Changes applied during the conversation.
90
- - Open questions and remaining verification.
91
-
92
- Do not repeatedly ask the user to approve the same underlying decision in different words.
93
-
94
- ## Orient a reviewer from first principles
95
-
96
- Assume the decision-maker begins without context from the issue, pull request, discussion, diff, or source and should not need to inspect those materials during the review. Across the conversation, transfer enough verified understanding for them to make a responsible approval decision from the review itself.
97
-
98
- Build that understanding progressively rather than front-loading a comprehensive summary. By the end, the reviewer should understand:
99
-
100
- - Why the change exists and how the user or operator experience changes.
101
- - The main architecture, ownership, data flow, lifecycle, and trust model.
102
- - The consequential alternatives and why the implementation chose this direction.
103
- - Material costs, compatibility effects, failure modes, and operational limits.
104
- - What evidence supports the change and what remains uncertain or unverified.
105
-
106
- Keep intent, verified behavior, recommendations, and unknowns distinct. Connect each question to the model already established, introduce only the new context needed for that decision, and revisit earlier context when later investigation changes it. The conversation should replace independent implementation archaeology, not conceal important implementation consequences.
107
-
108
- Before the final assessment, check whether the accumulated answers would let the reviewer explain the user outcome, the system boundaries, the accepted tradeoffs, the major risks, and the verification basis. If not, cover the missing material decision before concluding.
109
-
110
- ## Ask one contextual question at a time
111
-
112
- During the active review, each response may contain at most one decision question. When advancing the review sequence, ask exactly one. Never batch questions, even when they are related.
113
-
114
- Use this shape:
115
-
116
- ```markdown
117
- ### question N: concise decision title
118
-
119
- Two or more short paragraphs of context explaining the current behavior, why the change takes this direction, and the meaningful tradeoff or consequence. Use a small bullet list when it makes the contract easier to understand.
120
-
121
- **Are you okay with <specific decision>?**
122
- ```
123
-
124
- The question must be easy to answer with `okay`, `yes`, or an equivalent when the user agrees. The user should need a longer answer only when they have a concern, correction, or alternative.
125
-
126
- Provide enough context for a reader who has not opened the PR or source code:
127
-
128
- - Define project-specific terms before using them.
129
- - Explain before-and-after behavior when something is replaced.
130
- - Name the relevant boundary or workflow, not the implementing function.
131
- - State both the reason for the choice and its cost.
132
- - Make hidden consequences explicit, especially compatibility, credentials, network reach, persistence, cost, and failure behavior.
133
-
134
- Avoid:
135
-
136
- - Bare yes/no questions without orientation.
137
- - File-by-file narration.
138
- - Function-level mechanics that do not affect a material decision.
139
- - Leading praise or wording that pressures the user to agree.
140
- - Presenting an author's claim as established fact without verifying it.
141
- - Dumping the entire review up front.
142
-
143
- Treat the current decision as open until the user explicitly accepts it, defers it, or asks to stop. A clarification, correction, concern, or requested change does not implicitly resolve it. After handling any such response, ask the same decision again with updated context. Move to the next highest-value unresolved decision only after the user confirms the current outcome.
144
-
145
- ## Handle questions and disagreement
146
-
147
- When the user asks why something works a certain way, pause the sequence and answer directly. Verify the implementation before defending it. If the user's interpretation is correct, say so and refine or withdraw the earlier framing.
148
-
149
- End the response with one refined decision question when a decision still remains. Do not advance to a new topic until the user explicitly confirms the decision after the latest explanation or change.
150
-
151
- When the user disagrees or proposes another direction:
152
-
153
- 1. Restate the concern in concrete terms.
154
- 2. Investigate the relevant code or external contract as needed.
155
- 3. Explain the viable choices and their consequences.
156
- 4. Recommend one direction when the evidence supports it.
157
- 5. Ask one focused question that resolves the decision.
158
-
159
- Accuracy matters more than preserving the reviewer's original framing.
160
-
161
- ## Surface review findings as decisions
162
-
163
- When investigation reveals a real gap, do not hide it inside neutral explanation. Distinguish it from an intentional design choice.
164
-
165
- Use this shape:
166
-
167
- ```markdown
168
- ### question N: current behavior leaves <risk> unbounded
169
-
170
- Explain what is currently bounded, what remains unbounded, and the concrete failure or abuse mode. Give a proportionate recommendation with a proposed value or contract when possible.
171
-
172
- **Should the change add <specific protection> before approval?**
173
- ```
174
-
175
- Only surface findings that are actionable, introduced by the target, and supported by evidence. Do not manufacture questions from speculative concerns.
176
-
177
- For external APIs or infrastructure contracts, inspect authoritative documentation when practical. Say when a conclusion depends on an external assumption.
178
-
179
- ## Apply feedback during the review
180
-
181
- Default to conversational review without changing files merely because a question was asked. Once the user clearly requests a change or accepts a concrete recommendation to change the target, implement it without asking for another permission round.
182
-
183
- When applying feedback:
184
-
185
- - Update all owning contracts, tests, model-facing documentation, repository guidance, and user-facing docs affected by the change.
186
- - Prefer canonical changes over compatibility scaffolding unless compatibility is explicitly required.
187
- - Run the smallest useful verification immediately.
188
- - Briefly report what changed and whether verification passed, then ask the user to confirm the resulting decision before advancing.
189
- - Keep uncommitted changes visible in the final summary.
190
-
191
- Do not commit, push, merge, or open a pull request unless the user explicitly asks. If they did ask as part of the original task, carry that through after verification.
192
-
193
- If the user requests a read-only review, collect requested changes instead of editing and summarize them at the end.
194
-
195
- ## Know when to stop
196
-
197
- Continue until all material product, architecture, business, trust, compatibility, lifecycle, and operational decisions have been covered, plus any lower-level choice that could reasonably change the approval decision.
198
-
199
- Do not keep asking questions merely to be exhaustive. Stop when the remaining details are routine implementation mechanics that are already tested and consistent with accepted decisions.
200
-
201
- Before the final assessment:
202
-
203
- - Re-read the net change, including edits made during the review.
204
- - Confirm removed systems left no dependencies, configuration, protocol values, documentation, or tests behind.
205
- - Run project-required formatting, checks, build, and tests when changes were applied.
206
- - Recheck the remote head, merge state, review state, and checks whenever the target is a pull request. If the head changed since it was inspected, fetch it, review the updated net diff and affected context, revise the decision map, and reopen any accepted decision whose basis changed.
207
-
208
- ## Final assessment
209
-
210
- Summarize:
211
-
212
- - The accepted product and architectural model.
213
- - Material tradeoffs the user explicitly accepted.
214
- - Findings fixed or deferred during the review.
215
- - Verification results and remaining gaps.
216
- - Whether the target is ready to approve or merge.
217
- - Any uncommitted, unpushed, or administratively incomplete work.
218
-
219
- Keep the final assessment concise and decision-oriented. If one administrative action remains, such as committing and pushing review fixes, ask only that one question.
@@ -1,102 +0,0 @@
1
- ---
2
- name: "code-review"
3
- description: "Conduct rigorous code review for git changes and return prioritized, actionable findings in a strict verdict/findings format. Trigger: explicit."
4
- ---
5
-
6
- ## Goal
7
-
8
- Examine proposed changes made by another engineer. Identify discrete, actionable issues that the original author would likely fix if they noticed them.
9
-
10
- Think hard and be thorough. A sloppy review is worse than no review.
11
-
12
- ## Review mode and focus
13
-
14
- By default, run a comprehensive, balanced PR-style review. Cover the full change and all major risk areas (correctness, security, performance, cleanliness, and maintainability), not just one narrow angle.
15
-
16
- If you were given a specific review focus, angle, or additional instructions (for example, "focus on performance" or "look only for security issues"), follow that requested focus instead of the default broad pass.
17
-
18
- ## Select review scope
19
-
20
- Infer scope from the user request. Wrapper prompts may include `What to review: ...`, but do not require that exact line.
21
-
22
- Default to uncommitted changes when scope is not explicitly specified.
23
-
24
- Use this mapping:
25
-
26
- - Uncommitted or current changes -> `git status --short` and `git diff HEAD`
27
- - Current branch -> `git diff main...HEAD`
28
- - Most recent commit -> `git show HEAD`
29
-
30
- If the request contains conflicting scope signals, ask a clarifying question first.
31
-
32
- For every diff/show command, set bash `maxOutputTokens` to `32768`.
33
-
34
- ## Understand the change
35
-
36
- Start with the diff, but do not stop there. Read surrounding code, trace call sites, check type definitions, and search for related patterns. Understand what the author was trying to accomplish before judging whether they succeeded.
37
-
38
- Examine every changed file, not just the obvious ones. Trace how changes interact across files. Consider edge cases, error paths, and implicit assumptions. When changes in one file imply corresponding changes elsewhere and those are absent, treat that as a red flag. Do not guess when reading more code would give you the answer. If a change looks suspicious, verify before flagging.
39
-
40
- ## What to look for
41
-
42
- Actively hunt for issues across these categories:
43
-
44
- - **Correctness**: Logic errors, broken edge cases, off-by-one mistakes, race conditions, missing error handling.
45
- - **Security**: Injection vulnerabilities, exposed secrets, missing input validation, broken access controls.
46
- - **Performance**: Unnecessary allocations in hot paths, O(n²) where O(n) is straightforward, missing indexes.
47
- - **Cleanliness**: Leftover debug code (`console.log`, print statements), commented-out code, dead imports.
48
- - **Maintainability**: Fragile coupling, misleading names, duplicated logic that will drift.
49
-
50
- ## When to flag
51
-
52
- Report a finding only when it is:
53
-
54
- 1. **Actionable**: The fix is discrete, not a general complaint.
55
- 2. **New**: Introduced in the reviewed change, not pre-existing (unless the change made it worse).
56
- 3. **Provable**: You can point to specific code and explain why it breaks. No speculation, no unstated assumptions about the codebase or author intent.
57
- 4. **Proportionate**: The fix does not demand excessive rigor for the context.
58
-
59
- Report all qualifying findings, not just the first one. If none qualify, say so.
60
-
61
- ## Priority levels
62
-
63
- Prefix each finding title with one priority:
64
-
65
- - **[P0]**: Critical. Drop everything. (for example, crashes, security holes, data loss)
66
- - **[P1]**: Urgent. Fix this cycle. (for example, wrong logic, major perf regression, debug code left in)
67
- - **[P2]**: Normal. Fix soon. (for example, minor bugs, maintainability issues, clear typos)
68
- - **[P3]**: Low. Nice to have. (for example, style, naming nits)
69
-
70
- ## How to comment
71
-
72
- Write so the author understands at a glance. One paragraph max per finding. No filler ("Great job", "Thanks"). Explain why the issue matters and when it breaks. Mention specific scenarios or inputs if relevant.
73
-
74
- Use short code blocks for snippets. Keep line ranges tight to pinpoint the problem. When providing replacement code, preserve exact leading whitespace (spaces vs tabs) and do not change outer indentation unless that is the fix.
75
-
76
- ## Output format
77
-
78
- Use "Correct" when there are no blocking issues (P0/P1). Use "Incorrect" when there are blocking bugs or broken functionality.
79
-
80
- Gaps are things that matter for correctness but require information from outside the codebase to verify: external API contracts, deployment configuration, third-party service behavior, upstream schema compatibility. If the answer lives somewhere in the code, it is not a gap. Read the code and resolve it. Only list what genuinely cannot be determined from the repository alone.
81
-
82
- ```
83
- Verdict: [Correct|Incorrect]
84
-
85
- <one to three sentence summary>
86
-
87
- ## Findings
88
-
89
- ### [P#] <imperative title>
90
-
91
- **Location**: `<file-path>:<line-range>`
92
-
93
- <one to two paragraph description>
94
-
95
- <optional suggestion code block(s)>
96
-
97
- (...repeat for each finding, or "No findings." if none qualify)
98
-
99
- ## Gaps
100
-
101
- - <gap, or "None.">
102
- ```