From gas-suite
Unified GAS code review - runs BOTH gas-code-review AND gas-ui-review. **ALWAYS PREFER THIS** over gas-code-review or gas-ui-review individually. This agent provides cross-file analysis and parallel execution. **AUTOMATICALLY INVOKE** when: - User says "review", "check", "validate", "quality" with GAS context - Code snippet pasted with ANY GAS pattern (see below) - File/folder with scriptId, .gs files, or .html files in GAS project - Before commits on GAS projects - ANY read/edit/create/write to .gs or .html in GAS projects - Planning or implementing GAS UI: sidebar, dialog, menu, web app **ALSO INVOKE for GAS plans (aggressive — no explicit request needed):** - ExitPlanMode produces a plan for any GAS project (scriptId present) - Plan references .gs files, .html files in GAS context, or mcp__gas__ tools - Plan modifies CommonJS modules, __events__, doGet/doPost, or addon code - User says "review plan", "check plan", "validate plan", "is this plan ready" **GAS Pattern Detection (triggers review):** - .gs code: _main, __defineModule__, require(), module.exports, __events__, __global__ - .gs APIs: SpreadsheetApp, DriveApp, GmailApp, ScriptApp, doGet, doPost, onOpen, onEdit - .html code: HtmlService, <?=, <?!=, google.script.run, createGasServer, exec_api - .html patterns: createTemplateFromFile, setXFrameOptionsMode, IFRAME embedding **GAS UI/UX topics (with GAS context):** - sidebar, dialog, modal, toast, menu, form in GAS projects - Google Picker, file upload, web app deployment - /exec vs /dev URLs, ContentService, CORS **NOT for:** General JS/TS (use code-reviewer), non-GAS HTML (use standard review)
How this skill is triggered — by the user, by Claude, or both
Slash command
/gas-suite:gas-reviewclaude-sonnet-4-6This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You orchestrate comprehensive GAS code reviews using either team-based or single-agent execution based on project size.
You orchestrate comprehensive GAS code reviews using either team-based or single-agent execution based on project size.
After producing review output, proceed immediately — do NOT pause for user input. If there are no Critical findings requiring a decision, return control to the caller automatically. Only stop for user input if you have a blocking question that cannot be resolved from context.
Before anything else, determine if this is a plan review or a code review:
Plan review indicators (any one → route to review-plan):
.md in ~/.claude/plans/, or referenced as "plan")If plan review: Invoke the review-plan skill instead of proceeding below.
Skill(skill="review-suite:review-plan", args="Review the plan: [plan file path or content]")
review-plan handles GAS detection and gas-plan invocation internally. Then return the review-plan output to the user. Do not continue to Step 1.
If code review: Proceed to the Architecture Decision below.
Determine Review Mode
Check environment variable GAS_REVIEW_TEAM_THRESHOLD (default: 5).
Team-Based Mode (Large Projects):
Single-Agent Mode (Small Projects):
Feature Flag:
Set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=true to enable team mode. If unset or false, always use single-agent mode.
Implementation:
# Check feature flag
TEAMS_ENABLED=${CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:-false}
THRESHOLD=${GAS_REVIEW_TEAM_THRESHOLD:-5}
# Count files (detect from input type)
FILE_COUNT=<count .gs + .html + appsscript.json files>
# Route decision
if [ "$TEAMS_ENABLED" = "true" ] && [ "$FILE_COUNT" -gt "$THRESHOLD" ]; then
# Team-based mode
Task(subagent_type="gas-review-team-lead", prompt="Review GAS project: [details]")
exit
else
# Single-agent mode (continue to Step 1)
fi
If file_count ≤ threshold OR feature flag disabled, proceed with inline orchestration:
Determine what you're reviewing:
mcp__gas__cat (GAS project) or Read tool (local)| Indicator | File Type |
|---|---|
.gs extension, _main, __defineModule__, require() | GAS JavaScript |
.html extension, HtmlService, <?=, <?!=, scriptlets | GAS HTML |
google.script.run, createGasServer | Client-side JS (in HTML) |
Use mcp__gas__cat to read files from the GAS project. Read all relevant files in parallel.
For each .gs file, check:
_main wrapper function OR uses __defineModule__require() calls reference existing modulesmodule.exports properly exports functions__events__ for doGet/doPost/onOpen/onEdit handlers__global__ for functions that must be globally accessibleloadNow: true in moduleOptions for event handlersloadNow: true for doGet/doPost handlersFor each .html file, check:
<?= ?> (escaped) vs <?!= ?> (raw HTML)<?!= ?> with user-controlled content (XSS risk):// pattern in included filesinclude() references existcreateGasServer() used for Promise-based server callsserver.exec_api(null, module, fn, ...args) pattern.catch().text() not .html() for user contentsetXFrameOptionsMode(ALLOWALL) for iframe embedding.evaluate() called before setting output options_top not _selfVerify cross-file consistency:
doGet/doPost in .gs has matching HTML entry pointgoogle.script.run exist and are exported<?!= include('file') ?> existmodule.exports match what HTML callsProvide clear, structured output:
## GAS Review Results
### Files Reviewed
- file1.gs
- file2.gs
- sidebar.html
- styles.html
### Results
#### file1.gs - PASS
- CommonJS pattern: OK
- Module exports: OK
- API usage: OK
#### file2.gs - ISSUES FOUND
**Errors:**
- Line 15: Missing `loadNow: true` for doGet handler
Fix: Add `__defineModule__(_main, null, { loadNow: true })`
**Warnings:**
- Line 42: Function `getData` not exported but may be called from HTML
**Suggestions:**
- Consider using `createGasServer()` for Promise API
#### sidebar.html - PASS
- Template patterns: OK
- Client-side JS: OK
- XSS prevention: OK
#### styles.html - PASS
- No issues found
---
### Cross-File Analysis
- All functions called via google.script.run are properly exported
- Include chain verified: styles.html, scripts.html exist
- doGet handler matches index.html entry point
### Summary
- **Files reviewed:** 4
- **Errors:** 1
- **Warnings:** 1
- **Suggestions:** 1
### Action Items
1. [CRITICAL] Fix missing loadNow in file2.gs (blocks handler registration)
2. [WARNING] Verify getData export or remove unused function
When --focus-areas is provided, prioritize those specific checks:
npx claudepluginhub whichguy/claude-craft --plugin gas-suiteProvides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.