# Cursor Rule Scoping Tests


**Last Updated:** 2025-11-20

This document logs dry-run tests for each page type to validate that the correct rules trigger and generate quality plans.

## Test Methodology

For each page type, we prompt Cursor (Plan Mode) with a representative task and observe:

1. Which rules automatically attach
2. Plan quality (file paths, selectors, validation steps)
3. Risk callouts and guardrails mentioned
4. Tool suggestions (Multi-Edit, block replacement, etc.)

## Test Scenarios

### 1. Product Page Test

**Prompt:**

```
Update `v2/pages/product_timetracking.php`: refresh hero headline to emphasize legal compliance benefit, update feature list with new mobile app features, and add testimonial from a Pflege customer. Ensure SoftwareApplication schema includes latest pricing (€89/Standort/Monat) and features. Keep du tone, mention Ordio once per section.
```

**Expected Rules:**

- `global.mdc` (always applies)
- `product-pages.mdc` (scoped to `v2/pages/product_*.php`)

**Expected Plan Quality:**

- File paths: `v2/pages/product_timetracking.php`, `v2/css/product-pages.css` (reference only)
- Selectors: Hero h1, benefits list (lines X-Y), testimonial section, SoftwareApplication schema
- Validation: Schema validation (SoftwareApplication, Service), du tone check, CTA links, local preview
- Tool: Multi-Edit for feature list items, block replacement for hero, targeted edit for schema
- Risks: Unintended layout changes, missing Ordio mention, schema errors

**Status:** ⏳ Pending user test

---

### 2. Industry Page Test

**Prompt:**

```
Update `v2/pages/industry_retail.php`: add use case for seasonal staff planning during holiday season, update challenges section with "Personalkostenkontrolle" pain point, and refresh FAQ with question about Filialübergreifende Planung. Ensure Industry schema includes current customer count (300+ Einzelhandel customers). Use authentic Einzelhandel terminology, du tone.
```

**Expected Rules:**

- `global.mdc`
- `industry-pages.mdc` (scoped to `v2/pages/industry_*.php`)

**Expected Plan Quality:**

- File paths: `v2/pages/industry_retail.php`
- Selectors: Use cases section, challenges list, FAQ item, Industry schema
- Validation: Industry terminology check, use case authenticity, schema validation (Industry, Service), du tone
- Tool: Multi-Edit for challenge list, block replacement for use case, targeted edit for schema
- Risks: Generic copy, wrong terminology, inauthentic use cases

**Status:** ⏳ Pending user test

---

### 3. Tools Page Test

**Prompt:**

```
Update `v2/pages/tools_arbeitstage_rechner.php`: add input field for custom holiday dates, update calculation logic to account for regional holidays (Bayern, NRW, etc.), and ensure Excel export follows Ordio branding (no purple, proper column widths, no header borders). Test with edge cases (empty inputs, year 2026). Keep du tone, dotted background pattern.
```

**Expected Rules:**

- `global.mdc`
- `tools-pages.mdc` (scoped to `v2/pages/tools_*.php`, `v2/css/tools-pages.css`)

**Expected Plan Quality:**

- File paths: `v2/pages/tools_arbeitstage_rechner.php`, calculation JavaScript, Excel export function
- Selectors: Form inputs, calculation logic, export handler
- Validation: Calculator test (valid/invalid inputs), export test (Excel branding), responsive check, schema validation (HowTo)
- Tool: Targeted edits for form fields and logic, test with edge cases
- Risks: Breaking calculation logic, Excel branding violations, missing validation

**Status:** ⏳ Pending user test

---

### 4. Templates Page Test

**Prompt:**

```
Update `v2/pages/templates_dienstplan.php`: add customizer field for "Pausenregelung" (break rules), update preview rendering to show breaks in schedule, and ensure Excel export follows Ordio branding (no purple, relevant brand colors, proper column widths, no header borders). Test customizer state management with various inputs.
```

**Expected Rules:**

- `global.mdc`
- `templates-pages.mdc` (scoped to `v2/pages/templates_*.php`, `v2/css/templates-pages.css`)

**Expected Plan Quality:**

- File paths: `v2/pages/templates_dienstplan.php`, customizer JavaScript, Excel export function
- Selectors: Customizer UI, preview rendering, export handler
- Validation: Customizer test (all inputs), preview update check, Excel branding compliance, schema validation (DigitalDocument, HowTo)
- Tool: Targeted edits for customizer fields and preview logic
- Risks: Customizer state bugs, Excel branding violations, preview rendering errors

**Status:** ⏳ Pending user test

---

### 5. Download Page Test

**Prompt:**

