From agentic-rosetta
Adversarially stress-test any Rosetta knowledge base. Challenge an agent to implement a universal coding exercise using ONLY the KB, then run an adversarial reviewer against 28 universal anti-patterns to grade the fact graph and emit refactor recommendations. Trigger: /rosetta-validate {tech} [--challenge {id}]
How this skill is triggered — by the user, by Claude, or both
Slash command
/agentic-rosetta:rosetta-validateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **Purpose**: Dynamically validate any Rosetta knowledge base by challenging an agent to implement a universal coding exercise using ONLY the KB, then adversarially review the result to grade the fact graph.
Purpose: Dynamically validate any Rosetta knowledge base by challenging an agent to implement a universal coding exercise using ONLY the KB, then adversarially review the result to grade the fact graph.
Why prompt-based? Languages and frameworks change. Hardcoded probes (like
mutableStateOf in ViewModel) only work for one technology. Prompt-based review asks the LLM to reason about the output, which generalizes across Swift, Kotlin, GPUI, Tauri, or anything new.
INPUT: technology_slug (e.g., "swift", "kotlin", "gpui", "tauri")
INPUT: challenge_id (optional — default: "universal-crud")
[1] DISCOVER ROSETTA
Read: .rosetta/docs/{tech}/README.md
Read: .rosetta/docs/{tech}/fact-graph.json
Read: .rosetta/docs/{tech}/ROSETTA.md
Read: all concept docs in .rosetta/docs/{tech}/*.md
Count: rules, anti-patterns, widgets, traits
[2] SELECT CHALLENGE
Choose from UNIVERSAL CHALLENGE LIBRARY below
The challenge must be implementable in the target technology
If not, fall back to "universal-crud" (always works)
[3] CHALLENGE PROMPT ( implementer mode )
"You are an implementer agent. You have access ONLY to the
Rosetta KB at .rosetta/docs/{tech}/. You may NOT use any
external knowledge, StackOverflow, or training priors.
Implement this spec: {challenge_spec}
Write the minimum code to satisfy all acceptance criteria.
Follow every rule in the fact graph. Avoid every anti-pattern.
After writing each file, briefly cite which KB doc you used."
[4] SELF-REVIEW PROMPT ( reviewer mode )
"You are an adversarial reviewer. Review the code written above.
For each acceptance criterion, rate: PASS / FAIL / PARTIAL.
Then scan for these UNIVERSAL ANTI-PATTERNS (adapted to {tech}):
{universal_anti_patterns}
For each anti-pattern found, cite the file and line.
For each prevented anti-pattern, cite the KB rule that prevented it.
Finally, grade the fact graph:
- Coverage: % of anti-patterns that had KB rules
- False negatives: anti-patterns with no KB rule
- False positives: KB rules that don't apply to real code
- Stub count: placeholder/TODO/empty implementations"
[5] COMPUTE GRADE
Structural coverage = prevented / (prevented + missed)
Subtle bug coverage = subtle_prevented / (subtle_prevented + subtle_missed)
Stub discipline = 1.0 if zero stubs, else 0.0
Overall grade = weighted average:
0.4 * structural + 0.4 * subtle + 0.2 * stub
[6] EMIT REFACTOR RECOMMENDATIONS
For each missed anti-pattern:
- Suggest new fact-graph entry (rule or anti-pattern)
- Suggest new doc section with example
For each false positive:
- Flag for removal or clarification
Output: structured report + proposed fact-graph diff
[7] UPDATE KB (optional, human-gated)
On approval: append new rules to fact-graph.json
On approval: append new anti-patterns to fact-graph.json
On approval: update concept docs with examples
These challenges are designed to stress-test the SAME set of concepts across any technology:
Scope: Single-screen app that loads a list of items from local storage, displays them, allows search/filter, supports pull-to-refresh, and navigates to a detail screen.
What it tests:
Technology-specific variants:
Scope: Search bar with debounced query, real-time results, highlighting, empty states, error handling.
What it tests:
Scope: Login form → validation → API call → token storage → conditional routing → logout.
What it tests:
Scope: Offline-first app that creates items offline, then syncs on reconnect. Tests conflict resolution when server has newer data.
What it tests:
When reviewing ANY technology, check for these universal anti-patterns adapted to the target framework:
UNIVERSAL ANTI-PATTERNS (adapt per technology):
A. STATE MANAGEMENT
1. Using wrong state primitive (e.g., local state for shared data)
2. Directly mutating state from child instead of event-up pattern
3. Missing state initialization (undefined/null until first load)
4. State split across multiple sources of truth
B. LIFECYCLE / MEMORY
5. Resource leak (stream subscription, timer, listener not cleaned up)
6. Holding reference to destroyed scope / view / component
7. Calling lifecycle-sensitive API after teardown
C. REACTIVE DATA
8. Blocking operation on UI thread
9. Infinite collection of reactive stream (never completes)
10. Missing error handling on async/reactive chain
11. Fetching all data then filtering client-side (N+1 or full-scan)
D. NAVIGATION / ROUTING
12. Navigating between sibling states (loading/success/error are states, not routes)
13. Hardcoded route strings instead of typed navigation
14. Navigation state not restored on config change / process death
E. STYLING / ACCESSIBILITY
15. Hardcoded colors / spacing / fonts outside theme system
16. Missing accessibility labels on interactive elements
17. Fixed-size text (not respecting user font preference)
18. Touch target smaller than recommended minimum
F. DEPENDENCY INJECTION
19. Manual instantiation bypassing DI graph
20. Service locator / global singleton for testable deps
21. Constructor injection through entire view tree (prop drilling)
G. ASYNC / CONCURRENCY
22. Fire-and-forget async without cancellation / error handling
23. Race condition (multiple parallel writes to same state)
24. Deadlock or blocking await on UI thread
H. COMPLETENESS
25. Stub / placeholder / TODO in required behavior
26. Happy-path only (no error state handling)
27. Missing empty state
28. Loading state missing or flickers
Instructions for reviewer: For each anti-pattern above, determine if the KB has a rule that would prevent it. If yes → mark PREVENTED and cite the rule. If no → mark MISSED and suggest a new rule.
technology: swift
challenge: universal-crud
files_written: 13
lines_of_code: ~450
structural_anti_patterns:
total: 12
prevented: 12
missed: 0
coverage: 100%
subtle_bugs:
total: 5
prevented: 2
missed: 3
coverage: 40%
missed_details:
- id: "fixed-font-size"
file: EmptyStateView.swift:96
issue: "Used .system(size: 64) for decorative icon"
kb_gap: "No example for large decorative icons with Dynamic Type"
suggested_fix: "Add anti-pattern: .system(size:) for icons → .font(.largeTitle) + .accessibilityHidden(true)"
- id: "filter-in-body"
file: TaskListView.swift:14
issue: "Computed property filters allTasks in view body"
kb_gap: "No pattern for dynamic @Query predicates with user-selected filters"
suggested_fix: "Add dynamic predicate example to swiftdata.md"
- id: "viewmodel-in-state"
file: TaskListView.swift:6
issue: "@State private var viewModel = TaskListViewModel()"
kb_gap: "@Observable VM + @Environment pattern not prominent enough"
suggested_fix: "Add complete @Environment injection example to state-management.md"
stub_discipline:
stubs_found: 1
files: [TaskAPIService.swift]
grade: FAIL
overall_grade: B- (76%)
- Structural: A+ (100%)
- Subtle bugs: C (40%)
- Stub discipline: F (1 stub)
recommended_fact_graph_changes:
additions:
- rule: "Fixed .system(size:) for decorative icons → use .font(.largeTitle)"
- anti-pattern: "Filter in view body instead of @Query predicate → push to DB"
- doc_section: "Dynamic @Query predicates with user-selected filters"
removals: []
clarifications:
- doc: state-management.md
section: @Observable + @Environment
issue: "Pattern exists but not prominent; needs complete example"
{
"x_add": {
"Fixed .system(size:) for icons": "Use .font(.largeTitle) + .accessibilityHidden(true)",
"Filter all rows in view body": "Use @Query(filter: #Predicate { ... }) to push filter to DB"
},
"r_add": {
"Fixed .system(size:) for text/icons": "REJECT",
"Filter in view body when predicate available": "REJECT"
},
"w_add": {
"accessibilityHidden": {
"t": "modifier",
"i": "SwiftUI",
"note": "Hides decorative elements from VoiceOver"
}
}
}
/rosetta-validate swift --challenge universal-crud
rosetta-bootstrap — creates the Rosetta knowledge baserosetta-research — graceful-degradation research used during bootstrap/gap-fillingrosetta-upgrade — before/after upgrade test with fact-graph expansionreference/universal-anti-patterns.md. A per-technology probe catalog (generated by rosetta-bootstrap) lives at .rosetta/probes/{tech}.md.rosetta-validate — Plugin skill for agentic-rosetta Strategy: Prompt-based adversarial review of KB effectiveness via universal challenges.
npx claudepluginhub justincrich/agentic-rosetta --plugin agentic-rosettaProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.