create-deact-element
Create Deact UI elements for Discord bot interfaces. Use when building new UI components.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Create Deact UI elements for Discord bot interfaces. Use when building new UI components.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Add new moves to the battle system. Use when implementing attack, status, or support moves for Pokemon.
Add a Pokemon (real or fake) to src/config/pokemonConfig.js with its moves, abilities, rarity, and evolution data. Use when the user asks to add, register, implement, or create a new Pokemon, Pokemon form, or fake/custom Pokemon in the battle system.
Find a Pokemon's Discord emoji string — canonical (e.g. `<:25:1100282072003772457>`) from `pokestar-pk-{n}`, form variants (e.g. `<:483origin:1404654211324448848>`) from `pokestar-forms-1`, or fakemon (e.g. `<:ashpikachu:1109522092283658250>`) from `pokestar-pk-extra` — via Playwright CLI. Use when the user asks for a Pokemon's emoji, emoji ID, form emoji, fakemon emoji, or needs an `<:name:snowflake>` string.
Create an implementation plan before adding one or more Pokemon via the `add-pokemon` skill. Builds Pokemon, moves, and abilities tables with all required inputs, flags unimplemented moves/abilities, and produces step-by-step implementation instructions. Use when the user asks to plan adding a Pokemon, plan a Pokemon batch, or invokes this skill before `add-pokemon`.
Verify Discord bot changes by running the bot and testing commands in Discord via Playwright CLI. Use when the user asks to test, verify, or check bot commands in Discord.
Verify a Pokemon's configuration in pokemonConfig.js by testing its moves and abilities in Discord via Playwright CLI. Use when validating a Pokemon's battle behavior after configuration changes.
| name | create-deact-element |
| description | Create Deact UI elements for Discord bot interfaces. Use when building new UI components. |
File location: src/elements/<category>/YourElement.js
You may create a new category if no category is appropriate.
const { createElement } = require("../../deact/deact");
const Button = require("../../deact/elements/Button");
/**
* @type {DeactElementFunction<{
* propName: string,
* optionalProp?: number,
* }>}
*/
module.exports = async (ref, { propName, optionalProp = 10 }) => {
return {
contents: [],
embeds: [],
components: [],
};
};
| Property | Type | Description |
|---|---|---|
contents | string[] | Text content (concatenated) |
embeds | EmbedBuilder[] | Discord embeds (max 10) |
components | (Component[] | CreateElementResult)[] | Component rows (max 5) |
elements | (CreateElementResult | ElementPayload)[] | Child elements |
err | string | Return early with error |
Components use a 2D array: outer = rows, inner = components in that row.
return {
components: [
// Row 1: Multiple buttons
[
createElement(Button, { label: "A", callbackBindingKey: keyA }),
createElement(Button, { label: "B", callbackBindingKey: keyB }),
],
// Row 2: Single component (select menu takes full row)
createElement(StringSelectMenu, { options, callbackBindingKey }),
// Conditional row
showExtra
? [createElement(Button, { label: "C", callbackBindingKey: keyC })]
: [],
],
};
const { ButtonStyle } = require("discord.js");
const { createElement } = require("../../deact/deact");
const Button = require("../../deact/elements/Button");
module.exports = async (
ref,
{ callbackBindingKey, style = ButtonStyle.Primary },
) => ({
components: [
createElement(Button, {
emoji: "↩",
label: "Return",
style,
callbackBindingKey,
data: {},
}),
],
});
ref - The DeactElement instanceref as last argument{ err: "message" } for early error exitscreateElement() for child Deact elements/**
* @type {DeactElementFunction<{
* requiredProp: string,
* optionalProp?: number,
* callbackProp: (value: string) => void,
* }>}
*/
module.exports = async (
ref,
{ requiredProp, optionalProp = 5, callbackProp },
) => {
// ...
};
use-deact-hook - Using hooks for state, memoization, and effectsdeact-component-callback - Handling button clicks and select menu interactionscreate-deact-hook - Creating reusable custom hookscreate-deact-modal - Creating and using Discord modalsreferences/pattern-element-with-state.md - Element with useState and callbacksreferences/pattern-data-fetching.md - Element with async data fetchingreferences/pattern-composing-elements.md - Composing child Deact elementsreferences/pattern-using-hooks.md - Using custom hooks from src/hooks/