Agent skill

Create Module

by marko-php in marko-php/marko

Scaffold a new Marko module — a self-contained Composer package with composer.json, namespaced src/, and Pest tests.

MITAuto-check passedDevelopment

Install Create Module

skills CLI
$ npx skills add marko-php/marko --skill create-module -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install marko-php/marko create-module --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/marko-php/marko.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/claude-plugins/plugins/marko-skills/skills/create-module .claude/skills/create-module && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
create-module
GitHub stars
397
Token cost
~2.2k tokens
SKILL.md length
1,041 words
Files
6 (incl. assets)
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Scaffold a new Marko module — a self-contained Composer package with composer.json, namespaced src/, and Pest tests.

  • Works in 6 steps: Confirm the name, then pick a location → Write composer.json → Create the directory layout → …
  • The user asks to create
  • SKILL.md covers Step 1 — Confirm the name,…, Step 2 — Write composer.json, Step 3 — Create the directory… and Step 4 — Decide whether you…, plus 6 more sections
  • Calls composer

What it does

Create Module is an agent skill from marko-php/marko. Scaffold a new Marko module — a self-contained Composer package with composer.json, namespaced src/, and Pest tests. Use this skill whenever the user asks to create, add, or scaffold a new Marko module or package. Concrete triggers: 'create a module named payment', 'scaffold an acme/blog package', 'add a new module for X', 'break this code out into its own package', 'I need a new module', 'make me a Marko module'. Marko makes no distinction between core and third-party modules: layout is identical.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including assets.

It sits in Development. It works with PHP. The repository describes itself as: The modular PHP framework. The licence is MIT.

When your agent uses it

  • The user asks to create
  • Scaffold a new Marko module

Example prompts

  • “create a module named payment”
  • “scaffold an acme/blog package”
  • “add a new module for X”
  • “/create-module”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Confirm the name, then pick a location
  2. Write composer.json
  3. Create the directory layout
  4. Decide whether you need module.php
  5. Add a slim README
  6. Verify the module is discovered

What it can do on your machine

Read from SKILL.md and the folder at commit 0a400a7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • composer

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • marko.build
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Create Module loads about 2.2k tokens when it runs. Until then it costs about 130 tokens; SKILL.md has 1,041 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~130
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from marko-php/marko at commit 0a400a7, republished under its MIT licence (© marko-php). 1,041 words, ~2,217 tokens.

Download SKILL.mdSave it as .claude/skills/create-module/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
create-module
description
Scaffold a new Marko module — a self-contained Composer package with composer.json, namespaced src/, and Pest tests. **Use this skill whenever the user asks to create, add, or scaffold a new Marko module or package.** Concrete triggers: 'create a module named payment', 'scaffold an acme/blog package', 'add a new module for X', 'break this code out into its own package', 'I need a new module', 'make me a Marko module'. Marko makes no distinction between core and third-party modules: layout is identical.

Create a Marko module

A Marko module is a Composer package that the framework auto-discovers via the extra.marko.module flag. Modules can live anywhere — app/{name}/ for application code, modules/{vendor}/{name}/ for a distributable package dropped into a host project, packages/{name}/ in the framework monorepo, or vendor/{vendor}/{name}/ once installed from Packagist. The layout is identical in every case. Directory and Composer-name segments are always lowercase; only the PHP namespace is StudlyCase.

This skill is the canonical specification for a Marko module. Do not inspect existing modules in this project to infer layout — siblings may have drifted from spec. Copy the templates from assets/ verbatim, substitute placeholders, and stop.

Step 1 — Confirm the name, then pick a location

If the user did not give the module a name, ask for one before scaffolding anything. Do not invent a name, reuse a vendor as the name, or proceed with a placeholder.

Casing rule — read this before creating any directory

A module's identity has two forms that must stay in sync:

  • Directory and Composer name → always lowercase. They are identical segment-for-segment, so a module can move between tiers (e.g. modules/ → vendor/) or be symlinked with zero path rewrites.
  • PHP namespace → always StudlyCase. blog → Blog, my-payment → MyPayment.

So the name blog yields directory blog/, Composer name …/blog, and namespace …\Blog. Lowercase module directories are correct — do not capitalize them. The casing only flips to StudlyCase in the PHP namespace and the psr-4 autoload key. (If you have seen "lowercase module names" before and assumed it was a bug, it was not: the directory is supposed to be lowercase; only the namespace is StudlyCase.)

Pick the tier by where the module lives
TierDirectoryComposer nameNamespaceWhen
App-localapp/{name}/app/{name}App\{Name}Application code, not distributed. The vendor segment is always the literal app — there is no project-derived vendor.
Distributablemodules/{vendor}/{name}/{vendor}/{name}{Vendor}\{Name}A package you intend to publish or share, dropped into a host project. Two-segment, vendor-scoped.
Framework monorepopackages/{name}/marko/{name}Marko\{Name}Only when working inside the Marko monorepo itself (root contains packages/core/).

