Skip to content
Back to skills

Cheat Sheet

ASecurity

Quick reference for common patterns and code snippets. Use this when you need a fast lookup of project conventions.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
testingapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill cheat-sheet --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cheat Sheet?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cheat Sheet
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-cheat-sheet/badge)](https://www.skillsdirectory.com/skills/david-li0406-cheat-sheet)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cheat-sheet
description: Quick reference for common patterns and code snippets. Use this when you need a fast lookup of project conventions.
---

# BookStore Cheat Sheet

## IDs & Timestamps
```csharp
var id = Guid.CreateVersion7();           // ✅ UUIDv7
var now = DateTimeOffset.UtcNow;          // ✅ UTC timestamp
```

## Event (past tense, record)
```csharp
public record BookAdded(Guid Id, string Title, decimal Price);
```

## Command (record)
```csharp
public record AddBookCommand(string Title, decimal Price);
```

## Aggregate Apply Method
```csharp
public void Apply(BookAdded @event)
{
    Id = @event.Id;
    Title = @event.Title;
}
```

## Handler (static, Wolverine)
```csharp
public static class AddBookHandler
{
    public static BookAdded Handle(AddBookCommand cmd) =>
        new(Guid.CreateVersion7(), cmd.Title, cmd.Price);
}
```

## HybridCache Query
```csharp
var result = await cache.GetOrCreateAsync(
    $"books:{culture}",
    async ct => await session.Query<BookProjection>().ToListAsync(ct),
    tags: [CacheTags.BookList],
    cancellationToken: ct);
```

## Cache Invalidation
```csharp
await cache.RemoveByTagAsync(CacheTags.BookList, ct);
```

## SSE Notification
```csharp
public record BookUpdatedNotification(Guid Id) : IDomainEventNotification;
```

## TUnit Test
```csharp
[Test]
public async Task Should_Create_Book()
{
    var result = await client.CreateBookAsync(request);
    await Assert.That(result.Id).IsNotNull();
}
```

## Namespace
```csharp
namespace BookStore.ApiService.Handlers;  // ✅ File-scoped
```

## Related Skills
- `/scaffold-write` - Full command implementation
- `/scaffold-read` - Full query implementation
- `/scaffold-aggregate` - Full aggregate setup

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…