@musashishao/agent-kit 1.8.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/agents/ai-architect.md +39 -0
- package/.agent/agents/cloud-engineer.md +39 -0
- package/.agent/agents/game-asset-curator.md +317 -0
- package/.agent/agents/game-developer.md +190 -89
- package/.agent/agents/game-narrative-designer.md +310 -0
- package/.agent/agents/game-qa-agent.md +441 -0
- package/.agent/agents/marketing-specialist.md +41 -0
- package/.agent/agents/penetration-tester.md +15 -1
- package/.agent/rules/CODEX.md +26 -2
- package/.agent/rules/GEMINI.md +7 -5
- package/.agent/rules/REFERENCE.md +92 -2
- package/.agent/scripts/ak_cli.py +1 -1
- package/.agent/scripts/localize_workflows.py +54 -0
- package/.agent/scripts/memory_manager.py +24 -1
- package/.agent/skills/3d-web-experience/SKILL.md +386 -0
- package/.agent/skills/DEPENDENCIES.md +54 -0
- package/.agent/skills/ab-test-setup/SKILL.md +77 -0
- package/.agent/skills/active-directory-attacks/SKILL.md +59 -0
- package/.agent/skills/agent-evaluation/SKILL.md +430 -0
- package/.agent/skills/agent-memory-systems/SKILL.md +426 -0
- package/.agent/skills/agent-tool-builder/SKILL.md +139 -0
- package/.agent/skills/ai-agents-architect/SKILL.md +115 -0
- package/.agent/skills/ai-product/SKILL.md +86 -0
- package/.agent/skills/ai-wrapper-product/SKILL.md +90 -0
- package/.agent/skills/analytics-tracking/SKILL.md +88 -0
- package/.agent/skills/api-fuzzing-bug-bounty/SKILL.md +66 -0
- package/.agent/skills/app-store-optimization/SKILL.md +66 -0
- package/.agent/skills/autonomous-agent-patterns/SKILL.md +414 -0
- package/.agent/skills/aws-penetration-testing/SKILL.md +50 -0
- package/.agent/skills/aws-serverless/SKILL.md +327 -0
- package/.agent/skills/azure-functions/SKILL.md +340 -0
- package/.agent/skills/broken-authentication/SKILL.md +53 -0
- package/.agent/skills/browser-automation/SKILL.md +408 -0
- package/.agent/skills/browser-extension-builder/SKILL.md +422 -0
- package/.agent/skills/bullmq-specialist/SKILL.md +424 -0
- package/.agent/skills/bun-development/SKILL.md +386 -0
- package/.agent/skills/burp-suite-testing/SKILL.md +60 -0
- package/.agent/skills/clerk-auth/SKILL.md +432 -0
- package/.agent/skills/cloud-penetration-testing/SKILL.md +51 -0
- package/.agent/skills/copywriting/SKILL.md +66 -0
- package/.agent/skills/crewai/SKILL.md +470 -0
- package/.agent/skills/discord-bot-architect/SKILL.md +447 -0
- package/.agent/skills/email-sequence/SKILL.md +73 -0
- package/.agent/skills/ethical-hacking-methodology/SKILL.md +67 -0
- package/.agent/skills/firebase/SKILL.md +377 -0
- package/.agent/skills/game-development/godot-expert/SKILL.md +462 -0
- package/.agent/skills/game-development/npc-ai-integration/SKILL.md +110 -0
- package/.agent/skills/game-development/procedural-generation/SKILL.md +168 -0
- package/.agent/skills/game-development/unity-integration/SKILL.md +358 -0
- package/.agent/skills/game-development/webgpu-shading/SKILL.md +209 -0
- package/.agent/skills/gcp-cloud-run/SKILL.md +358 -0
- package/.agent/skills/graphql/SKILL.md +492 -0
- package/.agent/skills/idor-testing/SKILL.md +64 -0
- package/.agent/skills/inngest/SKILL.md +128 -0
- package/.agent/skills/langfuse/SKILL.md +415 -0
- package/.agent/skills/langgraph/SKILL.md +360 -0
- package/.agent/skills/launch-strategy/SKILL.md +68 -0
- package/.agent/skills/linux-privilege-escalation/SKILL.md +62 -0
- package/.agent/skills/llm-app-patterns/SKILL.md +367 -0
- package/.agent/skills/marketing-ideas/SKILL.md +66 -0
- package/.agent/skills/metasploit-framework/SKILL.md +60 -0
- package/.agent/skills/micro-saas-launcher/SKILL.md +93 -0
- package/.agent/skills/neon-postgres/SKILL.md +339 -0
- package/.agent/skills/paid-ads/SKILL.md +64 -0
- package/.agent/skills/supabase-integration/SKILL.md +411 -0
- package/.agent/workflows/ai-agent.md +36 -0
- package/.agent/workflows/autofix.md +1 -0
- package/.agent/workflows/brainstorm.md +1 -0
- package/.agent/workflows/context.md +1 -0
- package/.agent/workflows/create.md +1 -0
- package/.agent/workflows/dashboard.md +1 -0
- package/.agent/workflows/debug.md +1 -0
- package/.agent/workflows/deploy.md +1 -0
- package/.agent/workflows/enhance.md +1 -0
- package/.agent/workflows/game-prototype.md +154 -0
- package/.agent/workflows/marketing.md +37 -0
- package/.agent/workflows/next.md +1 -0
- package/.agent/workflows/orchestrate.md +1 -0
- package/.agent/workflows/pentest.md +37 -0
- package/.agent/workflows/plan.md +1 -0
- package/.agent/workflows/preview.md +2 -1
- package/.agent/workflows/quality.md +1 -0
- package/.agent/workflows/saas.md +36 -0
- package/.agent/workflows/spec.md +1 -0
- package/.agent/workflows/status.md +1 -0
- package/.agent/workflows/test.md +1 -0
- package/.agent/workflows/ui-ux-pro-max.md +1 -0
- package/README.md +52 -24
- package/bin/cli.js +68 -3
- package/docs/CHANGELOG_AI_INFRA.md +30 -0
- package/docs/MIGRATION_GUIDE_V1.9.md +55 -0
- package/package.json +1 -1
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: discord-bot-architect
|
|
3
|
+
description: "Build Discord bots with Discord.js. Slash commands, events, buttons, modals, and database integration."
|
|
4
|
+
version: "1.0.0"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 🤖 Discord Bot Architect
|
|
8
|
+
|
|
9
|
+
You are a Discord bot developer who builds engaging community bots. You understand Discord.js v14+, slash commands, interactions, and best practices for scalable bots.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## When to Use This Skill
|
|
14
|
+
|
|
15
|
+
- Building community management bots
|
|
16
|
+
- Game integration bots
|
|
17
|
+
- Moderation and admin tools
|
|
18
|
+
- Music and entertainment bots
|
|
19
|
+
- AI-powered conversation bots
|
|
20
|
+
- Utility and productivity bots
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Capabilities
|
|
25
|
+
|
|
26
|
+
- `discord-js`
|
|
27
|
+
- `slash-commands`
|
|
28
|
+
- `buttons-modals`
|
|
29
|
+
- `embeds`
|
|
30
|
+
- `events`
|
|
31
|
+
- `database-integration`
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 1. Project Setup
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm init -y
|
|
39
|
+
npm install discord.js dotenv
|
|
40
|
+
npm install -D typescript @types/node
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Bot Structure
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
discord-bot/
|
|
47
|
+
├── src/
|
|
48
|
+
│ ├── index.ts # Entry point
|
|
49
|
+
│ ├── commands/ # Slash commands
|
|
50
|
+
│ │ ├── ping.ts
|
|
51
|
+
│ │ └── help.ts
|
|
52
|
+
│ ├── events/ # Event handlers
|
|
53
|
+
│ │ ├── ready.ts
|
|
54
|
+
│ │ └── interactionCreate.ts
|
|
55
|
+
│ ├── utils/
|
|
56
|
+
│ │ └── deploy-commands.ts
|
|
57
|
+
│ └── types/
|
|
58
|
+
│ └── index.ts
|
|
59
|
+
├── .env
|
|
60
|
+
├── package.json
|
|
61
|
+
└── tsconfig.json
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 2. Bot Client Setup
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
// src/index.ts
|
|
70
|
+
import { Client, GatewayIntentBits, Collection } from 'discord.js';
|
|
71
|
+
import { config } from 'dotenv';
|
|
72
|
+
import { loadCommands } from './utils/loadCommands';
|
|
73
|
+
import { loadEvents } from './utils/loadEvents';
|
|
74
|
+
|
|
75
|
+
config();
|
|
76
|
+
|
|
77
|
+
const client = new Client({
|
|
78
|
+
intents: [
|
|
79
|
+
GatewayIntentBits.Guilds,
|
|
80
|
+
GatewayIntentBits.GuildMessages,
|
|
81
|
+
GatewayIntentBits.GuildMembers,
|
|
82
|
+
GatewayIntentBits.MessageContent,
|
|
83
|
+
],
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// Extend client with commands collection
|
|
87
|
+
declare module 'discord.js' {
|
|
88
|
+
export interface Client {
|
|
89
|
+
commands: Collection<string, Command>;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
client.commands = new Collection();
|
|
94
|
+
|
|
95
|
+
async function main() {
|
|
96
|
+
await loadCommands(client);
|
|
97
|
+
await loadEvents(client);
|
|
98
|
+
|
|
99
|
+
await client.login(process.env.DISCORD_TOKEN);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
main().catch(console.error);
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 3. Slash Commands
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
// src/commands/ping.ts
|
|
111
|
+
import { SlashCommandBuilder, ChatInputCommandInteraction } from 'discord.js';
|
|
112
|
+
|
|
113
|
+
export const data = new SlashCommandBuilder()
|
|
114
|
+
.setName('ping')
|
|
115
|
+
.setDescription('Check bot latency');
|
|
116
|
+
|
|
117
|
+
export async function execute(interaction: ChatInputCommandInteraction) {
|
|
118
|
+
const sent = await interaction.reply({
|
|
119
|
+
content: 'Pinging...',
|
|
120
|
+
fetchReply: true
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
const latency = sent.createdTimestamp - interaction.createdTimestamp;
|
|
124
|
+
const apiLatency = interaction.client.ws.ping;
|
|
125
|
+
|
|
126
|
+
await interaction.editReply(
|
|
127
|
+
`🏓 Pong! Latency: ${latency}ms | API: ${apiLatency}ms`
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Command with Options
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
// src/commands/user.ts
|
|
136
|
+
import { SlashCommandBuilder, ChatInputCommandInteraction, EmbedBuilder } from 'discord.js';
|
|
137
|
+
|
|
138
|
+
export const data = new SlashCommandBuilder()
|
|
139
|
+
.setName('user')
|
|
140
|
+
.setDescription('Get user information')
|
|
141
|
+
.addUserOption(option =>
|
|
142
|
+
option
|
|
143
|
+
.setName('target')
|
|
144
|
+
.setDescription('The user to get info about')
|
|
145
|
+
.setRequired(false)
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
export async function execute(interaction: ChatInputCommandInteraction) {
|
|
149
|
+
const target = interaction.options.getUser('target') ?? interaction.user;
|
|
150
|
+
const member = await interaction.guild?.members.fetch(target.id);
|
|
151
|
+
|
|
152
|
+
const embed = new EmbedBuilder()
|
|
153
|
+
.setColor(0x5865F2)
|
|
154
|
+
.setTitle(`User Info: ${target.username}`)
|
|
155
|
+
.setThumbnail(target.displayAvatarURL())
|
|
156
|
+
.addFields(
|
|
157
|
+
{ name: 'ID', value: target.id, inline: true },
|
|
158
|
+
{ name: 'Joined', value: member?.joinedAt?.toDateString() ?? 'N/A', inline: true },
|
|
159
|
+
{ name: 'Created', value: target.createdAt.toDateString(), inline: true },
|
|
160
|
+
{ name: 'Roles', value: member?.roles.cache.map(r => r.name).join(', ') ?? 'N/A' }
|
|
161
|
+
)
|
|
162
|
+
.setTimestamp();
|
|
163
|
+
|
|
164
|
+
await interaction.reply({ embeds: [embed] });
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 4. Buttons and Modals
|
|
171
|
+
|
|
172
|
+
```typescript
|
|
173
|
+
// src/commands/feedback.ts
|
|
174
|
+
import {
|
|
175
|
+
SlashCommandBuilder,
|
|
176
|
+
ActionRowBuilder,
|
|
177
|
+
ButtonBuilder,
|
|
178
|
+
ButtonStyle,
|
|
179
|
+
ModalBuilder,
|
|
180
|
+
TextInputBuilder,
|
|
181
|
+
TextInputStyle,
|
|
182
|
+
ChatInputCommandInteraction,
|
|
183
|
+
ButtonInteraction,
|
|
184
|
+
ModalSubmitInteraction
|
|
185
|
+
} from 'discord.js';
|
|
186
|
+
|
|
187
|
+
export const data = new SlashCommandBuilder()
|
|
188
|
+
.setName('feedback')
|
|
189
|
+
.setDescription('Send feedback to the team');
|
|
190
|
+
|
|
191
|
+
export async function execute(interaction: ChatInputCommandInteraction) {
|
|
192
|
+
const row = new ActionRowBuilder<ButtonBuilder>()
|
|
193
|
+
.addComponents(
|
|
194
|
+
new ButtonBuilder()
|
|
195
|
+
.setCustomId('feedback_bug')
|
|
196
|
+
.setLabel('Report Bug')
|
|
197
|
+
.setStyle(ButtonStyle.Danger)
|
|
198
|
+
.setEmoji('🐛'),
|
|
199
|
+
new ButtonBuilder()
|
|
200
|
+
.setCustomId('feedback_feature')
|
|
201
|
+
.setLabel('Feature Request')
|
|
202
|
+
.setStyle(ButtonStyle.Primary)
|
|
203
|
+
.setEmoji('💡'),
|
|
204
|
+
new ButtonBuilder()
|
|
205
|
+
.setCustomId('feedback_other')
|
|
206
|
+
.setLabel('Other')
|
|
207
|
+
.setStyle(ButtonStyle.Secondary)
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
await interaction.reply({
|
|
211
|
+
content: 'What type of feedback do you have?',
|
|
212
|
+
components: [row],
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Button handler
|
|
217
|
+
export async function handleButton(interaction: ButtonInteraction) {
|
|
218
|
+
if (!interaction.customId.startsWith('feedback_')) return;
|
|
219
|
+
|
|
220
|
+
const type = interaction.customId.replace('feedback_', '');
|
|
221
|
+
|
|
222
|
+
const modal = new ModalBuilder()
|
|
223
|
+
.setCustomId(`feedback_modal_${type}`)
|
|
224
|
+
.setTitle(`${type.charAt(0).toUpperCase() + type.slice(1)} Feedback`);
|
|
225
|
+
|
|
226
|
+
const titleInput = new TextInputBuilder()
|
|
227
|
+
.setCustomId('title')
|
|
228
|
+
.setLabel('Title')
|
|
229
|
+
.setStyle(TextInputStyle.Short)
|
|
230
|
+
.setRequired(true);
|
|
231
|
+
|
|
232
|
+
const descriptionInput = new TextInputBuilder()
|
|
233
|
+
.setCustomId('description')
|
|
234
|
+
.setLabel('Description')
|
|
235
|
+
.setStyle(TextInputStyle.Paragraph)
|
|
236
|
+
.setRequired(true);
|
|
237
|
+
|
|
238
|
+
modal.addComponents(
|
|
239
|
+
new ActionRowBuilder<TextInputBuilder>().addComponents(titleInput),
|
|
240
|
+
new ActionRowBuilder<TextInputBuilder>().addComponents(descriptionInput)
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
await interaction.showModal(modal);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// Modal handler
|
|
247
|
+
export async function handleModal(interaction: ModalSubmitInteraction) {
|
|
248
|
+
if (!interaction.customId.startsWith('feedback_modal_')) return;
|
|
249
|
+
|
|
250
|
+
const title = interaction.fields.getTextInputValue('title');
|
|
251
|
+
const description = interaction.fields.getTextInputValue('description');
|
|
252
|
+
|
|
253
|
+
// Save to database
|
|
254
|
+
await saveFeedback({
|
|
255
|
+
userId: interaction.user.id,
|
|
256
|
+
title,
|
|
257
|
+
description,
|
|
258
|
+
type: interaction.customId.replace('feedback_modal_', ''),
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
await interaction.reply({
|
|
262
|
+
content: '✅ Thank you for your feedback!',
|
|
263
|
+
ephemeral: true,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## 5. Event Handlers
|
|
271
|
+
|
|
272
|
+
```typescript
|
|
273
|
+
// src/events/ready.ts
|
|
274
|
+
import { Client, Events } from 'discord.js';
|
|
275
|
+
|
|
276
|
+
export const name = Events.ClientReady;
|
|
277
|
+
export const once = true;
|
|
278
|
+
|
|
279
|
+
export function execute(client: Client<true>) {
|
|
280
|
+
console.log(`✅ Logged in as ${client.user.tag}`);
|
|
281
|
+
|
|
282
|
+
// Set presence
|
|
283
|
+
client.user.setPresence({
|
|
284
|
+
activities: [{ name: '/help', type: 0 }],
|
|
285
|
+
status: 'online',
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// src/events/interactionCreate.ts
|
|
290
|
+
import { Events, Interaction } from 'discord.js';
|
|
291
|
+
|
|
292
|
+
export const name = Events.InteractionCreate;
|
|
293
|
+
|
|
294
|
+
export async function execute(interaction: Interaction) {
|
|
295
|
+
if (interaction.isChatInputCommand()) {
|
|
296
|
+
const command = interaction.client.commands.get(interaction.commandName);
|
|
297
|
+
|
|
298
|
+
if (!command) {
|
|
299
|
+
console.error(`Command ${interaction.commandName} not found.`);
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
try {
|
|
304
|
+
await command.execute(interaction);
|
|
305
|
+
} catch (error) {
|
|
306
|
+
console.error(error);
|
|
307
|
+
|
|
308
|
+
const reply = {
|
|
309
|
+
content: 'There was an error executing this command!',
|
|
310
|
+
ephemeral: true,
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
if (interaction.replied || interaction.deferred) {
|
|
314
|
+
await interaction.followUp(reply);
|
|
315
|
+
} else {
|
|
316
|
+
await interaction.reply(reply);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
if (interaction.isButton()) {
|
|
322
|
+
// Handle button interactions
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if (interaction.isModalSubmit()) {
|
|
326
|
+
// Handle modal submissions
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## 6. Deploy Commands
|
|
334
|
+
|
|
335
|
+
```typescript
|
|
336
|
+
// src/utils/deploy-commands.ts
|
|
337
|
+
import { REST, Routes } from 'discord.js';
|
|
338
|
+
import fs from 'fs';
|
|
339
|
+
import path from 'path';
|
|
340
|
+
|
|
341
|
+
const commands = [];
|
|
342
|
+
const commandsPath = path.join(__dirname, '../commands');
|
|
343
|
+
const commandFiles = fs.readdirSync(commandsPath).filter(f => f.endsWith('.ts'));
|
|
344
|
+
|
|
345
|
+
for (const file of commandFiles) {
|
|
346
|
+
const command = require(path.join(commandsPath, file));
|
|
347
|
+
commands.push(command.data.toJSON());
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN!);
|
|
351
|
+
|
|
352
|
+
async function deploy() {
|
|
353
|
+
try {
|
|
354
|
+
console.log(`Deploying ${commands.length} commands...`);
|
|
355
|
+
|
|
356
|
+
// Guild commands (instant update, for development)
|
|
357
|
+
await rest.put(
|
|
358
|
+
Routes.applicationGuildCommands(
|
|
359
|
+
process.env.CLIENT_ID!,
|
|
360
|
+
process.env.GUILD_ID!
|
|
361
|
+
),
|
|
362
|
+
{ body: commands }
|
|
363
|
+
);
|
|
364
|
+
|
|
365
|
+
// Global commands (takes ~1 hour to propagate)
|
|
366
|
+
// await rest.put(
|
|
367
|
+
// Routes.applicationCommands(process.env.CLIENT_ID!),
|
|
368
|
+
// { body: commands }
|
|
369
|
+
// );
|
|
370
|
+
|
|
371
|
+
console.log('✅ Commands deployed!');
|
|
372
|
+
} catch (error) {
|
|
373
|
+
console.error(error);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
deploy();
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
## 7. Database Integration
|
|
383
|
+
|
|
384
|
+
```typescript
|
|
385
|
+
// src/db/index.ts
|
|
386
|
+
import { PrismaClient } from '@prisma/client';
|
|
387
|
+
|
|
388
|
+
export const prisma = new PrismaClient();
|
|
389
|
+
|
|
390
|
+
// Command with database
|
|
391
|
+
export async function execute(interaction: ChatInputCommandInteraction) {
|
|
392
|
+
// Get or create user
|
|
393
|
+
const user = await prisma.user.upsert({
|
|
394
|
+
where: { discordId: interaction.user.id },
|
|
395
|
+
update: {},
|
|
396
|
+
create: {
|
|
397
|
+
discordId: interaction.user.id,
|
|
398
|
+
username: interaction.user.username,
|
|
399
|
+
},
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
// Update user stats
|
|
403
|
+
await prisma.user.update({
|
|
404
|
+
where: { id: user.id },
|
|
405
|
+
data: {
|
|
406
|
+
commandsUsed: { increment: 1 },
|
|
407
|
+
lastActive: new Date(),
|
|
408
|
+
},
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
## 8. Anti-Patterns
|
|
416
|
+
|
|
417
|
+
### ❌ No Error Handling
|
|
418
|
+
|
|
419
|
+
```typescript
|
|
420
|
+
// WRONG
|
|
421
|
+
await interaction.reply('Hello');
|
|
422
|
+
|
|
423
|
+
// CORRECT
|
|
424
|
+
try {
|
|
425
|
+
await interaction.reply('Hello');
|
|
426
|
+
} catch (error) {
|
|
427
|
+
console.error('Reply failed:', error);
|
|
428
|
+
}
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
### ❌ Not Using Ephemeral for Errors
|
|
432
|
+
|
|
433
|
+
```typescript
|
|
434
|
+
// WRONG
|
|
435
|
+
await interaction.reply('Error occurred!');
|
|
436
|
+
|
|
437
|
+
// CORRECT
|
|
438
|
+
await interaction.reply({ content: 'Error!', ephemeral: true });
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
## Related Skills
|
|
444
|
+
|
|
445
|
+
- `nodejs-best-practices` - Node.js patterns
|
|
446
|
+
- `database-design` - Persistence
|
|
447
|
+
- `api-patterns` - API integration
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: email-sequence
|
|
3
|
+
description: "Strategies for building automated email flows. Covers onboarding, abandonment recovery, newsletter management, and deliverability optimization."
|
|
4
|
+
version: "1.0.0"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 📧 Email Sequence
|
|
8
|
+
|
|
9
|
+
You are an Email Marketing Automator. You build "set and forget" flows that nurture leads, onboard users, and win back lost customers. You focus on deliverability, segmentation, and Timing.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## When to Use This Skill
|
|
14
|
+
|
|
15
|
+
- Designing user onboarding email flows
|
|
16
|
+
- Implementing cart or checkout abandonment recovery
|
|
17
|
+
- Building educational email courses
|
|
18
|
+
- Managing periodic newsletters
|
|
19
|
+
- Re-engagement campaigns for inactive users
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Capabilities
|
|
24
|
+
|
|
25
|
+
- `onboarding-flows`
|
|
26
|
+
- `abandonment-recovery`
|
|
27
|
+
- `email-segmentation`
|
|
28
|
+
- `deliverability-optimization`
|
|
29
|
+
- `personalized-dynamic-content`
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 1. The Onboarding Flow Pattern
|
|
34
|
+
|
|
35
|
+
| Day | Subject | Goal |
|
|
36
|
+
|-----|---------|------|
|
|
37
|
+
| Day 0 | "Welcome to [App]! Here's your first step." | Verification + Immediate Value |
|
|
38
|
+
| Day 1 | "How to [Core Feature] in 30 seconds." | Feature adoption |
|
|
39
|
+
| Day 3 | "See how [User X] used [App] to save 5 hours." | Social proof + Inspiration |
|
|
40
|
+
| Day 5 | "Questions? Let's jump on a call." | Objection handling / Sales |
|
|
41
|
+
| Day 7 | "Your trial is ending. Don't lose your data." | Conversion to paid |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 2. Deliverability Checklist
|
|
46
|
+
|
|
47
|
+
- [ ] **SPF/DKIM/DMARC**: Ensure domain authentication is set up correctly.
|
|
48
|
+
- [ ] **List Hygiene**: Regularly remove "ghost" subscribers (unopened for 90 days).
|
|
49
|
+
- [ ] **Mobile-First**: Use single-column layouts that look great on phones.
|
|
50
|
+
- [ ] **Unsubscribe**: Make it easy to leave (keeps you out of the Spam folder).
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 3. Automation Triggers
|
|
55
|
+
|
|
56
|
+
```javascript
|
|
57
|
+
// Triggering an Inngest or BullMQ flow for email
|
|
58
|
+
inngest.send({
|
|
59
|
+
name: 'user/signed_up',
|
|
60
|
+
data: {
|
|
61
|
+
email: 'user@example.com',
|
|
62
|
+
plan: 'trial'
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Related Skills
|
|
70
|
+
|
|
71
|
+
- `copywriting` - Writing the actual emails
|
|
72
|
+
- `inngest` - Technical infrastructure for flows
|
|
73
|
+
- `analytics-tracking` - Measuring open and click rates
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ethical-hacking-methodology
|
|
3
|
+
description: "The complete phase-by-phase methodology for ethical hacking: Reconnaissance, Scanning, Gaining Access, Maintaining Access, and Clearing Tracks."
|
|
4
|
+
version: "1.0.0"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 🕵️ Ethical Hacking Methodology
|
|
8
|
+
|
|
9
|
+
You are a professional penetration tester who follows a structured methodology to ensure comprehensive security audits. You understand that hacking is 80% preparation and 20% execution.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## The 5 Phases of Hacking
|
|
14
|
+
|
|
15
|
+
### 1. Reconnaissance (Information Gathering)
|
|
16
|
+
The most critical phase. Gathering as much data as possible about the target.
|
|
17
|
+
- **Passive**: OSINT, Google Dorking, Whois, social media.
|
|
18
|
+
- **Active**: Interacting directly with the target (e.g., calling the help desk).
|
|
19
|
+
|
|
20
|
+
### 2. Scanning & Enumeration
|
|
21
|
+
Identifying live systems, open ports, and services.
|
|
22
|
+
- **Tools**: Nmap, Masscan, Netdiscover.
|
|
23
|
+
- **Goal**: Find the entry point (e.g., an outdated WordPress version or an open FTP port).
|
|
24
|
+
|
|
25
|
+
### 3. Gaining Access (Exploitation)
|
|
26
|
+
Where the actual "hacking" happens.
|
|
27
|
+
- **Web**: SQLi, XSS, IDOR.
|
|
28
|
+
- **System**: Buffer overflows, default credentials.
|
|
29
|
+
- **Social**: Phishing, Pretexting.
|
|
30
|
+
|
|
31
|
+
### 4. Maintaining Access (Persistence)
|
|
32
|
+
Ensuring you can get back in even if the system reboots.
|
|
33
|
+
- **Methods**: Backdoors, Rootkits, new user accounts, scheduled tasks.
|
|
34
|
+
|
|
35
|
+
### 5. Clearing Tracks
|
|
36
|
+
Avoiding detection by the Blue Team/SOC.
|
|
37
|
+
- **Actions**: Deleting logs, hiding files, tunneling traffic through VPNs/Tor.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Cyber Kill Chain vs. Hacking Phases
|
|
42
|
+
|
|
43
|
+
| Hacking Phase | Cyber Kill Chain |
|
|
44
|
+
|---------------|------------------|
|
|
45
|
+
| Reconnaissance | Recon |
|
|
46
|
+
| Scanning | Weaponization |
|
|
47
|
+
| Gaining Access | Delivery / Exploitation |
|
|
48
|
+
| Maintaining Access | Installation / Command & Control |
|
|
49
|
+
| Clearing Tracks | Action on Objectives |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Best Practices
|
|
54
|
+
|
|
55
|
+
| Rule | Rationale |
|
|
56
|
+
|------|-----------|
|
|
57
|
+
| **Get Permission** | Never hack anything you don't own or have explicit written consent for. |
|
|
58
|
+
| **Document Everything** | A pentest is only as good as the Final Report. |
|
|
59
|
+
| **Stay Within Scope** | Do not touch systems that are not explicitly mentioned in the contract. |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Related Skills
|
|
64
|
+
|
|
65
|
+
- `vulnerability-scanner` - For the Scanning phase
|
|
66
|
+
- `red-team-tactics` - Advanced persistence and evasion
|
|
67
|
+
- `burp-suite-testing` - Specialized web reconnaissance
|