mbc-debug
БесплатноБез исполняемых скриптовНе проверенDebug and troubleshoot MBC CQRS Serverless applications. Use this when encountering errors, investigating issues, or optimizing performance in MBC CQRS…
Об этом скилле
Pre-flight Check (Version Update)
Before executing this skill, check for updates:
- Run
mbc install-skills --checkto check if a newer version is available - If the output shows "Update available: X.Y.Z → A.B.C", ask the user:
- "A newer version of MBC skills is available (X.Y.Z → A.B.C). Would you like to update before proceeding?"
- If the user agrees, run
mbc install-skills --forceto update - If the user declines or skills are up-to-date, proceed with the skill
Note: Skip this check if the user explicitly says to skip updates or if you've already checked in this session.
MBC CQRS Serverless Debug Guide
This skill helps debug and troubleshoot issues in MBC CQRS Serverless applications.
Quick Error Lookup
Common Error Codes
| Error Code | Category | Quick Fix |
|---|---|---|
| MBC-CMD-001 | Command | Check pk/sk format |
| MBC-CMD-002 | Command | Verify version field |
| MBC-CMD-003 | Command | Check command type |
| MBC-DDB-001 | DynamoDB | Verify table exists |
| MBC-DDB-002 | DynamoDB | Check IAM permissions |
| MBC-DDB-003 | DynamoDB | Resolve version conflict |
| MBC-TNT-001 | Tenant | Verify tenantCode |
| MBC-TNT-002 | Tenant | Check tenant isolation |
| MBC-IMP-001 | Import | Validate CSV format |
| MBC-IMP-002 | Import | Check S3 permissions |
Debugging Workflows
1. Command Publishing Issues
Symptom: Command not being processed
Debug Steps:
// Step 1: Enable verbose logging
const logger = new Logger('CommandDebug');
// Step 2: Log the command before publishing
logger.debug('Publishing command:', JSON.stringify(command, null, 2));
// Step 3: Wrap in try-catch with detailed logging
try {
const result = await this.commandService.publishAsync(command, {
source: commandSource,
invokeContext,
});
logger.debug('Command result:', JSON.stringify(result, null, 2));
return result;
} catch (error) {
logger.error('Command failed:', {
error: error.message,
name: error.name,
command: { pk: command.pk, sk: command.sk, type: command.type },
});
throw error;
}
Common Causes:
- Missing required fields (pk, sk, type, version)
- Invalid pk/sk format
- Version mismatch (optimistic locking failure)
- DataSyncHandler not registered
2. ConditionalCheckFailedException
Symptom: Version conflict error
Debug Steps:
// Step 1: Check current version
const existing = await this.dataService.getItem({ pk, sk });
console.log('Current version:', existing.version);
// Step 2: Compare with command version
console.log('Command version:', command.version);
// Step 3: Investigate concurrent modifications
// Check CloudWatch logs for other requests modifying the same item
Solution:
// Always fetch the latest version before updating
async update(key: DetailKey, dto: UpdateDto, invokeContext: IInvoke) {
// Retry logic for version conflicts
const maxRetries = 3;
let retries = 0;
while (retries < maxRetries) {
try {
const existing = await this.dataService.getItem(key);
return await this.commandService.publishPartialUpdateAsync({
pk: key.pk,
sk: key.sk,
version: existing.version, // Always use latest version
...dto,
}, { source: commandSource, invokeContext });
} catch (error) {
if (error.name === 'ConditionalCheckFailedException') {
retries++;
if (retries >= maxRetries) {
throw new ConflictException('Too many concurrent modifications');
}
// Wait before retry
await new Promise(resolve => setTimeout(resolve, 100 * retries));
continue;
}
throw error;
}
}
}
3. DataSyncHandler Not Triggering
Symptom: Data not syncing to RDS/Elasticsearch
Debug Checklist:
□ Handler is decorated with @DataSyncHandler({ type: 'ENTITY' })
□ Type matches the command's type field exactly
□ Handler is registered in module's dataSyncHandlers array
□ Handler implements IDataSyncHandler interface
□ up() method is async and properly awaited
Debug Steps:
// Step 1: Add logging to handler
@DataSyncHandler({ type: 'ORDER' })
export class OrderDataSyncRdsHandler implements IDataSyncHandler {
private readonly logger = new Logger(OrderDataSyncRdsHandler.name);
async up(cmd: CommandModel, data: DataModel): Promise<void> {
this.logger.log(`DataSync triggered for ${data.id}`);
this.logger.debug('Command:', JSON.stringify(cmd, null, 2));
this.logger.debug('Data:', JSON.stringify(data, null, 2));
// Your sync logic
}
}
// Step 2: Verify type matching
// In your command:
const command = new OrderCommandDto({
type: 'ORDER', // Must match @DataSyncHandler({ type: 'ORDER' })
});
// Step 3: Check module registration
CommandModule.register({
tableName: 'order',
dataSyncHandlers: [OrderDataSyncRdsHandler], // Must be included!
}),
4. Tenant I
Установить mbc-debug в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл mbc-debug?
Debug and troubleshoot MBC CQRS Serverless applications. Use this when encountering errors, investigating issues, or optimizing performance in MBC CQRS Serverless projects.
Как установить скилл mbc-debug?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл mbc-debug запускает скрипты?
Нет, скилл состоит только из инструкций (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