patternfeed
v0.1.3
Published
Crowdsourced coding anti-patterns library for smarter AI coding assistants
Maintainers
Readme
PatternFeed
Crowdsourced coding anti-patterns library for smarter AI coding assistants
PatternFeed is an open-source platform where:
- Testers submit structured bug reports when testing apps
- AI extracts reusable "patterns to avoid" from reports
- Library grows into an importable knowledge base for Claude Code users
- Rewards = attribution, reputation, and access (no money required)
Quick Start
# Install globally
npm install -g patternfeed
# Search existing patterns
patternfeed search "useEffect dependencies"
# Generate CLAUDE.md rules for your stack
patternfeed generate-rules --stack react nextjs -o .claude/rules/patternfeed.md
# Start MCP server for Claude Code integration
patternfeed serveFeatures
For Testers: Submit Bug Reports
patternfeed test https://github.com/example/repoInteractive CLI guides you through:
- Context: Stack, framework versions, environment
- Bug: What went wrong (steps to reproduce)
- Expected: What should have happened
- Root Cause: Why it happened (if known)
- Fix: How it was fixed (if applicable)
AI then extracts a reusable anti-pattern from your report.
For Library Users: Import Patterns
Option 1: MCP Server (Recommended)
Add to your ~/.claude/claude_desktop_config.json:
{
"mcpServers": {
"patternfeed": {
"command": "patternfeed",
"args": ["serve"]
}
}
}Claude Code can then:
get_relevant_patterns- Get patterns for your current stackcheck_code- Check code against anti-patternssearch_patterns- Search the library
Option 2: CLAUDE.md Generator
# Generate rules for your stack
patternfeed generate-rules --stack react nextjs typescript > .claude/rules/patternfeed.mdFor Contributors: Build Reputation
No money involved, but real value:
| Tier | Requires | Unlocks | |------|----------|---------| | Contributor | 1+ verified pattern | Submit patterns, basic library access | | Reviewer | 10+ patterns, 90%+ quality | Review others' patterns, early access | | Maintainer | 50+ patterns, community election | Curate categories, merge patterns |
Every pattern has attribution: contributedBy: @your-username
Commands
# Test and submit bug reports
patternfeed test <repo-or-url> # Interactive bug report
patternfeed submit report.json # Submit existing report
patternfeed submit report.json --dry-run # Preview extraction
# Browse patterns
patternfeed search <query> # Search patterns
patternfeed search hydration --framework react
patternfeed search --category async --severity critical
# Generate rules
patternfeed generate-rules --stack react nextjs
patternfeed generate-rules --categories hooks async -o rules.md
# MCP server
patternfeed serve # Start MCP server (stdio)
# Initialize library
patternfeed init # Create local library structurePattern Structure
Patterns are stored as YAML files:
id: react-useeffect-missing-deps-001
title: Missing useEffect dependencies cause stale closures
context:
frameworks: [React 18, React 19]
languages: [JavaScript, TypeScript]
appliesWhen: Using useEffect with variables from component scope
categories: [hooks, state, async]
antiPattern: |
useEffect(() => {
console.log(count); // Stale closure!
}, []); # Missing dependency
correctPattern: |
useEffect(() => {
console.log(count);
}, [count]); # Include dependencies
explanation: When useEffect dependencies are missing, the callback...
severity: high
confidence: 0.95
contributedBy: username
sourceReport: uuid
verified: true
votes: 42Library Structure
library/
├── index.json # Searchable index
├── schema.json # Validation schema
└── patterns/
├── react/
│ ├── hooks/
│ └── state/
├── nextjs/
│ └── hydration/
├── typescript/
│ └── types/
└── general/
└── async/Environment Variables
# Required for pattern extraction (submitting reports)
ANTHROPIC_API_KEY=sk-ant-...
# Optional: custom library path
PATTERNFEED_LIBRARY=/path/to/libraryDevelopment
# Clone and install
git clone https://github.com/patternfeed/patternfeed
cd patternfeed/cli
npm install
# Build
npm run build
# Link for local development
npm link
# Run in development
npm run dev # Watch modeContributing
- Find a bug in any open-source project
- Submit a report:
patternfeed test <repo> - AI extracts a reusable pattern
- Community verifies the pattern
- Your attribution stays with the pattern forever
Categories
- UI/Rendering: hydration, rendering, state, props, hooks
- Async: async, promises, callbacks, race-conditions
- Network: api, fetch, networking, caching
- Security: auth, security, validation, sanitization
- Performance: performance, memory, optimization
- Types: types, typescript
- Testing: testing, mocking, fixtures
- Database: database, orm, queries, migrations
- DevOps: deployment, build, bundling, config
Severity Levels
- Critical: Security vulnerabilities, data loss, crashes
- High: Functionality broken, significant bugs
- Medium: Unexpected behavior, edge cases
- Low: Code quality, best practices
License
MIT
Acknowledgments
PatternFeed is inspired by crowdsourced testing platforms and the idea that bugs found once shouldn't be found again. Built with Claude for pattern extraction.
