@frenchtoastman/oh-my-groundcontrol 0.0.17 → 0.0.19
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.
- package/dist/cli/custom-commands.d.ts +26 -0
- package/dist/cli/index.js +71 -12
- package/dist/hooks/analyze-command/index.d.ts +10 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +168 -8
- package/package.json +1 -1
- package/src/skills/analyze/SKILL.md +0 -116
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A custom command bundled in this repository.
|
|
3
|
+
* Copied from src/commands/ to ~/.config/opencode/command/ during install.
|
|
4
|
+
*/
|
|
5
|
+
export interface CustomCommand {
|
|
6
|
+
/** Command name (filename without .md extension) */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Human-readable description */
|
|
9
|
+
description: string;
|
|
10
|
+
/** Source path in this repo (relative to project root) */
|
|
11
|
+
sourcePath: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Registry of custom commands bundled in this repository.
|
|
15
|
+
*/
|
|
16
|
+
export declare const CUSTOM_COMMANDS: CustomCommand[];
|
|
17
|
+
/**
|
|
18
|
+
* Get the target directory for custom command installation.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getCustomCommandsDir(): string;
|
|
21
|
+
/**
|
|
22
|
+
* Install a custom command by copying from src/commands/ to ~/.config/opencode/command/
|
|
23
|
+
* @param command - The custom command to install
|
|
24
|
+
* @returns True if installation succeeded, false otherwise
|
|
25
|
+
*/
|
|
26
|
+
export declare function installCustomCommand(command: CustomCommand): boolean;
|
package/dist/cli/index.js
CHANGED
|
@@ -13822,12 +13822,6 @@ var CUSTOM_SKILLS = [
|
|
|
13822
13822
|
description: "Repository understanding and hierarchical codemap generation",
|
|
13823
13823
|
allowedAgents: ["orchestrator", "explorer"],
|
|
13824
13824
|
sourcePath: "src/skills/cartography"
|
|
13825
|
-
},
|
|
13826
|
-
{
|
|
13827
|
-
name: "analyze",
|
|
13828
|
-
description: "Code review and analysis for uncommitted changes, commits, branches, PRs, or specific files.",
|
|
13829
|
-
allowedAgents: ["*"],
|
|
13830
|
-
sourcePath: "src/skills/analyze"
|
|
13831
13825
|
}
|
|
13832
13826
|
];
|
|
13833
13827
|
function getCustomSkillsDir() {
|
|
@@ -16135,6 +16129,42 @@ function pickSupportOpenCodeModel(models, primaryModel) {
|
|
|
16135
16129
|
}, primaryModel);
|
|
16136
16130
|
return support;
|
|
16137
16131
|
}
|
|
16132
|
+
// src/cli/custom-commands.ts
|
|
16133
|
+
import { copyFileSync as copyFileSync3, existsSync as existsSync4, mkdirSync as mkdirSync3 } from "fs";
|
|
16134
|
+
import { homedir as homedir3 } from "os";
|
|
16135
|
+
import { join as join3 } from "path";
|
|
16136
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
16137
|
+
var CUSTOM_COMMANDS = [
|
|
16138
|
+
{
|
|
16139
|
+
name: "analyze",
|
|
16140
|
+
description: "Code review and analysis for uncommitted changes, commits, branches, PRs, or specific files",
|
|
16141
|
+
sourcePath: "src/commands/analyze.md"
|
|
16142
|
+
}
|
|
16143
|
+
];
|
|
16144
|
+
function getCustomCommandsDir() {
|
|
16145
|
+
return join3(homedir3(), ".config", "opencode", "command");
|
|
16146
|
+
}
|
|
16147
|
+
function installCustomCommand(command) {
|
|
16148
|
+
try {
|
|
16149
|
+
const packageRoot = fileURLToPath2(new URL("../..", import.meta.url));
|
|
16150
|
+
const sourcePath = join3(packageRoot, command.sourcePath);
|
|
16151
|
+
const targetDir = getCustomCommandsDir();
|
|
16152
|
+
const targetPath = join3(targetDir, `${command.name}.md`);
|
|
16153
|
+
if (!existsSync4(sourcePath)) {
|
|
16154
|
+
console.error(`Custom command source not found: ${sourcePath}`);
|
|
16155
|
+
return false;
|
|
16156
|
+
}
|
|
16157
|
+
if (!existsSync4(targetDir)) {
|
|
16158
|
+
mkdirSync3(targetDir, { recursive: true });
|
|
16159
|
+
}
|
|
16160
|
+
copyFileSync3(sourcePath, targetPath);
|
|
16161
|
+
return true;
|
|
16162
|
+
} catch (error48) {
|
|
16163
|
+
console.error(`Failed to install custom command: ${command.name}`, error48);
|
|
16164
|
+
return false;
|
|
16165
|
+
}
|
|
16166
|
+
}
|
|
16167
|
+
|
|
16138
16168
|
// src/cli/install.ts
|
|
16139
16169
|
var GREEN = "\x1B[32m";
|
|
16140
16170
|
var BLUE = "\x1B[34m";
|
|
@@ -16531,12 +16561,15 @@ async function runManualSetupMode(rl, detected, modelsOnly = false) {
|
|
|
16531
16561
|
console.log();
|
|
16532
16562
|
skills = await askYesNo(rl, "Install recommended skills?", "yes");
|
|
16533
16563
|
console.log();
|
|
16534
|
-
console.log(`${BOLD}Custom Skills:${RESET}`);
|
|
16564
|
+
console.log(`${BOLD}Custom Skills & Commands:${RESET}`);
|
|
16535
16565
|
for (const skill of CUSTOM_SKILLS) {
|
|
16536
|
-
console.log(` ${SYMBOLS.bullet} ${BOLD}${skill.name}${RESET}: ${skill.description}`);
|
|
16566
|
+
console.log(` ${SYMBOLS.bullet} ${BOLD}${skill.name}${RESET} (skill): ${skill.description}`);
|
|
16567
|
+
}
|
|
16568
|
+
for (const command of CUSTOM_COMMANDS) {
|
|
16569
|
+
console.log(` ${SYMBOLS.bullet} ${BOLD}/${command.name}${RESET} (command): ${command.description}`);
|
|
16537
16570
|
}
|
|
16538
16571
|
console.log();
|
|
16539
|
-
customSkills = await askYesNo(rl, "Install custom skills?", "yes");
|
|
16572
|
+
customSkills = await askYesNo(rl, "Install custom skills & commands?", "yes");
|
|
16540
16573
|
console.log();
|
|
16541
16574
|
} else {
|
|
16542
16575
|
printInfo("Models-only mode: skipping plugin/auth setup and skills prompts.");
|
|
@@ -16682,12 +16715,15 @@ async function runInteractiveMode(detected, modelsOnly = false) {
|
|
|
16682
16715
|
console.log();
|
|
16683
16716
|
skills = await askYesNo(rl, "Install recommended skills?", "yes");
|
|
16684
16717
|
console.log();
|
|
16685
|
-
console.log(`${BOLD}Custom Skills:${RESET}`);
|
|
16718
|
+
console.log(`${BOLD}Custom Skills & Commands:${RESET}`);
|
|
16686
16719
|
for (const skill of CUSTOM_SKILLS) {
|
|
16687
|
-
console.log(` ${SYMBOLS.bullet} ${BOLD}${skill.name}${RESET}: ${skill.description}`);
|
|
16720
|
+
console.log(` ${SYMBOLS.bullet} ${BOLD}${skill.name}${RESET} (skill): ${skill.description}`);
|
|
16721
|
+
}
|
|
16722
|
+
for (const command of CUSTOM_COMMANDS) {
|
|
16723
|
+
console.log(` ${SYMBOLS.bullet} ${BOLD}/${command.name}${RESET} (command): ${command.description}`);
|
|
16688
16724
|
}
|
|
16689
16725
|
console.log();
|
|
16690
|
-
customSkills = await askYesNo(rl, "Install custom skills?", "yes");
|
|
16726
|
+
customSkills = await askYesNo(rl, "Install custom skills & commands?", "yes");
|
|
16691
16727
|
console.log();
|
|
16692
16728
|
} else {
|
|
16693
16729
|
printInfo("Models-only mode: skipping plugin/auth setup and skills prompts.");
|
|
@@ -16744,6 +16780,8 @@ async function runInstall(config2) {
|
|
|
16744
16780
|
totalSteps += 1;
|
|
16745
16781
|
if (!modelsOnly && resolvedConfig.installCustomSkills)
|
|
16746
16782
|
totalSteps += 1;
|
|
16783
|
+
if (!modelsOnly && resolvedConfig.installCustomSkills)
|
|
16784
|
+
totalSteps += 1;
|
|
16747
16785
|
let step = 1;
|
|
16748
16786
|
if (modelsOnly) {
|
|
16749
16787
|
printInfo("Models-only mode: updating model assignments without reinstalling plugins/skills.");
|
|
@@ -16918,6 +16956,27 @@ ${JSON.stringify(liteConfig, null, 2)}
|
|
|
16918
16956
|
printSuccess(`${customSkillsInstalled}/${CUSTOM_SKILLS.length} custom skills installed`);
|
|
16919
16957
|
}
|
|
16920
16958
|
}
|
|
16959
|
+
if (!modelsOnly && resolvedConfig.installCustomSkills) {
|
|
16960
|
+
printStep(step++, totalSteps, "Installing custom commands...");
|
|
16961
|
+
if (resolvedConfig.dryRun) {
|
|
16962
|
+
printInfo("Dry run mode - would install custom commands:");
|
|
16963
|
+
for (const command of CUSTOM_COMMANDS) {
|
|
16964
|
+
printInfo(` - /${command.name}`);
|
|
16965
|
+
}
|
|
16966
|
+
} else {
|
|
16967
|
+
let commandsInstalled = 0;
|
|
16968
|
+
for (const command of CUSTOM_COMMANDS) {
|
|
16969
|
+
printInfo(`Installing /${command.name}...`);
|
|
16970
|
+
if (installCustomCommand(command)) {
|
|
16971
|
+
printSuccess(`Installed: /${command.name}`);
|
|
16972
|
+
commandsInstalled++;
|
|
16973
|
+
} else {
|
|
16974
|
+
printWarning(`Failed to install: /${command.name}`);
|
|
16975
|
+
}
|
|
16976
|
+
}
|
|
16977
|
+
printSuccess(`${commandsInstalled}/${CUSTOM_COMMANDS.length} custom commands installed`);
|
|
16978
|
+
}
|
|
16979
|
+
}
|
|
16921
16980
|
console.log();
|
|
16922
16981
|
console.log(formatConfigSummary(resolvedConfig));
|
|
16923
16982
|
console.log();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Part } from '@opencode-ai/sdk';
|
|
2
|
+
export declare function createAnalyzeCommandHook(): {
|
|
3
|
+
'command.execute.before': (input: {
|
|
4
|
+
command: string;
|
|
5
|
+
sessionID: string;
|
|
6
|
+
arguments: string;
|
|
7
|
+
}, output: {
|
|
8
|
+
parts: Part[];
|
|
9
|
+
}) => Promise<void>;
|
|
10
|
+
};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { createAnalyzeCommandHook } from './analyze-command';
|
|
1
2
|
export type { AutoUpdateCheckerOptions } from './auto-update-checker';
|
|
2
3
|
export { createAutoUpdateCheckerHook } from './auto-update-checker';
|
|
3
4
|
export { createDelegateTaskRetryHook } from './delegate-task-retry';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Plugin } from '@opencode-ai/plugin';
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const OhMyGroundControl: Plugin;
|
|
3
|
+
export default OhMyGroundControl;
|
|
4
4
|
export type { AgentName, AgentOverrideConfig, HashlineEditConfig, McpName, PluginConfig, SessionExportConfig, TmuxConfig, TmuxLayout, } from './config';
|
|
5
5
|
export type { RemoteMcpConfig } from './mcp';
|
package/dist/index.js
CHANGED
|
@@ -3284,12 +3284,6 @@ var CUSTOM_SKILLS = [
|
|
|
3284
3284
|
description: "Repository understanding and hierarchical codemap generation",
|
|
3285
3285
|
allowedAgents: ["orchestrator", "explorer"],
|
|
3286
3286
|
sourcePath: "src/skills/cartography"
|
|
3287
|
-
},
|
|
3288
|
-
{
|
|
3289
|
-
name: "analyze",
|
|
3290
|
-
description: "Code review and analysis for uncommitted changes, commits, branches, PRs, or specific files.",
|
|
3291
|
-
allowedAgents: ["*"],
|
|
3292
|
-
sourcePath: "src/skills/analyze"
|
|
3293
3287
|
}
|
|
3294
3288
|
];
|
|
3295
3289
|
|
|
@@ -22232,6 +22226,170 @@ function validateAllowedProviders(allowedProviders, enabledProviders) {
|
|
|
22232
22226
|
return null;
|
|
22233
22227
|
}
|
|
22234
22228
|
|
|
22229
|
+
// src/hooks/analyze-command/template/analyze.txt
|
|
22230
|
+
var analyze_default = `You are a code reviewer. Your job is to review code changes and provide actionable feedback.
|
|
22231
|
+
|
|
22232
|
+
---
|
|
22233
|
+
|
|
22234
|
+
$REVIEW_TARGET
|
|
22235
|
+
|
|
22236
|
+
---
|
|
22237
|
+
|
|
22238
|
+
## Gathering Context
|
|
22239
|
+
|
|
22240
|
+
**Diffs alone are not enough.** After getting the diff, read the entire file(s) being modified to understand the full context. Code that looks wrong in isolation may be correct given surrounding logic\u2014and vice versa.
|
|
22241
|
+
|
|
22242
|
+
- Use the diff to identify which files changed
|
|
22243
|
+
- Use \`git status --short\` to identify untracked files, then read their full contents
|
|
22244
|
+
- Read the full file to understand existing patterns, control flow, and error handling
|
|
22245
|
+
- Check for existing style guide or conventions files (CONVENTIONS.md, AGENTS.md, .editorconfig, etc.)
|
|
22246
|
+
|
|
22247
|
+
---
|
|
22248
|
+
|
|
22249
|
+
## What to Look For
|
|
22250
|
+
|
|
22251
|
+
**Bugs** - Your primary focus.
|
|
22252
|
+
- Logic errors, off-by-one mistakes, incorrect conditionals
|
|
22253
|
+
- If-else guards: missing guards, incorrect branching, unreachable code paths
|
|
22254
|
+
- Edge cases: null/empty/undefined inputs, error conditions, race conditions
|
|
22255
|
+
- Security issues: injection, auth bypass, data exposure
|
|
22256
|
+
- Broken error handling that swallows failures, throws unexpectedly or returns error types that are not caught.
|
|
22257
|
+
|
|
22258
|
+
**Structure** - Does the code fit the codebase?
|
|
22259
|
+
- Does it follow existing patterns and conventions?
|
|
22260
|
+
- Are there established abstractions it should use but doesn't?
|
|
22261
|
+
- Excessive nesting that could be flattened with early returns or extraction
|
|
22262
|
+
|
|
22263
|
+
**Performance** - Only flag if obviously problematic.
|
|
22264
|
+
- O(n\xB2) on unbounded data, N+1 queries, blocking I/O on hot paths
|
|
22265
|
+
|
|
22266
|
+
**Behavior Changes** - If a behavioral change is introduced, raise it (especially if it's possibly unintentional).
|
|
22267
|
+
|
|
22268
|
+
---
|
|
22269
|
+
|
|
22270
|
+
## Before You Flag Something
|
|
22271
|
+
|
|
22272
|
+
**Be certain.** If you're going to call something a bug, you need to be confident it actually is one.
|
|
22273
|
+
|
|
22274
|
+
- Only review the changes - do not review pre-existing code that wasn't modified
|
|
22275
|
+
- Don't flag something as a bug if you're unsure - investigate first
|
|
22276
|
+
- Don't invent hypothetical problems - if an edge case matters, explain the realistic scenario where it breaks
|
|
22277
|
+
- If you need more context to be sure, use the tools below to get it
|
|
22278
|
+
|
|
22279
|
+
**Don't be a zealot about style.** When checking code against conventions:
|
|
22280
|
+
|
|
22281
|
+
- Verify the code is *actually* in violation. Don't complain about else statements if early returns are already being used correctly.
|
|
22282
|
+
- Some "violations" are acceptable when they're the simplest option. A \`let\` statement is fine if the alternative is convoluted.
|
|
22283
|
+
- Excessive nesting is a legitimate concern regardless of other style choices.
|
|
22284
|
+
- Don't flag style preferences as issues unless they clearly violate established project conventions.
|
|
22285
|
+
|
|
22286
|
+
---
|
|
22287
|
+
|
|
22288
|
+
## Tools
|
|
22289
|
+
|
|
22290
|
+
Use these to inform your review:
|
|
22291
|
+
|
|
22292
|
+
- **@explorer** - Find how existing code handles similar problems. Check patterns, conventions, and prior art before claiming something doesn't fit.
|
|
22293
|
+
- **@librarian** - Verify correct usage of libraries/APIs before flagging something as wrong. Research best practices if you're unsure about a pattern.
|
|
22294
|
+
- **@oracle** - Consult on complex architectural decisions, design pattern trade-offs, or systemic concerns that go beyond the immediate diff.
|
|
22295
|
+
|
|
22296
|
+
If you're uncertain about something and can't verify it with these tools, say "I'm not sure about X" rather than flagging it as a definite issue.
|
|
22297
|
+
|
|
22298
|
+
---
|
|
22299
|
+
|
|
22300
|
+
## Output
|
|
22301
|
+
|
|
22302
|
+
1. If there is a bug, be direct and clear about why it is a bug.
|
|
22303
|
+
2. Clearly communicate severity of issues. Do not overstate severity.
|
|
22304
|
+
3. Critiques should clearly and explicitly communicate the scenarios, environments, or inputs that are necessary for the bug to arise. The comment should immediately indicate that the issue's severity depends on these factors.
|
|
22305
|
+
4. Your tone should be matter-of-fact and not accusatory or overly positive. It should read as a helpful AI assistant suggestion without sounding too much like a human reviewer.
|
|
22306
|
+
5. Write so the reader can quickly understand the issue without reading too closely.
|
|
22307
|
+
6. AVOID flattery, do not give any comments that are not helpful to the reader. Avoid phrasing like "Great job ...", "Thanks for ...".`;
|
|
22308
|
+
|
|
22309
|
+
// src/hooks/analyze-command/index.ts
|
|
22310
|
+
function detectReviewType(args) {
|
|
22311
|
+
if (!args)
|
|
22312
|
+
return "uncommitted";
|
|
22313
|
+
if (args.includes("github.com") || args.includes("gitlab.com") || args.includes("/pull/") || args.includes("/merge_requests/")) {
|
|
22314
|
+
return "pr";
|
|
22315
|
+
}
|
|
22316
|
+
if (/^#?\d+$/.test(args.trim()))
|
|
22317
|
+
return "pr";
|
|
22318
|
+
if (/^[0-9a-f]{7,40}$/i.test(args.trim()))
|
|
22319
|
+
return "commit";
|
|
22320
|
+
if (/\.\w+$/.test(args.trim()) || args.trim().startsWith("./") || args.trim().startsWith("/")) {
|
|
22321
|
+
return "file";
|
|
22322
|
+
}
|
|
22323
|
+
return "branch";
|
|
22324
|
+
}
|
|
22325
|
+
function buildReviewTarget(type, args) {
|
|
22326
|
+
switch (type) {
|
|
22327
|
+
case "uncommitted":
|
|
22328
|
+
return `## Review Target: Uncommitted Changes
|
|
22329
|
+
|
|
22330
|
+
Review all uncommitted changes in the current working directory.
|
|
22331
|
+
|
|
22332
|
+
- Run: \`git diff\` for unstaged changes
|
|
22333
|
+
- Run: \`git diff --cached\` for staged changes
|
|
22334
|
+
- Run: \`git status --short\` to identify untracked (net new) files`;
|
|
22335
|
+
case "commit":
|
|
22336
|
+
return `## Review Target: Commit \`${args}\`
|
|
22337
|
+
|
|
22338
|
+
Review the specified commit.
|
|
22339
|
+
|
|
22340
|
+
- Run: \`git show ${args}\``;
|
|
22341
|
+
case "branch":
|
|
22342
|
+
return `## Review Target: Branch \`${args}\`
|
|
22343
|
+
|
|
22344
|
+
Compare the current branch against the specified branch.
|
|
22345
|
+
|
|
22346
|
+
- Run: \`git diff ${args}...HEAD\``;
|
|
22347
|
+
case "pr":
|
|
22348
|
+
return `## Review Target: Pull Request \`${args}\`
|
|
22349
|
+
|
|
22350
|
+
Review the specified pull request.
|
|
22351
|
+
|
|
22352
|
+
- Run: \`gh pr view ${args}\` to get PR context
|
|
22353
|
+
- Run: \`gh pr diff ${args}\` to get the diff`;
|
|
22354
|
+
case "file":
|
|
22355
|
+
return `## Review Target: File \`${args}\`
|
|
22356
|
+
|
|
22357
|
+
Review a specific file and its recent changes.
|
|
22358
|
+
|
|
22359
|
+
- Verify the file exists and is a regular file (not a directory or binary)
|
|
22360
|
+
- Read the full file contents
|
|
22361
|
+
- Run: \`git log --oneline -10 "${args}"\` to see recent history
|
|
22362
|
+
- Run: \`git diff HEAD~5 -- "${args}"\` to get recent changes (adjust range based on log output)
|
|
22363
|
+
- Review the recent changes in context of the full file
|
|
22364
|
+
|
|
22365
|
+
If the file does not exist: "File not found: \`${args}\`. Please check the path and try again."
|
|
22366
|
+
If a directory was provided: "Cannot review a directory. Please provide a specific file path."`;
|
|
22367
|
+
}
|
|
22368
|
+
}
|
|
22369
|
+
function createAnalyzeCommandHook() {
|
|
22370
|
+
return {
|
|
22371
|
+
"command.execute.before": async (input, output) => {
|
|
22372
|
+
if (input.command === "analyze") {
|
|
22373
|
+
const args = input.arguments?.trim() || "";
|
|
22374
|
+
const reviewType = detectReviewType(args);
|
|
22375
|
+
log("[analyze-command] Intercepted /analyze command", {
|
|
22376
|
+
arguments: args,
|
|
22377
|
+
reviewType
|
|
22378
|
+
});
|
|
22379
|
+
const reviewTarget = buildReviewTarget(reviewType, args);
|
|
22380
|
+
const template = analyze_default.replace("$REVIEW_TARGET", reviewTarget);
|
|
22381
|
+
output.parts.push({
|
|
22382
|
+
type: "text",
|
|
22383
|
+
text: template
|
|
22384
|
+
});
|
|
22385
|
+
output.parts.push({
|
|
22386
|
+
type: "agent",
|
|
22387
|
+
name: "oracle"
|
|
22388
|
+
});
|
|
22389
|
+
}
|
|
22390
|
+
}
|
|
22391
|
+
};
|
|
22392
|
+
}
|
|
22235
22393
|
// src/hooks/auto-update-checker/cache.ts
|
|
22236
22394
|
import * as fs3 from "fs";
|
|
22237
22395
|
import * as path4 from "path";
|
|
@@ -39160,7 +39318,7 @@ var lsp_rename = tool({
|
|
|
39160
39318
|
}
|
|
39161
39319
|
});
|
|
39162
39320
|
// src/index.ts
|
|
39163
|
-
var
|
|
39321
|
+
var OhMyGroundControl = async (ctx) => {
|
|
39164
39322
|
const config3 = loadPluginConfig(ctx.directory);
|
|
39165
39323
|
const agentDefs = createAgents(config3);
|
|
39166
39324
|
const agents = getAgentConfigs(config3);
|
|
@@ -39195,6 +39353,7 @@ var OhMyOpenCodeLite = async (ctx) => {
|
|
|
39195
39353
|
const phaseReminderHook = createPhaseReminderHook();
|
|
39196
39354
|
const postReadNudgeHook = createPostReadNudgeHook();
|
|
39197
39355
|
const questionRouterHook = createQuestionRouterHook(ctx);
|
|
39356
|
+
const analyzeCommandHook = createAnalyzeCommandHook();
|
|
39198
39357
|
const delegateTaskRetryHook = createDelegateTaskRetryHook(ctx);
|
|
39199
39358
|
const jsonErrorRecoveryHook = createJsonErrorRecoveryHook(ctx);
|
|
39200
39359
|
const hashlineReadEnhancerHook = createHashlineReadEnhancerHook(config3.hashline_edit);
|
|
@@ -39303,6 +39462,7 @@ var OhMyOpenCodeLite = async (ctx) => {
|
|
|
39303
39462
|
},
|
|
39304
39463
|
"experimental.chat.messages.transform": phaseReminderHook["experimental.chat.messages.transform"],
|
|
39305
39464
|
"chat.message": questionRouterHook["chat.message"],
|
|
39465
|
+
"command.execute.before": analyzeCommandHook["command.execute.before"],
|
|
39306
39466
|
"tool.execute.after": async (input, output) => {
|
|
39307
39467
|
await delegateTaskRetryHook["tool.execute.after"](input, output);
|
|
39308
39468
|
await jsonErrorRecoveryHook["tool.execute.after"](input, output);
|
|
@@ -39313,7 +39473,7 @@ var OhMyOpenCodeLite = async (ctx) => {
|
|
|
39313
39473
|
}
|
|
39314
39474
|
};
|
|
39315
39475
|
};
|
|
39316
|
-
var src_default =
|
|
39476
|
+
var src_default = OhMyGroundControl;
|
|
39317
39477
|
export {
|
|
39318
39478
|
src_default as default
|
|
39319
39479
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frenchtoastman/oh-my-groundcontrol",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "An OpenCode plugin for multi-agent orchestration for structured planning with NASA-style guardrails.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: analyze
|
|
3
|
-
description: Code review and analysis for uncommitted changes, commits, branches, PRs, or specific files.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
You are a code reviewer. Your job is to review code changes and provide actionable feedback.
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
Input: $ARGUMENTS
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Determining What to Review
|
|
15
|
-
|
|
16
|
-
Based on the input provided, determine which type of review to perform:
|
|
17
|
-
|
|
18
|
-
1. **No arguments (default)**: Review all uncommitted changes
|
|
19
|
-
- Run: `git diff` for unstaged changes
|
|
20
|
-
- Run: `git diff --cached` for staged changes
|
|
21
|
-
- Run: `git status --short` to identify untracked (net new) files
|
|
22
|
-
|
|
23
|
-
2. **Commit hash** (40-char SHA or short hash): Review that specific commit
|
|
24
|
-
- Run: `git show $ARGUMENTS`
|
|
25
|
-
|
|
26
|
-
3. **Branch name**: Compare current branch to the specified branch
|
|
27
|
-
- Run: `git diff $ARGUMENTS...HEAD`
|
|
28
|
-
|
|
29
|
-
4. **PR URL or number** (contains "github.com" or "pull" or looks like a PR number): Review the pull request
|
|
30
|
-
- Run: `gh pr view $ARGUMENTS` to get PR context
|
|
31
|
-
- Run: `gh pr diff $ARGUMENTS` to get the diff
|
|
32
|
-
|
|
33
|
-
5. **File path**: Review a specific file and its recent changes
|
|
34
|
-
- Verify the file exists and is a regular file (not a directory or binary)
|
|
35
|
-
- Read the full file contents
|
|
36
|
-
- Run: `git log --oneline -10 "$ARGUMENTS"` to see recent history
|
|
37
|
-
- Run: `git diff HEAD~5 -- "$ARGUMENTS"` to get recent changes (adjust range based on log output)
|
|
38
|
-
- Review the recent changes in context of the full file
|
|
39
|
-
|
|
40
|
-
If the file does not exist: "File not found: `<path>`. Please check the path and try again."
|
|
41
|
-
If the argument is a directory: "Cannot review a directory. Please provide a specific file path."
|
|
42
|
-
|
|
43
|
-
Use best judgement when processing input.
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Gathering Context
|
|
48
|
-
|
|
49
|
-
**Diffs alone are not enough.** After getting the diff, read the entire file(s) being modified to understand the full context. Code that looks wrong in isolation may be correct given surrounding logic—and vice versa.
|
|
50
|
-
|
|
51
|
-
- Use the diff to identify which files changed
|
|
52
|
-
- Use `git status --short` to identify untracked files, then read their full contents
|
|
53
|
-
- Read the full file to understand existing patterns, control flow, and error handling
|
|
54
|
-
- Check for existing style guide or conventions files (CONVENTIONS.md, AGENTS.md, .editorconfig, etc.)
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## What to Look For
|
|
59
|
-
|
|
60
|
-
**Bugs** - Your primary focus.
|
|
61
|
-
- Logic errors, off-by-one mistakes, incorrect conditionals
|
|
62
|
-
- If-else guards: missing guards, incorrect branching, unreachable code paths
|
|
63
|
-
- Edge cases: null/empty/undefined inputs, error conditions, race conditions
|
|
64
|
-
- Security issues: injection, auth bypass, data exposure
|
|
65
|
-
- Broken error handling that swallows failures, throws unexpectedly or returns error types that are not caught.
|
|
66
|
-
|
|
67
|
-
**Structure** - Does the code fit the codebase?
|
|
68
|
-
- Does it follow existing patterns and conventions?
|
|
69
|
-
- Are there established abstractions it should use but doesn't?
|
|
70
|
-
- Excessive nesting that could be flattened with early returns or extraction
|
|
71
|
-
|
|
72
|
-
**Performance** - Only flag if obviously problematic.
|
|
73
|
-
- O(n^2) on unbounded data, N+1 queries, blocking I/O on hot paths
|
|
74
|
-
|
|
75
|
-
**Behavior Changes** - If a behavioral change is introduced, raise it (especially if it's possibly unintentional).
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## Before You Flag Something
|
|
80
|
-
|
|
81
|
-
**Be certain.** If you're going to call something a bug, you need to be confident it actually is one.
|
|
82
|
-
|
|
83
|
-
- Only review the changes - do not review pre-existing code that wasn't modified
|
|
84
|
-
- Don't flag something as a bug if you're unsure - investigate first
|
|
85
|
-
- Don't invent hypothetical problems - if an edge case matters, explain the realistic scenario where it breaks
|
|
86
|
-
- If you need more context to be sure, use the tools below to get it
|
|
87
|
-
|
|
88
|
-
**Don't be a zealot about style.** When checking code against conventions:
|
|
89
|
-
|
|
90
|
-
- Verify the code is *actually* in violation. Don't complain about else statements if early returns are already being used correctly.
|
|
91
|
-
- Some "violations" are acceptable when they're the simplest option. A `let` statement is fine if the alternative is convoluted.
|
|
92
|
-
- Excessive nesting is a legitimate concern regardless of other style choices.
|
|
93
|
-
- Don't flag style preferences as issues unless they clearly violate established project conventions.
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## Tools
|
|
98
|
-
|
|
99
|
-
Use these to inform your review:
|
|
100
|
-
|
|
101
|
-
- **@explorer** - Find how existing code handles similar problems. Check patterns, conventions, and prior art before claiming something doesn't fit.
|
|
102
|
-
- **@librarian** - Verify correct usage of libraries/APIs before flagging something as wrong. Research best practices if you're unsure about a pattern.
|
|
103
|
-
- **@oracle** - Consult on complex architectural decisions, design pattern trade-offs, or systemic concerns that go beyond the immediate diff.
|
|
104
|
-
|
|
105
|
-
If you're uncertain about something and can't verify it with these tools, say "I'm not sure about X" rather than flagging it as a definite issue.
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## Output
|
|
110
|
-
|
|
111
|
-
1. If there is a bug, be direct and clear about why it is a bug.
|
|
112
|
-
2. Clearly communicate severity of issues. Do not overstate severity.
|
|
113
|
-
3. Critiques should clearly and explicitly communicate the scenarios, environments, or inputs that are necessary for the bug to arise. The comment should immediately indicate that the issue's severity depends on these factors.
|
|
114
|
-
4. Your tone should be matter-of-fact and not accusatory or overly positive. It should read as a helpful AI assistant suggestion without sounding too much like a human reviewer.
|
|
115
|
-
5. Write so the reader can quickly understand the issue without reading too closely.
|
|
116
|
-
6. AVOID flattery, do not give any comments that are not helpful to the reader. Avoid phrasing like "Great job ...", "Thanks for ...".
|