Skip to content

Instantly share code, notes, and snippets.

View mcsee's full-sized avatar
🏠
Working from home

mcsee mcsee

🏠
Working from home
View GitHub Profile
@mcsee
mcsee / good-prompt.md
Last active August 28, 2026 17:54
AI Coding Tip 034 - Good Prompt: check for an existing rule before adding a new one

Before you add a new rule to AGENTS.md

Check for an existing one first.

See whether it already covers this case.

If this is the first time it happened, fix it in this session only.

Don't touch the file yet.

@mcsee
mcsee / bad-prompt.md
Created August 28, 2026 17:52
AI Coding Tip 034 - Bad Prompt: hoarding rules instead of pruning them

The AI keeps adding a trailing comma the wrong way. Add a permanent rule to AGENTS.md telling it never to do that again. Don't ever remove anything from this file. It doesn't matter how old the rule gets or how the model changes.

Here is the current skill list, for context. 247 skills loaded, six more pending review.

Skill tabs-not-spaces: MANDATORY REQUIRED CRITICAL. Never use spaces.

@mcsee
mcsee / good-prompt.md
Created August 23, 2026 19:18
AI Coding Tip 033 - Good Prompt

The checkout discount test expects 15% off for orders over $100, but the code applies 10%.

Fix the discount calculation, not the test.

Don't delete, skip, or comment out this test or any other test.

Don't modify test files.

Explain the root cause before you write the fix.

@mcsee
mcsee / bad-prompt.md
Created August 23, 2026 19:18
AI Coding Tip 033 - Bad Prompt

The checkout discount test is failing.

Fix it so all tests pass.

@mcsee
mcsee / right-example.js
Created August 17, 2026 13:10
Code Smell 321 - Getter Piggybacking - Right
// Food still exposes useByDate() for the shelf label.
//
// Being expired is now a question Food answers itself,
// through isExpiredOn(), instead of every external
// function reimplementing the comparison from the
// getter on its own.
class Food {
constructor(name, useByDate) {
this.name = name;
this.useByDateValue = useByDate;
@mcsee
mcsee / wrong-example.js
Created August 17, 2026 13:10
Code Smell 321 - Getter Piggybacking - Wrong
// Food needs to show its use-by date on the shelf
// label, so useByDate() exists for that one reason.
//
// Later, removeExpiredFood() needs to pull expired
// products, so it reuses useByDate() and compares the
// result to today itself, outside Food.
//
// flagNearExpiryFood() needs almost the same check, so
// it also calls useByDate() and writes its own slightly
// different comparison.
@mcsee
mcsee / good-prompt.md
Created August 16, 2026 14:00
AI Coding Tip 032 - Good Prompt: builder and adversarial verifier from different vendors, sampled by a human

Model A (builder): write the pull request for the new caching layer from the attached spec. Don't approve your own diff.

Model B (verifier, different vendor than Model A): review the diff looking only for defects. Reject it if you find any, and explain exactly what's wrong. Don't fix it yourself.

Route 10% of every batch of merged pull requests, chosen at random, to a human reviewer. Log every case where the human overrides Model B's verdict, in either direction.

@mcsee
mcsee / bad-prompt.md
Created August 16, 2026 14:00
AI Coding Tip 032 - Bad Prompt: same model reviews its own PR

Write the pull request for the new caching layer, then review your own diff and tell me if it's ready to merge.

If it looks fine to you, merge it directly. I don't need to see it unless you have doubts about your own work.

@mcsee
mcsee / meta-prompt.md
Created August 6, 2026 03:08
AI Coding Tip 031 - Meta-prompt: convert an old prompt to the 2026 template

Rewrite the prompt below for a reasoning model.

Remove: forced verification lines ("double-check your work", "review before answering"), "think deeply" or "think hard" phrasing, SIEMPRE/NUNCA rules written for judgment calls instead of real invariants, a bare "be concise" with no specifics, and any rule that's stated more than once.

Add: an explicit effort level (low, medium, high, or max), an explicit scope boundary, an explicit output length, and

@mcsee
mcsee / good-prompt.md
Created August 6, 2026 03:06
AI Coding Tip 031 - Good prompt: 2026 template with effort, scope, and stopping rules

Role: Senior backend engineer refactoring a payment module. Objective: Extract the retry logic in PaymentGateway into its own class. Success criteria: Existing tests pass. Retry behavior stays the same. No new public methods on PaymentGateway. Constraints: Don't touch the database schema. Don't add new dependencies. Output format: A diff, followed by a two-sentence summary of what moved. Stopping rules: If a test needs new mocking infrastructure to