fe: Command for Claude Code

.claude/commands/n9e-config-driven-e2e.md

n9e-config-driven-e2e is a command for Claude Code from n9e/fe. It costs 43 tokens per session (2,102 once invoked), scanned A, original, Apache-2.0.

A testing workflow for Nightingale forms that starts with JSON configuration, turns it into values a user interface can use, and checks the saved result through the application’s APIs.

In plain words
What is it for?
Use it to build Playwright and Midscene tests for configuration-based forms, such as creating alert rules, and to verify that submitted values were persisted.
Why use it?
It keeps end-to-end tests consistent when the expected data comes from exported or API configuration. End-to-end tests check a complete user flow, including the interface and the backend.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is n9e/fe's own configuration. It tells Claude Code how to work on fe itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything fe configures →

View source ↗ n9e/fe
Reuse

Borrowing it

Nothing to install: this file belongs to n9e/fe. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/n9e/fe/main/.claude/commands/n9e-config-driven-e2e.md
Clone the repo
git clone --depth 1 https://github.com/n9e/fe

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for n9e-config-driven-e2e

README.md
[![agentmods](https://agentmods.dev/badge/commands/n9e/fe/n9e-config-driven-e2e/github.svg)](https://agentmods.dev/commands/n9e/fe/n9e-config-driven-e2e)
Your own site
<a href="https://agentmods.dev/commands/n9e/fe/n9e-config-driven-e2e"><img src="https://agentmods.dev/badge/commands/n9e/fe/n9e-config-driven-e2e/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for n9e-config-driven-e2e

Your own site · 80×15
<a href="https://agentmods.dev/commands/n9e/fe/n9e-config-driven-e2e"><img src="https://agentmods.dev/badge/commands/n9e/fe/n9e-config-driven-e2e.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00043 $0.02102
Opus 5.5 $0.00017 $0.00841
Sonnet 5.5 $0.00009 $0.00420
Haiku 4.5 $0.00004 $0.00210

Measured 1mo ago against content hash 811e5e6514cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo ago.

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. 1mo ago 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 (308 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.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.