Crawler Summary

php-best-practices answer-first brief

PHP programming best practices and clean code guidelines from TiendaNube and the PHP community. This skill should be used when writing, reviewing, or refactoring PHP code to ensure clean code principles and SOLID design patterns. Triggers on tasks involving PHP classes, functions, object-oriented design, refactoring, or code review. --- name: php-best-practices description: PHP programming best practices and clean code guidelines from TiendaNube and the PHP community. This skill should be used when writing, reviewing, or refactoring PHP code to ensure clean code principles and SOLID design patterns. Triggers on tasks involving PHP classes, functions, object-oriented design, refactoring, or code review. license: MIT metadata: author: TiendaNube C Capability contract not published. No trust telemetry is available yet. 1 GitHub stars reported by the source. Last updated 4/15/2026.

Freshness

Last checked 4/15/2026

Best For

php-best-practices is best for php workflows where OpenClaw compatibility matters.

Not Ideal For

Contract metadata is missing or unavailable for deterministic execution.

Evidence Sources Checked

editorial-content, GITHUB OPENCLEW, runtime-metrics, public facts pack

Claim this agent
Agent DossierGitHubSafety: 94/100

php-best-practices

PHP programming best practices and clean code guidelines from TiendaNube and the PHP community. This skill should be used when writing, reviewing, or refactoring PHP code to ensure clean code principles and SOLID design patterns. Triggers on tasks involving PHP classes, functions, object-oriented design, refactoring, or code review. --- name: php-best-practices description: PHP programming best practices and clean code guidelines from TiendaNube and the PHP community. This skill should be used when writing, reviewing, or refactoring PHP code to ensure clean code principles and SOLID design patterns. Triggers on tasks involving PHP classes, functions, object-oriented design, refactoring, or code review. license: MIT metadata: author: TiendaNube C

OpenClawself-declared

Public facts

5

Change events

1

Artifacts

0

Freshness

Apr 15, 2026

Verifiededitorial-contentNo verified compatibility signals1 GitHub stars

Capability contract not published. No trust telemetry is available yet. 1 GitHub stars reported by the source. Last updated 4/15/2026.

1 GitHub starsTrust evidence available

Trust score

Unknown

Compatibility

OpenClaw

Freshness

Apr 15, 2026

Vendor

Developerfred

Artifacts

0

Benchmarks

0

Last release

Unpublished

Executive Summary

Key links, install path, and a quick operational read before the deeper crawl record.

Verifiededitorial-content

Summary

Capability contract not published. No trust telemetry is available yet. 1 GitHub stars reported by the source. Last updated 4/15/2026.

Setup snapshot

git clone https://github.com/developerfred/php-best-practices-skill.git
  1. 1

    Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.

  2. 2

    Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Evidence Ledger

Everything public we have scraped or crawled about this agent, grouped by evidence type with provenance.

Verifiededitorial-content
Vendor (1)

Vendor

Developerfred

profilemedium
Observed Apr 15, 2026Source linkProvenance
Compatibility (1)

Protocol compatibility

OpenClaw

contractmedium
Observed Apr 15, 2026Source linkProvenance
Adoption (1)

Adoption signal

1 GitHub stars

profilemedium
Observed Apr 15, 2026Source linkProvenance
Security (1)

Handshake status

UNKNOWN

trustmedium
Observed unknownSource linkProvenance
Integration (1)

Crawlable docs

6 indexed pages on the official domain

search_documentmedium
Observed Apr 15, 2026Source linkProvenance

Release & Crawl Timeline

Merged public release, docs, artifact, benchmark, pricing, and trust refresh events.

Self-declaredagent-index

Artifacts Archive

Extracted files, examples, snippets, parameters, dependencies, permissions, and artifact metadata.

Self-declaredGITHUB OPENCLEW

Extracted files

0

Examples

6

Snippets

0

Languages

typescript

Parameters

Executable Examples

php

$ymdstr = $moment->format('y-m-d');

php

$currentDate = $moment->format('y-m-d');

php

$customerphone = '1134971828';
public function calculate_product_price(int $productid, int $quantity)

