Co-Pilot / 辅助式
更新于 25 days ago

taylor-says

Mmischasigtermans
0.0k
mischasigtermans/taylor-says
82
Agent 评分

💡 摘要

Taylor Says 审查 Laravel 代码,检查过度工程和遵循 Laravel 规范。

🎯 适合人群

寻求代码优化的 Laravel 开发者追求最佳实践的软件工程师代码审查员和审计员学习 Laravel 的学生执行编码标准的开发团队

🤖 AI 吐槽:看起来很能打,但别让配置把人劝退。

安全分析中风险

风险:Medium。建议检查:是否执行 shell/命令行指令;是否发起外网请求(SSRF/数据外发);文件读写范围与路径穿越风险。以最小权限运行,并在生产环境启用前审计代码与依赖。

Taylor Says

Claude Code plugin channeling Taylor Otwell's Laravel philosophy. "Laravel is not Spring."

Taylor reviews your Laravel code for over-engineering, unnecessary abstractions, and violations of Laravel conventions. Direct, opinionated, and occasionally brutal.

Available through the Ryde Ventures plugin marketplace.

Installation

# Add the Ryde Ventures marketplace (one-time)
/plugin marketplace add rydeventures/claude-plugins

# Install the plugin
/plugin install taylor-says@rydeventures-claude-plugins

Quick Start

# Review uncommitted changes (default behavior)
@taylor

# Review a specific file
@taylor review app/Services/UserService.php

# Simplify uncommitted changes (applies fixes directly)
@taylor simplify

# Simplify a specific file
@taylor simplify app/Services/UserService.php

# Hunt for over-engineering in your codebase
@taylor find unnecessary abstractions in my codebase

# Review an entire directory
@taylor review all files in app/Actions/

# Find dead code
@taylor find interfaces with only one implementation

# Audit a pattern
@taylor check if my repository classes are actually needed

Modes

| Mode | Command | Behavior | |------|---------|----------| | Review | @taylor | Analyze, give feedback, no changes | | Simplify | @taylor simplify | Analyze AND apply fixes directly |

Simplify mode focuses on structural changes: deleting unnecessary abstractions, inlining single-use Actions, removing dead code. It won't over-simplify — if removing an abstraction bloats the controller, Taylor leaves it alone.

What Taylor Looks For

Red Flags

  • Repository patterns wrapping Eloquent
  • Service classes that just proxy model methods
  • Interfaces with single implementations
  • Actions that call one model method
  • Enterprise Java patterns in Laravel

