Agent skill

Skill Doli Test Phpunit

by Dolibarr in Dolibarr/dolibarr

Creates or modify PHP unit tests for Dolibarr ERP/CRM functions and methods.

MITAuto-check passedTesting & QA

Install Skill Doli Test Phpunit

skills CLI
$ npx skills add Dolibarr/dolibarr --skill skill-doli-test-phpunit -a claude-code

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

GitHub CLI
$ gh skill install Dolibarr/dolibarr skill-doli-test-phpunit --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/Dolibarr/dolibarr.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/skill-doli-test-phpunit .claude/skills/skill-doli-test-phpunit && 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
skill-doli-test-phpunit
GitHub stars
7.7k
Used in
1 other repo
Token cost
~1.3k tokens
SKILL.md length
571 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Creates or modify PHP unit tests for Dolibarr ERP/CRM functions and methods.

  • Works in 2 steps: locate or create… → add test method following Dolibarr…
  • The user asks to add
  • SKILL.md covers When to Use This Skill, Relationship with AGENTS.md, Inputs and General Rules, plus 8 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Skill Doli Test Phpunit is an agent skill from Dolibarr/dolibarr. Creates or modify PHP unit tests for Dolibarr ERP/CRM functions and methods. Use when the user asks to add, write, create, or complete a PHPUnit test for Dolibarr, or mentions testing a specific function, method, or class in the Dolibarr codebase.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Unit testing and Forms and invoices. It works with PHP. The repository describes itself as: Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an… The licence is MIT.

When your agent uses it

  • The user asks to add
  • Complete a PHPUnit test for Dolibarr
  • Mentions testing a specific function
  • Class in the Dolibarr codebase

Example prompts

  • “Use the skill-doli-test-phpunit skill to create or modify PHP unit tests for Dolibarr ERP/CRM functions and methods”
  • “/skill-doli-test-phpunit”

Requirements

  • Pre-approved tools (allowed-tools): read_file, write_file, grep

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. locate or create test/phpunit/MyObjectTest.php
  2. add test method following Dolibarr conventions

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • read_file
    • write_file
    • grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are php).

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

  • Network

    No URLs in SKILL.md.

    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

Skill Doli Test Phpunit loads about 1.3k tokens when it runs. Until then it costs about 68 tokens; SKILL.md has 571 words of instructions outside code blocks.

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

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 Dolibarr/dolibarr at commit e0f8c86, republished under its MIT licence (© Dolibarr). 571 words, ~1,253 tokens.

