Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add majiayu000/spellbook --skill elegant-architecturegit clone --depth 1 https://github.com/majiayu000/spellbookWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/majiayu000/spellbook/elegant-architecture)<a href="https://agentmods.dev/skills/majiayu000/spellbook/elegant-architecture"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/elegant-architecture/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/majiayu000/spellbook/elegant-architecture"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/elegant-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00043 | $0.01705 |
| Opus 5 | $0.00022 | $0.00852 |
| Sonnet 5 | $0.00009 | $0.00341 |
| Haiku 4.5 | $0.00004 | $0.00170 |
Grade A, and why
elegant-architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 299 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Elegant Architecture
Core Principles
- 200-line limit — No file exceeds 200 lines of code
- Split when exceeded — Convert to folder or multiple files
- Plan first, code later — Design architecture before implementation
- Single responsibility — Each module does one thing well
- Real tests only — No mocks, test actual behavior
Execution Flow
1. Analyze Requirements
Before writing any code:
- List all features/functionalities needed
- Estimate code volume for each module
- Identify shared components
- Map dependencies between modules
2. Design File Structure
When estimated lines > 200:
- Convert file to folder with index
- Split by sub-functionality
- Extract shared utilities
Example transformation:
# Before (user.ts - 400+ lines)
user.ts
# After (user/ folder)
user/
├── index.ts # Public exports
├── types.ts # Interfaces, types
├── validation.ts # Input validation
├── repository.ts # Data access
└── service.ts # Business logic
3. Define Interfaces First
// Define contracts before implementation
interface UserService {
create(input: CreateUserInput): Promise<User>;
findById(id: string): Promise<User | null>;
update(id: string, input: UpdateUserInput): Promise<User>;
delete(id: string): Promise<void>;
}
interface UserRepository {
save(user: User): Promise<User>;
findById(id: string): Promise<User | null>;
findByEmail(email: string): Promise<User | null>;
delete(id: string): Promise<void>;
}
4. Implement Incrementally
For each module:
1. Create type definitions
2. Implement core logic
3. Add error handling
4. Write tests
5. Verify line count < 200
5. Test Without Mocks
// ❌ Avoid: Mock everything
const mockRepo = jest.fn();
const service = new UserService(mockRepo);
// ✅ Prefer: Real implementations
const testDb = createTestDatabase();
const repo = new UserRepository(testDb);
const service = new UserService(repo);
// Test actual behavior
const user = await service.create({ email: '[email protected]' });
const found = await service.findById(user.id);
expect(found).toEqual(user);
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 299 lines · 43 tokens per session scan A e7c3a12d8989
elegant-architecture is a skill published in the GitHub repository majiayu000/spellbook (278 stars, last pushed yesterday), licensed MIT. It adds 43 tokens to every session and 1,705 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
base
Universal coding patterns, constraints, TDD workflow, atomic todos.
pneuma-session
Instructions for renaming an active Pneuma session and replacing its default preview with a useful title and summary. A Pneuma session is one work area inside a larger project.
coding-flow
Light coding workflow: features, fixes, refactors, unit tests, etc.; scales small to large.
coding-agents-prompting-flow
Workflow for authoring and adapting AI-agent prompts: skills, agents, workflows, rules, etc.
pipeline-efficiency-benchmark
A repeatable benchmark for comparing different versions of a development pipeline. It runs the same public tasks in isolated workspaces and records scores, tokens, time, tool calls, and cost.
x-qdev
A compact development workflow for a small, clearly defined code change. It keeps the requirement, initially failing tests, implementation, and real verification results in one task document, following TDD, or test-driven development.