|
| 1 | +# Code Review Style Guide |
| 2 | + |
| 3 | +## Project Context |
| 4 | + |
| 5 | +This is a **Gemini CLI extension** (`everything-gemini-code`) — not a typical application. |
| 6 | +The codebase consists of: |
| 7 | + |
| 8 | +- **Shell scripts** (`scripts/`) — Node.js utilities and bash installers |
| 9 | +- **TOML commands** (`commands/`) — Gemini CLI slash commands |
| 10 | +- **Markdown skills** (`skills/`) — AI workflow definitions (SKILL.md) |
| 11 | +- **Markdown agents** (`agents/`) — Subagent definitions with frontmatter |
| 12 | +- **Markdown docs** (`docs/`) — Multilingual documentation (en, ko-KR, zh-CN) |
| 13 | +- **JSON hooks** (`hooks/`) — Gemini CLI automation triggers |
| 14 | + |
| 15 | +## JavaScript / Node.js |
| 16 | + |
| 17 | +- Target Node.js 20+. Use CommonJS (`require`), not ESM. |
| 18 | +- No `console.log` in hook scripts — hooks must run silently on success. |
| 19 | +- Use `process.exit(0)` on hook errors to avoid blocking the CLI. |
| 20 | +- Prefer `const` over `let`. Never use `var`. |
| 21 | +- Functions should be under 50 lines. Files should be under 400 lines. |
| 22 | +- Use `assert` module for tests (custom test runner, not Jest/Mocha). |
| 23 | + |
| 24 | +## Shell Scripts |
| 25 | + |
| 26 | +- Use `set -e` at the top of all bash scripts. |
| 27 | +- Quote all variables: `"$VAR"` not `$VAR`. |
| 28 | +- Check file/directory existence before operations. |
| 29 | +- Support both macOS and Linux (no GNU-only flags). |
| 30 | + |
| 31 | +## TOML Commands |
| 32 | + |
| 33 | +- Every command must have a non-empty `description` field. |
| 34 | +- The `prompt` field should include usage examples and related commands. |
| 35 | +- Agent references use `@agent-name` format. |
| 36 | + |
| 37 | +## Markdown Skills (SKILL.md) |
| 38 | + |
| 39 | +- Must start with YAML frontmatter (`---` block) containing `name` and `description`. |
| 40 | +- Must have a `## When to Use` section (not "When to Activate" or "When to Apply"). |
| 41 | +- Keep under 800 lines. |
| 42 | + |
| 43 | +## Markdown Agents |
| 44 | + |
| 45 | +- Must have YAML frontmatter with `tools` field. |
| 46 | +- Tool names must use Gemini format: `read_file`, `run_shell_command`, `write_file`. |
| 47 | +- No `model` field (Gemini CLI does not support it). |
| 48 | + |
| 49 | +## Documentation |
| 50 | + |
| 51 | +- Main README.md (English) stays at root. All other docs live under `docs/{lang}/`. |
| 52 | +- Every doc file must have a language switcher line at the top. |
| 53 | +- Supported languages: English (`docs/en/`), Korean (`docs/ko-KR/`), Chinese (`docs/zh-CN/`). |
| 54 | +- Internal links must use relative paths. No absolute GitHub URLs for internal docs. |
| 55 | + |
| 56 | +## Testing |
| 57 | + |
| 58 | +- Tests use a custom runner (`tests/run-all.js`). Output must include `Passed: N` and `Failed: N`. |
| 59 | +- New library modules in `scripts/lib/` must have corresponding test files in `tests/lib/`. |
| 60 | +- Hook integration tests live in `tests/hooks/`. |
| 61 | + |
| 62 | +## CI / GitHub Actions |
| 63 | + |
| 64 | +- Pin third-party actions to commit SHA (e.g., `uses: action@<sha> # v2`). |
| 65 | +- First-party GitHub actions (`actions/*`) can use version tags (`@v4`). |
| 66 | +- Reusable workflows in `.github/workflows/reusable-*.yml` must be called by `ci.yml`. |
| 67 | + |
| 68 | +## What NOT to Flag |
| 69 | + |
| 70 | +- Emoji usage in markdown docs is intentional — do not flag. |
| 71 | +- Long TOML `prompt` fields are expected — do not flag line length. |
| 72 | +- Skills referencing `~/.gemini/` paths are correct — do not suggest `~/.claude/`. |
0 commit comments