Writing skills

From mkurman/zorai · View interactive version

Writing skills is an AI agent skill from the GitHub repository mkurman/zorai. Use when creating new skills, editing existing skills, or verifying skills work before deployment

How to use this skill

Skill file

|

| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |

| "I'll test after" | Tests passing immediately prove nothing. |

| "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |


### Create Red Flags List

Make it easy for agents to self-check when rationalizing:

Red Flags - STOP and Start Over

All of these mean: Delete code. Start over with TDD.


### Update CSO for Violation Symptoms

Add to description: symptoms of when you're ABOUT to violate the rule:

description: use when implementing any feature or bugfix, before writing implementation code


## RED-GREEN-REFACTOR for Skills

Follow the TDD cycle:

### RED: Write Failing Test (Baseline)

Run pressure scenario with subagent WITHOUT the skill. Document exact behavior:
- What choices did they make?
- What rationalizations did they use (verbatim)?
- Which pressures triggered violations?

This is "watch the test fail" - you must see what agents naturally do before writing the skill.

### GREEN: Write Minimal Skill

Write skill that addresses those specific rationalizations. Don't add extra content for hypothetical cases.

Run same scenarios WITH skill. Agent should now comply.

### REFACTOR: Close Loopholes

Agent found new rationalization? Add explicit counter. Re-test until bulletproof.

**Testing methodology:** See @testing-skills-with-subagents.md for the complete testing methodology:
- How to write pressure scenarios
- Pressure types (time, sunk cost, authority, exhaustion)
- Plugging holes systematically
- Meta-testing techniques

## Anti-Patterns

### ❌ Narrative Example
"In session 2025-10-03, we found empty projectDir caused..."
**Why bad:** Too specific, not reusable

### ❌ Multi-Language Dilution
example-js.js, example-py.py, example-go.go
**Why bad:** Mediocre quality, maintenance burden

### ❌ Code in Flowcharts

step1 [label="import fs"];

step2 [label="read file"];

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.