name: service-layer-generator
description: "Generates Backend Service interfaces and implementations. Use to "create auth service", "mock network layer", or "add playfab service"."
version: 2.0.0
tags: []
argument-hint: service_name='AuthService' namespace='Game.Services'
disable-model-invocation: false
user-invocable: true
allowed-tools:
- run_command
- list_dir
- write_to_file
requirements:
unity_version: ">=6.0"
render_pipeline: "Any"
dependencies: []
context_discovery:
check_unity_version: true
check_render_pipeline: false
scan_manifest_for: []
performance_budget:
gc_alloc_per_frame: "N/A - async or editor-only"
max_update_cost: "N/A"
tdd_first: true # ⚠️ Updated by audit v2.0.1 - needs manual test implementation
Service Layer Generator
Overview
Goal
To decouple game logic from external APIs (PlayFab, Firebase, Custom Backend). We generate an Interface (IService) and an Implementation (Service) that can be injected via VContainer.
When to Use
Use when defining contracts between systems
Use when implementing dependency injection
Use when creating testable code
Use when PlayFab integration
Use when backend services
Architecture
Interface: Defines what the service does.
Implementation: Defines how (REST, SDK, Mock).
Rule: Game Logic ONLY talks to the Interface.
Procedure
Analyze: Determine the scope (Auth, Inventory, Leaderboard).
Generate: Create I{Name}.cs and {Name}Impl.cs in Assets/Scripts/Services/.
Suggest: Remind the user to register this new service using di-container-manager.
Generates MockLoginService.cs (Fake success after 1 second).
User can then swap Mock for Real implementation later.
Best Practices
Follow the patterns and constraints documented in this skill.
Always run @context-discovery-agent before applying this skill to verify environment compatibility.
Apply TDD where applicable: write the interface contract first, then implement.
Zero GC in hot paths: cache references, avoid LINQ and
ew allocations in Update loops.
TDD Contract
⚠️ Legacy Skill — Refactor Pending
Este skill NO tiene tests automatizados aún. El siguiente boilerplate es un punto de partida.
// Escribe estos tests ANTES de implementar:
// Test 1: should [expected behavior] when [condition]
[Test]
public void ServiceLayerGenerator_Should{ExpectedBehavior}_When{Condition}()
{{
// Arrange
// TODO: Setup test fixtures
// Act
// TODO: Execute system under test
// Assert
Assert.Fail("Not implemented — write test first");
}}
// Test 2: should handle [edge case]
[Test]
public void ServiceLayerGenerator_ShouldHandle{EdgeCase}()
{{
// Arrange
// TODO: Setup edge case scenario
// Act
// TODO: Execute
// Assert
Assert.Fail("Not implemented");
}}
// Test 3: should throw when [invalid input]
[Test]
public void ServiceLayerGenerator_ShouldThrow_When{InvalidInput}()
{{
// Arrange
var invalidInput = default;
// Act & Assert
Assert.Throws<Exception>(() => {{ /* execute */ }});
}}
Pasos para completar el TDD:
Descomenta los tests above
Implementa la funcionalidad mínima para que compile
Ejecuta los tests — deben fallar (RED)
Implementa la funcionalidad real
Verifica que los tests pasen (GREEN)
Refactorea manteniendo los tests verdes
Nota: Este skill fue marcado como tdd_first: false durante la auditoría v2.0.1. La sección TDD fue agregada automáticamente pero requiere customización manual para reflejar el comportamiento real del skill.
Related Skills
@context-discovery-agent - Verify Unity version and package compatibility before proceeding
@unified-style-guide - Naming and formatting conventions
@automated-unit-testing - TDD scaffolding for this skill's components
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: nlelouche-unity3d-antigravityskills-service-layer-generator3description: ---4---5---6name: service-layer-generator7description: "Generates Backend Service interfaces and implementations. Use to "create auth service", "mock network layer", or "add playfab service"."8version: 2.0.09tags: []10argument-hint: service_name='AuthService' namespace='Game.Services'11disable-model-invocation: false12user-invocable: true13allowed-tools:14 - run_command15 - list_dir16 - write_to_file17requirements:18 unity_version: ">=6.0"19 render_pipeline: "Any"20 dependencies: []21context_discovery:22 check_unity_version: true23 check_render_pipeline: false24 scan_manifest_for: []25performance_budget:26 gc_alloc_per_frame: "N/A - async or editor-only"27 max_update_cost: "N/A"28tdd_first: true # ⚠️ Updated by audit v2.0.1 - needs manual test implementation29---3031# Service Layer Generator3233## Overview3435## Goal36To decouple game logic from external APIs (PlayFab, Firebase, Custom Backend). We generate an **Interface** (`IService`) and an **Implementation** (`Service`) that can be injected via VContainer.3738## When to Use39- Use when defining contracts between systems40- Use when implementing dependency injection41- Use when creating testable code42- Use when PlayFab integration43- Use when backend services4445## Architecture46- **Interface**: Defines *what* the service does.47- **Implementation**: Defines *how* (REST, SDK, Mock).48- **Rule**: Game Logic ONLY talks to the Interface.4950## Procedure511. **Analyze**: Determine the scope (Auth, Inventory, Leaderboard).522. **Generate**: Create `I{Name}.cs` and `{Name}Impl.cs` in `Assets/Scripts/Services/`.533. **Suggest**: Remind the user to register this new service using `di-container-manager`.5455## Few-Shot Example56User: "Create a Login Service."57Agent:581. Generates `ILoginService.cs` (Methods: `LoginAsync`, `Logout`).592. Generates `MockLoginService.cs` (Fake success after 1 second).603. User can then swap Mock for Real implementation later.6162## Best Practices63- Follow the patterns and constraints documented in this skill.64- Always run @context-discovery-agent before applying this skill to verify environment compatibility.65- Apply TDD where applicable: write the interface contract first, then implement.66- Zero GC in hot paths: cache references, avoid LINQ and 67ew allocations in Update loops.686970---7172## TDD Contract7374> ⚠️ **Legacy Skill — Refactor Pending**75> Este skill NO tiene tests automatizados aún. El siguiente boilerplate es un punto de partida.7677```csharp78// Escribe estos tests ANTES de implementar:7980// Test 1: should [expected behavior] when [condition]81[Test]82public void ServiceLayerGenerator_Should{ExpectedBehavior}_When{Condition}()83{{84 // Arrange85 // TODO: Setup test fixtures8687 // Act88 // TODO: Execute system under test8990 // Assert91 Assert.Fail("Not implemented — write test first");92}}9394// Test 2: should handle [edge case]95[Test]96public void ServiceLayerGenerator_ShouldHandle{EdgeCase}()97{{98 // Arrange99 // TODO: Setup edge case scenario100101 // Act102 // TODO: Execute103104 // Assert105 Assert.Fail("Not implemented");106}}107108// Test 3: should throw when [invalid input]109[Test]110public void ServiceLayerGenerator_ShouldThrow_When{InvalidInput}()111{{112 // Arrange113 var invalidInput = default;114115 // Act & Assert116 Assert.Throws<Exception>(() => {{ /* execute */ }});117}}118```119120### Pasos para completar el TDD:1211221. **Descomenta** los tests above1232. **Implementa** la funcionalidad mínima para que compile1243. **Ejecuta** los tests — deben fallar (RED)1254. **Implementa** la funcionalidad real1265. **Verifica** que los tests pasen (GREEN)1276. **Refactorea** manteniendo los tests verdes128129---130131**Nota**: Este skill fue marcado como `tdd_first: false` durante la auditoría v2.0.1. La sección TDD fue agregada automáticamente pero requiere customización manual para reflejar el comportamiento real del skill.132133134## Related Skills135- @context-discovery-agent - Verify Unity version and package compatibility before proceeding136- @unified-style-guide - Naming and formatting conventions137- @automated-unit-testing - TDD scaffolding for this skill's components138139---140> Converted and distributed by [TomeVault](https://tomevault.io/claim/nlelouche) — claim your Tome and manage your conversions.141<!-- tomevault:4.0:skill_md:2026-04-11 -->
Run npx skillmds@latest add tomevault-io/nlelouche-unity3d-antigravityskills-service-layer-generator in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
--- It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.