php

$customerPhone = '1134971828';
public function calculateProductPrice(int $productId, int $quantity)

php

class Payment 
{
    public function isPending()
    {
        if ($this->status === "pending") { 
            // logic here 
        }
    }
}

php

class Payment 
{
    const STATUS_PENDING = 'pending';

    public function isPending()
    {
        if ($this->status === self::STATUS_PENDING) { 
            // logic here 
        }
    }
}

Docs & README

Full documentation captured from public sources, including the complete README when available.

Self-declaredGITHUB OPENCLEW

Docs source

GITHUB OPENCLEW

Editorial quality

ready

PHP programming best practices and clean code guidelines from TiendaNube and the PHP community. This skill should be used when writing, reviewing, or refactoring PHP code to ensure clean code principles and SOLID design patterns. Triggers on tasks involving PHP classes, functions, object-oriented design, refactoring, or code review. --- name: php-best-practices description: PHP programming best practices and clean code guidelines from TiendaNube and the PHP community. This skill should be used when writing, reviewing, or refactoring PHP code to ensure clean code principles and SOLID design patterns. Triggers on tasks involving PHP classes, functions, object-oriented design, refactoring, or code review. license: MIT metadata: author: TiendaNube C

Full README

name: php-best-practices description: PHP programming best practices and clean code guidelines from TiendaNube and the PHP community. This skill should be used when writing, reviewing, or refactoring PHP code to ensure clean code principles and SOLID design patterns. Triggers on tasks involving PHP classes, functions, object-oriented design, refactoring, or code review. license: MIT metadata: author: TiendaNube Community version: "1.0.0" source: https://github.com/TiendaNube/php-programming-best-practices

PHP Best Practices

Comprehensive clean code and best practices guide for PHP development, based on TiendaNube's programming guidelines and SOLID principles. Contains 45+ rules across 7 categories to guide automated refactoring, code generation, and code review.

When to Apply

Reference these guidelines when:

  • Writing new PHP classes, functions, or methods
  • Implementing object-oriented PHP code
  • Reviewing PHP code for clean code violations
  • Refactoring existing PHP code
  • Applying SOLID design principles
  • Writing or reviewing tests for PHP code

Rule Categories by Priority

| Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 1 | Naming Conventions | HIGH | naming- | | 2 | Variables and Constants | HIGH | variable- | | 3 | SOLID Principles | HIGH | solid- | | 4 | Methods and Functions | MEDIUM | method- | | 5 | Conditionals | MEDIUM | conditional- | | 6 | Classes and Objects | MEDIUM | class- | | 7 | Testing | MEDIUM | test- |

Quick Reference

1. Naming Conventions (HIGH)

  • naming-descriptive - Use descriptive names that reflect purpose
  • naming-camel-case - Use camelCase for variables, methods, functions
  • naming-avoid-magic - Avoid magic values, use constants
  • naming-context - Don't add unnecessary context to variable names
  • naming-meaningful - Use meaningful names, not abbreviations

2. Variables and Constants (HIGH)

  • variable-avoid-magic - Use constants instead of magic values
  • variable-explanatory - Use explanatory variables for complex logic
  • variable-avoid-deep-nesting - Avoid deep nesting in conditionals
  • variable-final-by-default - Use final classes by default
  • variable-private-by-default - Use private properties by default

3. SOLID Principles (HIGH)

  • solid-single-responsibility - Single Responsibility Principle (SRP)
  • solid-open-closed - Open/Closed Principle (OCP)
  • solid-liskov-substitution - Liskov Substitution Principle (LSP)
  • solid-interface-segregation - Interface Segregation Principle (ISP)
  • solid-dependency-inversion - Dependency Inversion Principle (DIP)
  • solid-dry - Don't Repeat Yourself (DRY)
  • solid-tell-dont-ask - Tell, Don't Ask principle

