본문으로 건너뛰기
cccskills
무료GitHub에 공개

php-coder

Writes or edits PHP code — controllers, classes, type hints, SOLID refactors, modern idioms — even without naming PHP. NOT for writing tests (use pest-testing) or explaining PHP concepts.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(2)

  • SKILL.md4.8 KB
  • evals/triggers.json1.4 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

coder

When to use

This skill applies to ALL code generation and editing tasks. Every other skill builds on top of this one.

Do NOT use when:

  • Only reading/reviewing code (use code-review skill)
  • Only running quality tools (use quality-tools skill)

Procedure: Before writing code

Step 0: Inspect project

  1. Read AGENTS.md and .github/copilot-instructions.md for project-specific rules.
  2. If working in a module (app/Modules/*/), check app/Modules/{Module}/agents/ for module docs.
  3. Look at neighboring files in the same directory — match the style.
  4. Read ./agents/ for project-specific architecture.
  5. Check ecs.php / rector.php (if they exist) — code accordingly.
  6. Read Makefile or Taskfile.yml for available build/test/quality targets.

Step 1: Detect project type

  • artisan exists → Laravel project (Pest, Modules if present)
  • No artisan + composer.json → Standalone PHP / Composer project
  • Check AGENTS.md and ./agents/ for conventions

Step 2: Apply conventions

→ See php-coding rule (always loaded) for PHP coding standards. → See guideline php/general.md for detailed PHP conventions. → See guideline php/controllers.md, php/eloquent.md, etc. for domain-specific conventions.

Step 3: Stop-gate — branching on a discriminator?

Before writing a second match/switch arm, a second if/elseif branch, or a second class hardcoded to one enum/string value (e.g. Provider::FOO->value, 'stripe', a case Type::CSV), STOP and run the Strategy sniff test.

Trigger keywords in the task or surrounding code:

  • enum/string used as a type-tag: Provider, Type, Channel, Format, Driver, Kind
  • repeated match ($x) / switch ($x) blocks on the same value
  • class names that bake a single enum case in: StripeImportService, CsvExporter, Ks21Job next to GeoCaptureJob with the same shape
  • allowlist constants: private const SUPPORTED_FOO = [Type::A, Type::B]

→ Run the sniff test in docs/guidelines/php/patterns/strategy.md. Two "yes" answers → propose Strategy + Registry before adding the new branch. Three "yes" → it is already overdue and the refactor is the change.

This gate fires per task, not per file — once you've passed the sniff test for a given discriminator, do not re-ask on the next branch.

Core principles

  • KISS — simplest solution that works. No over-engineering.
  • YAGNI — only build what's needed now.
  • DRY — extract shared logic. Don't abstract prematurely.
  • SOLID — single responsibility, depend on abstractions, small interfaces.

Validate

  • Run PHPStan on changed files — must pass at level 9.
  • Run affected tests — must pass.
  • Verify strict types, typed properties, return types on all new code.
  • Check that no dd(), var_dump(), print_r() remain.

Output format

  1. Code following project guidelines and existing patterns
  2. All downstream changes (callers, tests, imports) included

Verification examples

  • Backend changes (service, controller, repository): probe the route with curl or an actingAs() HTTP test under api/; assert response shape and side effects.
  • Frontend-adjacent changes (Blade / Livewire component wiring): drive the component with a livewire test, a Playwright spec, or a browser screenshot snapshot.
  • Always run the targeted test (pest --filter=…) and the relevant phpstan / rector checks before claiming done.

Gotcha

  • Don't introduce new patterns without being asked.
  • Don't refactor code you're not working on.
  • Use Math helper for ALL calculations — never raw PHP arithmetic.
  • MonitoringHelper::captureException() for Sentry reporting.

Do NOT

  • Do NOT use native arithmetic (+, -, *, /) for business calculations — use Math helper.
  • Do NOT refactor code you're not actively working on.
  • Do NOT use var_dump(), print_r(), dd() — disallowed by PHPStan.

Anti-bruteforce — diagnose before retry

When PHPStan, Rector, or a test goes red after a change, do not retry blindly by toggling type hints, adding @phpstan-ignore, or shuffling arguments until it passes. Diagnose the root cause first — read the error, trace the symbol, then apply a targeted fix. Trial-and-error type narrowing hides real type errors.

Auto-trigger keywords

  • PHP coding
  • coding standards
  • SOLID
  • clean code
  • best practices

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use when reviewing UI for accessibility — WCAG 2.2 AA, keyboard nav, focus, ARIA, contrast, screen-reader semantics — even on 'is this a11y-OK?' or 'mach das barrierefrei'.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config122026년 10월 19일 업데이트

Use when defining or auditing the activation event — aha-moment selection, retention correlation, falsifiable definition. Triggers on 'what is our aha moment', 'redefine activation'.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config122026년 10월 19일 업데이트

Use when capturing an architectural decision — file naming, next ADR number, Status / Context / Decision / Consequences, index regen; fires even without saying 'ADR'.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config122026년 10월 19일 업데이트

Adversarial critique — devil's advocate, stress-test, honest teardown ('poke holes', 'be brutal', 'was hältst du davon'); explicit request only. Routine code or design review → code-review.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config122026년 10월 19일 업데이트

Use when reading, creating, or updating agent documentation, module docs, roadmaps, or AGENTS.md. Understands the full .augment/, agents/, and copilot-instructions structure.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config122026년 10월 19일 업데이트

Use for an adversarial red-team / blue-team / auditor review of an AI agent's CONFIG + behaviour (rules, skills, MCP, hooks, permissions) — attack-chain → defensive-gap list, not a code audit.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config122026년 10월 19일 업데이트

event4u-app의 스킬 모두 보기

이 스킬의 문제 신고