Skip to content

Commit 31cad07

Browse files
123pcclaude
andcommitted
feat(skill): add self-verification after construction
- New Self-Verification section: call geogebra_get_objects after building, check object count before claiming success - Decision table: count 0 = retry, 1-2 = warn, 3+ = proceed - Verify expected named objects appear in the list - Update First Contact flow and Completion Checklist - Prevents silent failures where AI claims success but GGB is empty Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 20d8c35 commit 31cad07

1 file changed

Lines changed: 28 additions & 4 deletions

File tree

‎skills/geogebra-master/SKILL.md‎

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ This skill follows the official GeoGebra tutorial structure: Graphing, Geometry,
2020
- Use `geogebra_create_construction` for complete named constructions.
2121
- Use `geogebra_run_commands` for ordered command batches.
2222
- Use `geogebra_exec` only for one-off commands or quick repair.
23-
7. Verify with `geogebra_get_objects`, `geogebra_save`, or `geogebra_export_png`.
23+
7. **After all commands, call `geogebra_get_objects` to verify the construction is not empty.**
24+
8. If verification passes, save with `geogebra_save` and optionally `geogebra_export_png`.
2425

2526
## Construction Order
2627

@@ -37,6 +38,29 @@ Build in dependency order:
3738

3839
Prefer ASCII object names and labels (`alpha`, `beta`, `O1`, `O2`, `crank`) unless the environment is known to preserve Unicode reliably.
3940

41+
## Self-Verification — MANDATORY
42+
43+
After sending all construction commands and before telling the user "done", call `geogebra_get_objects` to verify the construction actually has content.
44+
45+
```text
46+
Call: geogebra_get_objects()
47+
Expected response: {"success": true, "objects": [...], "count": N}
48+
```
49+
50+
**Decision logic based on `count`:**
51+
52+
| count | Action |
53+
|-------|--------|
54+
| 0 | **The construction is empty.** Do NOT claim success. Report: "The GeoGebra construction appears empty — commands may have failed silently. Let me retry with simplified commands." Retry from `geogebra_new_construction`. |
55+
| 1–2 | **Suspiciously low.** The user probably can't see the intended drawing. Report the low count, list the objects found, and retry or ask the user what they expected. |
56+
| 3+ | **Acceptable.** Proceed to save and export. |
57+
58+
**If verification fails after 2 attempts:** be honest with the user. Report the commands that were sent, the objects that GeoGebra returned, and suggest running `geogebra-mcp-doctor` to check the environment.
59+
60+
**Also verify by inspecting object names:**
61+
- If the user asked for a mechanism with segments named `crank`, `coupler`, `rocker`, check that those names appear in the objects list.
62+
- If expected objects are missing, resend only the missing commands.
63+
4064
## Command Idioms
4165

4266
Use these patterns as building blocks:
@@ -247,9 +271,9 @@ Before saying the drawing is done:
247271
- The connection status was checked or the tool call succeeded.
248272
- A fresh construction was used when appropriate.
249273
- Commands were issued in dependency order.
274+
- **`geogebra_get_objects` was called and returned count >= 3.** Do NOT claim success on 0 objects.
275+
- **Expected named objects (e.g., crank, coupler, rocker) appear in the objects list.**
250276
- **For mechanisms: the angle slider is created, `geogebra_set_appearance` made it visible, AND `geogebra_animate` was called with `animate=true`.**
251277
- User can see the slider in the Graphics view and the mechanism is autoplaying.
252-
- Objects were verified or a saved/exported path was returned.
253-
- Animation has a real slider driver if motion was requested.
254278
- The `.ggb` file was saved to the user-confirmed output path.
255-
- The response tells the user what was created and where files were saved.
279+
- The response tells the user what was created, the object count, and where files were saved.

0 commit comments

Comments
 (0)