4. Methods and Functions (MEDIUM)

  • method-type-declarations - Use type declarations for parameters and returns
  • method-few-arguments - Limit function arguments (2 or fewer ideally)
  • method-single-responsibility - Functions should do one thing
  • method-small-size - Keep functions small (20 lines or less)
  • method-descriptive-names - Function names should indicate what they do
  • method-single-abstraction - Functions should have one level of abstraction
  • method-avoid-flags - Avoid boolean flags as parameters
  • method-avoid-side-effects - Avoid side effects in functions
  • method-avoid-null - Avoid returning null, use exceptions or empty values

5. Conditionals (MEDIUM)

  • conditional-avoid-complex - Avoid complex conditional logic
  • conditional-avoid-negative - Avoid negative conditionals
  • conditional-avoid-type-check - Avoid type checking, use polymorphism
  • conditional-encapsulate - Encapsulate conditions in methods
  • conditional-avoid-else - Avoid else statements, use guard clauses

6. Classes and Objects (MEDIUM)

  • class-final-default - Make classes final by default
  • class-private-properties - Make properties private by default
  • class-constructor-over-setters - Use constructors over public setters
  • class-composition-over-inheritance - Prefer composition over inheritance
  • class-small-cohesive - Keep classes small and cohesive

7. Testing (MEDIUM)

  • test-arrange-act-assert - Follow Arrange-Act-Assert pattern
  • test-descriptive-names - Use descriptive test method names
  • test-one-assert-per-test - One assertion per test method (when possible)
  • test-isolation - Tests should be isolated from each other
  • test-fast - Tests should run fast

Detailed Rules

Naming Conventions

naming-descriptive

Use descriptive names that clearly indicate purpose and context.

Bad:

$ymdstr = $moment->format('y-m-d');

Good:

$currentDate = $moment->format('y-m-d');

naming-camel-case

Use camelCase for variables, methods, and functions.

Bad:

$customerphone = '1134971828';
public function calculate_product_price(int $productid, int $quantity)

Good:

$customerPhone = '1134971828';
public function calculateProductPrice(int $productId, int $quantity)

Variables and Constants

variable-avoid-magic

Avoid magic values; use constants instead.

Bad:

class Payment 
{
    public function isPending()
    {
        if ($this->status === "pending") { 
            // logic here 
        }
    }
}

Good:

class Payment 
{
    const STATUS_PENDING = 'pending';

    public function isPending()
    {
        if ($this->status === self::STATUS_PENDING) { 
            // logic here 
        }
    }
}

variable-explanatory

Use explanatory variables for complex logic.

Bad:

$address = 'Avenida Rivadavia 1678, 1406';
$cityZipCodeRegex = '/^[^,]+,\s*(.+?)\s*(\d{4})$/';
preg_match($cityZipCodeRegex, $address, $matches);
saveCityZipCode($matches[1], $matches[2]);

Good:

$address = 'Avenida Rivadavia 1678, 1406';
$cityZipCodeRegex = '/^[^,]+,\s*(?<street>.+?)\s*(?<zipCode>\d{4})$/';
preg_match($cityZipCodeRegex, $address, $matches);
saveCityZipCode($matches['street'], $matches['zipCode']);

SOLID Principles

solid-single-responsibility

A class should have only one reason to change.

Bad:

class Page 
{
    private string $title;
    
    public function title(): string 
    {
        return $this->title;
    }
    
    public function formatJson() 
    {
        return json_encode($this->title());
    }
}

Good:

class Page 
{
    private string $title;
 
    public function title(): string
    {
        return $this->title;    
    }
}
 
class JsonPageFormatter 
{
    public function format(Page $page)
    {
        return  json_encode($page->title());
    }
}

solid-open-closed

Software entities should be open for extension but closed for modification.

Bad:

class Customer
{
    public function pay(float $total, CreditCardPayment $paymentMethod)
    {
        $paymentMethod->execute($total);
    }
}

Good:

interface PaymentMethod
{
    public function execute(float $total);
}

class Customer
{
    public function pay(float $total, PaymentMethod $paymentMethod)
    {
        $paymentMethod->execute($total);
    }
}

class CreditCardPayment implements PaymentMethod
{
    public function execute(float $total)
    {
        // credit card payment logic
    }
}

Methods and Functions

method-type-declarations

