add-example
БесплатноЗапускает вложенные скриптыНе проверенAdd new example use cases to the Examples feature, including file setup, metadata registration, thumbnail generation, and link verification. Use when a…
Об этом скилле
Add Example Use Case
Guide for adding new use cases to the Examples feature when contributors provide sample files.
Prerequisites
- Use case files from contributor (PDF, PNG, TXT, etc.)
- Use case metadata: name, description, category
- Python with uv package manager installed
Step-by-Step Process
Phase 1: Gather Information
Ask the user for:
- Use case name (English or Japanese)
- Use case description
- Category tags: See
ExampleTagtype infrontend/src/features/examples/types/index.ts - Language:
enorja - Files provided with types:
checklist,review,knowledge - Location of files provided by contributor
Phase 2: Prepare Files in Repository
- Read
frontend/src/features/examples/data/examples-metadata.json - Determine next available use case number:
- Check existing IDs in the appropriate language array
- Use
use_case_NNNfor English oruse_case_NNN_jafor Japanese
- Create directory:
examples/{language}/use_case_NNN_descriptive_name/ - Copy contributor files, organize by type, use descriptive filenames
Phase 3: PDF Design (Optional)
If the use case includes multiple PDF files requiring visual differentiation:
Read references/PDF-DESIGN.md for design strategy, layout patterns, and reportlab generation instructions.
Phase 4: Generate GitHub URLs
For each file, construct the raw GitHub URL:
https://raw.githubusercontent.com/aws-samples/review-and-assessment-powered-by-intelligent-documentation/main/examples/{lang}/{folder}/{file}
Important: Japanese characters MUST be URL-encoded using encodeURIComponent().
Phase 5: Update Metadata
Edit frontend/src/features/examples/data/examples-metadata.json:
{
"id": "use_case_NNN",
"name": "Use Case Display Name",
"tags": ["tag1", "tag2"],
"description": "What this use case demonstrates",
"hasKnowledgeBase": true,
"files": [
{
"id": "checklist_NNN",
"name": "checklist_file.pdf",
"type": "checklist",
"url": "https://raw.githubusercontent.com/.../checklist_file.pdf"
}
]
}
- Set
hasKnowledgeBase: trueonly if knowledge files are included - Ensure JSON syntax is valid
Phase 6: Add New Category Tags (if needed)
Only if introducing NEW tags - requires updating three locations:
1. TypeScript Type Definition
Edit frontend/src/features/examples/types/index.ts - add new tag to ExampleTag union type.
2. UI Components
Add tag with emoji icon to both:
frontend/src/features/examples/components/TagFilter.tsx(tagsarray)frontend/src/features/examples/components/OnboardingModal.tsx(industriesarray)
Use the same emoji in both components.
3. Translations
Add to both frontend/src/i18n/locales/en.json and ja.json:
"examples": {
"tagNewTag": "Display Name"
}
Tag naming convention: Tag ID: new-tag (kebab-case) -> Translation key: examples.tagNewTag (camelCase with prefix)
Phase 7: Generate Thumbnails
Run the thumbnail generation script:
# First time only: install dependencies
cd .claude/skills/add-example && uv venv && uv pip install -e .
# Run script (from project root)
cd .claude/skills/add-example && source .venv/bin/activate
python scripts/generate_thumbnails.py
The script:
- Reads examples-metadata.json
- Downloads files from GitHub CDN URLs
- Converts PDFs to images (first page only)
- Generates 800x1200px JPEG images (85% quality)
- Saves to
frontend/public/examples/images/{example_id}/ - Updates metadata with
imagePathfields
Phase 8: Verify GitHub URLs
Test every GitHub URL in the metadata to ensure accessibility:
- Parse
frontend/src/features/examples/data/examples-metadata.json - Extract all
urlfields from bothenandjaarrays - Test each URL (WebFetch or HTTP GET with 10s timeout)
- Report results:
- Total URLs tested
- Working (HTTP 200) vs broken
- List of broken URLs with status codes
All URLs must return HTTP 200 for the example to be complete.
Phase 9: Local Testing (Optional)
cd frontend && npm run dev
Navigate to http://localhost:5173/examples and verify:
- New use case appears in the list
- Tag filtering works correctly
- Images display in thumbnail grid and modal zoom
File Structure Reference
examples/
├── en/use_case_NNN_descriptive_name/
│ ├── checklist_file.pdf
│ ├── review_file.png
│ └── knowledge_base_sources/ (optional)
└── ja/ユースケースNNN_説明的な名前/
└── ファイル.pdf
ID Assignment Rules
- Use Case ID:
use_case_{next_number}oruse_case_{next_number}_ja - File ID:
{type}_{number}or{type}_{number}_ja
Success Criteria
- Files added to correct language directory under
examples/ - Metadata entry added with all required fields (id, name, tags, description, files)
- File URLs properly encoded
- Thumbnails generated with
imagePathin metadata - All GitHu
Установить add-example в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл add-example?
Add new example use cases to the Examples feature, including file setup, metadata registration, thumbnail generation, and link verification. Use when a contributor provides PDF/PNG/TXT files for a new use case, when adding entries to the Examples page, or when verifying existing example GitHub URLs are accessible.
Как установить скилл add-example?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл add-example запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic