Generate production-ready Greptile AI code review configuration for any repository. Use this skill whenever the user mentions Greptile, AI code review setup, PR review configuration, automated code review rules, or wants to set up .greptile/ config files. Also trigger when someone says "set up code review", "configure PR reviews", "add review rules", or asks about Greptile configuration — even if they don't say "Greptile" explicitly but describe wanting AI-powered PR review automation. This skill analyzes the actual repository structure and produces tailored config, not generic boilerplate.
Generate optimal Greptile AI code review configuration by analyzing the actual repository — its structure, tech stack, patterns, documentation, and team conventions — then producing tailored .greptile/ configuration files.
What Greptile Is
Greptile is an AI code review agent that hooks into GitHub/GitLab PRs. It indexes the full codebase, reads configuration files on each PR (from the source branch), reviews changed files using LLM-powered semantic understanding, and posts inline comments, summaries, confidence scores, and status checks.
The critical insight: Greptile is not a linter. It uses LLMs to understand intent, architecture, and cross-file implications. Write rules that leverage semantic understanding — not rules a regex or ESLint could handle. "Service methods must not call HTTP endpoints directly — use the gateway client" is a great Greptile rule. "Use semicolons" is not.
Workflow
Follow these five phases in order. Do not skip any phase.
Phase 1: Explore the Repository
Before writing a single line of config, map the territory. Use tools to answer:
Structure — Is this a monorepo or single-service? What are the top-level directories?
Run: ls -la at root, look for packages/, apps/, services/, src/
Tech stack — What languages, frameworks, ORMs, and testing tools are in use?
Existing linting & formatting — What does the toolchain already cover?
Check: .eslintrc, .prettierrc, stylelint, rubocop, flake8, golangci-lint
If strong linting exists → drop "style" from commentTypes
Team conventions — Look at recent commits and PR patterns
Check: branch naming, commit message style, test patterns, code organization
Phase 2: Decide Configuration Strategy
Which config method?
Situation
Method
Monorepo with multiple packages/services
.greptile/ folder with cascading per-directory overrides
Single-service repo
.greptile/ folder (recommended)
Different directories need different strictness
Root .greptile/ + child .greptile/config.json in subdirectories
Always prefer .greptile/ folder over greptile.json. If a greptile.json already exists, plan to migrate and delete it (.greptile/ silently overrides greptile.json when both exist).
For monorepos: set 2 at root, override to 1 in critical paths (payments, auth), override to 3 in low-risk areas (internal tools, scripts).
Comment types:
Start with ["logic", "syntax"]. Add "style" only if no Prettier/ESLint. Add "info" only if the team wants educational comments (onboarding, junior devs).
Phase 3: Engineer the Rules
This is the highest-leverage step. Every rule must be:
Specific — "Functions must not exceed 50 lines" not "Keep functions short"
Measurable — Pass/fail criteria must be unambiguous
Scoped — Every rule gets a scope array targeting relevant directories. A database rule should not fire on frontend components
Actionable — The developer must know exactly what to change
Semantic — Rules that require understanding, not pattern matching. If ESLint can catch it, ESLint should catch it
Identifiable — Every rule gets a unique id so child directories can disable it
Rule categories to scan for (check which apply to the repo):
.greptile/rules.md — Prose rules with code examples (only if rules need narrative context)
.greptile/files.json — Context file mappings (only if documentation exists to reference)
Child .greptile/config.json files — For monorepo subdirectories that need different settings
Validation checklist — run before every output:
All JSON is syntactically valid (no trailing commas, no comments)
Every scope is an array of strings, never a comma-separated string
ignorePatterns is a newline-separated string (\n), never an array
strictness is integer 1, 2, or 3
commentTypes only contains: "logic", "syntax", "style", "info"
severity values only: "high", "medium", "low"
patternRepositories use org/repo format, never full URLs
Every disableable rule has a unique id
Every rule is specific and measurable — no vague platitudes
Every high-noise rule has a scope
fileChangeLimit is >= 1 (0 skips all PRs)
files.json paths point to files that actually exist in the repo
No .greptile/ and greptile.json coexistence (if migrating, note to delete old)
Output format:
For every configuration you produce, include:
File tree showing exactly which files go where
Each config file as a complete, valid JSON (or markdown) code block
Reasoning annotations after each file explaining WHY each major decision was made, referencing specific repo context
Canary test — a simple verification step to confirm the config is working
Migration notes if moving from greptile.json to .greptile/
Reference Files
Read these when you need detailed specifications:
references/config-spec.md — Complete parameter reference for all config files, data types, cascading behavior, and monorepo inheritance rules. Read this when you need to check a specific parameter's format or understand how child configs interact with parent configs.
references/anti-patterns.md — Common mistakes, the troubleshooting reasoning chain, and the testing/verification protocol. Read this before finalizing any output to catch errors. Also useful when debugging why a Greptile config isn't working.
references/scenarios.md — Complete example configurations for TypeScript backend, React frontend, and monorepo setups. Read these for inspiration, but never copy them verbatim — every rule must be justified by the actual repository context.
Key Gotchas (Keep in Mind)
Config is read from the source branch of the PR, not the target branch
Changes take effect on the next PR, not retroactively
ignorePatterns skips review only — files are still indexed
includeAuthors: [] means all authors (not none)
fileChangeLimit: 0 means skip all PRs (minimum is 1)
To suppress "X files reviewed, no comments" messages, use statusCheck: true (not statusCommentsEnabled: false)
After ~10 PRs, Greptile auto-suggests rules — duplicates of existing rules may appear (this is normal)
1---2name: greptile-config3description: Generate production-ready Greptile AI code review configuration for any repository. Use this skill whenever the user mentions Greptile, AI code review setup, PR review configuration, automated code review rules, or wants to set up .greptile/ config files. Also trigger when someone says "set up code review", "configure PR reviews", "add review rules", or asks about Greptile configuration — even if they don't say "Greptile" explicitly but describe wanting AI-powered PR review automation. This skill analyzes the actual repository structure and produces tailored config, not generic boilerplate.4---56# Greptile Configuration Generator78Generate optimal Greptile AI code review configuration by analyzing the actual repository — its structure, tech stack, patterns, documentation, and team conventions — then producing tailored `.greptile/` configuration files.910## What Greptile Is1112Greptile is an AI code review agent that hooks into GitHub/GitLab PRs. It indexes the full codebase, reads configuration files on each PR (from the source branch), reviews changed files using LLM-powered semantic understanding, and posts inline comments, summaries, confidence scores, and status checks.1314The critical insight: Greptile is **not a linter**. It uses LLMs to understand intent, architecture, and cross-file implications. Write rules that leverage semantic understanding — not rules a regex or ESLint could handle. "Service methods must not call HTTP endpoints directly — use the gateway client" is a great Greptile rule. "Use semicolons" is not.1516## Workflow1718Follow these five phases in order. Do not skip any phase.1920### Phase 1: Explore the Repository2122Before writing a single line of config, map the territory. Use tools to answer:23241. **Structure** — Is this a monorepo or single-service? What are the top-level directories?25 ```26 Run: ls -la at root, look for packages/, apps/, services/, src/27 ```282. **Tech stack** — What languages, frameworks, ORMs, and testing tools are in use?29 ```30 Check: package.json, requirements.txt, go.mod, Cargo.toml, build.gradle, etc.31 Look at: tsconfig.json, .eslintrc, prettier config, Dockerfile32 ```333. **Build artifacts & generated code** — What should be ignored?34 ```35 Look for: dist/, build/, .next/, out/, __generated__/, migrations/36 Check .gitignore for patterns to mirror in ignorePatterns37 ```384. **Existing documentation** — What context files can the reviewer use?39 ```40 Search for: docs/, architecture.md, ADRs, openapi/, swagger/, prisma/schema.prisma,41 CONTRIBUTING.md, style guides, API specs42 ```435. **Existing linting & formatting** — What does the toolchain already cover?44 ```45 Check: .eslintrc, .prettierrc, stylelint, rubocop, flake8, golangci-lint46 If strong linting exists → drop "style" from commentTypes47 ```486. **Team conventions** — Look at recent commits and PR patterns49 ```50 Check: branch naming, commit message style, test patterns, code organization51 ```5253### Phase 2: Decide Configuration Strategy5455**Which config method?**5657| Situation | Method |58|---|---|59| Monorepo with multiple packages/services | `.greptile/` folder with cascading per-directory overrides |60| Single-service repo | `.greptile/` folder (recommended) |61| Different directories need different strictness | Root `.greptile/` + child `.greptile/config.json` in subdirectories |6263Always prefer `.greptile/` folder over `greptile.json`. If a `greptile.json` already exists, plan to migrate and delete it (`.greptile/` silently overrides `greptile.json` when both exist).6465**Strictness calibration:**6667| Level | When to use |68|---|---|69| `1` (Verbose) | Security-critical code, junior-heavy teams, onboarding, early-stage projects |70| `2` (Balanced) | Most production codebases, mixed-seniority teams — **start here** |71| `3` (Critical only) | Senior teams, strong existing linting, pre-release hardening |7273For monorepos: set `2` at root, override to `1` in critical paths (payments, auth), override to `3` in low-risk areas (internal tools, scripts).7475**Comment types:**7677Start with `["logic", "syntax"]`. Add `"style"` only if no Prettier/ESLint. Add `"info"` only if the team wants educational comments (onboarding, junior devs).7879### Phase 3: Engineer the Rules8081This is the highest-leverage step. Every rule must be:82831. **Specific** — "Functions must not exceed 50 lines" not "Keep functions short"842. **Measurable** — Pass/fail criteria must be unambiguous853. **Scoped** — Every rule gets a `scope` array targeting relevant directories. A database rule should not fire on frontend components864. **Actionable** — The developer must know exactly what to change875. **Semantic** — Rules that require understanding, not pattern matching. If ESLint can catch it, ESLint should catch it886. **Identifiable** — Every rule gets a unique `id` so child directories can disable it8990**Rule categories to scan for** (check which apply to the repo):9192| Category | Signal to look for |93|---|---|94| Security | SQL queries, user input handling, auth code, PII |95| Architecture | Controller/service/repository layers, module boundaries |96| Error handling | try-catch patterns, error logging, error response shapes |97| API contracts | OpenAPI specs, shared API types, cross-service calls |98| Dependencies | Shared libraries, internal packages, design systems |99| Performance | Database queries in loops, N+1 patterns, unbounded fetches |100| Naming | Component naming, hook prefixes, file naming conventions |101| Migration | JS→TS migration, legacy patterns being phased out |102| Compliance | PII handling, logging restrictions, audit requirements |103| Tauri IPC | `#[tauri::command]` handlers, invoke calls, capability/permission scoping, state management with Mutex/RwLock |104| Tauri Security | CSP config, shell plugin usage, filesystem scope, input validation in command handlers, no panics in commands |105| MCP Protocol | Tool/resource/prompt handler compliance, input schema validation with Zod, structured error responses, transport correctness |106| MCP Security | Command injection prevention in tool handlers, file system access controls, secrets not logged, timeout enforcement |107| mcp-use Framework | MCPClient/MCPAgent session lifecycle, async context managers, tool call error handling, multi-server routing, connection cleanup |108| Next.js Website | Server Component boundaries, metadata/SEO, ISR/revalidation, image optimization, Core Web Vitals, structured data |109| Next.js Dashboard | Auth middleware on protected routes, server action input validation, role-based access, data table pagination, error boundaries |110| Next.js Shared | Server vs client component misuse, environment variable exposure, route handler authentication, CSRF via server actions |111112**For each rule you write**, explain why it exists by referencing what you found in the repo. Generic rules without repo-specific justification are noise.113114### Phase 4: Map Context Files115116Scan the repo for documentation that would help the reviewer:117118| File type | What it provides | Example scope |119|---|---|---|120| Architecture docs | System boundaries, service topology | All files |121| API specs (OpenAPI/Swagger) | Endpoint contracts | `src/api/**`, `src/routes/**` |122| Database schemas (Prisma, migrations) | Model relationships | `src/db/**`, `src/models/**` |123| ADRs | Decision rationale | All files |124| Style/contribution guides | Team conventions | All files |125| Type definitions / shared contracts | Cross-service types | Service-specific |126127Scope context files to relevant directories. A Prisma schema is useless context when reviewing React components.128129### Phase 5: Generate and Validate130131Generate the configuration files, then run the validation checklist before outputting.132133**Files to generate:**1341351. `.greptile/config.json` — Primary configuration (review behavior, rules, filters, output format)1362. `.greptile/rules.md` — Prose rules with code examples (only if rules need narrative context)1373. `.greptile/files.json` — Context file mappings (only if documentation exists to reference)1384. Child `.greptile/config.json` files — For monorepo subdirectories that need different settings139140**Validation checklist — run before every output:**141142- [ ] All JSON is syntactically valid (no trailing commas, no comments)143- [ ] Every `scope` is an **array** of strings, never a comma-separated string144- [ ] `ignorePatterns` is a **newline-separated string** (`\n`), never an array145- [ ] `strictness` is integer 1, 2, or 3146- [ ] `commentTypes` only contains: `"logic"`, `"syntax"`, `"style"`, `"info"`147- [ ] `severity` values only: `"high"`, `"medium"`, `"low"`148- [ ] `patternRepositories` use `org/repo` format, never full URLs149- [ ] Every disableable rule has a unique `id`150- [ ] Every rule is specific and measurable — no vague platitudes151- [ ] Every high-noise rule has a `scope`152- [ ] `fileChangeLimit` is >= 1 (0 skips all PRs)153- [ ] `files.json` paths point to files that actually exist in the repo154- [ ] No `.greptile/` and `greptile.json` coexistence (if migrating, note to delete old)155156**Output format:**157158For every configuration you produce, include:1591601. **File tree** showing exactly which files go where1612. **Each config file** as a complete, valid JSON (or markdown) code block1623. **Reasoning annotations** after each file explaining WHY each major decision was made, referencing specific repo context1634. **Canary test** — a simple verification step to confirm the config is working1645. **Migration notes** if moving from `greptile.json` to `.greptile/`165166## Reference Files167168Read these when you need detailed specifications:169170- **`references/config-spec.md`** — Complete parameter reference for all config files, data types, cascading behavior, and monorepo inheritance rules. Read this when you need to check a specific parameter's format or understand how child configs interact with parent configs.171172- **`references/anti-patterns.md`** — Common mistakes, the troubleshooting reasoning chain, and the testing/verification protocol. Read this before finalizing any output to catch errors. Also useful when debugging why a Greptile config isn't working.173174- **`references/scenarios.md`** — Complete example configurations for TypeScript backend, React frontend, and monorepo setups. Read these for inspiration, but never copy them verbatim — every rule must be justified by the actual repository context.175176## Key Gotchas (Keep in Mind)177178- Config is read from the **source branch** of the PR, not the target branch179- Changes take effect on the **next PR**, not retroactively180- `ignorePatterns` skips **review** only — files are still **indexed**181- `includeAuthors: []` means **all authors** (not none)182- `fileChangeLimit: 0` means **skip all PRs** (minimum is 1)183- To suppress "X files reviewed, no comments" messages, use `statusCheck: true` (not `statusCommentsEnabled: false`)184- After ~10 PRs, Greptile auto-suggests rules — duplicates of existing rules may appear (this is normal)
Run npx skillmds@latest add diegosouzapw/greptile-config in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Generate production-ready Greptile AI code review configuration for any repository. Use this skill whenever the user mentions Greptile, AI code review setup, PR review configuration, automated code review rules, or wants to set up .greptile/ config files. Also trigger when someone says "set up code review", "configure PR reviews", "add review rules", or asks about Greptile configuration — even if they don't say "Greptile" explicitly but describe wanting AI-powered PR review automation. This skill analyzes the actual repository structure and produces tailored config, not generic boilerplate. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
diegosouzapw (@diegosouzapw) published this skill. Their other Agent Skills are listed on their SkillMD profile.