Develop with AI coding tools
How to build Exment plugins with AI coding tools such as Claude Code, GitHub Copilot and Cursor.
The idea is the same with any tool: give it the right material, never give it secrets, and check what it made yourself.
To see how the official Exment plugins are really built, read How it is really done (the nine steps, people focusing on review, AI sessions with roles, tips and prompts).
The flow
1. Give the AI the right material
AI tools do not know Exment well. They may write old patterns or call functions that do not exist.
Keep the Exment source of the same version as your site next to your plugin, and let the tool read it.
mkdir exment-dev && cd exment-dev
# Exment to read (the tag of the version of your site, e.g. v7.2.9)
git clone --depth 1 -b v7.2.9 https://github.com/exceedone/exment.git exment
# sample plugins
git clone --depth 1 https://github.com/exment-git/plugin-sample.git plugin-sample
# your plugin (your own repository)
mkdir HelloExmentGood material for the AI:
| What | Where |
|---|---|
| The plugin types | exment/src/Enums/PluginType.php |
| The class to extend for each type | exment/src/Services/Plugin/Plugin*Base.php |
| The checks of config.json | exment/src/Services/Plugin/PluginInstaller.php, exment/src/Validator/PluginNamespaceRule.php |
| How to develop Exment itself | exment/docs/development.md |
| This manual | Your first plugin, Plugin creation method, Plugin reference. The Markdown source is in docs/ of exceedone/exment-manual |
| Examples | plugin-sample/, and the official plugins in exceedone/exment-plugins |
2. A prompt template
Copy it and replace the parts in ( ).
Make an Exment plugin.
- Type: (page / dashboard / view / button / event / validator / batch / api / import / export / document / script / style / crud)
- What it does: (e.g. a page that lists this month's records of the "information" table)
- Tables and columns: (e.g. information: title, priority)
- Exment version: (e.g. 7.2.9). The source to read is in ../exment.
Rules:
- Use the same structure as "Your first plugin" in the Exment manual (https://exment.net/docs/plugin_first.html): config.json, Plugin.php, resources/views.
- config.json has plugin_name, plugin_view_name, uuid and plugin_type. Make a new uuid.
- The namespace is App\Plugins\(plugin_name in Pascal case).
- Use only the base classes and functions that exist in ../exment/src/Services/Plugin/. If something does not exist, do not invent it; say so.
- Read data with CustomTable::getEloquent(...)->getValueQuery() and check permissions with hasPermission(). No raw SQL.
- Put @csrf in forms and output values escaped with Blade.
- No API keys in the code; read them from the settings of setCustomOptionForm.
- At the end, list the files you made and how to test them.3. An instructions file for your plugin repository
Many AI tools read an instructions file in the repository every time. The file name depends on the tool (for example CLAUDE.md for Claude Code, .github/copilot-instructions.md for GitHub Copilot, and AGENTS.md for several tools). Put the same content in the one your tool reads.
# This repository
The Exment plugin "HelloExment" (type: page).
## Rules
- Structure: config.json, Plugin.php, resources/views/*.blade.php. It is zipped and uploaded.
- Namespace: App\Plugins\HelloExment. PHP in a subfolder: App\Plugins\HelloExment\(folder name).
- Exment version: 7.2.9. Check classes and functions in ../exment/src (same version) before using them.
- Read data with getValueQuery() and check permissions with hasPermission(). No raw SQL.
- Forms have @csrf; output is escaped with Blade. Do not use {!! !!}.
- No secrets (API keys, passwords) in the code or in Git. Let administrators set them with setCustomOptionForm.
- Raise the version in config.json when releasing.
## How to check
- Run php -l on every PHP file.
- Upload it to the local Exment (docker-exment) and try it on the screen.4. Check what the AI made
Review AI code the same way you review code written by a person.
- Checks before running:
php -land PHPStan (Recommended development environment). - Try it locally: upload it to the local Exment (Docker) and try it as a normal user too. Make sure the user cannot see data they should not see.
- What to look at
- The required fields of config.json, and the namespace.
- Permissions: does it use
getValueQuery()andhasPermission()? Does it read the database directly? - CSRF: do the forms have
@csrf? - Escaping: is there unescaped Blade output (
{!! !!})? - Secrets: are keys or passwords written in the code?
- Functions that do not exist (check the source even when there is no error).
- Production last: upload to production only after it works locally.
5. What not to give the AI
- API keys, passwords, the contents of
.env, the contents of a production database. - Real data such as names and mail addresses of customers or staff. Use made-up data for tests.
- In the settings of your AI tool, decide which files it may send and which commands it may run.
How it is really done: the official Exment plugins are built with Claude too {#real-case}
The official Exment plugins are built by the president of Exceed One with Claude Code. The code is in the public repository exceedone/exment-plugins, so anyone can see the code and how the work goes.
In numbers (counted on GitHub on 2026-11-29):
| Count | |
|---|---|
| Official plugins | 7 (ExmentPM, ExmentPMBacklog, ExmentSupportDesk, ExmentGroupware, ExmentCRM, ExmentAttachmentExport, ExmentKintone) |
| PRs merged in the last 30 days | 263 |
| Releases in the last 30 days | 59 (34 of them ExmentPM; tags look like ExmentPM-v1.11.0) |
| Test scripts that CI runs | 78 |
The AI writes the code, but the rules are the same as for code written by a person.
- Every change goes through a PR. Nothing is pushed straight to main.
- CI runs on every PR (.github/workflows):
check:php -lon every PHP file with PHP 8.2 and 8.3, and the config.json of each pluginphp-cs-fixer: the same coding style as Exment itselfphpstan: static analysis with Exment 7 installedexmentpm-script:node --checkon the JavaScript of the screens, and the tests of each plugin (PHP and Node.js), including a check that every Japanese text also has EnglishNo internal references: no internal ticket numbers or personal names in the public repository
- Releases are signed. When a version tag is pushed, CI builds the zip and puts it on GitHub Releases. For the official plugins bundled with Exment, the release record (with the sha256 of the zip) is signed with Ed25519. Exment shows and installs only releases signed with a key it trusts. People manage the signing key; the AI never sees it.
The nine steps {#ai-workflow}
This is the flow used for the official plugins. You can do the same with any plugin.
- Ask: write what you want in plain words (for example a GitHub issue). Say who needs it, on which screen, and what the problem is; you get better plans.
- Plan: the AI reads the Exment source, the manual and the plugin repository, and proposes how to build it. Where there is a choice, ask it to list the options.
- Decide (spec review): several people review the AI's plan. The screens, how data is stored, whether the feature starts turned off: people decide the design.
- Build: the AI makes a branch, writes the code and the tests, and opens a PR.
- CI: the tests and static checks run by themselves on the PR. When something fails, the AI reads the log and fixes it.
- Try it: install it on a test Exment and try it in a browser. A person tries it, or a separate AI session that only tests. Try it as a normal user too. Several people review the test results (the CI log and the screens).
- Merge (code review): several people review the diff of the PR; merge when CI passes and the screens are checked.
- Release: raise the version and push a tag. CI builds the zip (and signs the official plugins). A person decides when to release.
- Install: take a backup, then upload the zip on the plugin screen.
People put their effort into review {#focus-on-review}
The AI writes; people check. The spec, the code and the test results are each reviewed by several people. People put their effort into these reviews to raise the quality.
- Writing has become fast. The AI writes code and tests in a short time. What takes time is checking that they are right, and that is also what decides the quality.
- Different reviewers find different problems. The eyes of a user, of a developer and of security notice different things. What one person misses, several people find.
- The AI's report is material for the review, not a pass mark.
| Review | When | What to look at |
|---|---|---|
| Spec review | when the plan of ② is ready | Is it the right thing? Screens, data, permissions, starting turned off |
| Code review | when the PR is open | Is the diff small? Permissions, escaping, how secrets are kept, no unrelated changes |
| Test result review | after ⑤ CI and ⑥ the screens | The CI log and the results on the screens. No failed tests, nothing left untried |
Several AI sessions with roles {#ai-roles}
For larger work, open a few AI sessions and give each a role. A person gives the OK at the important points.
- Coordinator: splits the work, asks the other sessions, and reports the results to you.
- Coder: writes the code and the tests in a branch and opens the PR.
- Tester: only tries the screens in a browser, on a test Exment. A second pair of eyes that did not write the code misses less.
- Run only a few sessions at the same time, as your computer's memory allows. When they share one local environment, apply only the diffs; do not copy whole files over the others' work.
What people still do {#human-role}
However much you give to the AI, people do these:
- Decide what to build and how (the design).
- Review the spec, the code and the test results, with several people.
- Approve releases and changes to production. Production servers and settings change only after a person checks.
- Never give the AI passwords, API keys or signing keys. Do not show it
.enveither. - Review the parts that matter for security yourself: permissions, login, file uploads, connections to the outside, how secrets are kept.
- Keep backups. Back up the data and the files before you install.
Tips from real use {#ai-tips}
- One topic per PR. Small PRs are easy to review, and CI finishes sooner.
- Ask for small diffs. Write "do not change unrelated code" and "do not rewrite whole files".
- Write the rules in a
CLAUDE.mdorAGENTS.mdin the repository. The AI reads it every time. - Let CI be the judge. Look at whether CI passed, not at "it works".
- The AI's report is a claim: check it. Look at the test log, the screen and the diff yourself. A test run that stopped halfway can look like a pass.
- Do not send real mail. Use
MAIL_MAILER=log(it only writes to the log) for tests, and addresses that cannot receive mail, such asuser@example.invalid. - Write neutrally in public repositories. No internal ticket numbers, and no names of staff or customers, in code, comments or PRs.
An example CLAUDE.md (a short version of the rules of the official plugins' repository):
# This repository
Exment plugins, one folder per plugin.
## Checks (all of them pass before a PR)
- php -l: find . -name '*.php' -print0 | xargs -0 -n1 php -l
- Style: php php-cs-fixer.phar fix --dry-run --diff
- PHPStan: cd .github/ci && vendor/bin/phpstan analyse -c phpstan.neon
- After changing JS: node --check on every file (one wrong character makes the screen blank)
- Tests: php <folder>/tools/test-*.php, node <folder>/tools/test-*.js
## Rules
- One topic per PR. Keep the diff small.
- Do not change "version" in config.json in a PR (it is raised at release). Never change uuid.
- Add every new text to both ja and en.
- No secrets (passwords, API keys, .env) in the code or in Git. Read them from the settings screen.
- Public repository: no internal ticket numbers, no names of staff or customers. Write neutrally.
- No "Generated with ..." lines or automatic co-author lines in commits or PRs.
- Mail in tests: MAIL_MAILER=log. Addresses: *.invalid.
- A new feature starts turned off.Prompts to copy {#ai-prompts}
To start a new plugin (an example for Claude Code; replace the parts in ( )):
I want to make a new Exment plugin. Do not write code yet.
What it does: (e.g. a dashboard that shows this week's open inquiries per person in charge)
Who uses it: (e.g. team leaders)
Exment version: (e.g. 7.2.9). The source is in ../exment and the samples are in ../plugin-sample.
1. Read ../exment/src/Services/Plugin/ and the manual pages "Your first plugin" and "Plugin reference".
2. Propose the plugin type, the list of files, the tables and columns it uses, and how it checks permissions. Where there is a choice, give two options with their good and bad points.
3. When I have decided, write the code and the tests in the branch feature/(name), run every check in CLAUDE.md, then open a PR.
4. At the end, list the files you changed, the tests you ran with their results, and how to try it on the screen. If something did not pass, say so.To fix a bug and add a test:
Fix a bug.
What happens: (e.g. choosing "Done" in the list does not change the count)
Steps: (1. ... 2. ... 3. ...)
Expected: (e.g. the count without the done items)
Versions: (plugin 1.2.0, Exment 7.2.9)
1. First find the cause, and explain which file and which part causes it.
2. Before fixing, write a test that fails because of this bug, and show that it fails.
3. Fix it with the smallest diff and show that the test passes. Do not change unrelated code.
4. Run every check in CLAUDE.md, then open a PR with only this topic. Do not change "version" in config.json.Development is not data work
There are two ways to use Exment from an AI. Choose by what you want to do.
| Development (this page) | Data work | |
|---|---|---|
| What | Write plugin code | Search and summarize Exment data |
| The AI reads | The Exment source, the manual, your code | Exment data (only within the user's permissions) |
| Connection | None (local files only) | MCP server, API |
The MCP server
Exment has an MCP server that AI tools can connect to (v7.2.1 or later). In the current version it can only read.
- Connect with an API key. Limit the key to the scopes (e.g.
value_read) and tables you need. - While you develop, connecting to a local Exment instead of production is safer.
- Details: MCP server (use from AI).
Next
- How to build each type: Plugin creation method
- Plugin reference