The Laravel Way

  • Eloquent used directly (it's not an anti-pattern)
  • Controllers that do things (30 lines is fine)
  • Form Requests for validation
  • Observers for model lifecycle events
  • Policies for authorization

Example Review

Input: A BookmarkService that wraps Eloquent operations

class BookmarkService { public function createBookmark(User $user, Chat $chat, string $messageId, string $role, string $content): ?Bookmark { try { return DB::transaction(function () use ($user, $chat, $messageId, $role, $content): Bookmark { $existing = Bookmark::forUser($user->id) ->where('chat_id', $chat->id) ->where('content_hash', sha1($content . $role)) ->first(); if ($existing) { return $existing; } return Bookmark::create([/* ... */]); }); } catch (Throwable $exception) { Log::error('Failed to create bookmark', ['error' => $exception->getMessage()]); return null; } } }

Taylor says:

Critical Issues

Service class that proxies models. BookmarkService is the poster child for this anti-pattern. You have 150 lines of service code that exists primarily to call Bookmark::create() and Bookmark::delete(). The model is clean. The service is unnecessary ceremony.

Database transaction around a single query. The transaction wraps a first() and a create(). If you're worried about race conditions on bookmark uniqueness, use a unique constraint and firstOrCreate(). The database handles this.

Error swallowing. You're catching Throwable, logging it, and returning null. The caller has no idea what went wrong. If creation fails, it should fail loudly. Laravel's exception handler will log it AND you'll actually know something's broken.

The Laravel Way

Delete the service. Put the logic where it belongs:

// In your Bookmark model public static function toggle(User $user, Chat $chat, string $messageId, string $role, string $content): ?self { $hash = sha1($content . $role); $existing = static::forUser($user->id) ->where('chat_id', $chat->id) ->where('content_hash', $hash) ->first(); if ($existing) { $existing->delete(); return null; } return static::create([/* ... */]); }

I once spent three days building an "elegant" abstraction layer that nobody ever extended or swapped out. It still haunts me. This service has that same energy - solving a problem that doesn't exist yet and probably never will.

Delete BookmarkService.php. Ship it.

Representative Quotes

"Stop writing Java in PHP."

"The interface exists purely to satisfy some abstract notion of 'clean architecture' rather than solving a real problem."

"Elegance means solving the problem directly."

"If your service just proxies to Eloquent, delete it."

"Enterprise PHP cosplaying as Laravel."

Knowledge System

Taylor automatically loads relevant knowledge based on the files being reviewed:

| File Pattern | Knowledge | |--------------|-----------| | Models, migrations | Eloquent best practices | | Controllers | Controller patterns | | Form Requests | Validation rules | | Routes, middleware | Routing patterns | | Policies | Authorization | | Views | Blade patterns | | Events, listeners | Event handling | | Tests | Testing practices |

Bonus: @taylor cocacola loads all knowledge for a comprehensive deep-dive.

Laravel Boost Integration

This agent uses Laravel Boost MCP server by default. Taylor can then:

  • Search official Laravel documentation to back up recommendations
  • Check your installed package versions for version-specific advice
  • Query your database schema to validate refactoring suggestions

If you're not using Laravel Boost, update the tools line in agents/taylor.md:

tools: Bash, Glob, Grep, Read, Edit

Philosophy

Taylor's code philosophy centers on:

  1. Elegance over cleverness - Beautiful, simple solutions
  2. Convention over configuration - Follow Laravel's way
  3. Disposability over durability - Easy to change > permanent
  4. Expressiveness - Code should read like prose
  5. Developer happiness - Laravel exists for joy, not just function

"You want your code to be like Kenny from South Park and not like T1000 from Terminator. Disposable, easy to change." — Taylor Otwell

Benchmarks

I take Taylor's quality seriously. Every release is benchmarked with 18 parallel Taylor agents reviewing 6 different Laravel features to ensure:

| Metric | Current (v1.7.0) | |--------|:----------------:| | Consistency | 100% | | Authenticity | 8.8/10 | | Technical Depth | 9/10 | | Personality | 7/10 |

Taylor has maintained 100% verdict consistency since version 1.3.0 - every instance reviewing the same code reaches the same conclusion.

See BENCHMARK.md for methodology and version history.

Note: Detailed benchmark reports, research materials, and prompt engineering artifacts are kept internal. The published plugin represents our best refinement of Taylor's voice and technical accuracy.

See Also

Raymond Says - The Python companion. Raymond reviews Python code for Java-isms, anti-patterns, and missed opportunities to use Python idiomatically. Same philosophy, different ecosystem.

Requirements

  • Claude Code
  • A Laravel codebase (or any PHP project embracing Laravel's philosophy)

Credits

License

MIT

五维分析
清晰度9/10
创新性7/10
实用性8/10
完整性9/10
可维护性8/10
优缺点分析

优点

  • 对 Laravel 代码提供直接反馈
  • 帮助识别反模式
  • 鼓励最佳实践
  • 与 Laravel Boost 集成以增强建议

缺点

  • 对某些开发者可能过于主观
  • 仅限于 Laravel 和 PHP 项目
  • 需要熟悉 Laravel 规范
  • 可能会抑制创造性编码方法

相关技能

pytorch

S
toolCode Lib / 代码库
92/ 100

“它是深度学习的瑞士军刀,但祝你好运能从47种安装方法里找到那个不会搞崩你系统的那一个。”

agno

S
toolCode Lib / 代码库
90/ 100

“它承诺成为智能体领域的Kubernetes,但得看开发者有没有耐心学习又一个编排层。”

nuxt-skills

S
toolCo-Pilot / 辅助式
90/ 100

“这本质上是一份组织良好的小抄,能把你的 AI 助手变成一只 Nuxt 框架的复读机。”

免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。

版权归原作者所有 mischasigtermans.