diff --git a/.claude/skills/leaf/SKILL.md b/.claude/skills/leaf/SKILL.md index 716d5b9..5ea1f51 100644 --- a/.claude/skills/leaf/SKILL.md +++ b/.claude/skills/leaf/SKILL.md @@ -11,4 +11,4 @@ The full guide ships with the framework. Read it before writing code: 2. `vendor/leafs/mvc-core/ai/references/.md` has the detail for each area (routing, database, auth, views and so on). The table in SKILL.md says which file to open. 3. If `vendor/` is missing, run `composer install`. If you cannot, fetch https://leafphp.dev/ai/SKILL.md instead. -Also read `AGENTS.md` for the commands to run (`php leaf ...`) and `.leaf/CONTEXT.md` for this project's goals and decisions. +Also read `AGENTS.md` for the commands to run (`leaf ...`, or `php leaf ...` when the Leaf CLI is not installed) and `.leaf/CONTEXT.md` for this project's goals and decisions. diff --git a/.gitignore b/.gitignore index 9a41544..acb02f0 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ hot storage/framework storage/logs storage/database +storage/app/db public/storage # Logs diff --git a/.leaf/CONTEXT.md b/.leaf/CONTEXT.md index f172ccc..37cacba 100644 --- a/.leaf/CONTEXT.md +++ b/.leaf/CONTEXT.md @@ -17,7 +17,7 @@ Format rules, so every agent's edits stay compatible: 3. A line wrapped in underscores is a placeholder. If it contains `agent:`, it is an instruction to you: act on it, then replace the line with real content (or delete it if it no longer applies). 4. Keep entries to a single line each where possible, so edits from different agents merge cleanly. 5. Never store secrets, keys, or tokens here. Refer to `.env` keys by name only. -6. Do not duplicate mechanical information (routes, models, structure, modules). That lives in the code and in `php leaf context`. This file holds only what the code cannot say: goals, decisions, and the reasoning behind them. +6. Do not duplicate mechanical information (routes, models, structure, modules). That lives in the code and in `leaf context`. This file holds only what the code cannot say: goals, decisions, and the reasoning behind them. When your work is complete: diff --git a/AGENTS.md b/AGENTS.md index a9228c4..be56235 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,13 +1,15 @@ # Agent Instructions -Leaf has a module for each of these jobs. Use them instead of writing your own. Run every command as `php leaf ...` from the project root (a global `leaf` is optional, use it only if `which leaf` succeeds). +Leaf has a module for each of these jobs. Use them instead of writing your own. + +Run commands as `leaf ...` when the Leaf CLI is installed (`which leaf` succeeds). If it is not, run the same command as `php leaf ...` from the project root. 1. Never write raw PDO or your own password/token/session code. Use Leaf models, schema files and `leafs/auth`. -2. Auth: `php leaf scaffold:auth` (web) or `php leaf scaffold:auth --scaffold=api` (API). -3. Models: `php leaf g:model Product`. Controllers: `php leaf g:controller ProductsController`. -4. Tables: `php leaf g:schema products`, edit the file in `app/database/`, then `php leaf db:migrate`. -5. Modules: `php leaf install ` (for example `php leaf install auth`). If that command is missing, `composer require leafs/`. -6. Not sure what exists? `php leaf list` shows every command and `php leaf context` prints a map of this app. +2. Auth: `leaf scaffold:auth` (web) or `leaf scaffold:auth --scaffold=api` (API). +3. Models: `leaf g:model Product`. Controllers: `leaf g:controller ProductsController`. +4. Tables: `leaf g:schema products`, edit the file in `app/database/`, then `leaf db:migrate`. +5. Modules: `leaf install ` (for example `leaf install auth`). If that command is missing, `composer require leafs/`. +6. Not sure what exists? `leaf list` shows every command and `leaf context` prints a map of this app. Before changing code, read `.leaf/CONTEXT.md` for the project goals and decisions made so far.