Superpowers review (#2)

Superpowers review (#2)

Co-authored-by: Danny Kim <temeddix@gmail.com>
Co-committed-by: Danny Kim <temeddix@gmail.com>
This commit was merged in pull request #2.
This commit is contained in:
2026-09-13 14:30:29 +00:00
committed by temeddix
parent 8c2041bbc5
commit b8d0093ef2
2 changed files with 32 additions and 12 deletions
+21 -3
View File
@@ -68,16 +68,32 @@ async function postResult(body: string): Promise<void> {
});
}
async function run(command: string, args: string[]): Promise<void> {
const { success, code } = await new Deno.Command(command, { args }).output();
if (!success) throw new Error(`${command} ${args[0]} exited with ${code}`);
}
// Commits belong to the same account as the pull request they end up in.
async function configureGitAuthor(): Promise<void> {
const user: GiteaUser = await (await gitea(AUTHOR_TOKEN, "user")).json();
for (const [key, value] of [["name", user.login], ["email", user.email]]) {
await new Deno.Command("git", {
args: ["config", "--global", `user.${key}`, value],
}).output();
await run("git", ["config", "--global", `user.${key}`, value]);
}
}
// The superpowers plugin gives the agent its skills, including the code review
// one that the prompt asks for. Both installs are idempotent on the persisted
// home.
async function installSuperpowers(bot: string): Promise<void> {
const commands = bot === "claude"
? [
["plugin", "marketplace", "add", "obra/superpowers-marketplace"],
["plugin", "install", "-y", "superpowers@superpowers-marketplace"],
]
: [["plugin", "add", "superpowers@openai-curated-remote"]];
for (const args of commands) await run(bot, args);
}
async function renderPrompt(): Promise<string> {
const comments: GiteaComment[] = await (await gitea(
REVIEWER_TOKEN,
@@ -111,6 +127,7 @@ async function runClaude(prompt: string): Promise<string> {
);
Deno.exit(1);
}
await installSuperpowers("claude");
const claude = new Deno.Command("claude", {
args: [
"--print",
@@ -174,6 +191,7 @@ async function runCodex(prompt: string): Promise<string> {
})
.output();
if (!loggedIn.success) await codexDeviceLogin();
await installSuperpowers("codex");
const file = await Deno.makeTempFile();
const status = await new Deno.Command("codex", {
args: [