my 2nd response to TLDR - Prompts don't scale. MCPs don't scale. Hooks do.
Concrete Examples
1. Layer Enforcement (Transport can't call Capability)
const CAPABILITY_PATTERN = /\w+Capability\.shared\./
export const noCapabilityInTransportRule: FileRule = {
name: 'noCapabilityInTransport',
active: true,
check(params: FileRuleCheckParams): RuleCheckResult {
// Only check Transport files
const isTransport = params.filePath.includes('/Transport/')
|| params.filePath.endsWith('HTTP.swift')
if (!isTransport) return { matched: false }
const match = params.content.match(CAPABILITY_PATTERN)
if (match) {
return {
matched: true,
violation: `[swift] noCapabilityInTransport violation
File: ${params.filePath}
Found: ${match[0]}
CONSTRAINT: Transport -> Intent (not Capability)
CORRECT:
await IntentExecutor.shared.trigger(.context(.action), source: .http)`
}
}
return { matched: false }
}
}2. Architecture Injection on First Read
3. Locality Enforcement (MVI Pattern)
Summary
Category
Example
Linter can do?
Last updated
Was this helpful?