add-feature
БесплатноБез исполняемых скриптовНе проверенScaffold a new toggleable feature with full structure, storage, API exposure, and bootstrap registration
от diegosouzapw★ 68 звёзд на GitHubОб этом скилле
Add Feature Skill
Usage
/add-feature <featureName>
Step 1: Ask Questions
Before creating files, gather this information:
1. Game Data (CRITICAL)
Does this feature need game data?
A) Static data → MGData
B) Real-time state → Globals
C) Both → MGData + Globals
D) None
If A or C (Static data), specify which:
[ ] Plants - definitions, growth stages, harvest data
[ ] Items - definitions, categories, properties
[ ] Pets - definitions, abilities, stats
[ ] Mutations - definitions, effects
[ ] Shops - configurations (not stock)
[ ] Recipes - crafting recipes
[ ] Other: ___________
If B or C (Real-time), specify which:
[ ] currentTile - player's current tile
[ ] myGarden - player's garden state
[ ] myInventory - player's inventory
[ ] myPets - player's pets
[ ] players - other players in room
[ ] shops - current shop stock
[ ] weather - current weather
[ ] gameMap - full map data
[ ] Other: ___________
2. UI Type
A) Gemini HUD only - UI in Gemini overlay
B) Game UI injection - Modifies existing game UI (src/ui/inject/qol/<name>/)
C) Both - Feature logic + game UI injection
D) No UI - Backend/logic only
3. Sprites (if UI selected)
Does the UI need game sprites?
A) Yes → MGSprite.show() / MGSprite.toCanvas()
B) No - Text/icons only
If A, which types?
[ ] Plant sprites [ ] Item sprites [ ] Pet sprites
[ ] Cosmetic sprites [ ] Tile sprites [ ] Other: ___
4. UI Components (if UI selected)
Does the UI need existing components?
→ REUSE, never recreate!
[ ] ArcadeButton, GeminiIconButton → Buttons
[ ] Modal → Dialogs/popups
[ ] ProgressBar → Progress indicators
[ ] SegmentedControl → Tab-like selection
[ ] Tab → Tabs
[ ] SoundPicker → Audio selection
[ ] Other from src/ui/components/
5. Module Dependencies
[ ] MGCalculators - XP, prices, growth time calculations
[ ] MGCosmetic - Player cosmetic data
[ ] MGTile - Map/tile utilities
[ ] MGAudio - Sound effects, notifications
[ ] MGShopActions - Buy/sell operations
[ ] MGEnvironment - World/environment data
[ ] None
6. WebSocket
A) Outgoing actions - Sends messages (api.ts)
B) Incoming handlers - Reacts to server messages
C) Middleware - Intercept/block/modify outgoing messages
D) Multiple (specify which)
E) None
If C (Middleware), specify:
[ ] Intercept specific message types
[ ] Modify payload before sending
[ ] Block messages based on conditions
[ ] Log/track outgoing messages
Which message types? ___________
7. Brief Description
One sentence for documentation:
Step 2: Create Structure
src/features/<featureName>/
├── types.ts # Config, constants, types
├── state.ts # Storage operations
├── index.ts # Public API (MG<FeatureName>)
├── logic/
│ └── core.ts # Business logic
├── ui.ts # (if HUD UI)
├── handler.ts # (if incoming WS)
└── middleware.ts # (if WS middleware)
Naming Conventions
- Folder:
camelCase→src/features/autoHarvest/ - Public API:
MG<PascalCase>→MGAutoHarvest - Storage key:
SCREAMING_SNAKE→AUTO_HARVEST - Storage value:
feature:<camelCase>:config→feature:autoHarvest:config
File Responsibilities
| File | Purpose |
|---|---|
types.ts |
Config interface with enabled: boolean, STORAGE_KEY, DEFAULT_CONFIG |
state.ts |
loadConfig(), saveConfig(), updateConfig() |
index.ts |
MG<Name> with init, destroy, isEnabled, setEnabled |
logic/core.ts |
start(), stop(), cleanups[] array |
ui.ts |
HUD components (reuse existing!) |
handler.ts |
registerHandlers() for incoming WS |
middleware.ts |
registerFeatureMiddleware(), unregisterFeatureMiddleware() |
Read existing features for templates: src/features/*/
Step 3: Register
A) Storage key → src/utils/storage.ts
export const FEATURE_KEYS = {
// ... existing
<FEATURE_NAME>: 'feature:<featureName>:config',
} as const;
B) Export → src/features/index.ts
export { MG<FeatureName> } from './<featureName>';
export type { <FeatureName>Config } from './<featureName>';
C) API → src/api/index.ts
import { MG<FeatureName> } from "../features/<featureName>";
Features: {
<FeatureName>: MG<FeatureName>,
}
D) Bootstrap → src/ui/loader/bootstrap.ts
import { MG<FeatureName> } from "../../features/<featureName>";
{ name: "<FeatureName>", init: () => MG<FeatureName>.init() }
E) Game UI injection (if applicable)
Create structure in src/ui/inject/qol/<featureName>/:
├── index.ts # init(), destroy(), isEnabled()
├── inject.ts # DOM injection logic
├── styles.css.ts # Scoped styles
└── state.ts # (optional)
Step 4: Key Patterns
Using Globals (reactive state)
import { getMyInventory } from '../../../globals/variables/myInventory';
const cleanups
Установить add-feature в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл add-feature?
Scaffold a new toggleable feature with full structure, storage, API exposure, and bootstrap registration
Как установить скилл add-feature?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл add-feature запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic