Skip to content

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 ​

You ask the AI tool; it reads the Exment source and the manual and writes the plugin code. After the checks and a test on a local Exment, you upload it. When it does not work, the AI fixes itYouask, reviewMaterial to readExment source, manualAI codingtoolPlugincodeChecksphp -l, PHPStanTry it locallyExment on DockerUploadproduction lastwhen it does not work, show the error and let it fix the code

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.

bash
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 HelloExment

Good material for the AI:

WhatWhere
The plugin typesexment/src/Enums/PluginType.php
The class to extend for each typeexment/src/Services/Plugin/Plugin*Base.php
The checks of config.jsonexment/src/Services/Plugin/PluginInstaller.php, exment/src/Validator/PluginNamespaceRule.php
How to develop Exment itselfexment/docs/development.md
This manualYour first plugin, Plugin creation method, Plugin reference. The Markdown source is in docs/ of exceedone/exment-manual
Examplesplugin-sample/, and the official plugins in exceedone/exment-plugins

2. A prompt template ​

Copy it and replace the parts in ( ).

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

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

  1. Checks before running: php -l and PHPStan (Recommended development environment).
  2. 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.
  3. What to look at
    • The required fields of config.json, and the namespace.
    • Permissions: does it use getValueQuery() and hasPermission()? 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).
  4. 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 plugins7 (ExmentPM, ExmentPMBacklog, ExmentSupportDesk, ExmentGroupware, ExmentCRM, ExmentAttachmentExport, ExmentKintone)
PRs merged in the last 30 days263
Releases in the last 30 days59 (34 of them ExmentPM; tags look like ExmentPM-v1.11.0)
Test scripts that CI runs78

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 -l on every PHP file with PHP 8.2 and 8.3, and the config.json of each plugin
    • php-cs-fixer: the same coding style as Exment itself
    • phpstan: static analysis with Exment 7 installed
    • exmentpm-script: node --check on the JavaScript of the screens, and the tests of each plugin (PHP and Node.js), including a check that every Japanese text also has English
    • No 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.

1 ask, 2 the AI reads and proposes a plan, 3 you decide, 4 the AI writes code and tests, 5 CI checks, 6 try it in a browser, 7 merge, 8 release, 9 upload and install. If 5 or 6 finds a problem, go back to 4. The spec, the code and the test results are each reviewed by several people. People do 1, 3, 8 and 9① Askwhat you want② PlanAI reads, proposes③ Decideyou choose④ BuildAI: code + tests⑤ CItests, checks⑥ Try itperson or test AI⑦ Mergewhen CI passes⑧ Releasenew version, zip⑨ Installupload the zipfails: fix ita personAI, CIa reviewspec reviewby several peoplecode reviewby several peopletest result reviewby several peopleif ⑤ or ⑥ finds a problem, go back to ④ and let the AI fix ittake a backup before you install on production
  1. 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.
  2. 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.
  3. 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.
  4. Build: the AI makes a branch, writes the code and the tests, and opens a PR.
  5. CI: the tests and static checks run by themselves on the PR. When something fails, the AI reads the log and fixes it.
  6. 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).
  7. Merge (code review): several people review the diff of the PR; merge when CI passes and the screens are checked.
  8. Release: raise the version and push a tag. CI builds the zip (and signs the official plugins). A person decides when to release.
  9. 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.
ReviewWhenWhat to look at
Spec reviewwhen the plan of ② is readyIs it the right thing? Screens, data, permissions, starting turned off
Code reviewwhen the PR is openIs the diff small? Permissions, escaping, how secrets are kept, no unrelated changes
Test result reviewafter ⑤ CI and ⑥ the screensThe 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.

You ask the coordinator AI and get its reports. The coordinator asks the coder AI and the tester AI. The coder opens PRs and GitHub CI is the judge. The tester tries the branch on a test Exment. Release and production only after your OK. Only people hold keys and passwordsKeys, passwordsonly people hold themYoudesign, release, productionRelease, productiononly after your OKCoordinator AIplans, assigns, reportsCoder AIcode and tests in a branchGitHubPR and CI (the judge)Tester AIa test Exment in a browserask, reportOKPRbranch
  • 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 .env either.
  • 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.md or AGENTS.md in 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 as user@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):

markdown
# 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 ( )):

text
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:

text
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
WhatWrite plugin codeSearch and summarize Exment data
The AI readsThe Exment source, the manual, your codeExment data (only within the user's permissions)
ConnectionNone (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.

An MCP-capable AI connects to the MCP server of Exment with an API key and reads data within that user's permissions. The tools used are written to the operation logMCP-capable AIthe AI clientMCP server/api/mcp, read onlyExment dataonly what the key's user may seeOperation logthe tools usedAPI key
  • 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 ​