Download SKILL.mdSave it as .claude/skills/skill-doli-test-phpunit/SKILL.md (or your agent's skills folder).
name
skill-doli-test-phpunit
description
Creates or modify PHP unit tests for Dolibarr ERP/CRM functions and methods. Use when the user asks to add, write, create, or complete a PHPUnit test for Dolibarr, or mentions testing a specific function, method, or class in the Dolibarr codebase.
allowed-tools
read_file, write_file, grep
license
MIT
user-invocable
true

Skill: Add or modify a PHP Unit Test for Dolibarr

When to Use This Skill

Use this skill whenever the user asks to create, modify, or complete a PHP unit test for the Dolibarr ERP/CRM project. The goal is to produce a unit test that follows Dolibarr conventions and integrates cleanly into the existing PHPUnit test suite.

Relationship with AGENTS.md

The instructions in this file are complementary to the instructions defined in .agents/AGENTS.md.

  • AGENTS.md contains the general instructions and rules for the project.
  • SKILLS.md contains additional instructions specific to skills.
  • Unless explicitly stated otherwise, the instructions from both files apply.
  • SKILLS.md does not replace or override AGENTS.md.
  • If an instruction in SKILLS.md conflicts with AGENTS.md, follow the rules defined by AGENTS.md.

Inputs

The user request should contain, when available:

  • a name of the function to test
  • or the class method name to test

General Rules

  • follow the coding style already used in files in the test/phpunit/ directory
  • modify the minimum amount of existing code
  • prefer adding new test methods instead of modifying existing ones
  • tests must be deterministic and independent
  • avoid dependencies on external services
  • clean up every object created during the test
  • when launching phpunit, set the cache directory to /tmp with --cache-directory "/tmp"

Critical Rules (DO NOT VIOLATE)

  • Do not use @dataProvider or #[DataProvider] in test methods. Use a simple PHP loop instead.
  • Do not use the assertRegExp(), assertNotRegExp, assertMatchesRegularExpression(), or assertDoesNotMatchRegularExpression() method. Use a simple PHP regex and an assert on result instead.
  • Do not remove comment like, above all lines with @depends

Test Location

Locate the most appropriate existing PHPUnit test file in test/phpunit/.

If no suitable test file exists, create one using the naming convention FeatureTest.php.

Naming

A test method should describe the expected behavior.

Examples:

php
public function testCreateObject()
public function testDeleteObject()
public function testFetchReturnsExpectedValues()
public function testInvalidInputThrowsException()

Assertions

Prefer specific assertions over generic ones.

Good examples:

php
$this->assertTrue($result);
$this->assertFalse($result);
$this->assertEquals($expected, $actual);
$this->assertCount(3, $array);
$this->assertNull($value);
$this->assertNotNull($value);

Output

When generating code:

  • provide only the relevant PHP code
  • preserve the existing file formatting
  • do not rewrite unrelated methods
  • explain briefly what is being tested

Examples

Input: "Add a unit test for the create() method of the Invoice class"

Action:

  1. locate or create test/phpunit/MyObjectTest.php
  2. add test method following Dolibarr conventions
Show full SKILL.md (218 more words)Show less
Input: "Write tests for the calculateVAT() function in price.lib.php"

Action:

  1. locate or create appropriate test file in test/phpunit/
  2. add test methods for various VAT calculation scenarios
  3. you can test or suggest to test it by running the command: phpunit test/phpunit/TheTestFile.php

Error Handling

Common Failures and Validation
IssueValidationSolution
Test file does not existCheck test/phpunit/ directoryCreate new test file with proper naming
Class or method not foundVerify namespace and file locationUse proper use statements and class paths
Database dependenciesReview test for external DB callsMock database interactions or use test fixtures
Non-deterministic behaviorCheck for random values or timestampsUse fixed seeds or mock time
Missing PHPUnitCheck project dependenciesEnsure PHPUnit is installed via Composer

Before generating code:

  • verify the target function or method exists and is accessible
  • confirm the test directory structure matches Dolibarr conventions
  • ensure no external service dependencies exist in the code under test

Gotchas

  • Dolibarr global variables: Tests may need $conf, $db, $user mocks. Use DolibarrTestCase if available
  • Entity filtering: Add entity IN ('.getDolEntity('tablename').') to SQL in tests if needed
  • Permissions: Some methods check $user->hasRight(). Mock user permissions in tests
  • File paths: Use DOL_DOCUMENT_ROOT constant for paths, not hardcoded values
  • Legacy code: Older modules may not have test files. Create new ones following current conventions

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

Files

Just SKILL.md in .agents/skills/skill-doli-test-phpunit of Dolibarr/dolibarr.

Open the folder on GitHubat commit e0f8c86

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in Dolibarr/dolibarr, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Skill Doli Test Phpunit 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.

Skill Doli Test Phpunit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Skill Doli Test Phpunit this skillDolibarr/dolibarr7.7k1 repos~1.3kAutomated safety check: PassMIT
Test GuardamElnagdy/guard-skills1.3k2 repos~2.1kAutomated safety check: PassMIT
Pest Testingluadotsh/lua3421 repos~1.2kAutomated safety check: PassMIT
Async Test And Doc Syncdiscord-php/DiscordPHP1.1k—~3.4kAutomated safety check: NotesMIT
Pest Testingliberusoftware/real-estate-laravel1121 repos~1.8kAutomated safety check: PassMIT
Pest Testingmnapoli/vibephp158—~1.4kAutomated safety check: PassMIT

Similar skills

  • Test Guard

    amElnagdy/guard-skills

    Reviews newly written or edited tests against nine rules that cut test bloat, such as mock-heavy checks and near-duplicate cases, before they are committed.

    1.3k GitHub starsUsed in 2 repos~2.1k tokens
    Testing & QAAuto-check passed
  • Pest Testing

    luadotsh/lua

    A skill your agent uses for Pest PHP testing in Laravel projects only.

    342 GitHub starsUsed in 1 repo~1.2k tokens
    Testing & QAAuto-check passed
  • Async Test And Doc Sync

    discord-php/DiscordPHP

    Maintain test and documentation alignment — PHPUnit tests, async testing patterns, PHPDoc contracts, guide pages, and documentation workflow.

    1.1k GitHub stars~3.4k tokensUpdated yesterday
    Testing & QAAuto-check: notes
  • Pest Testing

    liberusoftware/real-estate-laravel

    A skill your agent uses for Pest PHP testing in Laravel projects only.

    112 GitHub starsUsed in 1 repo~1.8k tokens
    Testing & QAAuto-check passed
  • Pest Testing

    mnapoli/vibephp

    A skill your agent uses for Pest PHP testing in Laravel projects only.

    158 GitHub stars~1.4k tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Shopware CLI

    shopware/shopware-cli

    Use Shopware CLI for Shopware project, extension, and account workflows — create and install new projects (project create, project dev install), validate projects or extensions (with…

    123 GitHub stars~4.9k tokensUpdated yesterday
    Testing & QAAuto-check passed

More from Dolibarr/dolibarr

  • 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
    Auto-check passed
  • Skill Doli Devmodule

    Dolibarr/dolibarr

    A skill your agent uses when developing a Dolibarr ERP/CRM external module, working with database queries, or asking about Dolibarr best practices.

    7.7k GitHub starsUsed in 1 repo~3.3k tokens
    Auto-check passed
  • Skill Doli Dev

    Dolibarr/dolibarr

    A skill your agent uses when developing Dolibarr ERP/CRM code, working with database queries, or asking about Dolibarr best practices.

    7.7k GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Create interactive PHP test case scripts for Dolibarr ERP/CRM that allow users to setup test data, view results via direct links, and tear down (clean up) the data.

    7.7k GitHub starsUsed in 1 repo~5.5k tokens
    Auto-check passed
  • Skill Doli Test Hurl

    Dolibarr/dolibarr

    Create and maintain Hurl tests for Dolibarr ERP/CRM. An agent skill from Dolibarr/dolibarr.

    7.7k GitHub stars~3.7k tokensUpdated today
    Auto-check passed

Works with

Questions about Skill Doli Test Phpunit

What does Skill Doli Test Phpunit do?

Creates or modify PHP unit tests for Dolibarr ERP/CRM functions and methods. Skill Doli Test Phpunit is an agent skill from Dolibarr/dolibarr. Creates or modify PHP unit tests for Dolibarr ERP/CRM functions and methods.

When should I use Skill Doli Test Phpunit?

Skill Doli Test Phpunit fits situations like: the user asks to add; complete a PHPUnit test for Dolibarr; mentions testing a specific function; class in the Dolibarr codebase.

How do I install Skill Doli Test Phpunit in Claude Code?

Run `npx skills add Dolibarr/dolibarr --skill skill-doli-test-phpunit -a claude-code`. Or copy the skill folder (.agents/skills/skill-doli-test-phpunit in Dolibarr/dolibarr) into .claude/skills/skill-doli-test-phpunit in your project. Claude Code loads it when a task matches its description.

How do I install Skill Doli Test Phpunit in Codex?

Run `npx skills add Dolibarr/dolibarr --skill skill-doli-test-phpunit -a codex`. Or copy the skill folder (.agents/skills/skill-doli-test-phpunit in Dolibarr/dolibarr) into .agents/skills/skill-doli-test-phpunit in your project. Codex loads it when a task matches its description.

Can I use Skill Doli Test Phpunit 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 Dolibarr/dolibarr --skill skill-doli-test-phpunit -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/skill-doli-test-phpunit, .gemini/skills/skill-doli-test-phpunit, .github/skills/skill-doli-test-phpunit and .opencode/skills/skill-doli-test-phpunit in your project.

What does Skill Doli Test Phpunit need to run?

SKILL.md names no scripts, command-line tools or credentials: Skill Doli Test Phpunit is instructions for the agent only. Its frontmatter pre-approves these tools: read_file, write_file, grep.

Does Skill Doli Test Phpunit access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Skill Doli Test Phpunit 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 Skill Doli Test Phpunit use?

Skill Doli Test Phpunit is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Skill Doli Test Phpunit use?

About 1.3k tokens (SKILL.md is roughly 5k 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 Skill Doli Test Phpunit?

Skills that share tags, products or a category with Skill Doli Test Phpunit: Test Guard (amElnagdy/guard-skills, 1.3k stars), Pest Testing (luadotsh/lua, 342 stars), Async Test And Doc Sync (discord-php/DiscordPHP, 1.1k stars) and Pest Testing (liberusoftware/real-estate-laravel, 112 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Skill Doli Test Phpunit?

Dolibarr (a GitHub organization) maintains it in Dolibarr/dolibarr, which has 7,696 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 7, 2026.

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