Repository navigation
fix: show "changes requested" reviews with how to send them again - #59
Conversation
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)) |
There was a problem hiding this comment.
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).` |
There was a problem hiding this comment.
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)}` |
There was a problem hiding this comment.
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.
Code Review SummaryStatus: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (5 files)
Fix these issues in Kilo Cloud Reviewed by deepseek-v4.1-flash-1017 · Input: 53.1K · Output: 10.4K · Cached: 516.8K |
ralphstodomingo
left a comment
There was a problem hiding this comment.
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 putaltimate-codenext toaltimate, and altimate-code's own TUI toast saysaltimate-code skill publishtoo. 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.
Summary
When a reviewer requests changes on a skill or knowledge request, the Claude Code toast read
… is now changes_requested, and/altimate-code:rulesdidn't list the status.◆ 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:ruleshad nochanges_requestedstatusrules.tsx,resend-hint.ts), including itsshellArgquoting. 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 toMAX_NAME.rules.mdsays 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-codeoraltimate).Replaces #58 (same change, renamed branch, plus the review follow-ups from there).
Testing
hooks/review-notices.test.ts(skill and knowledge wording, no double period, quoting a non-slug name).claude plugin test .: 1493 pass, 0 fail.Companion: the same
/altimate-code:ruleschange in altimate-codex-plugin.🤖 Generated with Claude Code