Stats
Actions
Tags
From junjak-ai-harness
Universal coding standards and best practices. Use in Phase 3 (Implementation) as the baseline for Designer agents. Covers readability, KISS, DRY, YAGNI, TypeScript patterns, error handling, and code smell detection.
How this skill is triggered — by the user, by Claude, or both
Slash command
/junjak-ai-harness:coding-standardsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Universal standards applicable across all projects.
Universal standards applicable across all projects.
tsconfig.json MUST include:
{
"compilerOptions": {
"strict": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
"exactOptionalPropertyTypes": true
}
}
any types in production code (use unknown + type narrowing)as casts without a // ts-expect-error: [reason] comment or explicit refinementtype for unions, interface for object shapes that may be extended// ✅ Descriptive names
const isUserAuthenticated = true;
const maxRetryCount = 3;
const fetchUserById = async (id: string) => { ... };
// ❌ Vague names
const flag = true;
const n = 3;
const doStuff = async (x: string) => { ... };
// ✅ Specific error handling
try {
const data = await fetchUser(id);
return data;
} catch (error) {
if (error instanceof NotFoundError) {
return null;
}
throw error; // Re-throw unexpected errors
}
// ❌ Silent swallow
try {
const data = await fetchUser(id);
} catch (error) {
// silently ignored
}
// ✅ Parallel when independent
const [users, posts] = await Promise.all([
fetchUsers(),
fetchPosts(),
]);
// ❌ Sequential when independent
const users = await fetchUsers();
const posts = await fetchPosts();
// ✅ Explicit types at boundaries
function processOrder(order: Order): ProcessedOrder { ... }
// ❌ any/unknown without narrowing
function processOrder(order: any): any { ... }
| Smell | Fix |
|---|---|
| Function > 30 lines | Extract smaller functions |
| Nesting > 3 levels | Early return, extract helpers |
| Magic numbers | Named constants |
| Boolean parameters | Use options object |
| God class/file | Split by responsibility |
| Copy-paste code | Extract shared utility |
| Long parameter list | Use options object or builder |
src/
├── components/ # UI components
├── composables/ # Reusable logic
├── stores/ # State management
├── services/ # API/business logic
├── utils/ # Pure utilities
├── types/ # Type definitions
└── pages/ # Route pages
// ✅ Explain WHY, not WHAT
// Retry with exponential backoff because the payment API
// has intermittent 503s during peak hours
await retryWithBackoff(processPayment, { maxRetries: 3 });
// ❌ Restating the code
// Set count to 0
let count = 0;
npx claudepluginhub junjak/ai-harness --plugin junjak-ai-harnessGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.