Skip to content

Commit e7ef634

Browse files
committed
chore: add Greptile code review configuration
1 parent 45887dc commit e7ef634

3 files changed

Lines changed: 95 additions & 0 deletions

File tree

.greptile/config.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"strictness": 2,
3+
"commentTypes": ["logic", "syntax"],
4+
"triggerOnUpdates": true,
5+
"includeBranches": ["main"],
6+
"ignoreKeywords": "WIP\nDO NOT REVIEW",
7+
"ignorePatterns": "node_modules/**\ndist/**\nbuild/**\n**/*.min.js\npnpm-lock.yaml\nflake.lock\n**/*.snap\nreports/**\n**/*.webp\n**/*.png\n**/*.gif",
8+
"instructions": "TypeScript pnpm monorepo for pythinker-code, a provider-agnostic AI coding agent. packages/* are published libraries; apps/* are the CLI/TUI, web UI, and dashboard. The root AGENTS.md is the authoritative contributor guide; nearest sub-directory AGENTS.md files add local rules.",
9+
"rules": [
10+
{
11+
"id": "no-type-weakening",
12+
"rule": "Do not weaken types to silence errors: no `any`, unconstrained `unknown`, `@ts-ignore`, or type assertions added only to make a type error go away.",
13+
"scope": ["packages/**", "apps/**"],
14+
"severity": "high"
15+
},
16+
{
17+
"id": "flake-workspace-sync",
18+
"rule": "When a workspace package is added or removed in pnpm-workspace.yaml, flake.nix workspacePaths and workspaceNames must be updated in the same PR. A missing path silently drops files from the Nix build.",
19+
"severity": "high"
20+
},
21+
{
22+
"id": "tests-can-fail",
23+
"rule": "Tests must be able to fail. Flag vacuous assertions: empty-set matches, missing awaits on async expectations, and mocked units asserting on the mock itself.",
24+
"scope": ["**/*.test.ts", "**/*.test.tsx"],
25+
"severity": "medium"
26+
},
27+
{
28+
"id": "tui-reactivity",
29+
"rule": "Solid signals must not be destructured, rendering must stay allocation-light, and no blocking I/O on the render path.",
30+
"scope": ["apps/pythinker-code/src/tui/**"],
31+
"severity": "high"
32+
},
33+
{
34+
"id": "changeset-required",
35+
"rule": "PRs that change published package behavior need a changeset. Default to minor or patch; a major bump requires explicit maintainer confirmation.",
36+
"severity": "medium"
37+
}
38+
]
39+
}

.greptile/files.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"files": [
3+
{
4+
"path": "AGENTS.md",
5+
"description": "Repository-wide contributor guide: product identity, project map, coding rules, and PR workflow"
6+
},
7+
{
8+
"path": "apps/pythinker-code/AGENTS.md",
9+
"description": "CLI / terminal UI app rules",
10+
"scope": ["apps/pythinker-code/**"]
11+
},
12+
{
13+
"path": "apps/pythinker-web/AGENTS.md",
14+
"description": "Browser UI (Vue 3) rules",
15+
"scope": ["apps/pythinker-web/**"]
16+
},
17+
{
18+
"path": "packages/server/AGENTS.md",
19+
"description": "Server package rules (REST + WS /api/v1)",
20+
"scope": ["packages/server/**"]
21+
},
22+
{
23+
"path": "packages/server-e2e/AGENTS.md",
24+
"description": "E2E test suite rules",
25+
"scope": ["packages/server-e2e/**"]
26+
},
27+
{
28+
"path": "docs/AGENTS.md",
29+
"description": "Documentation rules",
30+
"scope": ["docs/**"]
31+
}
32+
]
33+
}

.greptile/rules.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Review Rules
2+
3+
## TypeScript conventions
4+
5+
- `user?: User`, never `user?: User | undefined`.
6+
- Pass `undefined` directly for optional props — no conditional spread.
7+
- Single-param internal methods stay single-param — no options-object wrapping.
8+
- Non-root `index.ts` files: prefer `export * from './module'`.
9+
- Prefer `import ... from '#/...'` over deep relative paths (equivalent to `@/...`).
10+
11+
## Architecture boundaries
12+
13+
- `apps/pythinker-code` and `apps/pythinker-web` must not depend on `packages/agent-core`. They consume the SDK (`@pythoughts/pythinker-code-sdk`) or the server REST/WS API.
14+
- The `Agent` class in `packages/agent-core` stays standalone: no mandatory `Session` or `agentId`; optional `sessionId` is a provider hint only.
15+
- `packages/acp-adapter` pins `@agentclientprotocol/sdk` to `^0.23.0` — flag any bump to 0.24+ (it broke the session-model API).
16+
- Experimental features are gated behind flags in `packages/agent-core/src/flags/registry.ts`, not shipped unguarded.
17+
18+
## Hygiene
19+
20+
- English-only code, comments, and identifiers. Unicode tests use ASCII/Latin fixtures (e.g. `café`).
21+
- No backward-compatibility shims; implement the current requirement directly.
22+
- Prefer adding tests to existing test files over creating new ones.
23+
- Internal identifiers must not appear in public text or test data — use neutral placeholders.

0 commit comments

Comments
 (0)