n9e-config-driven-e2e

Maintain config-driven Nightingale E2E tests that convert JSON config data into UI-readable normalized values, drive Playwright + Midscene interactions, and verify persistence through APIs.

Command for Claude Code

View the source file n9e/fe
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/n9e/fe/n9e-config-driven-e2e
Clone the repo
git clone --depth 1 https://github.com/n9e/fe

Made for: Claude Code.

Per session 43 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,102 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00043 $0.02102
Opus 5 $0.00022 $0.01051
Sonnet 5 $0.00009 $0.00420
Haiku 4.5 $0.00004 $0.00210

Measured today against content hash 811e5e6514cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

n9e-config-driven-e2e scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/n9e-config-driven-e2e.md · 180 lines

How it starts

The opening of the file, as written. The whole thing — 180 lines — stays where its author put it; the contents beside it link to each section on GitHub.

n9e Config-Driven E2E

Use this skill when working on Nightingale config-driven E2E flows. This includes alert-rule creation under e2e/add-alert-rule, and should also guide future flows that start from structured JSON config data. The general pattern is:

JSON 配置数据 -> normalizer 转换为 UI 可读/可操作值 -> Playwright + Midscene 执行页面操作 -> API 回查验证保存结果

This skill is no longer only about adding one alert-rule JSON file. Treat it as the standard way to build E2E coverage for product forms whose source of truth is an exported/API JSON config.

Architecture

  • Config files live under a feature-specific configs/ directory, currently e2e/add-alert-rule/configs/*.json.
  • config-loader.ts discovers config files and supports E2E_CONFIGS=<stem> filtering.
  • reference-data.ts resolves ID-backed fields into visible UI labels.
  • normalizer.ts converts API/export JSON into a UI-readable normalized model and builds the expected persisted payload.
  • Step files under steps/ fill page cards or sections from the normalized model.
  • Datasource-specific query/condition behavior lives under queries/.
  • The main test file orchestrates: load config, fetch references, normalize, fill steps, save, API 回查, subset assert, cleanup.

Core Principle

Never silently skip a non-default config field.

If JSON contains a meaningful field, do one of these:

  • Fill it into the UI through the correct step handler.
  • Normalize it into the exact visible UI value first, then fill it.
  • Document a real FormNG/API transformation in buildExpectedAlertRule().
  • Fail with a precise TODO only when no UI path exists yet.

Do not delete expected fields merely to make assertions pass.

Source-Code First

Before changing E2E logic, inspect the product code that owns the form:

  • Start with src/pages/alertRules/FormNG/index.tsx.
  • For API/export config shape vs page form shape, inspect src/pages/alertRules/Form/utils.ts.
    • processInitialValues() shows how API/export data becomes FormNG form values.
    • processFormValues() shows how FormNG values become save payload.
  • For step-card UI:
    • Basic/datasource/rule: FormNG/index.tsx, FormNG/Rule/**, datasource plugins.
    • Query/trigger: FormNG/Rule/**, FormNG/components/Triggers/**.
    • Event handling: FormNG/PipelineConfigsNG/**.
    • Effective config: FormNG/Effective/index.tsx.
    • Notify config: FormNG/Notify/**.

Read the full file on GitHub · 180 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 180 lines · 43 tokens per session scan A 811e5e6514cb

Subscribe to this mod's changes

n9e-config-driven-e2e is a command published in the GitHub repository n9e/fe (302 stars, last pushed today), licensed Apache-2.0. It adds 43 tokens to every session and 2,102 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.