```
Update `v2/pages/download_lohnabrechnungen.php`: refresh hero copy to emphasize "Fehlerfreie Lohnabrechnung" benefit, update form fields to include "Anzahl Mitarbeiter" field, and verify file download triggers correctly. Ensure GDPR consent checkbox present and functional. Du tone.
```

**Expected Rules:**

- `global.mdc`
- `download-pages.mdc` (scoped to `v2/pages/download_*.php`)

**Expected Plan Quality:**

- File paths: `v2/pages/download_lohnabrechnungen.php`, form handler
- Selectors: Hero copy, form fields, GDPR checkbox, file download trigger
- Validation: Form validation test, GDPR checkbox check, file download test, schema validation (DigitalDocument)
- Tool: Block replacement for hero, targeted edit for form fields
- Risks: Missing GDPR consent, broken file download, form validation errors

**Status:** ⏳ Pending user test

---

### 6. Webinar Page Test

**Prompt:**

```
Update `v2/pages/webinar_sozialversicherung.php`: change webinar date to 2025-12-15 14:00 CET, update agenda with new topic "Minijob-Grenzen 2025", and verify calendar download (.ics) includes correct details. Test registration form with valid/invalid inputs. Du tone.
```

**Expected Rules:**

- `global.mdc`
- `webinar-pages.mdc` (scoped to `v2/pages/webinar_*.php`)

**Expected Plan Quality:**

- File paths: `v2/pages/webinar_sozialversicherung.php`, calendar file (.ics)
- Selectors: Date/time display, agenda section, Event schema, .ics file
- Validation: Date/time accuracy (with timezone!), calendar file validity, registration form test, schema validation (Event)
- Tool: Targeted edits for date/time and agenda, verify .ics file
- Risks: Wrong timezone, invalid .ics format, schema date errors

**Status:** ⏳ Pending user test

---

### 7. Pillar Page Test

**Prompt:**

```
Update `v2/pages/pillar_dienstplan.php`: add section on "Digitale Dienstplanung vs. Excel", update internal links to include new comparison pages (compare_planday, compare_shiftbase), and refresh FAQ with question "Wie erstelle ich einen rechtssicheren Dienstplan?". Ensure Article + FAQPage schema current. Du tone, keyword-optimized, natural Ordio mentions.
```

**Expected Rules:**

- `global.mdc`
- `pillar-pages.mdc` (scoped to `v2/pages/pillar_*.php`)

**Expected Plan Quality:**

- File paths: `v2/pages/pillar_dienstplan.php`
- Selectors: New section location, internal links, FAQ item, Article/FAQPage schema
- Validation: Internal link check (all functional), FAQ quality, schema validation (Article, FAQPage), keyword presence, du tone
- Tool: Block replacement for new section, Multi-Edit for internal links, targeted edit for FAQ
- Risks: Broken internal links, thin content, keyword stuffing, forced Ordio mentions

**Status:** ⏳ Pending user test

---

### 8. Static Page Test (Pricing)

**Prompt:**

```
Update `v2/pages/static_pricing_new.php` (`/preise`): refresh plan/add-on pricing in `pricing-data.php` and schema, update `comparison-table-data.json` to include "API-Zugang" where applicable, and ensure free trial CTA prominent. Verify FAQ JSON-LD parity. Du tone.
```

**Expected Rules:**

- `global.mdc`
- `static-pages.mdc` (scoped to `v2/pages/static_*.php`)

**Expected Plan Quality:**

- File paths: `v2/pages/static_pricing_new.php`
- Selectors: Pricing table, feature comparison, CTA
- Validation: Pricing accuracy check, feature comparison completeness, CTA prominence, schema validation (WebPage)
- Tool: Multi-Edit for pricing table rows, targeted edit for feature comparison
- Risks: Incorrect pricing, missing features, CTA not prominent

**Status:** ⏳ Pending user test

---

### 9. Homepage Test

**Prompt:**

```
Update `v2/pages/landingpage.php`: refresh hero headline to "Ordio – Smarte Personalplanung für moderne Teams", update value props with new benefit "Spare bis zu 10 Stunden pro Woche", and add testimonial from Einzelhandel customer. Ensure hero image preloaded, LCP < 2.5s. Du tone, conversion-focused.
```

**Expected Rules:**

- `global.mdc`
- `homepage.mdc` (scoped to `v2/pages/landingpage*.php`, `v2/pages/start*.php`)

**Expected Plan Quality:**

