From arch-guard
This skill should be used when the user asks "do contracts exist?", "can I start implementing?", "contract-first check", "are interfaces defined?", "define interfaces", "suggest interfaces", "fill contracts", or wants to verify that the layer's Contracts project exists and required interfaces are defined before writing implementation code. Can also design and generate interfaces interactively.
How this skill is triggered — by the user, by Claude, or both
Slash command
/arch-guard:contract-firstThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Verifies that the layer's Contracts project exists and required interfaces are defined before implementation begins.
Verifies that the layer's Contracts project exists and required interfaces are defined before implementation begins.
/contract-first MyApp.Execution.Workflow
Without arguments, targets the project of recently changed files (from git diff).
Read arch-guard.json before starting. If not found, suggest /setup first.
Match the target project against config.layers[].pattern to find its layer and the corresponding Contracts project.
The Contracts project name follows the pattern: {layer_base}.{config.contracts.project_suffix}
Verify:
config.project.source_root.csproj for .NET)Scan the target implementation project for types it references or should implement. Check if corresponding interfaces exist in Contracts.
For .NET:
grep -rn 'interface I' {contracts_dir} --include='*.cs'
Compare against implementation references to identify gaps.
If blocked:
## Contract-First Check
### Target: {project} (L{level})
### Contracts: {contracts_project}
### Status: BLOCKED
- {contracts_project} does not exist.
- Run `/scaffold {contracts_project}` first.
If ready:
### Status: READY
- Contracts project exists
- {interface1} defined
- {interface2} defined
### Undefined Interfaces (define before implementing):
- WARNING: {InterfaceName} — used in implementation but not in Contracts
Next steps based on result:
| Result | Recommendation |
|---|---|
| BLOCKED (Contracts missing) | /scaffold {layer}.Contracts |
| WARNING — undefined interfaces | Proceed to Step 5 (Interface Design Mode) |
| READY | Start implementation, then → /arch-check to verify |
Only runs Steps 5-9 when undefined interfaces are detected. Skipped for BLOCKED or READY paths.
Analyze the target project's responsibilities based on:
arch-guard.json layer definition and roleconfig.docs.architecture is set)Produce: candidate interface list with rationale.
Present structured proposals:
## Interface Proposals
### Rationale: Based on {layer_name} layer responsibilities
| # | Interface | Method Signature | Rationale |
|---|-----------|-----------------|-----------|
| 1 | IStepExecutor | Task<StepResult> ExecuteAsync(StepContext, CancellationToken) | Core execution contract |
| 2 | ITransitionResolver | StepId ResolveNext(WorkflowState, StepResult) | State transition logic |
Review:
- Add/change/remove any interfaces?
- Method signature adjustments?
Rules:
Iterate until user confirms with "OK", "proceed", "generate", etc. Do not create files before confirmation.
For .NET: Create {contracts_dir}/{config.contracts.interface_dir}/{InterfaceName}.cs:
namespace {contracts_namespace}.Interfaces;
/// <summary>
/// {description}
/// </summary>
public interface {InterfaceName}
{
{method signatures};
}
Rules:
{contracts_dir}/{config.contracts.model_dir}/Re-run Steps 2-3 to confirm, then report:
## Contract-First Check (Interface Design Complete)
### Generated Interfaces
| File | Purpose |
|------|---------|
| Interfaces/IStepExecutor.cs | Core execution contract |
| Models/StepResult.cs | IStepExecutor return type |
### Status: READY
### Next Steps
- Start implementing the target project
- After implementation: /arch-check to verify compliance
npx claudepluginhub jaebit/claudemate --plugin arch-guardProvides 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.