architecture
Skill44 starsChanged 6 months agoMITView on GitHub
Clean Architecture (Uncle Bob) guide for this project. Use when creating modules, entities, use cases, presenters, controllers, gateways, guards, services. Contains tactical patterns and structure conventions.
144 other projects use a version of this.
Adopted by
Most recently taken up by
- AtilaMedeiros/skillstheir own version, first seen Nov 16, 2026
- ieuanign/skillstheir own version, first seen Nov 16, 2026
- Ivan-propio/claude-skillstheir own version, first seen Nov 16, 2026
- Birdiz/skillstheir own version, first seen Nov 16, 2026
- ohvignas/lancetonsitetheir own version, first seen Nov 16, 2026
- patrickjaja/claude-desktop-extratheir own version, first seen Nov 15, 2026
Used with
Projects with it also use intelligent-routing, bash-linux and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SKB3002Skillintelligent-routing
Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.
Also in 6 projects that use this
xenitV1Skillbash-linux
Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS or Linux systems.
Also in 9 projects that use this
xenitV1Skillred-team-tactics
Red team tactics principles based on MITRE ATT&CK. Attack phases, detection evasion, reporting.
Also in 9 projects that use this
SKB3002Skillnextjs-react-expert
React and Next.js performance optimization from Vercel Engineering. Use when building React components, optimizing performance, eliminating waterfalls, reducing bundle size, reviewing code for performance issues, or implementing server/client-side optimizations.
Also in 3 projects that use this
CES-LtdSkilloss-pr
Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.
Also in 3 projects that use this
- +7 more from xenitV1
Other versions144 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 144
- anthropics/knowledge-work-plugins★ 36ksame name
- iOfficeAI/AionUi★ 34ksame name
- vudovn/ag-kit★ 8.2ksame name
- vudovn/antigravity-kit★ 8.2ksame name
- nativewind/nativewind★ 8.1ksame name
- PaulWoitaschek/Voice★ 3.3ksame name
- wellwelwel/poku★ 1.2ksame name
- patrickjaja/claude-desktop-extra★ 761same name
- Alwurts/simple-ai★ 755same name
- ktnyt/cclsp★ 673same name
134 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agent-creatorSkill
- anti-overengineeringSkill
- audit-docsSkill
- auto-reviewSkill
- clean-codeSkill
- commitSkill
- create-docSkill
- dddSkill
- discoverySkill
- docs-indexSkill
- e2eSkill
- event-stormingSkill
- implement-featureSkill
- product-managerSkill
- refactor-featureSkill
- refactoring-mikado-stranglerSkill
- review-backSkill
- review-docSkill
- review-followupSkill
- review-frontSkill
- review-fullstackSkill
- securitySkill
- shipSkill
- skill-creatorSkill
- solidSkill
- dashboard-stylingSkill
- tddSkill
- update-docsSkill
- worktreeSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 124 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Read .claude/roles/architect.md — adopt this profile and follow all its rules.
- Distinctive: line 298
No business logic in Controllers
- Distinctive: line 299
No presentation logic in Use Cases
- Distinctive: line 300
No infrastructure awareness in Entities
“Common” is measured: kept by at least 6 in 10 of the 124 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.
Files
Clean Architecture - Tactical Guide
Persona
Read .claude/roles/architect.md — adopt this profile and follow all its rules.
Activation
This skill activates for any creation or modification of architectural components:
- Entities, Use Cases, Presenters
- Controllers, Gateways, Guards
- Services
- Module structure
Core Principle
"The architecture should scream the intent of the system." — Uncle Bob
┌─────────────────────────────────────┐
│ Interface Adapters │ ← Controllers, Presenters, Gateways
├─────────────────────────────────────┤
│ Use Cases │ ← Application Business Rules
├─────────────────────────────────────┤
│ Entities │ ← Enterprise Business Rules
└─────────────────────────────────────┘Dependency Rule: Dependencies point inward. The domain knows nothing about infrastructure.
Module Structure
src/
├── entities/
│ └── <entity>/
│ ├── <entity>.ts # Entity + business logic
│ ├── <entity>.schema.ts # Zod schema
│ ├── <entity>.guard.ts # Boundary validation
│ └── <entity>.gateway.ts # Interface (port)
├── usecases/
│ └── <action><Entity>.usecase.ts
├── interface-adapters/
│ ├── controllers/
│ │ ├── webhook/
│ │ │ └── <platform>.controller.ts
│ │ ├── http/
│ │ │ └── <feature>.routes.ts
│ │ └── mcp/
│ │ └── <action>.handler.ts
│ ├── presenters/
│ │ └── <feature>.presenter.ts
│ ├── gateways/
│ │ └── <entity>.<source>.gateway.ts
│ └── adapters/
│ └── <platform>.adapter.ts
├── shared/
│ └── foundation/
│ ├── usecase.base.ts
│ ├── guard.base.ts
│ ├── gateway.base.ts
│ └── presenter.base.ts
└── tests/
├── units/
├── factories/
├── stubs/
└── mocks/Components
Entity
Pure business logic, independent of any framework.
// entities/review/reviewScore.valueObject.ts
export class ReviewScore {
private constructor(private readonly props: ReviewScoreProps) {}
static create(props: ReviewScoreProps): ReviewScore {
const validated = ReviewScoreSchema.parse(props);
return new ReviewScore(validated);
}
get blocking(): number {
return this.props.blocking;
}
get severity(): Severity {
if (this.blocking > 0) return 'critical';
if (this.warnings > 0) return 'warning';
if (this.suggestions > 0) return 'info';
return 'clean';
}
get hasBlockingIssues(): boolean {
return this.blocking > 0;
}
}Use Case
Orchestrates a business action. One use case = one user intention.
// usecases/triggerReview.usecase.ts
export function triggerReview(
params: TriggerReviewParams,
deps: TriggerReviewDependencies
): TriggerReviewResult {
const { queuePort, reviewRequestTrackingGateway, logger } = deps;
const jobId = queuePort.createJobId(params.platform, params.projectPath, params.reviewRequestNumber);
if (queuePort.hasActiveJob(jobId)) {
return { status: 'deduplicated', reason: 'Review already in progress' };
}
const enqueued = queuePort.enqueue(job);
if (!enqueued) {
return { status: 'failed', reason: 'Queue full or job rejected' };
}
reviewRequestTrackingGateway.recordPush(params.localPath, params.reviewRequestNumber, params.platform);
return { status: 'success', jobId };
}Presenter
Transforms business data into a ViewModel. Contains ALL presentation logic.
// interface-adapters/presenters/reviewList.presenter.ts
export class ReviewListPresenter {
constructor(private jobPresenter: JobStatusPresenter) {}
present(active: JobStatus[], recent: JobStatus[]): ReviewListViewModel {
const activeJobs = active.map(job => this.jobPresenter.present(job));
const recentJobs = recent.map(job => this.jobPresenter.present(job));
const totalCount = activeJobs.length + recentJobs.length;
return {
activeJobs,
recentJobs,
totalCount,
isEmpty: totalCount === 0,
emptyMessage: 'No active reviews',
};
}
}ViewModel
Simple data structure. Formatted strings, UI booleans. Defined with a TypeScript interface.
// interface-adapters/presenters/reviewList.presenter.ts
export interface ReviewListViewModel {
activeJobs: JobStatusViewModel[];
recentJobs: JobStatusViewModel[];
activeCount: number;
recentCount: number;
totalCount: number;
isEmpty: boolean;
emptyMessage: string;
}Controller
Orchestrates Use Case + Presenter. Entry point for an action.
// interface-adapters/controllers/webhook/github.controller.ts
export async function handleGitHubWebhook(
request: FastifyRequest,
reply: FastifyReply,
logger: Logger,
trackingGateway: ReviewRequestTrackingGateway,
deps: GitHubWebhookDependencies
): Promise<void> {
const { trackAssignment, recordCompletion } = deps;
const verification = verifyGitHubSignature(request);
if (!verification.valid) {
reply.status(401).send({ error: verification.error });
return;
}
// Orchestrate use cases...
}Gateway
Interface (port) in entities, implementation in interface-adapters.
// entities/reviewContext/reviewContext.gateway.ts (CONTRACT)
export interface ReviewContextGateway {
create(input: CreateReviewContextInput): CreateReviewContextResult;
read(localPath: string, mergeRequestId: string): ReviewContext | null;
exists(localPath: string, mergeRequestId: string): boolean;
appendAction(localPath: string, mergeRequestId: string, action: ReviewContextAction): UpdateResult;
}
// interface-adapters/gateways/reviewContext.fileSystem.gateway.ts (IMPLEMENTATION)
export class ReviewContextFileSystemGateway implements ReviewContextGateway {
read(localPath: string, mergeRequestId: string): ReviewContext | null {
const filePath = this.getFilePath(localPath, mergeRequestId);
if (!existsSync(filePath)) return null;
const content = readFileSync(filePath, 'utf-8');
return JSON.parse(content) as ReviewContext;
}
}Guard
Boundary validation with Zod.
// entities/reviewContext/reviewContextAction.guard.ts
export const reviewContextActionGuard = createGuard(reviewContextActionSchema);
export function parseReviewContextAction(data: unknown): ReviewContextAction {
return reviewContextActionGuard.parse(data);
}
export function isValidReviewContextAction(data: unknown): data is ReviewContextAction {
return reviewContextActionGuard.safeParse(data).success;
}
export function parseReviewContextActions(data: unknown): ReviewContextAction[] {
return reviewContextActionsGuard.parse(data);
}Service
Utilities injected via Dependencies.
| Scope | Location |
| Cross-context | shared/services/ |
| Specific to bounded context | interface-adapters/gateways/ or services/ |
Dependency Injection
Via composition root in src/main/routes.ts. See references.md for details.
// main/routes.ts — the "dirty" component (Uncle Bob Ch. 26)
app.post('/webhooks/github', async (request, reply) => {
await handleGitHubWebhook(request, reply, deps.logger, trackingGw, {
reviewContextGateway: deps.reviewContextGateway,
threadFetchGateway: new GitHubThreadFetchGateway(defaultGitHubExecutor),
trackAssignment: new TrackAssignmentUseCase(trackingGw),
recordCompletion: new RecordReviewCompletionUseCase(trackingGw),
});
});Test Doubles
tests/
├── stubs/
│ └── reviewContextGateway.stub.ts # Happy path
├── factories/
│ └── reviewContext.factory.ts # Test data creation
└── mocks/See examples.md for concrete examples.
Anti-patterns to Avoid
- No business logic in Controllers
- No presentation logic in Use Cases
- No infrastructure awareness in Entities
- No outward-pointing dependencies
- No
as Typeassertions — use guards with Zod
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
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.

