Licensing Review Skill
Purpose
Conduct structured eligibility and compliance reviews for state licensing board applications — contractor, liquor, and alcohol renewal — by fetching data from a shared licensing API environment, applying business rules, and returning schema-compliant JSON decisions.
When to Use
Invoke this skill when a prompt assigns a licensing examiner role and references a task environment base URL (<TASK_ENV_BASE_URL>), a batch of application or license identifiers, and an answer template schema.
Operating Rules
1. Environment Bootstrap
- Locate
environment_access.md in the working directory.
- Extract
base_url. Substitute every occurrence of <TASK_ENV_BASE_URL> in the prompt with this value.
- Extract credentials. The header
X-Task-Token and its value are required for every POST /api/sql call.
- Cross-reference the endpoints listed in the prompt against
allowed_endpoints in environment_access.md. Only call endpoints that appear in both.
2. Role and Scope
- Adopt the role stated in the prompt (e.g., "Senior Licensing Examiner").
- Identify every target identifier from the prompt: application IDs, license numbers, or location codes. These define the scope — only these targets appear in the output.
- Note any review date or boundary date (e.g., "review date 2025-07-18", "release boundary 2025-04-10"). This date governs temporal filters: insurance/bond validity, violation recency, correspondence staleness.
3. Data Collection
Fetch from every GET endpoint listed in the prompt that also appears in environment_access.md:
- Contractor domain:
/api/policies, /api/contractor/applications, /api/contractor/bonds, /api/contractor/insurance, /api/contractor/license-history, /api/contractor/violations, /api/contractor/correspondence, /api/contractor/inspections
- Liquor domain:
/api/policies, /api/liquor/applications, /api/liquor/settlements, /api/liquor/privileges, /api/liquor/incidents, /api/liquor/site-evidence
- Alcohol/renewal domain:
/api/alcohol/licensees, /api/alcohol/violations, /api/renewal/rules
When POST /api/sql is listed and present in allowed_endpoints, use it for complex cross-entity queries (e.g., joining violations to licensees, filtering by date ranges) that the GET endpoints cannot express directly. Include the X-Task-Token header on every SQL POST.
4. Record Matching
Match fetched records to target identifiers:
- Exact match on ID: application_id, license_no, location code.
- Name/address matching (renewal queue): When violation records use facility names rather than license numbers, match by name and address. Record match confidence as
exact (ID match), close_address (address similarity), or uncertain (name-only match).
- Temporal filtering: Apply the review/boundary date. Violations after the boundary are excluded from scoring but recorded in the summary's exclusion list. Insurance/bonds are current only if their effective dates cover the review date.
5. Deficiency and Risk Assessment
Contractor Applications
For each target application, check these dimensions and map findings to the schema's deficiency codes and required actions:
| Dimension |
Data Source |
Check |
| Bond |
/api/contractor/bonds |
Active bond exists; amount meets requirement |
| Insurance |
/api/contractor/insurance |
Policy is current (covers review date); coverage meets minimum |
| License history |
/api/contractor/license-history |
No active suspensions |
| Violations |
/api/contractor/violations |
No open/unresolved serious complaints |
| Endorsements |
applications record |
Specialty endorsements verified |
| Experience |
applications record |
Experience requirements documented |
| Inspections |
/api/contractor/inspections |
No outstanding document gaps or failed safety rechecks |
| Correspondence |
/api/contractor/correspondence |
No stale or unverified correspondence |
| Policies |
/api/policies |
Current policy baseline may create new deficiencies |
Determination logic:
APPROVE: No deficiencies. All required coverage current, no unresolved violations or suspensions.
HOLD: Deficiencies that can be cured (e.g., bond shortfall, expired insurance, pending endorsement, documentation gaps). The applicant can fix these.
DENY: Unresolvable or severe issues (e.g., active suspension, unresolved serious complaint).
Risk tier logic:
high: Active suspension, unresolved serious violation, or multiple concurrent deficiencies.
medium: At least one deficiency or a policy-impacted flag.
low: Approve with no flags.
Policy impact: Set policy_impacted: true when a current policy standard (from /api/policies) creates a deficiency or material review flag that would not have existed under the prior baseline.
Liquor License Applications
For each target application, check these dimensions:
| Dimension |
Data Source |
Check |
| Application |
/api/liquor/applications |
Application details, status |
| Settlements |
/api/liquor/settlements |
Tax holds, settlement status |
| Privileges |
/api/liquor/privileges |
Current privileges |
| Incidents |
/api/liquor/incidents |
Open incidents, police involvement |
| Site evidence |
/api/liquor/site-evidence |
Floor plans, signage, photos, police memos, camera evidence, food service evidence |
| Policies |
/api/policies |
Policy baseline |
Same-premises basis: true when the application is for the same physical premises as a prior license (transfer/continuation), and the location records confirm continuity. false for new locations or when site evidence shows material changes.
Covered risks: Risk codes that current controls adequately address. Uncovered risks become verification gaps.
Verification gaps: Controls that are required but not yet verified (missing evidence, conflicting documents, stale records).
Standard obligations vs. location-specific controls:
standard_obligation_codes: Obligations required by license class regardless of location.
location_specific_control_codes: Controls currently active at this specific location based on site evidence and privileges.
First-90-day plan: Build check items from verification gaps — each gap maps to a check_code. Distribute timing across the three 30-day windows based on urgency (missing evidence → first_30_days, follow-ups → days_31_60, rechecks → days_61_90).
Escalation triggers: Conditions that should cause field staff to escalate — drawn from uncovered risks, open incidents, and unverified critical controls.
Posture determination:
issue_restricted: All critical controls verified; risks covered. Issue with standard restrictions.
request_follow_up: Verification gaps exist but are resolvable. Do not issue until gaps close.
deny: Unresolvable issues (tax hold, major incidents, same-premises basis broken).
Alcohol Renewal Queue
For building a ranked manual-review queue:
- Fetch all licensees from
/api/alcohol/licensees.
- Fetch all violations from
/api/alcohol/violations.
- Fetch renewal rules from
/api/renewal/rules.
- Match violations to licensees by name, address, or license number.
- Exclude violations dated after the boundary date. Record excluded IDs in the summary.
- Rank licensees by: violation count (descending), then most recent violation date (ascending), using only pre-boundary violations.
- Assign match confidence per the matching method.
- Assign risk tier:
high (serious violations or ≥3 violations), medium (1-2 non-serious violations), low (no matched violations).
- Assign next step:
board_review for high risk, manual_ALERT_check or manual_fine_check for medium, additional_record_check for low/uncertain matches.
- Fill the queue to the target size. If fewer licensees have violations than the target, pad with zero-violation licensees ranked at the bottom.
6. Output Construction
- Load
input/payloads/answer_template.json for the task.
- Build the output object key-by-key from the template's
required_top_level_keys or top_level_keys specification.
- For each target, populate all fields using only values from the schema's
allowed_values.
- Apply ordering rules exactly as stated (ascending by ID, lexical order, by date then ID, operational sequence).
- Use empty arrays (
[]) when no codes, IDs, or actions apply — never omit a required key.
- Verify summary counts (approve/hold/deny, queue size) are consistent with item-level decisions.
- Return only the JSON object. No prose, markdown, citations, comments, or extra keys.
7. Validation Checklist
Before returning output, confirm:
1---2name: self-attempt-01-583description: Licensing Review Skill4---5# Licensing Review Skill67## Purpose8Conduct structured eligibility and compliance reviews for state licensing board applications — contractor, liquor, and alcohol renewal — by fetching data from a shared licensing API environment, applying business rules, and returning schema-compliant JSON decisions.910## When to Use11Invoke this skill when a prompt assigns a licensing examiner role and references a task environment base URL (`<TASK_ENV_BASE_URL>`), a batch of application or license identifiers, and an answer template schema.1213---1415## Operating Rules1617### 1. Environment Bootstrap181. Locate `environment_access.md` in the working directory.192. Extract `base_url`. Substitute every occurrence of `<TASK_ENV_BASE_URL>` in the prompt with this value.203. Extract credentials. The header `X-Task-Token` and its value are required for every `POST /api/sql` call.214. Cross-reference the endpoints listed in the prompt against `allowed_endpoints` in `environment_access.md`. Only call endpoints that appear in both.2223### 2. Role and Scope24- Adopt the role stated in the prompt (e.g., "Senior Licensing Examiner").25- Identify every target identifier from the prompt: application IDs, license numbers, or location codes. These define the scope — only these targets appear in the output.26- Note any review date or boundary date (e.g., "review date 2025-07-18", "release boundary 2025-04-10"). This date governs temporal filters: insurance/bond validity, violation recency, correspondence staleness.2728### 3. Data Collection29Fetch from every GET endpoint listed in the prompt that also appears in `environment_access.md`:30- Contractor domain: `/api/policies`, `/api/contractor/applications`, `/api/contractor/bonds`, `/api/contractor/insurance`, `/api/contractor/license-history`, `/api/contractor/violations`, `/api/contractor/correspondence`, `/api/contractor/inspections`31- Liquor domain: `/api/policies`, `/api/liquor/applications`, `/api/liquor/settlements`, `/api/liquor/privileges`, `/api/liquor/incidents`, `/api/liquor/site-evidence`32- Alcohol/renewal domain: `/api/alcohol/licensees`, `/api/alcohol/violations`, `/api/renewal/rules`3334When `POST /api/sql` is listed and present in `allowed_endpoints`, use it for complex cross-entity queries (e.g., joining violations to licensees, filtering by date ranges) that the GET endpoints cannot express directly. Include the `X-Task-Token` header on every SQL POST.3536### 4. Record Matching37Match fetched records to target identifiers:38- **Exact match on ID**: application_id, license_no, location code.39- **Name/address matching** (renewal queue): When violation records use facility names rather than license numbers, match by name and address. Record match confidence as `exact` (ID match), `close_address` (address similarity), or `uncertain` (name-only match).40- **Temporal filtering**: Apply the review/boundary date. Violations after the boundary are excluded from scoring but recorded in the summary's exclusion list. Insurance/bonds are current only if their effective dates cover the review date.4142### 5. Deficiency and Risk Assessment4344#### Contractor Applications45For each target application, check these dimensions and map findings to the schema's deficiency codes and required actions:4647| Dimension | Data Source | Check |48|-----------|------------|-------|49| Bond | `/api/contractor/bonds` | Active bond exists; amount meets requirement |50| Insurance | `/api/contractor/insurance` | Policy is current (covers review date); coverage meets minimum |51| License history | `/api/contractor/license-history` | No active suspensions |52| Violations | `/api/contractor/violations` | No open/unresolved serious complaints |53| Endorsements | applications record | Specialty endorsements verified |54| Experience | applications record | Experience requirements documented |55| Inspections | `/api/contractor/inspections` | No outstanding document gaps or failed safety rechecks |56| Correspondence | `/api/contractor/correspondence` | No stale or unverified correspondence |57| Policies | `/api/policies` | Current policy baseline may create new deficiencies |5859**Determination logic:**60- `APPROVE`: No deficiencies. All required coverage current, no unresolved violations or suspensions.61- `HOLD`: Deficiencies that can be cured (e.g., bond shortfall, expired insurance, pending endorsement, documentation gaps). The applicant can fix these.62- `DENY`: Unresolvable or severe issues (e.g., active suspension, unresolved serious complaint).6364**Risk tier logic:**65- `high`: Active suspension, unresolved serious violation, or multiple concurrent deficiencies.66- `medium`: At least one deficiency or a policy-impacted flag.67- `low`: Approve with no flags.6869**Policy impact**: Set `policy_impacted: true` when a current policy standard (from `/api/policies`) creates a deficiency or material review flag that would not have existed under the prior baseline.7071#### Liquor License Applications72For each target application, check these dimensions:7374| Dimension | Data Source | Check |75|-----------|------------|-------|76| Application | `/api/liquor/applications` | Application details, status |77| Settlements | `/api/liquor/settlements` | Tax holds, settlement status |78| Privileges | `/api/liquor/privileges` | Current privileges |79| Incidents | `/api/liquor/incidents` | Open incidents, police involvement |80| Site evidence | `/api/liquor/site-evidence` | Floor plans, signage, photos, police memos, camera evidence, food service evidence |81| Policies | `/api/policies` | Policy baseline |8283**Same-premises basis**: `true` when the application is for the same physical premises as a prior license (transfer/continuation), and the location records confirm continuity. `false` for new locations or when site evidence shows material changes.8485**Covered risks**: Risk codes that current controls adequately address. Uncovered risks become verification gaps.8687**Verification gaps**: Controls that are required but not yet verified (missing evidence, conflicting documents, stale records).8889**Standard obligations vs. location-specific controls**: 90- `standard_obligation_codes`: Obligations required by license class regardless of location.91- `location_specific_control_codes`: Controls currently active at this specific location based on site evidence and privileges.9293**First-90-day plan**: Build check items from verification gaps — each gap maps to a check_code. Distribute timing across the three 30-day windows based on urgency (missing evidence → `first_30_days`, follow-ups → `days_31_60`, rechecks → `days_61_90`).9495**Escalation triggers**: Conditions that should cause field staff to escalate — drawn from uncovered risks, open incidents, and unverified critical controls.9697**Posture determination:**98- `issue_restricted`: All critical controls verified; risks covered. Issue with standard restrictions.99- `request_follow_up`: Verification gaps exist but are resolvable. Do not issue until gaps close.100- `deny`: Unresolvable issues (tax hold, major incidents, same-premises basis broken).101102#### Alcohol Renewal Queue103For building a ranked manual-review queue:1041051. Fetch all licensees from `/api/alcohol/licensees`.1062. Fetch all violations from `/api/alcohol/violations`.1073. Fetch renewal rules from `/api/renewal/rules`.1084. Match violations to licensees by name, address, or license number.1095. Exclude violations dated after the boundary date. Record excluded IDs in the summary.1106. Rank licensees by: violation count (descending), then most recent violation date (ascending), using only pre-boundary violations.1117. Assign match confidence per the matching method.1128. Assign risk tier: `high` (serious violations or ≥3 violations), `medium` (1-2 non-serious violations), `low` (no matched violations).1139. Assign next step: `board_review` for high risk, `manual_ALERT_check` or `manual_fine_check` for medium, `additional_record_check` for low/uncertain matches.11410. Fill the queue to the target size. If fewer licensees have violations than the target, pad with zero-violation licensees ranked at the bottom.115116### 6. Output Construction1171181. Load `input/payloads/answer_template.json` for the task.1192. Build the output object key-by-key from the template's `required_top_level_keys` or `top_level_keys` specification.1203. For each target, populate all fields using only values from the schema's `allowed_values`.1214. Apply ordering rules exactly as stated (ascending by ID, lexical order, by date then ID, operational sequence).1225. Use empty arrays (`[]`) when no codes, IDs, or actions apply — never omit a required key.1236. Verify summary counts (approve/hold/deny, queue size) are consistent with item-level decisions.1247. Return **only** the JSON object. No prose, markdown, citations, comments, or extra keys.125126### 7. Validation Checklist127128Before returning output, confirm:129- [ ] `<TASK_ENV_BASE_URL>` resolved from `environment_access.md`130- [ ] Only allowed endpoints called; `X-Task-Token` on every SQL POST131- [ ] Every target from the prompt appears in the output132- [ ] All field values are from the schema's allowed_values133- [ ] Ordering matches schema instructions134- [ ] Summary counts match item-level decisions135- [ ] Review/boundary date applied to temporal filters136- [ ] Empty arrays where no codes apply137- [ ] Output is pure JSON — no wrapping text138- [ ] No keys present that are not in the answer template