skills/review-php/SKILL.md
Review PHP code for language and runtime conventions: strict types, error handling, resource management, PSR standards, namespaces, null safety, generators, and testability. Language-only atomic skill; output is a findings list.
npx skillsauth add nesnilnehc/ai-cortex review-phpInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
仅查看 PHP 中的代码以了解 语言和运行时约定。不要定义范围(差异与代码库)或执行安全/架构分析;这些是通过范围和cognitive技能来处理的。以标准格式发出结果列表以进行聚合。重点关注严格的类型和声明、错误处理、资源管理、PSR 标准(PSR-4、PSR-12)、命名空间、空安全、生成器和可迭代、PHP 版本兼容性和可测试性。
首要目标:生成 PHP 语言/运行时结果列表,涵盖严格类型、错误处理、资源管理、PSR 标准、命名空间、空安全、生成器、版本兼容性和给定代码范围的可测试性。
成功标准(必须满足所有要求):
language-php)、严重性、标题、描述和可选建议验收测试:输出是否包含以 PHP 为中心的结果列表,其中包含 file:line 引用,涵盖所有相关语言/运行时维度,而无需执行安全性、架构或范围分析?
本技能负责:
declare(strict_types=1),类型化属性,参数,返回类型??)、空安全运算符(?->)、避免错误抑制本技能不负责:
review-sql转交点:当所有 PHP 发现结果发出后,将其交给 orchestrate-code-review 进行聚合。对于 PHP 代码中发现的 SQL 注入或安全漏洞,请记下它们并建议“review-security”。
何时使用:当正在审查的代码是 PHP 并且任务包括语言/运行时质量时。范围由调用者或用户确定。
declare(strict_types=1) 使用;类型属性和参数;返回类型声明;避免隐式类型强制陷阱。Throwable 层次结构;正确的尝试捕获和重新抛出;避免空捕获或过于宽泛的捕获;相关的“error_reporting”和错误到异常的转换。fopen/fclose、数据库连接、流;确保资源已关闭(try-finally 或短期作用域);避免资源泄漏。use语句;避免全局命名空间污染;作曲家自动加载对齐。??)、空安全运算符(?->);避免“@”错误抑制;数组的“isset”与“array_key_exists”。yield用法;正确的迭代器实现;大型数据集的内存高效迭代。不要做这些(其他技能可以处理它们):
review-sql何时停止并交接:
language-php)、严重性、标题、描述和可选建议输出是否包含以 PHP 为中心的结果列表,其中包含文件:行引用,涵盖所有相关语言/运行时维度,而无需执行安全性、体系结构或范围分析?
declare(strict_types=1) 且缺少参数/返回类型的新 PHP 文件。development
Generate an LLM agent test suite (golden cases, mock-LLM unit tests, evaluator harness) from an agent implementation and its agent-test contract. Use when an agent has no tests, or a contract exists but the test code is missing.
development
After code changes, auto-detect the project's build system and local deployment method for a given directory, then build the project and restart its locally-deployed environment (Docker Compose / systemd / process manager). Never assumes — asks only when detection is ambiguous. Caches detected commands per project in .cortex/redeploy-local.yaml; re-invocations on the same project skip re-scanning until signal files change, the cache expires (30 days), or the skill version bumps.
tools
Publish a NATS message conforming to a cross-team contract, using NATS MCP tools. Authors the contract on first use if missing. Reads project-level cache (.cortex/nats.yaml) to avoid re-prompting basics across sessions.
tools
Drain pending NATS messages from a producer contract via NATS MCP tools (default batch / drain-style). Applies Tolerant Reader semantics and per-message ack/nak/term, returning aggregated stats. Reads project-level cache (.cortex/nats.yaml) to avoid re-prompting.