一键导入
add-service
Add a new Laminas service (with factory) to this Omeka S module. Invoke with the service name, e.g. /add-service MyNewService
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add a new Laminas service (with factory) to this Omeka S module. Invoke with the service name, e.g. /add-service MyNewService
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Attach a new Omeka S event listener in Module.php. Invoke with a description, e.g. /add-event log media updates
Add a new route and controller action to this Omeka S module. Invoke with a short description, e.g. /add-route admin export endpoint
Run the full translation workflow — extract strings, update .po files, check for untranslated strings, and compile .mo files.
Package the module for distribution. Invoke with a version number, e.g. /release 1.2.3
Run the full CI verification pipeline locally — lint, unit tests, and 90% coverage check. Use after making changes to confirm they are ready.
| name | add-service |
| description | Add a new Laminas service (with factory) to this Omeka S module. Invoke with the service name, e.g. /add-service MyNewService |
Add a new service called $ARGUMENTS following the patterns in this module.
Create src/Service/$ARGUMENTS.php — the service class in namespace ExeLearning\Service.
Create src/Service/${ARGUMENTS}Factory.php — implements Laminas\ServiceManager\Factory\FactoryInterface:
namespace ExeLearning\Service;
use Interop\Container\ContainerInterface;
use Laminas\ServiceManager\Factory\FactoryInterface;
class ${ARGUMENTS}Factory implements FactoryInterface
{
public function __invoke(ContainerInterface $services, $requestedName, array $options = null)
{
// pull dependencies from $services:
// $services->get('Omeka\ApiManager')
// $services->get('Omeka\EntityManager')
// $services->get('Omeka\Logger')
// $services->get('Config')
return new $ARGUMENTS(/* dependencies */);
}
}
Register in config/module.config.php under service_manager.factories:
'service_manager' => [
'factories' => [
Service\$ARGUMENTS::class => Service\${ARGUMENTS}Factory::class,
],
],
Inject where needed — in a controller factory retrieve it with:
$myService = $services->get(\ExeLearning\Service\$ARGUMENTS::class);
Write a unit test in test/ExeLearningTest/Service/ using PHPUnit. Add stubs to test/Stubs/ for any new Omeka/Laminas collaborators not already stubbed.
Omeka\ApiManager, Omeka\EntityManager, Omeka\Logger, Omeka\Settings, Omeka\Acl.$services->get('Config') for module config values.