Skip to content

fix: show "changes requested" reviews with how to send them again - #59

Merged
saravmajestic merged 1 commit into
mainfrom
fix/changes-requested-toast
Dec 3, 2026
Merged

saravmajestic merged 1 commit into
mainfrom
fix/changes-requested-toast

Conversation

@saravmajestic

Copy link
Copy Markdown
Contributor

Summary

When a reviewer requests changes on a skill or knowledge request, the Claude Code toast read … is now changes_requested, and /altimate-code:rules didn't list the status.

Before After
◆ altimate · Your skill "naming" is now changes_requested ◆ altimate · Changes requested on your skill "naming" by <reviewer> — <comment>. Change the skill, then send it again with `altimate-code skill publish naming` (or from your IDE).
/altimate-code:rules had no changes_requested status Listed as "changes requested", with the reviewer's comment and how the user sends it again
  • The toast wording mirrors the altimate-code TUI (rules.tsx, resend-hint.ts), including its shellArg quoting. A knowledge base points to the workspace's Knowledge tab instead of the CLI. In the publish command a name that isn't a plain slug is quoted in full; the name shown is still clipped to MAX_NAME.
  • rules.md says sending it again is the user's to do, not the workflow's (an unchanged publish would resend what the reviewer sent back), and names the CLI step 1 found (altimate-code or altimate).
  • README lists "sent back for changes" among the request states.

Replaces #58 (same change, renamed branch, plus the review follow-ups from there).

Testing

  • 2 new tests in hooks/review-notices.test.ts (skill and knowledge wording, no double period, quoting a non-slug name).
  • claude plugin test .: 1493 pass, 0 fail.
  • Not run: a live session showing the toast.

Companion: the same /altimate-code:rules change in altimate-codex-plugin.

🤖 Generated with Claude Code

A skill or knowledge request sent back for changes toasted as
"is now changes_requested", and `/altimate-code:rules` did not know the status.

- `decisionText` words `changes_requested` like the altimate-code TUI: the reviewer, their comment, and how to send it again
- `resendHint`: `altimate-code skill publish <name>` for a skill (name quoted unless a plain slug), the Knowledge tab for a knowledge base
- `commands/rules.md` lists the status with the comment and tells the user how to resend; the workflow does not publish it itself
- README and CHANGELOG; tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
const clip = (text: string, max: number) => (text.length > max ? `${text.slice(0, max - 1)}…` : text)
const sentence = (text: string) => (/[.!?…]$/.test(text) ? text : `${text}.`)
/** A skill name as a shell argument: quoted unless it is a plain slug. */
const shellArg = (name: string) => (/^[A-Za-z0-9._-]+$/.test(name) ? name : JSON.stringify(name))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: JSON.stringify produces a double-quoted shell string, so $ and backticks are still expanded when the hint is pasted.

A name like dbt-$ref renders as `altimate-code skill publish "dbt-$ref"` and the shell expands $ref (usually to nothing), so the command publishes the wrong name. A name containing $(...) or backticks would even run a command in the user's shell. JSON.stringify also leaves newlines as a literal \n instead of the real character.

Use single quotes and escape an embedded apostrophe the POSIX way, e.g. '${name.replace(/'/g, "'\\''")}', which makes every character literal.

