From harness-engineering
Advise on layered architecture patterns for the current language/framework: correct layer boundaries, dependency direction, and anti-pattern detection. Use when designing a new feature's structure, reviewing an architecture decision, or when code violates layer boundaries. Do NOT use for dependency visualization (use dependency-graph) or execution flow tracing (use code-journey).
npx claudepluginhub toru-oizumi/claude-harness-engineering --plugin harness-engineeringThis skill uses the workspace's default tool permissions.
Language-adaptive architecture guide. Apply the section matching the project's language.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Language-adaptive architecture guide. Apply the section matching the project's language.
Identify language from:
.go → Go, .ts/.tsx → TypeScriptgo.mod → Go, package.json + tsconfig.json → TypeScript<source_root>/
├── handler/ # HTTP/gRPC handlers (thin — delegate to usecase)
├── usecase/ # Application logic (orchestrates domain)
├── domain/ # Entities, repository interfaces, service interfaces
└── infrastructure/ # DB implementations, external API clients, gRPC stubs
handler → usecase → domain ← infrastructure
context.Context must be the first parameter in all functions// domain/repository.go
type UserRepository interface {
FindByID(ctx context.Context, id string) (*User, error)
Save(ctx context.Context, user *User) error
}
// usecase/user_usecase.go
type UserUsecase struct {
repo UserRepository
}
func NewUserUsecase(repo UserRepository) *UserUsecase {
return &UserUsecase{repo: repo}
}
// handler/user_handler.go
type UserHandler struct {
uc *usecase.UserUsecase
}
func NewUserHandler(uc *usecase.UserUsecase) *UserHandler {
return &UserHandler{uc: uc}
}
// handler/grpc/user_server.go
type UserServer struct {
pb.UnimplementedUserServiceServer
uc *usecase.UserUsecase
}
func (s *UserServer) GetUser(ctx context.Context, req *pb.GetUserRequest) (*pb.GetUserResponse, error) {
user, err := s.uc.GetUser(ctx, req.GetId())
if err != nil {
return nil, status.Errorf(codes.NotFound, "user not found: %v", err)
}
return &pb.GetUserResponse{User: toProto(user)}, nil
}
// Use fmt.Errorf with %w for wrapping
return nil, fmt.Errorf("usecase.GetUser: %w", err)
// Sentinel errors in domain
var ErrNotFound = errors.New("not found")
var ErrAlreadyExists = errors.New("already exists")
var db *sql.DB (use constructor injection)context.TODO() in production code (use passed context)<source_root>/
├── api/ # Route handlers (thin — delegate to usecase)
├── usecase/ # Application logic
├── domain/ # Entities, repository interfaces
└── infrastructure/ # DB implementations, external clients
<source_root>/
├── agents/ # Agent definitions (LLM + tools + instructions)
├── tools/ # Tool implementations (atomic actions)
├── workflows/ # Multi-step orchestration (coordinates agents/tools)
└── lib/ # Shared utilities, types, config
api → usecase → domain ← infrastructure
any types in domain or usecase layerszod for all external input validation at the API boundary// tools/fetch-user-tool.ts
export const fetchUserTool = createTool({
id: 'fetch-user',
description: 'Fetch user data by ID',
inputSchema: z.object({ userId: z.string() }),
outputSchema: z.object({ id: z.string(), name: z.string() }),
execute: async ({ context }) => {
return userRepository.findById(context.userId);
},
});
// agents/user-agent.ts
export const userAgent = new Agent({
name: 'UserAgent',
instructions: 'You help manage user data...',
model: anthropic('claude-sonnet-4-6'),
tools: { fetchUserTool },
});
type Result<T, E = Error> = { ok: true; value: T } | { ok: false; error: E };
async function createUser(input: CreateUserInput): Promise<Result<User>> {
if (!input.name) {
return { ok: false, error: new Error('Name is required') };
}
const user = await userRepository.save(new User(input));
return { ok: true, value: user };
}
any type in domain or usecase layerpr-reviewer-3a — Architecture review in PR contextcode-explorer — Visualize current dependency structure