一键导入
system-run-and-test
Use when running Zolinga locally, triggering CLI-origin events, evaluating scripts, and finding the correct run/test command workflow.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when running Zolinga locally, triggering CLI-origin events, evaluating scripts, and finding the correct run/test command workflow.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when creating or updating MCP resources — static files exposed to MCP clients via `resources/list` and `resources/read`. Covers `.meta.json` descriptors, URI rewriting, dynamic resources via `mcp:resources/list` event hook, and the `mcp-system` scheme.
Use when exposing an existing `origin: ["remote"]` listener as an MCP tool without rewriting the handler. Covers the one-line manifest pattern that re-uses the same class+method, plus the minimal schema work needed to satisfy `McpToolsListHandler::collectTools()`. Complements system-create-mcp-tool (which covers the greenfield case).
Use when exposing a Zolinga event handler as an MCP (Model Context Protocol) tool — i.e. a method clients can invoke via JSON-RPC `tools/call`. Covers handler class, manifest binding, JSON Schemas, the `Tools\CallEvent` contract, and the `schema.response` requirement enforced by `McpToolsListHandler::collectTools()`.
Use when working with the JavaScript client-side event system in Zolinga. Covers the Event class, Api gateway, dispatching events from JS to PHP, receiving broadcastBack responses, inter-component communication via BroadcastChannel, and web component integration.
Use when adding localized strings in PHP or HTML, including gettext usage patterns and context-aware translation strings for Zolinga Intl.
Use when writing or reviewing PHP code in this repository to enforce strict typing, naming, file layout, and listener/service interface conventions.
| name | system-run-and-test |
| description | Use when running Zolinga locally, triggering CLI-origin events, evaluating scripts, and finding the correct run/test command workflow. |
| argument-hint | [event-name] [params] |
bin/zolinga — never run php -f or other direct PHP invocations. The bin/zolinga wrapper sets up the full framework environment (autoloading, config, services, error handling). Direct php -f calls will miss framework initialization and fail.bin/zolinga --help.bin/zolinga <event-name> <params>.bin/zolinga --execute=\"<path>\".bin/zolinga --eval=\"<php-code>\".bin/zolinga --server[=[HOST:]PORT] and optional --xdebug. Default is 0.0.0.0:8888. Omit the argument to use the default, e.g. bin/zolinga --server. See bin/zolinga --help for details.config/local.json then config/global.json (baseURL) to determine front-end URL defaults.bin/zolinga skeleton:module --name=<module-name>.bin/zolinga skeleton:apache ... (see system/wiki/ref/event/skeleton/apache.md).bin/zolinga process:content --input=<file> --url=/test/page (see system/wiki/ref/event/process/content.md).Ad-hoc temporary, debugging, or testing scripts must follow these placement rules:
./tmp/ai-*.* — always use the ai- prefix (e.g. ai-test-db.php, ai-check-urls.php)../data/system/tmp/ai-*.*./public/data/system/tmp/ai-*.*./public/dist/system/tmp/ai-*.*./public/tmp/ai-*.* — for scripts that must be reachable via HTTP.Create the tmp/ directory if it does not exist. Always clean up temporary scripts after use.
bin/zolinga writes system logs, warnings, and debug messages to stderr, while the actual event response (JSON) and any listener echo output go to stdout. This lets you separate structured output from diagnostic noise using shell redirection:
# Capture only the JSON response
bin/zolinga my:event > response.json
# Capture response and suppress logs
bin/zolinga my:event > response.json 2> /dev/null
# Capture response and logs separately
bin/zolinga my:event > response.json 2> debug.log
# Pipe response to another tool while still seeing logs in terminal
bin/zolinga my:event | jq '.response.data'
system/define.php)| Constant | Value | Description |
|---|---|---|
Zolinga\System\IS_CLI | PHP_SAPI === 'cli' | true when running from command line, false during web requests. Use to branch CLI-only logic (e.g. skip output buffering, avoid exit() in web context). |
Zolinga\System\IS_INTERACTIVE | IS_CLI && posix_isatty(STDOUT) or env INTERACTIVE | true when running in an interactive terminal (TTY) or when INTERACTIVE=1 is set. Use to decide whether to show progress bars, prompts, or colored output. |
Running the System.md for execution modes.system/wiki/Zolinga Core/Running the System.mdsystem/wiki/Zolinga Core/Running the System/Command Line.mdsystem/wiki/Zolinga Core/Running the System/Custom Scripts.mdsystem/wiki/Zolinga Core/Running the System/Page Request.mdsystem/wiki/Zolinga Core/Running the System/AJAX.mdsystem/wiki/ref/event/skeleton/apache.mdsystem/wiki/templates/Running the System.mdsystem/wiki/Zolinga Core/Installing Additional Modules.md