Skip to content

leafs/llms v0.1: llms init and detect - #1

Merged
mychidarko merged 2 commits into
mainfrom
feat/init
Nov 10, 2026
Merged

mychidarko merged 2 commits into
mainfrom
feat/init

Conversation

@mychidarko

Copy link
Copy Markdown
Member

First version of leafs/llms, as scoped and approved on 9 Nov 2026.

composer require --dev leafs/llms, then vendor/bin/llms init writes:

  • AGENTS.md (source of truth: stack, commands, layout, conventions, finish checklist)
  • CLAUDE.md (imports @AGENTS.md)
  • llms.txt
  • .cursor/rules/project.mdc (always applied) and .cursor/rules/php.mdc (**/*.php)
  • .claude/skills/<name>/SKILL.md and .agents/skills/<name>/SKILL.md

Detection (src/Detector.php): framework from composer.json (Leaf MVC, Leaf, Laravel, Symfony, plain PHP; --framework overrides), PHP constraint, PSR-4 map, test runner (Alchemy, Pest, PHPUnit), lint/format/analyse/refactor tools, and composer scripts (preferred over calling tools directly; pre-/post- hooks skipped). Starter-kit names like leafs/mvc and laravel/laravel fall back to the folder name.

Re-runs: generated text sits between <!-- leafs/llms:start --> / <!-- leafs/llms:end -->. Only that part is replaced. A file without markers (e.g. the AGENTS.md that ships with Leaf MVC) keeps its text and gets the section appended. A second run with no changes reports everything unchanged.

Skills: php-tests for every project, plus leaf-routes; leaf-mvc-feature and leaf-database (schema files); laravel-feature and laravel-database; symfony-controller and symfony-doctrine; php-package. Leaf MVC output also points agents at .leaf/CONTEXT.md and leaf context, matching the skeleton's own AGENTS.md.

vendor/bin/llms detect and init --dry-run show what would happen without writing.

Checks

  • 27 Pest tests through alchemy (fixtures for all five project types, re-run safety, frontmatter shape), lint clean. CI is the same alchemy workflow as leafsphp/db.
  • README and the generated AGENTS.md, llms.txt and skills for all five frameworks pass Kata (leaf-writing preset).
  • Skill frontmatter (name matching the folder, description) and Cursor .mdc frontmatter (description, globs, alwaysApply) are checked in the tests.

Not done yet: a live run in Claude Code and Cursor. Neither is installed on my machine and I don't have a login for either. Please run vendor/bin/llms init in a Leaf MVC app and check that Claude Code lists the skills and Cursor shows the two rules. I'll fix anything that turns up.

Before tagging: Packagist needs the repo submitted once it's merged.

@mychidarko
mychidarko merged commit 2720251 into main Nov 10, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant