Learnings & Knowledge Base
Teach CodePeel your codebase conventions. Learnings are rules that get injected into every review, so the AI checks for your team's specific patterns.
Adding a Learning
Via PR Comment (fastest)
Mention @codepeel with the learn: prefix in any PR comment:
@codepeel learn: Always use Zod schemas for API request validation
@codepeel learn: We use effect-ts for error handling, not try/catch
@codepeel learn: The src/generated/ directory is auto-generated — never flag issues there
The rule is saved immediately and applied to all future reviews for this repository.
Via .codepeel.yml (version-controlled)
Add rules to your config file for team-wide conventions:
expert_rules:
- "Use functional components with hooks, not class components"
- "All database queries must use the repository pattern"
- "API responses follow JSend specification"
The difference:
learn:rules are stored in CodePeel's database per-repo.expert_ruleslive in your repo and are version-controlled.
Adding Ignore Rules
Suppress false positives with the ignore: prefix:
@codepeel ignore: Don't flag TODO comments as issues
@codepeel ignore: The console.log in src/lib/debug.ts is intentional
Viewing Your Learnings in the Webapp
Knowledge Base Page
Go to Knowledge Base in the sidebar. This shows:
- Learning growth over time (chart)
- Pattern category breakdown (pie chart)
- Learnings per repository
- Recent learnings list
Use the date range filter (7d / 30d / 90d) or filter by repository.
Learnings Page
Go to Learnings in the sidebar. This shows the per-repository list:
- Select a repository from the dropdown
- View all active learnings for that repo
- Use thumbs up/down to give feedback
- Delete learnings you no longer need
Managing Learnings (Thumbs Up / Down)
Each learning has feedback buttons:
| Action | What it does |
|---|---|
| 👍 Thumbs up | Confirms the rule is correct. Keeps it active in future reviews. |
| 👎 Thumbs down | Marks the rule as incorrect. Tells the AI to stop enforcing this pattern. |
| 🗑️ Delete | Removes the rule entirely. |
How Learnings Affect Reviews
When CodePeel reviews a PR:
- Loads all learnings for the repository
- Injects confirmed rules as "TEAM PREFERENCES" in the AI prompt
- Injects thumbs-down rules as "FALSE POSITIVE CORRECTIONS" (don't flag these)
- The AI considers these alongside its standard analysis
The more specific your learnings, the more relevant your reviews become.
Best Practices
- Add learnings early — the sooner CodePeel knows your conventions, the better
- Be specific — "Use parameterized queries" is better than "Be careful with databases"
- Review periodically — remove outdated rules from the Learnings page
- Use ignore rules on the spot — when you see a false positive, suppress it immediately
- Combine both methods —
expert_rulesfor team standards,learn:for ad-hoc rules