.agents/skills/api-add-review/SKILL.md
This skill has two modes:
Both modes share the same design rules and quality bar.
| User says | Mode |
|---|---|
| "add", "expose", "wrap", "create binding" | Add |
| "review", "check API", "look at PR" | Review |
| Issue classified as "New API" | Add |
| Self-review after adding | Review (automatic) |
🛑 NEVER commit directly to protected branches. This is a policy violation.
| Repository | Protected Branches | Required Action |
|---|---|---|
| SkiaSharp (parent) | main | Create feature branch first |
| externals/skia (submodule) | main, skiasharp | Create feature branch first |
| Shortcut | Consequence |
|---|---|
Commit directly to main or skiasharp | Policy violation |
Edit *.generated.cs manually | Overwritten on regenerate |
| Skip native build after C API change | EntryPointNotFoundException |
| Skip tests | Unacceptable |
| Skip tests because they fail | Unacceptable — fix the issue |
| Use default parameters in public APIs | ABI breaking change |
| Invent type names not in upstream Skia | Confusing, wrong naming |
| Add XML doc comments | Inserted by separate process |
| Fabricate test fonts | Use real fonts from known sources |
All three references work together:
| File | Purpose | When to read |
|---|---|---|
| references/api-design-rules.md | Naming, properties vs methods, Span patterns, type wrapping, test and sample requirements | Always — before writing or reviewing any API |
| references/add-workflow.md | Step-by-step add workflow with C API patterns, struct conversion, JSON config, gallery samples | Add mode |
| references/review-workflow.md | Structured review checklist, test coverage analysis, sample review, auto-fix mode | Review mode, and as final phase of add mode |
| references/troubleshooting.md | Common errors and fixes | When something goes wrong |