- File paths: `v2/pages/landingpage.php`
- Selectors: Hero headline, value props section, testimonial, hero image preload tag
- Validation: Performance check (LCP, CLS, PageSpeed), schema validation (WebSite, Organization), CTA functionality, du tone
- Tool: Targeted edits for hero and value props, verify preload tag
- Risks: Slow LCP, vague headline, missing preload tag, layout shifts

**Status:** ⏳ Pending user test

---

### 10. Base Component Test (HIGH PROTECTION)

**Prompt:**

```
I need to update `v2/base/header.php` to add a new navigation link for "Webinare". This affects all Ordio pages. Should I proceed? I'll test on product, industry, tools, comparison, and homepage before finalizing.
```

**Expected Rules:**

- `global.mdc`
- `base-components.mdc` (scoped to `v2/base/*.php`)

**Expected Plan Quality:**

- File paths: `v2/base/header.php`
- Selectors: Navigation menu
- Validation: **HIGH PROTECTION WARNING**, request explicit approval, test plan for multiple page types (product, industry, tools, comparison, homepage), no unintended side effects
- Tool: Targeted edit for navigation link, extensive testing
- Risks: **Breaking all pages**, navigation issues, mobile menu problems

**Expected Behavior:** Agent should ask for explicit approval before proceeding and emphasize the high-risk nature of the change.

**Status:** ⏳ Pending user test

---

### 11. API Endpoint Test

**Prompt:**

```
Update `v2/api/lead-capture.php`: add validation for new "company_size" field (required, must be one of: "1-10", "11-50", "51-200", "200+"), improve error handling for HubSpot API failures (retry logic), and ensure all submissions log to `logs/lead-capture.log`. Test with valid/invalid inputs.
```

**Expected Rules:**

- `global.mdc`
- `api-endpoints.mdc` (scoped to `v2/api/*.php` excluding ShiftOps)

**Expected Plan Quality:**

- File paths: `v2/api/lead-capture.php`, `logs/lead-capture.log`
- Selectors: Validation logic, error handling, logging
- Validation: Input validation test (valid/invalid), error scenario test (API failure), logging check, security review
- Tool: Targeted edits for validation, error handling, logging
- Risks: Missing validation, exposed errors, no rate limiting, security vulnerabilities

**Status:** ⏳ Pending user test

---

### 12. Comparison Page Test (Existing Rule)

**Prompt:**

```
Update `v2/pages/compare_planday.php`: refresh hero copy to du tone, update pricing table with latest Planday pricing (€4.50/user/month), and regenerate schema. Keep comparison layout + CSS untouched.
```

**Expected Rules:**

- `global.mdc`
- `comparison-pages.mdc` (scoped to `v2/pages/compare_*.php`)

**Expected Plan Quality:**

- File paths: `v2/pages/compare_planday.php`, `COMPARISON_PAGES_GUIDE.md` (reference)
- Selectors: Hero copy, pricing table rows, schema
- Validation: Du tone check, pricing accuracy, schema validation (Table, Product), visual diff (hero, table, FAQ), PageSpeed check
- Tool: Multi-Edit for table rows, block replacement for hero, targeted edit for schema
- Risks: Unintended class changes, missing preload tag, duplicate Ordio mentions

**Status:** ✅ Previously validated (see `docs/ai/cursor-validation.md`)

---

## Summary of Expected Behavior

### Rule Attachment

- `global.mdc` should attach to **every** task
- Page-type-specific rules should attach based on file globs
- Multiple rules can attach (e.g., `global.mdc` + `product-pages.mdc`)

### Plan Quality Indicators

✅ **Good Plan:**

- Specific file paths
- Selectors or line ranges
- Validation steps listed
- Risk callouts mentioned
- Tool suggestions (Multi-Edit, block replacement, etc.)
- References to relevant docs (playbook, guides)

❌ **Bad Plan:**

- Vague language ("update the page")
- No file paths or selectors
- Missing validation steps
- No risk awareness
- Generic tool usage

### Next Steps

1. **User Testing:** User should run these prompts in Cursor Plan Mode and observe results
2. **Log Observations:** Document which rules attached, plan quality, any issues
3. **Iterate:** Adjust rule globs or content if scoping doesn't work as expected
4. **Monitor:** Track plan quality over time, log regressions

### Test Log Template

For each test, log:

```
## Test: [Page Type]
Date: [YYYY-MM-DD]
Prompt: [exact prompt used]
Rules Attached: [list of rules that triggered]
Plan Quality: [good/bad, specific observations]
Issues: [any problems or unexpected behavior]
Action Items: [fixes or improvements needed]
```

---

## Continuous Monitoring

- Run these tests weekly for the first month
- Log any plan regressions in this document
- Update rules if patterns emerge
- Consider automating plan quality checks (future)
