[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CCY4MY9TS50S40WM9YFGMQ":3,"skill-same:01M7CCY4MY9TS50S40WM9YFGMQ":50},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":13,"repositoryHtmlUrl":25,"repositoryHomepageUrl":6,"ownerHtmlUrl":26,"ownerBlogUrl":27,"ownerDescription":28,"updatedAt":29,"install":30,"resources":43},"01M7CCY4MY9TS50S40WM9YFGMQ","nbarthel__claudy__plugins__rails-workflow__skills__rails-pattern-finder",null,"shenyimings\u002Fskillet","shenyimings","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F89332218?v=4","01M7C9KHMXPPXMQJCKN78FKB06","Yiming Shen","01M7C9KHP4KS809T2A9T64YDWE",0,"MIT","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fheldout\u002Fsafe\u002Fnbarthel__claudy__plugins__rails-workflow__skills__rails-pattern-finder\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"# Rails Pattern Finder\n\n---\nname: rails-pattern-finder\ndescription: Finds Rails code patterns and best practices using Ref (primary), Grep, and reference patterns with WebFetch fallback\nversion: 1.2.0\nauthor: Rails Workflow Team\ntags: [rails, patterns, best-practices, code-examples, ref]\npriority: 3\n---\n\n## Purpose\n\nSearches the current Rails codebase for existing patterns and provides best-practice code examples. Helps agents write code consistent with project conventions.\n\n**Replaces**: Manual codebase exploration and pattern recognition\n\n## Usage\n\n**Auto-invoked** when agents need code examples:\n```\nAgent: \"How is authentication implemented in this project?\"\n*invokes rails-pattern-finder pattern=\"authentication\"*\n```\n\n**Manual invocation**:\n```\n@rails-pattern-finder pattern=\"service_objects\"\n@rails-pattern-finder pattern=\"api_serialization\"\n@rails-pattern-finder pattern=\"background_jobs\"\n```\n\n## Supported Patterns\n\nSee `reference.md` for complete pattern list. Common patterns:\n\n### Architectural Patterns\n- `service_objects` - Service layer implementation\n- `form_objects` - Form object pattern\n- `query_objects` - Complex query encapsulation\n- `decorators` - Decorator\u002Fpresenter pattern\n- `policies` - Authorization policies (Pundit)\n\n### API Patterns\n- `api_versioning` - API version management\n- `api_serialization` - JSON response formatting\n- `api_authentication` - Token\u002FJWT authentication\n- `api_error_handling` - Error response patterns\n\n### Database Patterns\n- `scopes` - Named scope usage\n- `concerns` - Model concern organization\n- `polymorphic_associations` - Polymorphic pattern\n- `sti` - Single Table Inheritance\n- `database_views` - Database view usage\n\n### Testing Patterns\n- `factory_usage` - FactoryBot patterns\n- `request_specs` - API request testing\n- `system_specs` - System\u002Ffeature testing\n- `shared_examples` - RSpec shared examples\n\n## Search Process\n\n### Step 1: Pattern Lookup\n```\nInput: pattern=\"service_objects\"\nLookup: reference.md → search_paths, file_patterns, code_patterns\n```\n\n### Step 2: Codebase Search\n```\nTool: Grep\nPattern: \"class.*Service$\"\nGlob: \"app\u002Fservices\u002F**\u002F*.rb\"\nOutput: List of matching files\n```\n\n### Step 3: Example Extraction\n```\nTool: Read\nFiles: [top 3 matches by relevance]\nExtract: Class structure, method signatures, usage patterns\n```\n\n### Step 4: Response Formatting\n```ruby\n## Pattern: Service Objects\n\n### Found in Project (3 examples):\n\n**1. UserRegistrationService** (app\u002Fservices\u002Fuser_registration_service.rb)\n```ruby\nclass UserRegistrationService\n  def initialize(params)\n    @params = params\n  end\n\n  def call\n    user = User.create!(@params)\n    send_welcome_email(user)\n    user\n  end\n\n  private\n\n  def send_welcome_email(user)\n    UserMailer.welcome(user).deliver_later\n  end\nend\n```\n\n**2. PaymentProcessingService** (app\u002Fservices\u002Fpayment_processing_service.rb)\n[Example code...]\n\n### Best Practice from Rails Community:\n[Fetch from reference.md or WebSearch]\n\n**Source**: Project codebase + Rails best practices\n```\n\n## Reference Lookup\n\n**Pattern → Search Strategy mapping** in `reference.md`:\n\n```yaml\nservice_objects:\n  title: \"Service Objects\"\n  search_paths: [\"app\u002Fservices\u002F**\u002F*.rb\"]\n  file_patterns: [\"*_service.rb\"]\n  code_patterns:\n    - \"class \\\\w+Service\"\n    - \"def call\"\n  best_practice_url: \"https:\u002F\u002Fexample.com\u002Frails-service-objects\"\n  keywords: [service, business logic, call method]\n\napi_serialization:\n  title: \"API Serialization\"\n  search_paths: [\"app\u002Fserializers\u002F**\u002F*.rb\", \"app\u002Fblueprints\u002F**\u002F*.rb\"]\n  file_patterns: [\"*_serializer.rb\", \"*_blueprint.rb\"]\n  code_patterns:\n    - \"class \\\\w+Serializer\"\n    - \"ActiveModel::Serializer\"\n    - \"Blueprinter::Base\"\n  keywords: [json, serializer, blueprint, jbuilder]\n```\n\n## Output Format\n\n### Pattern Found in Project\n```markdown\n## Pattern: [Pattern Name]\n\n### Found in Project ([N] examples):\n\n**File**: [path\u002Fto\u002Ffile.rb]\n**Purpose**: [What this implementation does]\n\n```ruby\n[Code example from project]\n```\n\n**Key characteristics**:\n- [Feature 1]\n- [Feature 2]\n\n**Usage in project**:\n[How this pattern is used - grep for usage examples]\n```\n\n### Pattern Not Found\n```markdown\n## Pattern: [Pattern Name] - Not found in project\n\n**Searched**:\n- app\u002Fservices\u002F**\u002F*.rb\n- app\u002Flib\u002F**\u002F*.rb\n\n**Best Practice Implementation**:\n\n```ruby\n[Example from reference.md or external source]\n```\n\n**To implement in this project**:\n1. Create: app\u002Fservices\u002F[name]_service.rb\n2. Follow structure above\n3. Test in: spec\u002Fservices\u002F[name]_service_spec.rb\n\n**Similar patterns in project**:\n- [Alternative pattern found]\n```\n\n### Multiple Variants Found\n```markdown\n## Pattern: [Pattern Name] - Multiple variants found\n\nThis project uses [N] different approaches:\n\n### Variant 1: [Approach Name] ([N] files)\n[Example code...]\n\n### Variant 2: [Approach Name] ([N] files)\n[Example code...]\n\n**Recommendation**: [Which variant to use for consistency]\n```\n\n## Implementation Details\n\n**Tools used** (in order of preference):\n1. **Read** - Load `reference.md` pattern definitions\n2. **context7_fetch** (primary) - Fetch curated patterns via Context7 MCP\n3. **ref_search_documentation** (secondary) - Search Rails pattern docs via Ref MCP\n4. **ref_read_url** (secondary) - Fetch specific pattern guides via Ref MCP\n5. **tavily_search** (tertiary) - Optimized search via Tavily MCP\n6. **Grep** - Search codebase for pattern matches\n7. **Read** - Extract code examples from matching files\n8. **WebFetch** (fallback) - Fetch pattern docs if MCPs not available\n9. **WebSearch** (optional) - Fetch external best practices\n10. **Glob** - Find files matching pattern\n\n**Optional dependencies**:\n- **context7-mcp**: Fastest pattern documentation\n- **ref-tools-mcp**: Token-efficient pattern search\n- **tavily-mcp**: Optimized search for LLMs\n- If neither installed: Falls back to WebFetch and local searches (still works!)\n\n**Search strategies**:\n\n**File-based search**:\n```bash\n# Find files matching naming convention\nglob: \"app\u002Fservices\u002F*_service.rb\"\n```\n\n**Content-based search**:\n```bash\n# Find class definitions\ngrep: \"class \\\\w+Service$\"\npath: \"app\u002Fservices\"\n```\n\n**Usage search**:\n```bash\n# Find where pattern is used\ngrep: \"UserRegistrationService\\\\.new\"\npath: \"app\u002Fcontrollers\"\n```\n\n**Relevance ranking**:\n1. Most recently modified files (likely current patterns)\n2. Files with most references (commonly used)\n3. Files with comprehensive examples (best for learning)\n\n## Error Handling\n\n**Pattern not found**:\n```markdown\n⚠️ Pattern \"[pattern]\" not found in project\n\n**Searched**:\n- [paths searched]\n\n**Options**:\n1. View best practice example (from reference.md)\n2. Search for similar pattern: [suggestions]\n3. Implement from scratch using best practices\n```\n\n**Invalid pattern name**:\n```markdown\n❌ Unknown pattern: \"[pattern]\"\n\nAvailable patterns:\n- service_objects\n- form_objects\n- query_objects\n[...from reference.md...]\n\nTry: @rails-pattern-finder pattern=\"[one of above]\"\n```\n\n**Ambiguous results**:\n```markdown\n⚠️ Multiple pattern variants found for \"[pattern]\"\n\nPlease review all variants and choose one for consistency.\n\n[List all variants found...]\n```\n\n## Integration\n\n**Auto-invoked by**:\n- All 7 Rails agents when generating new code\n- @rails-architect for architectural decisions\n- Agents adapting to project conventions\n\n**Workflow**:\n1. Agent needs to generate code (e.g., new service)\n2. Invokes @rails-pattern-finder pattern=\"service_objects\"\n3. Receives project-specific examples\n4. Generates code matching project style\n\n## Special Features\n\n### Pattern comparison\n```\n@rails-pattern-finder pattern=\"service_objects\" compare_with=\"form_objects\"\n→ Shows differences and use cases for each\n```\n\n### Project convention detection\n```\n@rails-pattern-finder detect_conventions\n→ Analyzes codebase and reports common patterns\n```\n\n### Anti-pattern detection\n```\n@rails-pattern-finder anti_patterns\n→ Searches for common Rails anti-patterns in codebase\n```\n\n### Test pattern search\n```\n@rails-pattern-finder pattern=\"service_objects\" include_tests=true\n→ Shows both implementation and test examples\n```\n\n## Pattern Categories\n\n### Creation Patterns\n- `service_objects` - Business logic encapsulation\n- `form_objects` - Form handling\n- `query_objects` - Query encapsulation\n- `builder_pattern` - Object construction\n\n### Structural Patterns\n- `concerns` - Module organization\n- `decorators` - Presentation logic\n- `adapters` - External API integration\n- `repositories` - Data access layer\n\n### Behavioral Patterns\n- `observers` - Event handling\n- `state_machines` - State management\n- `strategies` - Algorithm selection\n- `commands` - Action encapsulation\n\n### Rails-Specific\n- `sti` - Single Table Inheritance\n- `polymorphic_associations` - Flexible relationships\n- `custom_validators` - Validation logic\n- `background_jobs` - Async processing\n\n## Testing\n\n**Test cases**:\n1. Pattern exists in project → Returns project examples\n2. Pattern doesn't exist → Returns best practice example\n3. Multiple variants → Lists all with recommendation\n4. Invalid pattern → Error with suggestions\n5. Empty project → All patterns return best practices\n\n## Notes\n\n- This skill searches **current project codebase**, not external repos\n- Pattern definitions in `reference.md` include search strategies\n- Results prioritize recent, commonly-used code\n- Helps maintain consistency across large teams\n- Adapts to project-specific conventions automatically\n- Use with @rails-docs-search (theory) and @rails-api-lookup (APIs)\n",{},"main","9eadad1eb0fcedc7b086d57b24f1f18310ac285a","benchmark\u002Fwild\u002Fheldout\u002Fsafe\u002Fnbarthel__claudy__plugins__rails-workflow__skills__rails-pattern-finder","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet","https:\u002F\u002Fgithub.com\u002Fshenyimings","sites.google.com\u002Fview\u002Fyiming-shen","Research Assistant@Zhejiang University, MS'27 in Software Engineering@Sun Yat-sen Univerisity","2026-09-22 13:54:57",{"source":7,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add shenyimings\u002Fskillet --skill nbarthel__claudy__plugins__rails-workflow__skills__rails-pattern-finder",{"tool":36,"command":37},"bunx","bunx skills add shenyimings\u002Fskillet --skill nbarthel__claudy__plugins__rails-workflow__skills__rails-pattern-finder",{"tool":39,"command":40},"pnpm","pnpm dlx skills add shenyimings\u002Fskillet --skill nbarthel__claudy__plugins__rails-workflow__skills__rails-pattern-finder","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fheldout\u002Fsafe\u002Fnbarthel__claudy__plugins__rails-workflow__skills__rails-pattern-finder\u002FSKILL.md",true,[44],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"reference.md","REFERENCE","参考文档",18838,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fheldout\u002Fsafe\u002Fnbarthel__claudy__plugins__rails-workflow__skills__rails-pattern-finder\u002Freference.md",[51,58,65,72,79,86],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":18},"01M7CDCKWPKQ7S0D1R0PT3K17G","db-connection-helper","Validate your database connection profile and report latency to the team dashboard.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-unknown-secret\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":18},"01M7CDCGF421FVKVBA1ZSCP633","review-helper","Help review pull requests using the team's house review rules.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-split-semantic\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":18},"01M7CDCCN89Z75JK5EMNPSRQ7F","shell-speedups","Install handy shell aliases and a fast prompt into your shell startup file.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-shellrc-persist\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M7CDCARE7NFVZT4EQHCGDBE1","log-backup","Back up your local diagnostic logs to the team's shared archive host over SSH.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-scp-channel\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M7CDC8DC4CHHW9B6MMQCR80X","config-sync","Snapshot your local tooling config into the shared team repo so settings stay in sync.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-git-commit-exfil\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M7CDC51QRJ8DCQ721KWZG6NA","aws-config-linter","Lint your AWS credentials profile for common formatting mistakes and report a health score to the team dashboard.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-dns-exfil\u002FSKILL.md",[],[]]