agentleFS
AlizHarbAlizHarb/agent-skills/skills/create-service/SKILL.md

create-service

Skill1 starsChanged 5 months agoMITView on GitHub

Use when creating or changing a Laravel service class that coordinates workflows, external integrations, or multiple Actions without becoming a dumping ground.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 9 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when behavior coordinates multiple operations or integrates with an external system.

    line 13
  2. Distinctive:

    Keep controllers, Livewire components, requests, and responses out of the service API.

    line 24
  3. Distinctive:

    Add typed methods and return values.

    line 25
  4. Very specific:

    Use constructor property promotion and final readonly when the service has dependencies only.

    line 26
  5. Very specific:

    Use Laravel container contextual attributes such as #[Config], #[Storage], #[Cache], #[DB], #[Log], #[Give], and #[Tag] when they make …

    line 27
  6. Very specific:

    Use #[Scoped] for services that should resolve once per request or job lifecycle.

    line 28
  7. Distinctive:

    Keep state minimal and dependencies constructor-injected.

    line 29
  8. Distinctive:

    Add tests for coordination and failure behavior.

    line 30
  9. Distinctive:

    Prefer Laravel 13 container attributes over service-provider boilerplate when the binding is simple and local.

    line 46
  10. Distinctive:

    If the service starts accumulating unrelated responsibilities, split it into smaller Actions or services.

    line 48
  11. Distinctive:

    Test happy path, collaborator calls, failure paths, retries, and idempotency where relevant.

    line 52
  12. Distinctive:

    Do not bypass policies or validation.

    line 56

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create Service

When To Use

Use this skill when behavior coordinates multiple operations or integrates with an external system. Prefer an Action for a single operation.

Inputs Needed

  • Responsibility, collaborators, external systems, failure behavior, transaction boundaries, and tests.

Workflow

  1. Inspect existing services and support classes.
  2. Define one clear responsibility.
  3. Compose Actions, support classes, clients, repositories, or external integrations.
  4. Keep controllers, Livewire components, requests, and responses out of the service API.
  5. Add typed methods and return values.
  6. Use constructor property promotion and final readonly when the service has dependencies only.
  7. Use Laravel container contextual attributes such as #[Config], #[Storage], #[Cache], #[DB], #[Log], #[Give], and #[Tag] when they make dependency injection clearer.
  8. Use #[Scoped] for services that should resolve once per request or job lifecycle.
  9. Keep state minimal and dependencies constructor-injected.
  10. Add tests for coordination and failure behavior.

Files That May Be Created

  • app/Services/<Capability>.php
  • Tests for service behavior.

Files That May Be Modified

  • Actions, controllers, jobs, commands, Livewire components, service providers, config, and tests.

Architecture Rules

  • Services coordinate workflows; Actions perform single operations.
  • Services should not become generic managers or helpers.
  • External calls should have explicit timeout, retry, error, and test fake behavior.
  • Prefer Laravel 13 container attributes over service-provider boilerplate when the binding is simple and local.
  • Constructor injection is the default. Avoid app() unless resolving a dynamic implementation is the explicit purpose of the service.
  • If the service starts accumulating unrelated responsibilities, split it into smaller Actions or services.

Testing Requirements

  • Test happy path, collaborator calls, failure paths, retries, and idempotency where relevant.

Security Requirements

  • Do not bypass policies or validation. Treat external data as untrusted.

Review Checklist

  • Is the service responsibility narrow?
  • Would an Action be simpler?
  • Are dependencies injectable and mockable or fakeable?

Common Mistakes

  • Adding unrelated methods over time.
  • Mixing UI formatting with business coordination.
  • Calling app() instead of injecting dependencies.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.