make-dev/orca-harpoon
Composer 安装命令:
composer require make-dev/orca-harpoon
包简介
Extract HTML elements into Livewire components with a single click. OrcaHarpoon lets you visually inspect any element on your page and instantly scaffold a new Livewire component from it.
README 文档
README
Extract any HTML element into a Livewire component with a single click.
Point. Click. Component. OrcaHarpoon turns visual element inspection into instant Livewire scaffolding — complete with AI refactor prompts for seamless source code integration.
What is OrcaHarpoon?
OrcaHarpoon is a developer tool that lets you visually inspect any element on your page and instantly scaffold a fully-wired Livewire component from it. It generates the PHP class, Blade view, and service provider registration — then produces an AI refactor prompt so Claude can replace the original HTML with your new @livewire() tag.
Quick Start
composer require make-dev/orca-harpoon
That's it. OrcaHarpoon auto-injects into every page in local environments via middleware.
How It Works
1. Click the harpoon icon (bottom-left corner)
2. Hover over elements — a blue highlight follows your cursor
3. Click an element to capture it
4. Name your component (PascalCase, e.g. TaskQueue)
5. Click "Harpoon It"
OrcaHarpoon then:
- Creates
Modules/{Module}/app/Livewire/{ComponentName}.phpextendingMakeDevModuleComponent - Creates
Modules/{Module}/resources/views/livewire/{component-name}.blade.phpwith the captured HTML - Adds
Livewire::component()registration to the module's service provider - Stores an AI refactor prompt in the session for Orca to pick up
- Dispatches a
harpoon-completeLivewire event with all file paths and the refactor prompt
The generated component includes transition traits, module metadata, overlay positioning, and Agent README support out of the box.
Features
-
Visual Element Inspector — Browser-native DOM inspection with live blue highlight overlay, element tag + class labels, and XPath generation.
-
One-Click Scaffolding — Generates a complete Livewire component: PHP class, Blade view, and service provider registration in a single action.
-
PascalCase Validation — Client-side and server-side validation ensures component names follow convention.
-
AI Refactor Prompts — Automatically generates a structured prompt that instructs Claude to find the source Blade code and replace it with
@livewire('component-alias'). -
Orca Integration — Refactor prompts are stored in the session (
orca.pending_harpoon_refactor) so Orca can pick them up after the Vite file-watcher triggers a page refresh. -
Module-Aware — Automatically detects which module owns the current page from the route's controller namespace and scopes all generated files to that module.
UI States
| State | Visual | Interaction |
|---|---|---|
| Idle | Harpoon icon button (dark, bottom-left) | Click to start inspecting |
| Inspecting | Pulsing blue button + highlight overlay following cursor | Click any element to capture, Esc to cancel |
| Naming | Modal dialog with XPath, HTML preview, name input, prompt preview | Enter name and click "Harpoon It", Esc to cancel |
| Success | Green toast notification | Auto-dismisses after 5 seconds |
Configuration
Publish the config file:
php artisan vendor:publish --tag=orcaharpoon-config
| Variable | Default | Description |
|---|---|---|
MODULE_ORCA_HARPOON_ENABLED |
true |
Enable/disable OrcaHarpoon entirely |
OrcaHarpoon only activates in the local environment (app()->isLocal()). It will never appear in production.
Generated Component Example
When you harpoon an element named TaskQueue in the DemoSimpleHomepage module, you get:
Modules/DemoSimpleHomepage/app/Livewire/TaskQueue.php
namespace Modules\DemoSimpleHomepage\Livewire; use MakeDev\MakeDev\Concerns\TransitionFadeIn; use MakeDev\MakeDev\Concerns\TransitionFadeOut; use MakeDev\MakeDev\Livewire\MakeDevModuleComponent; class TaskQueue extends MakeDevModuleComponent { use TransitionFadeIn, TransitionFadeOut; public function moduleInfo(): array { return [ 'name' => 'TaskQueue', 'description' => 'Extracted component from DemoSimpleHomepage.', 'version' => '1.0.0', // ... ]; } public function render() { return view('demosimplehomepage::livewire.task-queue'); } }
Modules/DemoSimpleHomepage/resources/views/livewire/task-queue.blade.php
Contains the captured outer HTML from the browser.
Architecture
src/
├── Http/Middleware/
│ └── InjectOrcaHarpoon.php # Auto-injects component into HTML responses
├── Livewire/
│ └── Harpoon.php # Core extraction logic and file generation
└── Providers/
└── OrcaHarpoonServiceProvider.php
config/
└── orcaharpoon.php # Enable/disable toggle
resources/views/livewire/
└── harpoon.blade.php # Alpine.js UI (inspector, modal, toast)
Middleware Guards
The InjectOrcaHarpoon middleware only injects when all conditions are met:
- Environment is
local - Config
orcaharpoon.enabledistrue - Request does not have
X-Livewireheader (skips Livewire updates) - Response Content-Type contains
text/html
Requirements
- PHP 8.4+
- Laravel 12
- Livewire 4
- MakeDev (for
MakeDevModuleComponentbase class and transition traits)
License
MIT
make-dev/orca-harpoon 适用场景与选型建议
make-dev/orca-harpoon 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 17 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「developer-tools」 「livewire」 「component-extraction」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 make-dev/orca-harpoon 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 make-dev/orca-harpoon 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 make-dev/orca-harpoon 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Puppeteer bridge for PHP, supporting the entire API.
Livewire starter kit for Lunar e-commerce.
Views for the package MedicOneSystems Livewire Datatables with Bootstrap 4
Livewire component that provides drawers (slide overs) that support multiple children while maintaining state.
Interactive CLI that generates customized Claude Code markdown files (CLAUDE.md, commands, agents) for PHP projects with Symfony, Laravel, Rector, PHPStan, PHP-CS-Fixer, GrumPHP and more.
Symfony Profiler bundle that analyzes per-request signals and produces scored, actionable optimization opportunities with ready-made AI agent prompts.
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 31
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-14
