| name | prompt-audit |
| description | Audit AI prompts and rules for web navigation and testing. Use when reviewing src/ai/rules.ts, navigator.ts, or tools.ts for contradictions, gaps, locator guidance, or tool/schema consistency. |
Prompt and rules audit (Explorbot)
Instructions for auditing navigation and testing prompts in this repository.
When to apply
Use this workflow when asked to audit rules, navigation prompts, tool definitions, or when checking consistency across rules.ts, navigator.ts, and tools.ts.
Files to read
| File | Role |
|---|
src/ai/rules.ts | Locator, action, and verification rules |
src/ai/navigator.ts | Prompts that consume those rules |
src/ai/tools.ts | Tool schemas, locator guidance, failure messages |
1. Rules (rules.ts)
- Contradictions: Conflicting guidance (e.g. ARIA-first vs text-first without ordering).
- Ambiguity: Text that can be read multiple ways; missing definitions.
- Gaps: No explicit priority, disambiguation, or edge cases where the model needs them.
- Locator priority: ARIA → accessible name/text → CSS → XPath should be explicit if all are allowed.
- Context parameter: When it is required or optional; which tools or Codecept calls use it.
- Short vs long locators: What counts as "short" vs "long" and when each is appropriate.
- Dead exports: Rules exported but never imported.
2. Navigator (navigator.ts)
- Unused imports: Rule strings imported but not embedded in prompts.
- Missing injections: Prompts that need
locatorRule, actionRule, or verification text but omit them.
- Duplication: Inline guidance that repeats or diverges from
rules.ts.
- Structure: Comparable sections across similar prompts.
- HTML wrapping: Page HTML wrapped in
<page_html> (or the project's agreed tag) where required.
3. Tools (tools.ts)
- locatorRule: Present on tools that take locators, aligned with
rules.ts.
- Schema copy: Descriptions mention locator kinds the stack supports (e.g. ARIA, CSS, XPath) where relevant.
- Failures: Unsuccessful tool results include actionable
suggestion (or equivalent) text.
- Reachability: No branches that cannot run (e.g. validation that makes a path impossible).
- Consistency: Error and success shapes follow one pattern across tools.
- Differentiation: Descriptions state when to prefer one tool over another (e.g. click vs text-based variants, type with vs without locator).
Severity
| Level | Meaning | Examples |
|---|
| Critical | Wrong or unsafe model behavior | Contradictory rules, unreachable logic, required rules missing from prompts |
| High | Major confusion or misleading examples | Ambiguous locator order, wrong formats, schema vs prompt mismatch |
| Medium | Works but weak | Redundant prose, weak failure hints, uneven structure |
| Minor | Polish | Typos, spacing, heading inconsistency |
Output format
Use this structure in the audit reply:
## Audit Results
### Critical issues
1. **[path:line]** Summary
- Impact: …
- Fix: …
### High priority issues
1. **[path:line]** Summary
- Impact: …
- Fix: …
### Medium priority issues
1. **[path:line]** Summary
- Impact: …
- Fix: …
### Minor issues
1. **[path:line]** Summary
- Fix: …
### Observations
- Patterns and recommendations
- Open questions if anything is unclear
Deep checklist
Locator rules
Action rules
Verification rules
Tool definitions
Execution
- Read the three files above.
- Walk sections 1–3 and the deep checklist.
- Report findings in the output format, with file and line references.