Parent
Subtask of #5408. Shipped on draft PR #5409.
Spec
One locator policy everywhere generated Java is taught:
- Unique author-written id:
SHAFT.GUI.Locator.hasAnyTagName().hasId(...).build()
- ARIA:
SHAFT.GUI.Locator.hasRole(...)
- Native relative
By.xpath(...) only when neither exists
- Never
SHAFT.GUI.Locator.xpath(...) or raw Locator.id/name/cssSelector/className/tagName(...)
Must delete the inverted MCP rule “ARIA first, then the SHAFT.GUI.Locator XPath builder”.
GeneratedCodeGuardrails.NO_ABSOLUTE_XPATH must not recommend a Locator XPath builder.
shaft-locator-design valid examples stay legal builder calls. Playbook practice 5 names the xpath factory without the exact call shape that false-triggered RECORD.
shaft-page-objects practice 3 states the same ladder.
Files
shaft-mcp/src/main/java/com/shaft/mcp/TestAutomationService.java
shaft-mcp/src/test/java/com/shaft/mcp/TestAutomationServiceTest.java
shaft-capture/src/main/java/com/shaft/capture/guardrail/GeneratedCodeGuardrails.java
shaft-skills/shaft-locator-design/references/playbook.md
shaft-skills/shaft-page-objects/references/playbook.md
tests/scripts/test_shaft_skills_content.py
Proof
mvn -pl shaft-mcp,shaft-capture -Dtest=TestAutomationServiceTest,GeneratedCodeGuardrailsTest test
python3 -m unittest tests.scripts.test_shaft_skills_content
Parent
Subtask of #5408. Shipped on draft PR #5409.
Spec
One locator policy everywhere generated Java is taught:
SHAFT.GUI.Locator.hasAnyTagName().hasId(...).build()SHAFT.GUI.Locator.hasRole(...)By.xpath(...)only when neither existsSHAFT.GUI.Locator.xpath(...)or rawLocator.id/name/cssSelector/className/tagName(...)Must delete the inverted MCP rule “ARIA first, then the SHAFT.GUI.Locator XPath builder”.
GeneratedCodeGuardrails.NO_ABSOLUTE_XPATHmust not recommend a Locator XPath builder.shaft-locator-designvalid examples stay legal builder calls. Playbook practice 5 names the xpath factory without the exact call shape that false-triggered RECORD.shaft-page-objectspractice 3 states the same ladder.Files
shaft-mcp/src/main/java/com/shaft/mcp/TestAutomationService.javashaft-mcp/src/test/java/com/shaft/mcp/TestAutomationServiceTest.javashaft-capture/src/main/java/com/shaft/capture/guardrail/GeneratedCodeGuardrails.javashaft-skills/shaft-locator-design/references/playbook.mdshaft-skills/shaft-page-objects/references/playbook.mdtests/scripts/test_shaft_skills_content.pyProof
mvn -pl shaft-mcp,shaft-capture -Dtest=TestAutomationServiceTest,GeneratedCodeGuardrailsTest testpython3 -m unittest tests.scripts.test_shaft_skills_content