igmarin/elixir-phoenix-skills

liveview

LiveView feature playbook with hard gates and HITL: define mount/assigns contract → failing LiveView test → thin-edge implementation (FCIS) → lifecycle verify → quality gate.

First seen Jun 20, 2026

Installation

$ npx skills add igmarin/elixir-phoenix-skills --skill liveview

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from igmarin/elixir-phoenix-skills · top by installs.

npx skills add igmarin/elixir-phoenix-skills

Browse all from igmarin/elixir-phoenix-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 2
License LICENSE
Default branch main
Open issues 0
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.0.0
LicenseMIT
More metadata
version
1.0.0
user-invocable
true
entry_point
1
phases
Phase 1: Contract, Phase 2: RED test, Phase 3: HITL impl, Phase 4: Verify, Phase 5: Quality
hard_gates
LiveView contract, Test fails for right reason, Thin handle_event and handle_info, Lifecycle green, User approval and green suite
dependencies
{"source":"self","skills":["phoenix-liveview-essentials","testing-essentials","elixir-essentials","apply-phoenix-liveview-conventions"]}

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 4,989 B
  • docs SUMMARY.md 279 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 18 installs

SKILL.md

LiveView Playbook

HARD-GATE

  • A LiveView contract and failing live/2 or live_isolated test must exist before implementation.
  • The test must fail because behaviour is missing, not due to config/syntax.
  • handleevent/3 and handleinfo/2 remain thin; no Repo calls inside LiveViews.
  • Implementation requires explicit user approval; full suite and Credo/format must pass.

When to use

New LiveView pages/features or substantial LiveView behaviour changes.

Atomic skills this playbook loads

Skill Path Role
phoenix-liveview-essentials skills/phoenix-liveview-essentials/ Lifecycle, assigns
apply-phoenix-liveview-conventions skills/apply-phoenix-liveview-conventions/ Conventions
testing-essentials skills/testing-essentials/ LV tests
elixir-essentials skills/elixir-essentials/ FCIS thin edges
liveview-streams skills/liveview-streams/ Large collections

Flow

flowchart TD
  A[Define mount assigns contract] --> B[Write failing LV test]
  B --> C{Fail right reason?}
  C -->|No| B
  C -->|Yes| D[HITL: approve thin-edge design]
  D --> E[Implement LV + context]
  E --> F[Lifecycle verify]
  F --> G[Quality gate]

Agent Phases

Phase 1 — Contract

Document assigns shape, events, and which work lives in context/pure modules vs LiveView.

HARD GATE — LiveView contract:

  • Assigns shape and lifecycle events are documented.
  • A failing live/2 or live_isolated test exists before implementation.
  • Work is split between LiveView (render/events) and context/pure modules (domain/Repo).

If gate fails: Refine the contract and write the failing test before writing any implementation code.

Phase 2 — RED

Write live/2 or live_isolated test; run until fail is “missing behaviour”.

HARD GATE — Test fails for right reason:

  • The test fails because behaviour is missing, not due to config/syntax errors.

If gate fails: Fix the test setup or expectations; do not write implementation to make a wrongly-failing test pass.

Phase 3 — HITL impl

  1. Propose thin handle_event → context design (no Repo in LiveView).
  2. HUMAN-IN-THE-LOOP: wait for approval.
  3. Implement; keep callbacks thin (FCIS).

HARD GATE — Thin handleevent and handleinfo:

  • handleevent/3 and handleinfo/2 call context functions; no Repo or heavy business logic in LiveView.
  • User approves the implementation design before code is written.

If gate fails: Extract logic into context or pure functions; re-HITL the design.

Phase 4 — Verify

  • Mount → render → event → update path green
  • connected? for side effects; streams for large lists

HARD GATE — Lifecycle green:

  • Mount → render → event → update path is green.
  • Side effects are guarded by connected?(socket).
  • Streams are used for large collections.

If gate fails: Extract heavy logic from callbacks; re-test the lifecycle path.

Phase 5 — Quality

mix test, format, credo; no assigns bloat.

HARD GATE — User approval and green suite:

  • Implementation matches the approved design.
  • mix test, mix format --check-formatted, and mix credo --strict pass.
  • No unnecessary assigns bloat.

If gate fails: Refactor, remove bloat, and re-run the full quality gate.

Verification checklist

  • Contract written
  • Failing test first
  • Approval before impl
  • No Repo/business soup in LiveView
  • Tests green

Error Recovery

Fat LiveView after impl → extract pure/context module; re-test.

Output Style

## LiveView Feature Report

**Contract:** <assigns/events and where work lives>
**Test command:** `<test command>`
**HARD-GATE results:**
- LiveView contract: PASS / FAIL
- Test fails for right reason: PASS / FAIL
- Thin handle_event and handle_info: PASS / FAIL
- User approval and green suite: PASS / FAIL
**Lifecycle notes:** <mount/render/event/update path, connected? side effects, streams>
**Verdict:** APPROVE / REQUEST_CHANGES