mbc-net/mbc-cqrs-serverless/mbc-review

Claude Code and agent skill by mbc-net/mbc-cqrs-serverless

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Review code for MBC CQRS Serverless best practices and anti-patterns. Use this when reviewing code that uses MBC CQRS Serverless framework, checking for common mistakes, or validating implementation patterns.

Install

npx vskill@latest install mbc-net/mbc-cqrs-serverless/mbc-review

SKILL.md

The same SKILL.md was published earlier as mbc-net/mbc-cqrs-serverless/mbc-review.

Pre-flight Check (Version Update)

Before executing this skill, check for updates:

  1. Run mbc install-skills --check to check if a newer version is available
  2. 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?"
  1. If the user agrees, run mbc install-skills --force to update
  2. 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 Code Review

This skill reviews code for MBC CQRS Serverless best practices and identifies anti-patterns.

⚠️ Important: Two Anti-Pattern Code Systems

This codebase currently has two independent `AP00X` numbering systems that are NOT interchangeable:

  1. Skill `AP` codes (this document) — used in human-facing reviews and documentation. Stable identifiers for discussion.
  2. Detector `AP` codes (output of the mbc_check_anti_patterns tool, defined in src/tools/analyze.ts) — used by the static analysis tool. Numbered in detector implementation order.

Only AP016, AP017, AP018, AP019, and AP021 happen to refer to the same concept in both systems. All other AP numbers diverge — for example, the detector's AP005: Hardcoded Tenant corresponds to this document's AP002: Missing tenantCode. Do not assume the codes match.

Cross-reference table (detector → skill doc):

Detector code (analyze.ts)Skill doc code (this file)Topic
AP001 Direct DynamoDB WriteAP012Bypassing CommandService / DataService
AP002 Ignored Version MismatchAP005ConditionalCheckFailedException handling
AP003 N+1 Query Pattern— (detector only)Query in a loop
AP004 Full Table Scan— (detector only).scan() usage
AP005 Hardcoded TenantAP002Multi-tenant code/key handling
AP006 Missing Tenant ValidationAP002Trusting client-provided tenantCode
AP007 Throwing in Sync Handler— (detector only)DataSyncHandler error escape
AP008 Hardcoded Secret— (detector only)Secrets in code
AP009 Manual JWT Parsing— (detector only)Bypassing Cognito authorizer
AP010 Heavy Module Import— (detector only)Cold-start optimization
AP011 Deprecated Method UsageAP010publish() / publishPartialUpdate() removal
AP012 Uppercase COMMON Tenant Key— (detector only)v1.1.0 tenant key migration
AP013 publishSync Null Return UncheckedAP001 (related)publishSync v1.2.0+ return
AP014 Deprecated genNewSequenceAP010 (related)v1.2.0 sequence API change
AP015 Duplicate TaskModule Registration— (detector only)v1.2.4 global TaskModule
AP016 Missing Error Logging Before RethrowAP016✅ same code
AP017 Incorrect Attribute MergingAP017✅ same code
AP018 Missing Swagger DocumentationAP018✅ same code
AP019 Missing Pagination in List QueriesAP019✅ same code
AP020 Missing getCommandSource for TracingAP011Tracing/audit
AP021 Event Emit After publishAsyncAP021✅ same code
AP022 Use of eval() or Function() Constructor— (detector only)RCE/XSS sink (CWE-95)
AP023 Shell Command Built from String Concatenation— (detector only)Command injection (CWE-78)
AP024 HTTP Request Without Timeout— (detector only)Local DoS via stalled upstream (CWE-400)
AP025 Logging process.env or full request object— (detector only)Sensitive data exposure (CWE-312, CWE-532)
AP026 @Injectable instead of @NotificationTransport— (detector only)INotificationTransport implementor never invoked
AP027 GroupRoleResolver also annotated with @InjectableAP022Incorrect group-based role resolver (v1.3.1+)
AP028 Duplicate DataSyncHandler RegistrationAP023✅ same code
AP029 Reserved DataSyncHandler TypeAP024✅ same code
AP030 Fully-Qualified Table Name in @DataSyncHandlerAP025✅ same code

When you receive mbc_check_anti_patterns output, look up the detector code in this table to find the corresponding skill-doc section for full context and recommended fixes. Future versions of this framework should consolidate the two systems; until then, treat them as separate identifier spaces.

Anti-Patterns to Detect

AP001: Using publishSync Instead of publishAsync

Severity: Warning

Pattern:

typescript
// Bad
await this.commandService.publishSync(command, options)
// Good
await this.commandService.publishAsync(command, options)

Explanation: publishAsync is the recommended default. Only use publishSync when immediate consistency is absolutely required, as it blocks until processing completes.


AP002: Missing tenantCode in Multi-Tenant Operations

Severity: Error

Pattern:

typescript
// Bad
const pk = `ORDER#${code}`
// Good
const { tenantCode } = getUserContext(invokeContext)
const pk = `ORDER#${tenantCode}`

