## PLANNING GATE ENFORCEMENT ({{GATE_LEVEL}})

> **THIS CHECK IS MANDATORY. DO NOT SKIP. DO NOT PROCEED WITHOUT COMPLETING IT.**
>
> This skill has a **{{GATE_LEVEL}}** planning gate. {{GATE_DESCRIPTION}}

### Enforcement Check (run BEFORE any implementation)

**Step 1: Determine if this work has a feature context.**

Search `accounts/<PROFILE>/features/` for a `status.json` whose feature slug matches the current work. Use the user's description, entity types, or workflow names to find the matching feature.

**Step 2: If feature context found (status.json exists):**

1. Read `status.json` and check `spec` field:
   - If `spec` is NOT `"APPROVED"` --> **STOP. Emit: `-> BLOCKED: PREREQ_MISSING -- Spec not approved. Run /fluent-use-case-discover first to create and get spec approved.` Do NOT proceed.**
2. Check `plan` field:
   - If `plan` is NOT `"APPROVED"` --> **STOP. Emit: `-> BLOCKED: PLAN_REQUIRED -- Plan not approved. Run /fluent-feature-plan first to create and get plan approved.` Do NOT proceed.**
3. If BOTH `spec: "APPROVED"` AND `plan: "APPROVED"` --> proceed to implementation, referencing the approved plan.

**Step 3: If NO feature context (standalone work):**

1. Search `accounts/<PROFILE>/tasks/` for a task plan file (`*.md`) with `Status: APPROVED` that matches this work.
2. If approved task plan found --> proceed to implementation.
3. If NO approved plan found:
   - {{STANDALONE_ACTION}}

**Step 4: Override conditions (ONLY these bypass the gate):**

- User explicitly says "just do it", "skip the plan", or "no plan needed"
- Read-only operations within the skill (audit, analyze, list, discover)
- A pre-approved plan already exists and is referenced

**If blocked, do NOT:** suggest workarounds, offer to create a "quick plan", or proceed with partial work. Simply emit the BLOCKED signal and stop.

### GraphQL Schema Gate (for skills that generate or embed GraphQL)

If this skill generates Java code with GraphQL operations (DynamicUtils field paths, Apollo queries/mutations) or embeds GraphQL in manifests/components, the plan MUST include a §12 (GraphQL Operations) section listing every operation with:

| Operation | Type | Approach | Fields/Paths | Schema Validated |
|-----------|------|----------|-------------|-----------------|

Before proceeding to implementation, validate every operation in §12 against the live schema:

1. **Full queries/mutations** → `graphql.validate({ query })` — check `valid` field
2. **DynamicUtils field paths** → `graphql.introspect({ type })` — verify each path segment
3. **Mutation inputs** → `graphql.introspect({ mutation })` — verify input fields

If ANY operation fails validation → fix in the plan, re-validate, then proceed.
If MCP is unavailable → proceed with warning, add TODO markers for pre-deploy validation.

Full protocol: `knowledge/platform/graphql-preflight.md`.

---

