CLAUDE.md
website/src/_posts/CLAUDE.mdCLAUDE.md
Quality
74/100
Scores the file, not the repository.Length
1,055 words
20 headings · 13 code blocksRepository
14k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# PHPStan Blog Writing Style Guide23The PHPStan blog is written by Ondrej Mirtes, creator and maintainer of PHPStan. All articles are written in first person singular ("I"). The voice is conversational, technically authoritative, and occasionally humorous.45## Voice and Tone67- **First person**: Always "I", never "we" when referring to the author's decisions (though "we" is okay when referring to the PHPStan project or community collectively, e.g. "we improved BetterReflection").8- **Casual but knowledgeable**: Uses contractions ("it's", "doesn't", "I'm"), informal phrasing ("gonna", "dtto"), and direct address to the reader ("you").9- **Confident and opinionated**: Doesn't hedge or equivocate. States positions clearly. e.g. "I'd absolutely avoid inheritance", "the right solutions to both of these reasons are different, and I'm gonna tell you how and why."10- **Enthusiastic about static analysis**: Genuine excitement about features and improvements. e.g. "I've been looking forward to implementing and releasing the ideas present in PHPStan 1.10 for a long time."11- **Self-deprecating humor**: Occasional jokes at own expense. e.g. "I automated and scaled my favourite part of being a software developer: pointing out mistakes in other people's code", or footnotes like `[^lovemyjob]: I love my job!`12- **Emoji usage**: Very rare and restrained. Occasional use in informal contexts.13- **Explains the "why" before the "how"**: Motivates features by describing the problem they solve, often with real-world scenarios.1415## Frontmatter1617Every post has YAML frontmatter:1819```yaml20---21title: "Title in Title Case With Quotes"22date: YYYY-MM-DD23tags: releases # or: guides, other24---25```2627Tags categorize articles:28- `releases` - Version announcements, new feature introductions29- `guides` - Explanations, tutorials, problem-solving articles30- `other` - Website meta, process, non-technical3132## Article Types and Their Patterns3334### Release Announcements (tag: releases)3536Open with context about what makes this release special. Cover headline features with their own `##` sections. Each feature section explains the motivation, shows code examples, and links to documentation or playground. Often credits contributors by name with GitHub links. End with excitement about the future and the standard sponsorship CTA.3738Example opening: "PHPStan 1.0 was released a little over three years ago. I'm happy to report the project is thriving! We did about 176 new releases since then..."3940### Guides and Explanations (tag: guides)4142Start by framing the problem or concept. Walk through solutions or explanations methodically. Heavy use of PHP code examples. Link to relevant documentation pages. Often structured as a series of solutions or approaches.4344Example opening: "This error is reported for `new static()` calls that might break once the class is extended, and the constructor is overridden with different parameters."4546### "Solving PHPStan error..." Series4748Title format: `Solving PHPStan error "Exact error message here"`4950These follow a consistent pattern:511. Brief explanation of what triggers the error522. Multiple solution sections, each with its own heading533. Code examples showing the fix (often using `diff-php` syntax)544. Links to relevant documentation5556## Structure and Formatting5758### Headings5960Use either `##` (H2) or dashed-underline style:6162```markdown63Section title64------------------------65```6667Both styles are used; dashed underlines are more common in guides, `##` in release announcements.6869### Code Examples7071- PHP code in ` ```php ` fenced blocks72- NEON configuration in ` ```neon ` blocks73- Diff examples use ` ```diff-php ` with `+`/`-` prefixes74- Bash commands in ` ```bash ` blocks75- Comments inside code explain what PHPStan reports or what types are inferred76- Example: `// PHPStan reports: Unsafe usage of new static()`77- Example: `\PHPStan\dumpType($d); // MyDerivative :)`7879### Footnotes8081Used liberally for asides, jokes, and tangential notes:8283```markdown84Something important. [^footnote]8586[^footnote]: This is a tangential aside or joke.87```8889Examples:90- `[^lovemyjob]: I love my job!`91- `[^parcel]: It might as well mean "I can't configure Webpack and I'm not ashamed!"`92- `[^telemetry]: This is just from my personal experience and anecdotal evidence - PHPStan doesn't perform any telemetry on user's code.`9394### Links9596- Cross-references to other blog posts: `[Learn more](/blog/article-slug)`97- Links to documentation: `[configuration](/config-reference)`98- Playground examples: `[playground example](/r/uuid-here)` or `[Link to this example on the playground](/r/uuid-here)`99- GitHub releases: `[PHPStan 1.9.0](https://github.com/phpstan/phpstan/releases/tag/1.9.0)`100- Credit contributors with GitHub profile links101102### Embedded Tweets103104Used as social proof, community reactions, or to reference prior statements. Full HTML `<blockquote class="twitter-tweet">` embeds with the Twitter widgets script.105106### Markdown Abbreviations107108Occasionally used for technical acronyms:109110```markdown111*[AST]: Abstract Syntax Tree112*[OOP]: Object-Oriented Programming113*[TLC]: Tender Loving Care114```115116### Bullet Points117118Used extensively, especially for listing features, solutions, or examples. Concise, often one line each.119120### Error Messages121122PHPStan error messages are quoted with `>` blockquotes or inline backticks:123124```markdown125> Access to an undefined property Foo::$x.126```127128or129130```markdown131PHPStan reports "string|null is not subtype of native type string"132```133134### Images135136Occasionally used for screenshots or diagrams. Format:137138```markdown139140```141142Or with additional HTML/CSS classes for styled presentation.143144### Mermaid Diagrams145146Used sparingly for flowcharts:147148```markdown149{% mermaid %}150flowchart LR;151Node1== label ==>Node2152{% endmermaid %}153```154155## Standard Closing156157Almost every article ends with a horizontal rule and a sponsorship CTA. The exact wording has evolved over time:158159Early articles:160```markdown161Do you like PHPStan and use it every day? [**Consider supporting further development of PHPStan on GitHub Sponsors**](https://github.com/sponsors/ondrejmirtes/). I'd really appreciate it!162```163164Recent articles:165```markdown166Do you like PHPStan and use it every day? [**Consider sponsoring** further development of PHPStan on GitHub Sponsors and also **subscribe to PHPStan Pro**](/sponsor)! I'd really appreciate it!167```168169Most recent:170```markdown171Do you like PHPStan and use it every day? [**Consider supporting further development of PHPStan**](/sponsor). I'd really appreciate it!172```173174## Content Principles1751761. **Practical over theoretical**: Always show real code examples. Don't just describe - demonstrate.1772. **Acknowledge tradeoffs**: When explaining design decisions, mention what was considered and why certain approaches were chosen.1783. **Credit contributors**: Name individuals who contributed features, with links to their GitHub profiles.1794. **Build on existing content**: Reference and link to previous blog posts and documentation. The blog forms an interconnected knowledge base.1805. **Progressive disclosure**: Start with the simplest explanation or solution, then build to more complex ones.1816. **Real-world context**: Use examples from actual frameworks (Doctrine, PHPUnit, Laravel) and real codebases (Adminer, PrestaShop) to ground explanations.1827. **Don't talk down**: Assume the reader is a competent PHP developer who may not be familiar with type theory or static analysis concepts.183
Also in phpstan/phpstan
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| phpstan/phpstanCLAUDE.md · 14k | CLAUDE.md | buildarchgitdeployment | 82/100 | 3 days ago | |
| phpstan/phpstanwebsite/CLAUDE.md · 14k | CLAUDE.md | buildtestlint-formatarch+2 | 89/100 | 3 days ago | |
| phpstan/phpstanwebsite/errors/CLAUDE.md · 14k | CLAUDE.md | lint-formatstyledo-notdocs | 77/100 | 3 days ago | |
| phpstan/phpstanwebsite/infra/CLAUDE.md · 14k | CLAUDE.md | teststylearchdeployment | 94/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| dotCMS/corecore-web/CLAUDE.md · 950 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 3 days ago | |
| Adit-Jain-srm/NightmareNetCLAUDE.md · 45 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 3 days ago | |
| microsoft/playwrightCLAUDE.md · 94k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.4k | CLAUDE.md | setupbuildstylearch+2 | 100/100 | 3 days ago | |
| stacklok/toolhiveCLAUDE.md · 2.0k | CLAUDE.md | buildteststylearch+4 | 100/100 | 3 days ago | |
| filamentphp/filamentCLAUDE.md · 32k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| bagisto/bagistoCLAUDE.md · 28k | CLAUDE.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| livewire/livewireCLAUDE.md · 24k | CLAUDE.md | setupbuildteststyle+4 | 100/100 | 3 days ago |
