# Create module

> Create module is an open-source agent skill for developer tools. Scaffolds a new Marko module as a Composer package with src, Pest tests and config. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/marko-php/marko/tree/develop/packages/claude-plugins/plugins/marko-skills/skills/create-module
- **Repository:** https://github.com/marko-php/marko
- **GitHub stars:** 416
- **License:** MIT
- **Skill name:** create-module
- **Collection:** https://github.com/marko-php/marko
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill walks the agent through creating a new Marko module, which is a self-contained Composer package that the framework discovers through an extra.marko.module flag. It covers choosing where the module lives (app-local, distributable under modules/, or inside the framework monorepo), naming rules that keep directories and Composer names lowercase while the PHP namespace uses StudlyCase, and picking the right marko/core version constraint based on the host project's existing composer.json.

The workflow copies templates from the skill's assets folder for composer.json, the Pest bootstrap, a README pointer and an optional module.php that is only added when explicit bindings or boot callbacks are needed. It also sets out coding conventions to follow, such as strict types, constructor property promotion and avoiding final classes, plus guidance for driver modules that must throw an unsupported-feature exception for unsupported methods.

The skill assumes a Marko project and works with PHP and Composer. It states it does not cover writing plugins, routes or migrations, which are handled by other skills or the framework docs.

## When your agent uses it

> 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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/marko-php/marko/tree/HEAD/packages/claude-plugins/plugins/marko-skills/skills/create-module)
- [License: MIT](https://github.com/marko-php/marko/tree/HEAD/packages/claude-plugins/plugins/marko-skills/skills/create-module)

## Features

- **Module layout scaffolding:** Creates the composer.json, src directory, Pest test folders and a slim README for a new module.
- **Tier and naming selection:** Chooses app-local, distributable or monorepo placement and applies the lowercase directory and StudlyCase namespace rules.
- **Version constraint resolution:** Matches the marko/core constraint to what the host project already declares.
- **Optional module.php setup:** Adds DI bindings, argument overrides and boot callbacks only when the module needs them.
- **Driver exception guidance:** Specifies how driver modules should report features they cannot support.
- **Coding conventions:** Enforces strict types, constructor promotion, explicit typing and no magic methods.

## Good for

- Create a new Marko module named payment in my app
- Scaffold a distributable acme/blog package for my host project
- Break this code out into its own Marko package
- Add a new module for handling user notifications

## Install

### Claude Code

This skill ships in the `marko-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add marko-php/marko
/plugin install marko-skills@marko
```

Or copy only this skill to `~/.claude/skills/create-module`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/marko-php/marko.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/create-module &&
cp -R "$tmp/packages/claude-plugins/plugins/marko-skills/skills/create-module" ~/.claude/skills/create-module &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/create-module` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/create-module` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/marko-php/marko.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/create-module &&
cp -R "$tmp/packages/claude-plugins/plugins/marko-skills/skills/create-module" ~/.agents/skills/create-module &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/create-module` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/create-module` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/marko-php/marko.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/create-module &&
cp -R "$tmp/packages/claude-plugins/plugins/marko-skills/skills/create-module" ~/.cursor/skills/create-module &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/create-module` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/marko-php/marko.git --path packages/claude-plugins/plugins/marko-skills/skills/create-module
```

Or copy the folder to `~/.gemini/skills/create-module` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/create-module`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/marko-php/marko.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/create-module &&
cp -R "$tmp/packages/claude-plugins/plugins/marko-skills/skills/create-module" ~/.copilot/skills/create-module &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/create-module` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/marko-php/marko.git
```

Then copy `marko/packages/claude-plugins/plugins/marko-skills/skills/create-module` into your agent's skills folder as `create-module`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need before Create module runs?

It needs a module name from the user; the skill asks for one rather than inventing it. It targets PHP projects that use Composer and Marko.

### Does Create module create a module.php file every time?

No. module.php is optional and is only created when the module needs DI bindings, constructor arguments, singletons or boot callbacks.

### Which marko/core version constraint does Create module use?

It reads the first marko/* constraint in the host project's composer.json and reuses it, defaulting to * when none is declared.

### Does Create module cover plugins, routes or migrations?

No. The skill points to other skills and Marko docs for plugins, routes, observers, commands and database migrations.

### How do I install Create module in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/create-module to use it in all your projects, or to .claude/skills/create-module in one project. Or install the marko-skills plugin, which includes it: /plugin marketplace add marko-php/marko, then /plugin install marko-skills@marko.

### Does Create module run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Create module?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Create module?

The closest alternatives to Create module are Create plugin, Php MCP server generator, Release, Project scaffold and Skill creator.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Create plugin](https://ai-powered.com/skills/create-plugin): Create plugin is an open-source agent skill for developer tools.
- [Php MCP server generator](https://ai-powered.com/skills/php-mcp-server-generator): Php MCP server generator is an open-source agent skill for ai models and llm tooling.
- [Release](https://ai-powered.com/skills/release-marko-php): Release is an open-source agent skill for developer tools.
- [Project scaffold](https://ai-powered.com/skills/project-scaffold): Project scaffold is an open-source agent skill for developer tools.
- [Skill creator](https://ai-powered.com/skills/skill-creator-base44): Skill creator is an open-source agent skill for developer tools.
- [Plugin creator](https://ai-powered.com/skills/plugin-creator): Plugin creator is a free agent skill for developer tools.
- [Go project layout](https://ai-powered.com/skills/go-project-layout): Go project layout is an open-source agent skill for developer tools.
- [Holoscan module lifecycle](https://ai-powered.com/skills/holoscan-module-lifecycle): Holoscan module lifecycle is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/create-module
