netalertx-settings-management
Manage NetAlertX configuration settings. Use this when asked to add setting, read config, get_setting_value, ccd, or configure options.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Manage NetAlertX configuration settings. Use this when asked to add setting, read config, get_setting_value, ccd, or configure options.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | netalertx-settings-management |
| description | Manage NetAlertX configuration settings. Use this when asked to add setting, read config, get_setting_value, ccd, or configure options. |
Read a setting (backend):
from helper import get_setting_value
value = get_setting_value('SETTING_NAME')
Never hardcode ports, secrets, or configuration values. Always use get_setting_value().
Read a setting (frontend):
getSetting("SETTING_NAME")
Add a core setting — use ccd() in server/initialise.py:
ccd('SETTING_NAME', 'default_value', 'description')
Add a plugin setting — define in the plugin's config.json under the settings key.
| File | Purpose |
|---|---|
/data/config/app.conf | Runtime config (source of truth, modified by app) |
back/app.conf | Default config (template) |
Use APP_CONF_OVERRIDE for settings that must be set before startup.
The goal is for every setting to be:
Before creating a new setting, search for similar ones. Reuse existing naming conventions, types, and validation patterns. Follow the style already used by similar plugins. Avoid introducing new setting types unless absolutely necessary.
Setting keys use uppercase snake case: UI_DEV_SECTIONS, SCAN_INTERVAL, MQTT_HOST.
Names should clearly describe the purpose.
Place settings into the most appropriate category. Keep related settings together. Avoid creating new categories unless there is a clear need.
Use the simplest type that correctly models the value: string, integer, float, boolean, password, select, array, textarea. Avoid encoding structured JSON inside string settings.
Always define validation whenever appropriate (min/max values, regex, allowed options). Reject invalid configuration rather than silently accepting it.
Provide sensible defaults that work for a fresh installation. The default_value in config.json is the single source of truth — do not duplicate it in Python or JavaScript.
Names should be concise. Descriptions should explain what the setting does, when to use it, and any important side effects — not implementation details.
Prefer verbs: Enable, Disable, Require, Allow, Ignore, Show, Hide. Examples: Enable MQTT, Require NICs Online, Hide Offline Devices.
Use when users must choose from predefined values. Each option must have a meaningful label — never require users to remember internal values.
Use only when multiple independent values are expected (e.g., ignored MACs, subnet lists, plugin lists).
Every setting must have localized language strings. If not defined directly in config.json, they must exist in en_us.json.
Example for UI_DEV_SECTIONS:
"UI_DEV_SECTIONS_name": "Hide device sections",
"UI_DEV_SECTIONS_description": "Select which UI elements to hide on the Devices page."
When using external language files, config.json must reference:
"name": [{ "string": "_GLOBAL_LANG_FILES_" }]
app.conf is the source of truth. User-defined values always come from app.conf; defaults from config.json apply only when a setting is absent. Never read app.conf directly — always go through get_setting_value().
Whenever possible, define new settings inside a plugin's config.json. Avoid adding hardcoded application settings unless there is a compelling architectural reason.
config.json (defaults)
→ app.conf (source of truth)
→ Settings database table
→ table_settings.json API
→ Frontend getSetting() / Backend get_setting_value()
The database and API are runtime representations only, regenerated from app.conf at init.
Avoid renaming settings, changing data types, or changing semantics. If unavoidable, provide migration logic and preserve compatibility where possible.
config.json)_GLOBAL_LANG_FILES_ used where appropriateget_setting_value() — no direct app.conf readsEnables live interaction with the NetAlertX runtime. This skill configures the Model Context Protocol (MCP) connection, granting full API access for debugging, troubleshooting, and real-time operations including database queries, network scans, and device management.
Reference for the NetAlertX codebase structure, key file paths, and configuration locations. Use this when exploring the codebase or looking for specific components like the backend entry point, frontend files, or database location.
Best practices for creating and maintaining NetAlertX settings (config.json), including UI, validation, localization, runtime behavior, and implementation consistency.
Index of all available skills across both Gemini CLI (.gemini/skills/) and GitHub Copilot (.github/skills/). Load this to find the right skill for a task, or to locate the counterpart skill in the other AI system.
Read before running tests. Detailed instructions for single, standard unit tests (fast), full suites (slow), handling authentication, and obtaining the API Token. Tests must be run when a job is complete.
NetAlertX database architecture patterns. Use this when designing features that write to the Devices table, implementing audit/history logging, or choosing between trigger-based vs Python-hook approaches.