Never author into vendor/ — it is ephemeral and populated by Composer. The modules/ tier is the manual-install mirror of vendor/: same two-segment {vendor}/{name} shape, so a module can later move to vendor/ (or be symlinked) without changes.

Default tier: if the user does not specify, assume an app-local module (app/{name}/, namespace App\{Name}). Only use modules/{vendor}/{name}/ when the user signals the module is meant to be distributed/shared.

Choosing {vendor} (distributable modules only — app-local modules have no vendor): derive it from the host project's root directory name (a project in ~/Sites/acme → vendor acme). Do not read it from the project's composer.json name: a project scaffolded from marko/skeleton still carries marko/skeleton there, so the directory name is the reliable signal. Never use marko as the vendor for an application or third-party module — that vendor is reserved for packages inside the framework monorepo.

Step 2 — Write composer.json

Copy the appropriate template to <module-root>/composer.json and substitute all placeholders.

Required keys: name, type: marko-module, require.marko/core, psr-4 autoload, and extra.marko.module: true to flag it for the code indexer. Never set a version field — let Composer infer it from the branch.

Deterministic constraint selection rule

Resolve {{marko_constraint}} and choose the template using this ordered decision tree:

  1. Inside the Marko monorepo (root directory contains packages/core/) → use assets/composer.json.monorepo.tmpl. Set {{marko_constraint}} to self.version. This ensures all packages in the monorepo resolve against each other at the same version without manual pinning.

  2. Otherwise (host project / standalone module) → use assets/composer.json.tmpl. Determine {{marko_constraint}} by reading the host project's root composer.json:

    • Find the first marko/* constraint that is already declared (e.g. "marko/framework": "*" → constraint is *; "marko/framework": "dev-develop" → constraint is dev-develop; "marko/framework": "^1.2" → constraint is ^1.2).
    • If no marko/* constraint is present in the host composer.json, default to *.

    Using * (or matching the host's existing constraint) ensures the scaffolded module resolves against whatever version of Marko the host project is consuming — whether that is a tagged release, a dev-develop branch alias, or a Composer path symlink. Never default to ^1.0: that constraint is incompatible with any host consuming dev-develop or *, which is the most common case during active development (e.g. marko/skeleton requires marko/framework: *).

Show full SKILL.md (358 more words)Show less

Step 3 — Create the directory layout

{module-root}/
  composer.json
  src/                      # PSR-4 source
  tests/
    Pest.php                # Pest bootstrap
    Unit/
    Feature/
  README.md                 # Slim pointer per docs/DOCS-STANDARDS.md

Copy assets/Pest.php.tmpl to tests/Pest.php. No placeholder substitution needed.

Step 4 — Decide whether you need module.php

module.php is optional. Only create it if the module needs explicit DI bindings (interface → concrete class wiring), singleton declarations, or boot callbacks for lifecycle hooks.

If the module is just classes that auto-resolve, omit module.php entirely. Do not create an empty manifest.

When you do need it, copy assets/module.php.tmpl to <module-root>/module.php and substitute {{Vendor}} and {{Name}} placeholders.

Step 5 — Add a slim README

Copy assets/README.md.tmpl to <module-root>/README.md and substitute {{vendor}} and {{name}} placeholders.

Per docs/DOCS-STANDARDS.md, package READMEs are slim pointers — title, install command, one quick example, and a link to the full docs page. Substantive documentation belongs in docs/src/content/docs/packages/{name}.md, not the README.

Step 6 — Verify the module is discovered

The module exists because you wrote it. The runtime discovers and autoloads it live on the next request — no composer dump-autoload, no index rebuild, no extra registration step. The MCP/LSP index self-refreshes (scoped to app/ and modules/), so list_modules and validate_module will reflect freshly created code automatically.

If you want to double-check structure, confirm:

  • composer.json has extra.marko.module: true
  • The module's psr-4 namespace resolves correctly

You may call list_modules or validate_module as an optional cross-check, but these are not gates — the module is live as soon as the files are in place.

Verification

After writing files, expect LSP diagnostics from marko-lsp to surface in the same turn. Resolve all diagnostics before declaring the module complete — diagnostics are the verification gate, not optional warnings. Calling list_modules is an optional cross-check to confirm the MCP index reflects the new module; it is not required for the module to be active.

Conventions to enforce

  • Every PHP file: declare(strict_types=1);
  • Constructor property promotion always
  • Type declarations on every parameter, return, and property
  • No final classes (blocks Preferences extensibility)
  • No magic methods — be explicit
  • Use readonly where immutability is appropriate, not as a blanket rule

What this skill does not cover

  • Authoring plugins for the new module — see the marko-create-plugin skill
  • Adding routes, observers, commands — see the relevant Marko docs pages
  • Database migrations — see the marko/database package docs

See also

© marko-php, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (assets) in packages/claude-plugins/plugins/marko-skills/skills/create-module of marko-php/marko.

  • SKILL.md
  • assets/Pest.php.tmpl
  • assets/README.md.tmpl
  • assets/composer.json.monorepo.tmpl
  • assets/composer.json.tmpl
  • assets/module.php.tmpl

Open the folder on GitHubat commit 0a400a7

Compare with similar skills

Create Module next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Create Module compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Create Module this skillmarko-php/marko397—~2.2kAutomated safety check: PassMIT
WooCommerce Code Reviewwoocommerce/woocommerce11k3 repos~1.1kAutomated safety check: PassCustom licence
Skill Doli Code ReviewDolibarr/dolibarr7.7k1 repos~1.1kAutomated safety check: PassMIT
Bug Triagesymfony/symfony31k—~1.9kAutomated safety check: PassMIT
Merge Upsymfony/symfony31k—~4kAutomated safety check: PassMIT
PR Mergesymfony/symfony31k—~3.1kAutomated safety check: PassMIT

Similar skills

  • WooCommerce Code Review

    woocommerce/woocommerce

    Reviews WooCommerce code changes against the project's standards, flagging backend PHP architecture, naming, documentation, data integrity and testing violations.

    11k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Skill Doli Code Review

    Dolibarr/dolibarr

    Reviews Dolibarr PHP code for compliance with coding standards and security best practices, and fixes identified issues.

    7.7k GitHub starsUsed in 1 repo~1.1k tokens
    DevelopmentAuto-check passed
  • Bug Triage

    symfony/symfony

    Decide whether open Bug PRs target the correct branch. An agent skill from symfony/symfony.

    31k GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Merge Up

    symfony/symfony

    Cascade-merge maintained Symfony branches from oldest to newest (e.g.

    31k GitHub stars~4k tokensUpdated today
    DevelopmentAuto-check passed
  • PR Merge

    symfony/symfony

    Merge a reviewed pull request the way the Symfony core team does: one --no-ff merge commit per PR, whose message archives the whole discussion, with the review gates checked first.

    31k GitHub stars~3.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Wp Interactivity API

    Automattic/agent-skills

    A skill your agent uses when building or debugging WordPress Interactivity API features (data-wp- directives, @wordpress/interactivity store/state/actions, block viewScriptModule integration…

    211 GitHub starsUsed in 2 repos~1.5k tokens
    DevelopmentAuto-check passed

More from marko-php/marko

  • Create Plugin

    marko-php/marko

    Create a Marko plugin — a class that intercepts methods on another class to modify behavior without subclassing.

    397 GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed
  • Release

    marko-php/marko

    Cut a new Marko release. An agent skill from marko-php/marko.

    397 GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Create Module

What does Create Module do?

Scaffold a new Marko module — a self-contained Composer package with composer.json, namespaced src/, and Pest tests. Create Module is an agent skill from marko-php/marko.json, namespaced src/, and Pest tests.

When should I use Create Module?

Create Module fits situations like: the user asks to create; scaffold a new Marko module.

How do I install Create Module in Claude Code?

Run `npx skills add marko-php/marko --skill create-module -a claude-code`. Or copy the skill folder (packages/claude-plugins/plugins/marko-skills/skills/create-module in marko-php/marko) into .claude/skills/create-module in your project. Claude Code loads it when a task matches its description.

How do I install Create Module in Codex?

Run `npx skills add marko-php/marko --skill create-module -a codex`. Or copy the skill folder (packages/claude-plugins/plugins/marko-skills/skills/create-module in marko-php/marko) into .agents/skills/create-module in your project. Codex loads it when a task matches its description.

Can I use Create Module in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add marko-php/marko --skill create-module -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/create-module, .gemini/skills/create-module, .github/skills/create-module and .opencode/skills/create-module in your project.

What does Create Module need to run?

Going by SKILL.md and its folder, Create Module needs the command-line tools its instructions call (composer).

Does Create Module access the network?

SKILL.md names 2 domains. As links in the text: marko.build and github.com. This is read from the text; nothing was executed.

Is Create Module safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Create Module use?

Create Module is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Create Module use?

About 2.2k tokens (SKILL.md is roughly 8.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Create Module?

Skills that share tags, products or a category with Create Module: WooCommerce Code Review (woocommerce/woocommerce, 11k stars), Skill Doli Code Review (Dolibarr/dolibarr, 7.7k stars), Bug Triage (symfony/symfony, 31k stars) and Merge Up (symfony/symfony, 31k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Create Module?

marko-php (a GitHub organization) maintains it in marko-php/marko, which has 397 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 6, 2026.

Source: marko-php/marko on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.