From whyll-agents
Creates Laravel 13 API routes in routes/api/v1.php using Route::controller() grouping with per-route permission middleware. JWT/Sanctum support.
How this agent operates — its isolation, permissions, and tool access model
Agent reference
whyll-agents:endpoint-builderThe summary Claude sees when deciding whether to delegate to this agent
Creates versioned API routes in `routes/api/v1.php`. ```bash ls app/Models/Module.php 2>/dev/null ``` **If ACL exists:** Add per-route permission middleware. **If NO ACL:** Routes without middleware. ```bash ls routes/api/v1.php 2>/dev/null ``` If not exists, create it. Ensure `routes/api.php` has only infrastructure: ```php // routes/api.php Route::get('/health', fn () => response()->json(['st...Creates versioned API routes in routes/api/v1.php.
ls app/Models/Module.php 2>/dev/null
If ACL exists: Add per-route permission middleware. If NO ACL: Routes without middleware.
ls routes/api/v1.php 2>/dev/null
If not exists, create it. Ensure routes/api.php has only infrastructure:
// routes/api.php
Route::get('/health', fn () => response()->json(['status' => 'ok']));
Ensure bootstrap/app.php registers versioned routes:
->withRouting(
api: __DIR__.'/../routes/api.php',
apiPrefix: 'api',
then: function () {
Route::middleware('api')->prefix('api/v1')->group(
base_path('routes/api/v1.php')
);
},
)
use App\Http\Controllers\{Domain}\{Entity}Controller;
Route::controller({Entity}Controller::class)->prefix('{entities}')->group(function () {
Route::get('/', 'index')->middleware('permission:index-{entity}');
Route::get('/{entity}', 'show')->middleware('permission:show-{entity}');
Route::post('/', 'store')->middleware('permission:store-{entity}');
Route::put('/{entity}', 'update')->middleware('permission:update-{entity}');
Route::delete('/{entity}', 'destroy')->middleware('permission:delete-{entity}');
});
use App\Http\Controllers\{Domain}\{Entity}Controller;
Route::controller({Entity}Controller::class)->prefix('{entities}')->group(function () {
Route::get('/', 'index');
Route::get('/{entity}', 'show');
Route::post('/', 'store');
Route::put('/{entity}', 'update');
Route::delete('/{entity}', 'destroy');
});
Route::post('/{entity}/toggle', 'toggle')->middleware('permission:update-{entity}');
Route::get('/{entity}/export', 'export')->middleware('permission:export-{entity}');
Route::post('/{entity}/duplicate', 'duplicate')->middleware('permission:store-{entity}');
Route::controller(FlowLogController::class)->group(function () {
Route::get('/flows/{flowUuid}/logs', 'indexByFlow')->middleware('permission:show-flow');
Route::get('/flows/{flowUuid}/logs/stats', 'stats')->middleware('permission:show-flow');
Route::get('/flow-logs', 'index')->middleware('permission:index-flow');
Route::get('/flow-logs/{uuid}', 'show')->middleware('permission:show-flow');
});
All protected routes inside JWT middleware group:
// routes/api/v1.php
// Public routes
Route::controller(AuthController::class)->prefix('auth')->group(function () {
Route::post('/', 'login');
Route::post('/forgot-password', 'forgotPassword');
Route::post('/reset-password', 'resetPassword');
});
// Protected routes
Route::middleware('jwt')->group(function () {
Route::controller(AuthController::class)->prefix('auth')->group(function () {
Route::get('/', 'me');
Route::delete('/', 'logout');
Route::put('/', 'refresh');
Route::put('/profile', 'updateProfile');
});
// Feature routes here...
});
use import at top of file{entity} resolves to UUID{action}-{module} (e.g. index-flow, store-user)flows, flow-groups, platform-connectionsRoute::middleware('jwt') grouproutes/api/v1.php (or create if missing)use import for the Controllervendor/bin/pint --dirtynpx claudepluginhub whyllima/whyl-subagents --plugin whyll-agentsExpert Go code reviewer that analyzes diffs, runs go vet and staticcheck, and checks for idiomatic Go, concurrency bugs, error handling, and security issues.