Skip to content

Plugin Development: Validator Prompts

This file collects six end-to-end prompts for building a new Validator plugin, one of the 11 plugin types. Validators extend FCCValidator.from_registry() and the schema enforcement that runs ahead of every simulation. Each prompt pins personas, R.I.S.C.E.A.R. slots, and the deliverable shape.

Table of Contents

  1. Scope the Validator
  2. Skeleton the Validator Class
  3. Wire into the Scenario Loader
  4. Produce Actionable Errors
  5. Test the Validator
  6. Ship and Document

1. Scope the Validator

Personas/subsystems invoked. dal, ra. R.I.S.C.E.A.R. slot: Role + Input.

You are the Data Analyst Lead (dal). Risk Analyst (ra) reviews.

TASK: Produce a scoping doc for a new Validator plugin named
"persona_dimension_budget_validator" that verifies a scenario JSON
does not reference personas whose dimension profile would exceed a
team budget.

Include:
1. Inputs (scenario JSON path + dimension budget dict).
2. Validation checks (>= 3).
3. What the validator does NOT do (>= 3).
4. The one existing schema under src/fcc/data/schemas/ it reads.

CONSTRAINTS:
- No changes to the scenario schema itself.
- Only read persona data already loaded by PersonaRegistry.

Deliverable: 4-section Markdown, 200 to 350 words.

Expected output notes. 3+ checks, explicit non-goals, real schema path.


2. Skeleton the Validator Class

Personas/subsystems invoked. tr. R.I.S.C.E.A.R. slot: Expected Output.

You are the Technical Reviewer (tr).

TASK: Produce the Python skeleton at src/fcc/plugins/
persona_dimension_budget_validator.py.

Requirements:
1. Dataclass definition for the budget config.
2. Class with a validate(scenario_dict, registry) method.
3. Return a list of ValidationError instances (use the pattern already
   present in src/fcc/scenarios/).

CONSTRAINTS:
- No Pydantic.
- No Path(__file__) chains; use fcc._resources.

Deliverable: .py file body, 50 to 100 lines with docstrings.

Expected output notes. Dataclass config, real return type, fcc._resources used.


3. Wire into the Scenario Loader

Personas/subsystems invoked. tr, dal. R.I.S.C.E.A.R. slot: Constraints + Role Collaborators.

You are the Technical Reviewer (tr). Data Analyst Lead (dal) reviews.

TASK: Show exactly where the validator registers via
FCCValidator.from_registry() and how it composes with the existing
validators.

Requirements:
1. Diff-style patch (Markdown) showing the hook point.
2. Ordering: this validator runs after schema validation but before
   persona reference resolution.
3. Fail-fast vs collect-all: choose collect-all with a 10-error cap.

CONSTRAINTS:
- Do not alter signatures of existing validators.
- Respect the load order convention already in scenarios/.

Deliverable: a unified diff snippet plus a 2-paragraph justification.

Expected output notes. Diff preserves existing signatures, collect-all chosen with cap.


4. Produce Actionable Errors

Personas/subsystems invoked. cw, tr. R.I.S.C.E.A.R. slot: Style.

You are the Content Writer (cw). Technical Reviewer (tr) reviews.

TASK: Define the error message template for each of the 3 validator
checks. For each:
- One-line summary.
- JSON Pointer to the offending field.
- Suggested fix (<= 20 words).
- Doc link (relative path) where the user can read more.

CONSTRAINTS:
- No emojis.
- No blame language ("you did X wrong"); use neutral phrasing.

Deliverable: a 3-row table plus a short style guide paragraph.

Expected output notes. 3 rows with JSON Pointer paths; neutral tone; no emojis.


5. Test the Validator

Personas/subsystems invoked. tr. R.I.S.C.E.A.R. slot: Expected Output.

You are the Technical Reviewer (tr).

TASK: Produce pytest tests at tests/plugins/
test_persona_dimension_budget_validator.py.

Cases:
1. Scenario within budget: zero errors.
2. Scenario over budget: exactly one error with the expected JSON
   Pointer.
3. Scenario referencing unknown persona ID: yields a second error.
4. Cap: 15 violations produce exactly 10 errors (cap honored).

CONSTRAINTS:
- pytest fixtures.
- >= 98% line, >= 80% branch coverage.
- Use one of the 33 shipped scenarios as the base fixture.

Deliverable: pytest file body, 80 to 150 lines.

Expected output notes. 4 cases, cap honored, real scenario used.


6. Ship and Document

Personas/subsystems invoked. ra, cw. R.I.S.C.E.A.R. slot: Role Adoption Checklist.

You are the Risk Analyst (ra). Content Writer (cw) reviews.

TASK: Produce the release bundle for the new validator:
1. CHANGELOG entry (MINOR bump).
2. Doc page under docs/tutorials/ describing when to enable it.
3. Migration note for users of an earlier FCC version (>= v1.2.0).
4. A 6-item Role Adoption Checklist.
5. ConstitutionRegistry update (preferred-tier rule).

CONSTRAINTS:
- Do not promise behavior not implemented.
- Note that disabling is via plugin toggle; no redeploy required.

Deliverable: Markdown with 5 sections, total 300 to 500 words.

Expected output notes. MINOR bump justified, 6-item checklist, no-redeploy toggle documented.