From arch-guard
This skill should be used when the user asks "generate implementation", "implement interface", "create stubs", "implement", "generate class from interface", or wants to generate implementation classes and unit test stubs from Contracts interfaces following the architecture rules in arch-guard.json. Creates sealed classes with constructor injection and empty test methods.
How this skill is triggered — by the user, by Claude, or both
Slash command
/arch-guard:implementThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generates implementation classes and unit test stubs from Contracts interfaces. **Does not write business logic** — only `throw new NotImplementedException()` stubs.
Generates implementation classes and unit test stubs from Contracts interfaces. Does not write business logic — only throw new NotImplementedException() stubs.
/implement MyApp.Execution.Workflow IStepExecutor
/implement MyApp.Execution.Workflow # lists interfaces if not specified
Read arch-guard.json from the project root before starting. This is the single source of truth for all rules.
config.layers[].pattern to identify its layerconfig.project.source_root{project} not found. Run /scaffold {project} to create it first."{layer_base}.{config.contracts.project_suffix}config.contracts.interface_dir)/contract-first first."Important: Never generate implementations for interfaces not defined in Contracts.
From arch-guard.json, determine allowed references for this project type:
config.references.intra_layer[] for same-layer referencesconfig.references.cross_layer[] for cross-layer referencesconfig.references.forbidden[] to identify what must be avoided.csproj for .NET) and report missing required referencesIf config.docs.architecture is set, read the architecture document and verify the interface being implemented fits within this project's responsibilities.
Create {source_root}/{project}/Services/{ClassName}.cs:
namespace {project_namespace}.Services;
public sealed class {ClassName} : {InterfaceName}
{
private readonly ILogger<{ClassName}> _logger;
public {ClassName}(ILogger<{ClassName}> logger)
{
_logger = logger;
}
// Stub for each interface method
public {ReturnType} {MethodName}({Parameters})
{
throw new NotImplementedException();
}
}
Rules:
sealed classILogger<T> by defaultthrow new NotImplementedException() stubsCreate {test_root}/{project}.Tests.Unit/{ClassName}Tests.cs. Generate tests that fail against the NotImplementedException stubs.
Test Category: Contract Compliance (always generated):
namespace {project}.Tests.Unit;
public class {ClassName}Tests
{
private readonly {InterfaceName} _sut;
public {ClassName}Tests()
{
_sut = new {ClassName}(NullLogger<{ClassName}>.Instance);
}
[Fact]
public void {MethodName}_Should_Not_Throw_NotImplementedException()
{
// Act & Assert — RED when stub throws NotImplementedException
var exception = Record.Exception(() => _sut.{MethodName}({default_params}));
Assert.IsNotType<NotImplementedException>(exception);
}
[Fact]
public void {MethodName}_Should_Return_Valid_Result()
{
// Act
var result = _sut.{MethodName}({default_params});
// Assert
Assert.NotNull(result);
}
}
Rules:
NotImplementedException stubsNullLogger<T>.Instance (Microsoft.Extensions.Logging.Abstractions)Record.Exception() + Assert.IsNotType<NotImplementedException>() patternVerify the generated code against config.references.forbidden[] and config.forbidden_patterns[]:
## /implement Complete
### Generated Files
| File | Type |
|------|------|
| {source_root}/{project}/Services/{Class}.cs | Implementation stub |
| {test_root}/{project}.Tests.Unit/{Class}Tests.cs | Unit tests (RED) |
### Reference Verification
- Required references: OK/WARNING
- Forbidden references: OK/WARNING
### Responsibility Check
- Architecture boundary: OK/WARNING
Recommend next steps using slash command format:
| Situation | Recommendation |
|---|---|
| RED tests ready, start implementing | /tdd {project} {class} |
| After filling stubs, verify compliance | /impl-review {project} |
| More interfaces to implement in same project | /implement {project} {next-interface} |
| Need architecture guard-rail tests | /test-gen |
| Different project implementation | /contract-first {other-project} |
/contract-firstProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
npx claudepluginhub jaebit/claudemate --plugin arch-guard