Explanation: All operations must include tenantCode for proper tenant isolation.


AP003: Hardcoded Version Numbers

Severity: Error

Pattern:

typescript
// Bad
version: 1,
version: 0,
// Good
version: VERSION_FIRST, // For new entities (0)
version: existingItem.version, // For updates

Explanation: Use VERSION_FIRST constant for new entities. For updates, always fetch the current version to enable optimistic locking.


AP004: Missing DataSyncHandler Registration

Severity: Error

Pattern:

typescript
// Bad
CommandModule.register({
tableName: 'order',
// dataSyncHandlers missing!
}),
// Good
CommandModule.register({
tableName: 'order',
dataSyncHandlers: [OrderDataSyncRdsHandler],
}),

Explanation: If you have DataSyncHandlers, they must be registered in the module.


AP005: Not Handling ConditionalCheckFailedException

Severity: Warning

Pattern:

typescript
// Bad
await this.commandService.publishAsync(command, options)
// Good
try {
await this.commandService.publishAsync(command, options)
} catch (error) {
if (error.name === 'ConditionalCheckFailedException') {
// Handle version conflict - retry or inform user
throw new ConflictException('Data was modified by another user')
}
throw error
}

Explanation: Optimistic locking can cause version conflicts that should be handled gracefully.


AP006: Using Wrong PK/SK Format

Severity: Error

Pattern:

typescript
// Bad - inconsistent format
const pk = `order-${tenantCode}`
const sk = `order_${code}`
// Good - consistent ENTITY#value format
const pk = `ORDER#${tenantCode}`
const sk = `ORDER#${code}`

Explanation: Follow the ENTITY#value convention for partition and sort keys.


AP007: Missing invokeContext in Service Methods

Severity: Error

Pattern:

typescript
// Bad
async create(dto: CreateOrderDto) {
// No way to get user context
}
// Good
async create(dto: CreateOrderDto, invokeContext: IInvoke) {
const { tenantCode, userId } = getUserContext(invokeContext);
}

Explanation: invokeContext is required to extract user information and tenant context.


AP008: Not Using generateId for Entity IDs

Severity: Warning

Pattern:

typescript
// Bad
id: uuid(),
id: `${pk}-${sk}`,
// Good
id: generateId(pk, sk),

Explanation: Use generateId() for consistent ID generation across the framework.


AP009: Missing DTO Validation Decorators

Severity: Warning

Pattern:

typescript
// Bad
export class CreateOrderDto {
code: string
name: string
}
// Good
export class CreateOrderDto {
@IsString()
@IsNotEmpty()
code: string
@IsString()
@IsNotEmpty()
name: string
}

Explanation: Always use class-validator decorators for input validation.


AP010: Deprecated Method Usage

Severity: Warning

Pattern:

typescript
// Bad - deprecated
await this.commandService.publish(command, options)
await this.commandService.publishPartialUpdate(command, options)
// Good - use Async variants
await this.commandService.publishAsync(command, options)
await this.commandService.publishPartialUpdateAsync(command, options)

Explanation: The non-Async methods are deprecated. Use publishAsync and publishPartialUpdateAsync.


AP011: Missing getCommandSource for Tracing

Severity: Warning

Pattern:

typescript
// Bad - no source tracking
await this.commandService.publishAsync(command, {
invokeContext,
})
// Good - with source tracking
const commandSource = getCommandSource(
basename(__dirname),
this.constructor.name,
'create',
)
await this.commandService.publishAsync(command, {
source: commandSource,
invokeContext,
})

Explanation: Always include source in publish options for debugging and audit trails.


AP012: Direct DynamoDB Access Instead of DataService

Severity: Warning

Pattern:

typescript
// Bad - direct DynamoDB access
import { DynamoDBClient, GetItemCommand } from '@aws-sdk/client-dynamodb'
const client = new DynamoDBClient({})
const result = await client.send(
new GetItemCommand({
TableName: 'my-table',
Key: { pk: { S: 'ORDER#tenant' }, sk: { S: 'ORDER#123' } },
}),
)
// Good - use DataService
const result = await this.dataService.getItem({ pk, sk })

Explanation: Use DataService for read operations. It provides caching, consistent interfaces, and proper error handling.


AP013: Missing Type Declaration in DataSyncHandler

Severity: Error

Pattern:

typescript
// Bad - missing type
@DataSyncHandler({})
export class OrderDataSyncRdsHandler implements IDataSyncHandler {
// ...
}
// Good - with type declaration
@DataSyncHandler({ type: 'ORDER' })
export class OrderDataSyncRdsHandler implements IDataSyncHandler {
// ...
}

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
29
Repository forks
5
7-day trend score
17

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 21 Mar 2026, 8 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/mbc-net/mbc-cqrs-serverless/mbc-review/badge)](https://verified-skill.com/skills/mbc-net/mbc-cqrs-serverless/mbc-review)

Something wrong with this skill or its page? Tell us.