Skip to main content

code-quality

Runs linting and static analysis on PHP/CSS/JS using phpcs, phpstan, and rector. Use when checking code style, fixing lint errors, or running static analysis.

来源信息

仓库
bonny/WordPress-Simple-History
最近来源活动
2026年7月27日 15:12
检测到的 SKILL.md 语言
英语
星标
317
Forks
74

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
6 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
code-quality
description
Runs linting and static analysis on PHP/CSS/JS using phpcs, phpstan, and rector. Use when checking code style, fixing lint errors, or running static analysis.
allowed-tools
Read, Grep, Glob, Bash
# Code Quality Standards ## Quick Commands ```bash composer lint # Check PHP style (local, fastest) composer lint-fix # Auto-fix PHP issues (local) npm run php:lint # Same check, in Docker npm run php:lint-fix # Same fix, in Docker npm run php:phpstan # Static analysis npm run lint:js # JavaScript npm run lint:css # CSS ``` Always run phpstan via `npm run php:phpstan`. Bare `vendor/bin/phpstan analyse` crashes a worker at the default 128M and still crashes at 1G; the npm script passes the 2048M that actually works. ## Project-Specific Rules | Area | Standard | | ------------------ | ------------------------------------------ | | PHP | 7.4+, WordPress Coding Standards | | Prefixes | `sh`, `simplehistory`, `simple_history` | | Text domain | `simple-history` | | CSS naming | SuitCSS: `sh-ComponentName-subpart` | | Array syntax | Short `[]` not `array()` | | Control structures | Always use braces `{}`, never colon syntax | ## Essential Principles 1. **Always escape output** - Use WordPress escaping functions 2. **Prefix everything** - All hooks, functions, classes 3. **Run tools after changes** - phpcs/phpstan before committing ## Detailed Guidelines - [php-standards.md](php-standards.md) - PHP style, happy path, early returns - [css-standards.md](css-standards.md) - SuitCSS naming conventions - [js-standards.md](js-standards.md) - JavaScript conventions - [tooling.md](tooling.md) - phpcs, phpstan, rector usage - [design-principles.md](design-principles.md) - DRY, YAGNI, refactoring patterns ## Related Files - `phpcs.xml.dist` - PHP_CodeSniffer config - `phpstan.neon` - PHPStan config
在 GitHub 查看