Agent skill

reference-educational-template

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/testing/reference-educational-template

SKILL.md

Reference-Educational Template

Purpose

This template demonstrates educational content delivery with concept explanation, examples, and anti-patterns.

Use this template when:

  • Teaching concepts or design patterns
  • Explaining language features
  • Demonstrating best practices
  • Showing common mistakes to avoid

Workflow

Phase 1: Explain Concept

Phase 2: Show Examples

Phase 3: Demonstrate Patterns

Phase 4: Highlight Pitfalls

Progressive Disclosure

Core content (this file):

  • Concept explanation
  • Basic examples
  • When to use guidance

Detailed examples (references/):

  • @references/type-guard-examples.md - Complete pattern demonstrations
  • Advanced techniques and edge cases

Example Usage

xml
<explain>
Type guards are TypeScript constructs that narrow types within conditional blocks.
They allow the compiler to understand type refinement based on runtime checks.

Why: TypeScript needs runtime evidence to narrow union types safely.
When: Use when working with union types or unknown data.
</explain>

<examples>
Basic typeof guard:
```typescript
function process(value: string | number) {
  if (typeof value === "string") {
    return value.toUpperCase();
  }
  return value.toFixed(2);
}

See Also

  • @references/type-guard-examples.md - Comprehensive type guard patterns

Didn't find tool you were looking for?

Be as detailed as possible for better results