route-management
Skill1 starsChanged 2 months agoMITView on GitHub
Laravel のルートを追加・変更・削除するとき。 routes/web.php を編集しようとしているとき。 Route::get, Route::post 等を書く前に必ず確認。
In this repository27 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- add-hookSkill
- affected-area-testingSkill
- commit-workflowSkill
- create-issueSkill
- create-manualSkill
- create-prSkill
- debug-bar-investigationSkill
- documentation-standardsSkill
- edit-issueSkill
- handoffSkill
- large-feature-executionSkill
- livewire-v3-syntaxSkill
- parallel-setupSkill
- pdf-readSkill
- pdfSkill
- playwright-error-detectionSkill
- pre-implementation-researchSkill
- questionnaireSkill
- resolve-issueSkill
- review-permissionsSkill
- review-prSkill
- systematic-debuggingSkill
- tailwind-enforcementSkill
- tddSkill
- ui-approvalSkill
- writing-skillsSkill
The file
Files
ルート追加の絶対ルール
DDD / モジュラーモノリス的に app/Contexts/<ContextName>/ で機能を区切る
Laravel プロジェクトを想定したルール。プロジェクト構造が違う場合は配置先を
読み替える。
routes/web.php に直書きしない
routes/web.php への直接編集は禁止。
ルートは必ず Context (機能ドメイン) の ServiceProvider に書く。
理由: ルート定義が web.php に集中するとファイルが肥大化し、機能境界が
不明瞭になる。Context ごとに ServiceProvider で $this->loadRoutesFrom()
または Route::group(...) で登録すると、機能とルートが同じディレクトリに
収まる。
配置場所の決定
例:
app/Contexts/<ContextName>/ServiceProvider.php- バージョニングするなら
app/Contexts/v3/<ContextName>/ServiceProvider.phpのように切る(自プロジェクトの方針に合わせる)
新規 Context の ServiceProvider は config/app.php の providers 配列に
登録する。
記述パターン
public function boot(): void
{
Route::middleware(['web'])->prefix('/<context-prefix>')->group(function () {
Route::middleware(['auth'])->group(function () {
Route::get('/<resource>/<action>', Presentation\View\<Action>::class)
->name('<context>.<resource>.<action>');
});
});
}既存ルートの確認
新規追加前に必ず該当 ServiceProvider.php で既存のルート構造を確認する。
重複や命名衝突を避ける。
違反時の対応
routes/web.php を誤って編集してしまった場合:
- 即座に元の状態に戻す(または該当行を削除)
- 適切な Context の
ServiceProviderに移動
「動いているから大丈夫」は理由にならない。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