Use type declarations for parameters and return values.

Bad:

function sum($val1, $val2)
{
    return $val1 + $val2;
}

Good:

function sum(int $val1, int $val2): int
{
    return $val1 + $val2;
}

method-few-arguments

Limit function arguments; 2 or fewer is ideal.

Bad:

function createProduct(string $title, string $description, float $price, int $stock): void
{
    // ...
}

Good:

class ProductConfig
{
    private string $title;
    private string $description;
    private float $price;
    private int $stock;

    public function __construct(string $title, string $description, float $price, int $stock) 
    {
        $this->title = $title;
        $this->description = $description;
        $this->price = $price;
        $this->stock = $stock;
    }
}

function createProduct(ProductConfig $config): void
{
    // ...
}

Conditionals

conditional-avoid-else

Avoid else statements; use guard clauses instead.

Bad:

if ($product->hasStock()) {
    // much code...
} else {
    return false;
}

Good:

if (!$product->hasStock()) {
    return false;
}

// code...

conditional-avoid-complex

Avoid complex conditional logic with deep nesting.

Bad:

function isShopOpen($day): bool
{
    if ($day) {
        if (is_string($day)) {
            $day = strtolower($day);
            if ($day === 'friday') {
                return true;
            } elseif ($day === 'saturday') {
                return true;
            } elseif ($day === 'sunday') {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    } else {
        return false;
    }
}

Good:

function isShopOpen(string $day): bool
{
    if (empty($day)) {
        return false;
    }

    $openingDays = [
        'friday', 'saturday', 'sunday'
    ];

    return in_array(strtolower($day), $openingDays, true);
}

Classes and Objects

class-final-default

Make classes final by default.

Good:

final class Employee
{
    // code...
}

class-private-properties

Make properties private by default.

Bad:

final class Product
{
    public float $price = 1000.00;
}

Good:

final class Product
{
    private float $price = 1000.00;
    
    public function getPrice(): float
    {
        return $this->price;
    }
}

class-composition-over-inheritance

Prefer composition over inheritance.

Bad:

class Vehicle
{    
    public function move()
    {
        echo "Move the car";
    }    
}

class Car extends Vehicle
{
    public function accelerate()
    {    
        $this->move();    
    }
}

Good:

interface MoveVehicle
{
    public function move();
}

final class Vehicle implements MoveVehicle
{    
    public function move()
    {
        echo "Move the car";
    }    
}

final class Car
{
    private MoveVehicle $vehicle;

    public function __construct(MoveVehicle $vehicle)
    {
        $this->vehicle = $vehicle;
    }

    public function accelerate()
    {    
        $this->vehicle->move();    
    }
}

Testing Guidelines

test-arrange-act-assert

Follow the Arrange-Act-Assert pattern in tests.

Good:

public function testCalculateTotal(): void
{
    // Arrange
    $calculator = new Calculator();
    $items = [new Item(10.0), new Item(20.0)];
    
    // Act
    $total = $calculator->calculateTotal($items);
    
    // Assert
    $this->assertEquals(30.0, $total);
}

test-descriptive-names

Use descriptive test method names.

Bad:

public function test1(): void

Good:

public function testCalculateTotalReturnsCorrectSum(): void

How to Use This Skill

  1. For code review: Scan PHP code against these rules to identify violations
  2. For code generation: Apply these rules when writing new PHP code
  3. For refactoring: Use specific rule references to guide refactoring efforts
  4. For architecture: Apply SOLID principles when designing PHP class hierarchies

Implementation Notes

  • This skill is optimized for PHP 7.0+ with type declarations
  • Rules are prioritized by impact on code quality and maintainability
  • Each rule includes concrete examples of "bad" and "good" code
  • The skill follows the TiendaNube PHP best practices document structure

License

This skill is based on the TiendaNube PHP Programming Best Practices document (MIT licensed) and follows the Vercel skills.sh format.

Contract & API

Machine endpoints, protocol fit, contract coverage, invocation examples, and guardrails for agent-to-agent use.

MissingGITHUB OPENCLEW

Contract coverage

Status

missing

Auth

None

Streaming

No

Data region

Unspecified

Protocol support

OpenClaw: self-declared

Requires: none

Forbidden: none

Guardrails

Operational confidence: low

No positive guardrails captured.
Invocation examples
curl -s "https://xpersona.co/api/v1/agents/developerfred-php-best-practices-skill/snapshot"
curl -s "https://xpersona.co/api/v1/agents/developerfred-php-best-practices-skill/contract"
curl -s "https://xpersona.co/api/v1/agents/developerfred-php-best-practices-skill/trust"

Reliability & Benchmarks

Trust and runtime signals, benchmark suites, failure patterns, and practical risk constraints.

Missingruntime-metrics

Trust signals

Handshake

UNKNOWN

Confidence

unknown

Attempts 30d

unknown

Fallback rate

unknown

Runtime metrics

Observed P50

unknown

Observed P95

unknown

Rate limit

unknown

Estimated cost

unknown

Do not use if

Contract metadata is missing or unavailable for deterministic execution.
No benchmark suites or observed failure patterns are available.

Media & Demo

Every public screenshot, visual asset, demo link, and owner-provided destination tied to this agent.

Missingno-media
No screenshots, media assets, or demo links are available.

Related Agents

Neighboring agents from the same protocol and source ecosystem for comparison and shortlist building.

Self-declaredprotocol-neighbors
GITHUB_REPOSactivepieces

Rank

70

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

Traction

No public download signal

Freshness

Updated 2d ago

OPENCLAW
GITHUB_REPOScherry-studio

Rank

70

AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs

Traction

No public download signal

Freshness

Updated 5d ago

MCPOPENCLAW
GITHUB_REPOSAionUi

Rank

70

Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!

Traction

No public download signal

Freshness

Updated 6d ago

MCPOPENCLAW
GITHUB_REPOSCopilotKit

Rank

70

The Frontend for Agents & Generative UI. React + Angular

Traction

No public download signal

Freshness

Updated 23d ago

OPENCLAW
Machine Appendix

Contract JSON

{
  "contractStatus": "missing",
  "authModes": [],
  "requires": [],
  "forbidden": [],
  "supportsMcp": false,
  "supportsA2a": false,
  "supportsStreaming": false,
  "inputSchemaRef": null,
  "outputSchemaRef": null,
  "dataRegion": null,
  "contractUpdatedAt": null,
  "sourceUpdatedAt": null,
  "freshnessSeconds": null
}

Invocation Guide

{
  "preferredApi": {
    "snapshotUrl": "https://xpersona.co/api/v1/agents/developerfred-php-best-practices-skill/snapshot",
    "contractUrl": "https://xpersona.co/api/v1/agents/developerfred-php-best-practices-skill/contract",
    "trustUrl": "https://xpersona.co/api/v1/agents/developerfred-php-best-practices-skill/trust"
  },
  "curlExamples": [
    "curl -s \"https://xpersona.co/api/v1/agents/developerfred-php-best-practices-skill/snapshot\"",
    "curl -s \"https://xpersona.co/api/v1/agents/developerfred-php-best-practices-skill/contract\"",
    "curl -s \"https://xpersona.co/api/v1/agents/developerfred-php-best-practices-skill/trust\""
  ],
  "jsonRequestTemplate": {
    "query": "summarize this repo",
    "constraints": {
      "maxLatencyMs": 2000,
      "protocolPreference": [
        "OPENCLEW"
      ]
    }
  },
  "jsonResponseTemplate": {
    "ok": true,
    "result": {
      "summary": "...",
      "confidence": 0.9
    },
    "meta": {
      "source": "GITHUB_OPENCLEW",
      "generatedAt": "2026-04-17T00:21:47.799Z"
    }
  },
  "retryPolicy": {
    "maxAttempts": 3,
    "backoffMs": [
      500,
      1500,
      3500
    ],
    "retryableConditions": [
      "HTTP_429",
      "HTTP_503",
      "NETWORK_TIMEOUT"
    ]
  }
}

Trust JSON

{
  "status": "unavailable",
  "handshakeStatus": "UNKNOWN",
  "verificationFreshnessHours": null,
  "reputationScore": null,
  "p95LatencyMs": null,
  "successRate30d": null,
  "fallbackRate": null,
  "attempts30d": null,
  "trustUpdatedAt": null,
  "trustConfidence": "unknown",
  "sourceUpdatedAt": null,
  "freshnessSeconds": null
}

Capability Matrix

{
  "rows": [
    {
      "key": "OPENCLEW",
      "type": "protocol",
      "support": "unknown",
      "confidenceSource": "profile",
      "notes": "Listed on profile"
    },
    {
      "key": "php",
      "type": "capability",
      "support": "supported",
      "confidenceSource": "profile",
      "notes": "Declared in agent profile metadata"
    }
  ],
  "flattenedTokens": "protocol:OPENCLEW|unknown|profile capability:php|supported|profile"
}

Facts JSON

[
  {
    "factKey": "docs_crawl",
    "category": "integration",
    "label": "Crawlable docs",
    "value": "6 indexed pages on the official domain",
    "href": "https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenclaw%2Fskills%2Ftree%2Fmain%2Fskills%2Fasleep123%2Fcaldav-calendar",
    "sourceUrl": "https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenclaw%2Fskills%2Ftree%2Fmain%2Fskills%2Fasleep123%2Fcaldav-calendar",
    "sourceType": "search_document",
    "confidence": "medium",
    "observedAt": "2026-04-15T05:03:46.393Z",
    "isPublic": true
  },
  {
    "factKey": "vendor",
    "category": "vendor",
    "label": "Vendor",
    "value": "Developerfred",
    "href": "https://github.com/developerfred/php-best-practices-skill",
    "sourceUrl": "https://github.com/developerfred/php-best-practices-skill",
    "sourceType": "profile",
    "confidence": "medium",
    "observedAt": "2026-04-15T00:18:48.991Z",
    "isPublic": true
  },
  {
    "factKey": "protocols",
    "category": "compatibility",
    "label": "Protocol compatibility",
    "value": "OpenClaw",
    "href": "https://xpersona.co/api/v1/agents/developerfred-php-best-practices-skill/contract",
    "sourceUrl": "https://xpersona.co/api/v1/agents/developerfred-php-best-practices-skill/contract",
    "sourceType": "contract",
    "confidence": "medium",
    "observedAt": "2026-04-15T00:18:48.991Z",
    "isPublic": true
  },
  {
    "factKey": "traction",
    "category": "adoption",
    "label": "Adoption signal",
    "value": "1 GitHub stars",
    "href": "https://github.com/developerfred/php-best-practices-skill",
    "sourceUrl": "https://github.com/developerfred/php-best-practices-skill",
    "sourceType": "profile",
    "confidence": "medium",
    "observedAt": "2026-04-15T00:18:48.991Z",
    "isPublic": true
  },
  {
    "factKey": "handshake_status",
    "category": "security",
    "label": "Handshake status",
    "value": "UNKNOWN",
    "href": "https://xpersona.co/api/v1/agents/developerfred-php-best-practices-skill/trust",
    "sourceUrl": "https://xpersona.co/api/v1/agents/developerfred-php-best-practices-skill/trust",
    "sourceType": "trust",
    "confidence": "medium",
    "observedAt": null,
    "isPublic": true
  }
]

Change Events JSON

[
  {
    "eventType": "docs_update",
    "title": "Docs refreshed: Sign in to GitHub · GitHub",
    "description": "Fresh crawlable documentation was indexed for the official domain.",
    "href": "https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenclaw%2Fskills%2Ftree%2Fmain%2Fskills%2Fasleep123%2Fcaldav-calendar",
    "sourceUrl": "https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenclaw%2Fskills%2Ftree%2Fmain%2Fskills%2Fasleep123%2Fcaldav-calendar",
    "sourceType": "search_document",
    "confidence": "medium",
    "observedAt": "2026-04-15T05:03:46.393Z",
    "isPublic": true
  }
]

Sponsored

Ads related to php-best-practices and adjacent AI workflows.