Phase 17: Antigravity Plugin Bundle Skeleton#3
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements the skeleton command layer (ctxt antigravity) and local templates for the Antigravity plugin bundle (Phase 17). It introduces the antigravity command with subcommands for exporting, validating skills, auditing hooks, and packaging plugins, along with comprehensive templates and smoke tests. Feedback suggests simplifying the repetitive parsing logic for these subcommands in src/cli.rs and adding a target path argument to the ctxt verify command in the hooks template to ensure it runs successfully.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| "antigravity" => { | ||
| if argv.len() < 2 { | ||
| return Err("missing subcommand for 'antigravity'. Usage: ctxt antigravity <export | skills validate | agents export | hooks audit | plugin package>".to_string()); | ||
| } | ||
| let sub = argv[1].as_str(); | ||
| match sub { | ||
| "export" => { | ||
| if argv.len() > 2 { | ||
| return Err(format!( | ||
| "unexpected argument '{}' for 'antigravity export'", | ||
| argv[2] | ||
| )); | ||
| } | ||
| Ok(Command::Antigravity { | ||
| subcommand: "export".to_string(), | ||
| action: None, | ||
| }) | ||
| } | ||
| "skills" => { | ||
| if argv.len() < 3 { | ||
| return Err("missing action for 'antigravity skills'. Usage: ctxt antigravity skills validate".to_string()); | ||
| } | ||
| if argv[2] != "validate" { | ||
| return Err(format!( | ||
| "unsupported action '{}' for 'antigravity skills'", | ||
| argv[2] | ||
| )); | ||
| } | ||
| if argv.len() > 3 { | ||
| return Err(format!( | ||
| "unexpected argument '{}' for 'antigravity skills validate'", | ||
| argv[3] | ||
| )); | ||
| } | ||
| Ok(Command::Antigravity { | ||
| subcommand: "skills".to_string(), | ||
| action: Some("validate".to_string()), | ||
| }) | ||
| } | ||
| "agents" => { | ||
| if argv.len() < 3 { | ||
| return Err("missing action for 'antigravity agents'. Usage: ctxt antigravity agents export".to_string()); | ||
| } | ||
| if argv[2] != "export" { | ||
| return Err(format!( | ||
| "unsupported action '{}' for 'antigravity agents'", | ||
| argv[2] | ||
| )); | ||
| } | ||
| if argv.len() > 3 { | ||
| return Err(format!( | ||
| "unexpected argument '{}' for 'antigravity agents export'", | ||
| argv[3] | ||
| )); | ||
| } | ||
| Ok(Command::Antigravity { | ||
| subcommand: "agents".to_string(), | ||
| action: Some("export".to_string()), | ||
| }) | ||
| } | ||
| "hooks" => { | ||
| if argv.len() < 3 { | ||
| return Err("missing action for 'antigravity hooks'. Usage: ctxt antigravity hooks audit".to_string()); | ||
| } | ||
| if argv[2] != "audit" { | ||
| return Err(format!( | ||
| "unsupported action '{}' for 'antigravity hooks'", | ||
| argv[2] | ||
| )); | ||
| } | ||
| if argv.len() > 3 { | ||
| return Err(format!( | ||
| "unexpected argument '{}' for 'antigravity hooks audit'", | ||
| argv[3] | ||
| )); | ||
| } | ||
| Ok(Command::Antigravity { | ||
| subcommand: "hooks".to_string(), | ||
| action: Some("audit".to_string()), | ||
| }) | ||
| } | ||
| "plugin" => { | ||
| if argv.len() < 3 { | ||
| return Err("missing action for 'antigravity plugin'. Usage: ctxt antigravity plugin package".to_string()); | ||
| } | ||
| if argv[2] != "package" { | ||
| return Err(format!( | ||
| "unsupported action '{}' for 'antigravity plugin'", | ||
| argv[2] | ||
| )); | ||
| } | ||
| if argv.len() > 3 { | ||
| return Err(format!( | ||
| "unexpected argument '{}' for 'antigravity plugin package'", | ||
| argv[3] | ||
| )); | ||
| } | ||
| Ok(Command::Antigravity { | ||
| subcommand: "plugin".to_string(), | ||
| action: Some("package".to_string()), | ||
| }) | ||
| } | ||
| other => Err(format!("unsupported antigravity subcommand '{}'", other)), | ||
| } | ||
| } |
There was a problem hiding this comment.
The parsing logic for the antigravity subcommands (skills, agents, hooks, plugin) is highly repetitive and can be significantly simplified by grouping the subcommands that require a single specific action. This reduces code duplication, improves maintainability, and makes it easier to add new subcommands in the future.
"antigravity" => {
if argv.len() < 2 {
return Err("missing subcommand for 'antigravity'. Usage: ctxt antigravity <export | skills validate | agents export | hooks audit | plugin package>".to_string());
}
let sub = argv[1].as_str();
match sub {
"export" => {
if argv.len() > 2 {
return Err(format!(
"unexpected argument '{}' for 'antigravity export'",
argv[2]
));
}
Ok(Command::Antigravity {
subcommand: "export".to_string(),
action: None,
})
}
"skills" | "agents" | "hooks" | "plugin" => {
let expected_action = match sub {
"skills" => "validate",
"agents" => "export",
"hooks" => "audit",
"plugin" => "package",
_ => unreachable!(),
};
if argv.len() < 3 {
return Err(format!(
"missing action for 'antigravity {sub}'. Usage: ctxt antigravity {sub} {expected_action}"
));
}
if argv[2] != expected_action {
return Err(format!(
"unsupported action '{}' for 'antigravity {sub}'",
argv[2]
));
}
if argv.len() > 3 {
return Err(format!(
"unexpected argument '{}' for 'antigravity {sub} {expected_action}'",
argv[3]
));
}
Ok(Command::Antigravity {
subcommand: sub.to_string(),
action: Some(expected_action.to_string()),
})
}
other => Err(format!("unsupported antigravity subcommand '{}'", other)),
}
}
Phase 17 Review-Gate PR.