* command takes the full name: a cut one would publish nothing. */
function resendHint(kind: ReviewDecision['kind'], name: string): string {
if (kind === 'knowledge') return "Change the knowledge base, then send it again from the workspace's Knowledge tab."
return `Change the skill, then send it again with \`altimate-code skill publish ${shellArg(name)}\` (or from your IDE).`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: The hint hardcodes altimate-code, but the plugin resolves the CLI as altimate first (CLI_NAMES = ['altimate', 'altimate-code'] in hooks/altimate-cli.ts: altimate is what the standalone installer and npm v0.7.1+ put on PATH; only older npm installs have altimate-code).

For a user whose CLI is altimate only, the suggested command fails with "command not found", and the accompanying commands/rules.md change already says to use <cli> — the binary actually found in step 1. Since decisionText is a pure formatter, either pass the resolved binary name in, or word the hint without a binary (skill publish <name>, or point at /altimate-code:rules, which resolves it).

if (d.status === 'retired') return `◆ altimate · Your ${what} "${name}" was removed from the workspace${by}${why}`
if (d.status === 'changes_requested') {
const said = `◆ altimate · Changes requested on your ${what} "${name}"${by}${why}`
return `${sentence(said)} ${resendHint(d.kind, d.name)}`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: The resend hint is given the unclipped d.name while the visible name is clipped to MAX_NAME, so the toast length is no longer bounded (the tests even assert a 113-character name stays whole, producing a ~250-character toast).

Consider passing the whole name only when d.name.length <= MAX_NAME, and otherwise dropping the command in favour of the existing /altimate-code:rules pointer (which lists the exact name and status), so the "a toast is one glance" budget in the comments still holds.

@kilo-code-bot

kilo-code-bot Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
plugins/altimate-code/hooks/review-notices.ts 47 shellArg uses JSON.stringify, which double-quotes while still allowing $ and backtick expansion: a name like dbt-$ref produces a command that publishes the wrong name, and $(...)/backticks would execute. Use POSIX single-quote escaping.
plugins/altimate-code/hooks/review-notices.ts 53 The resend hint hardcodes altimate-code, but the plugin resolves altimate first (CLI_NAMES in hooks/altimate-cli.ts); with only altimate on PATH the suggested command fails. commands/rules.md already says to use the binary step 1 found.

SUGGESTION

File Line Issue
plugins/altimate-code/hooks/review-notices.ts 67 The resend hint receives the unclipped d.name, so the "a toast is one glance" MAX_NAME budget no longer bounds the toast length; use the full name only when it fits, else point at /altimate-code:rules.
Files Reviewed (5 files)
  • plugins/altimate-code/CHANGELOG.md - 0 issues
  • plugins/altimate-code/README.md - 0 issues
  • plugins/altimate-code/commands/rules.md - 0 issues
  • plugins/altimate-code/hooks/review-notices.test.ts - 0 issues (tests mirror the current wording; no case covers $/backtick names)
  • plugins/altimate-code/hooks/review-notices.ts - 3 issues

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash-1017 · Input: 53.1K · Output: 10.4K · Cached: 516.8K

@ralphstodomingo ralphstodomingo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for redoing this without the ticket ref. Everything from my review on #58 is in: the README lists "sent back for changes" in both places, /altimate-code:rules says sending it again is the user's to do and uses the CLI from step 1, and resendHint isn't exported any more.

Kilo's new points, so you don't have to chase them:

  • altimate-only PATH: current installers (npm, Homebrew, AUR and the install script) all put altimate-code next to altimate, and altimate-code's own TUI toast says altimate-code skill publish too. So this matches.
  • Quoting: same as before. It's altimate-code's helper, so harden it there first if at all.
  • Toast length with a long name: altimate-code passes the full name into the command too, and a cut name would publish nothing.

Good to go.

Appendix — complexity delta (Complexity delta)

e9a26dddd0 → c1c679da47 · only functions this diff touches · advisory, not a gate.

Function File Cognitive CCN Status
decisionText L57 plugins/altimate-code/hooks/review-notices.ts 6 → 7 ▲ 7 → 8 ▲ easy

Summary: 1 touched · 1 rose · 0 improved · 3 new (max cognitive 1) · net cognitive Δ +4

ℹ️ How to read these numbers

Cognitive (Sonar spec) counts breaks in linear reading flow — each if/loop/catch/ternary/boolean-operator switch adds 1, and nesting makes every further break cost more. It approximates how much you must hold in your head to follow the function: 0–5 trivial · 6–10 easy · 11–15 moderate (15 = Sonar's recommended per-function cap) · 16–25 hard to follow · >25 needs decomposition.

CCN (cyclomatic) counts independent paths — also the minimum number of test cases for full branch coverage of the function.

Only functions this diff touches are measured, as deltas — pre-existing complexity is not counted against this change. Rising numbers aren't automatically wrong; they're where review attention should go. Test files excluded.

@saravmajestic
saravmajestic merged commit 48e3c4e into main Dec 3, 2026
4 checks passed
@saravmajestic
saravmajestic deleted the fix/changes-requested-toast branch December 3, 2026 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants