Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计提醒

nftables-rule-writingnftables 规则编写

Agent Skill

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

总安装

294

周安装

12

GitHub Stars

公开资料未说明

下载量

95
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:nftables-rule-writing(nftables 规则编写)
来源仓库:https://github.com/tttpob/skills
仓库路径:skills/nftables-rule-writing
安装命令:
npx skills add https://github.com/tttpob/skills --skill nftables-rule-writing
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/tttpob/skills --skill nftables-rule-writing

简介

用于辅助文档、README、Markdown 和内容稿件的整理与改写。

  • 适合让 Agent 提炼结构、补齐章节、统一术语或检查链接。
  • 使用时需保留项目已有事实,避免将未确认信息写成确定结论。
  • 涉及对外文案时应控制语气,避免过度营销或夸大能力。
  • 建议结合原始 README 和仓库内容核验具体用法和功能边界。

SKILL.md

nftables Rule Writing (Quickstart, Pitfalls, Constraints)

Use this skill when generating, reviewing, or debugging nftables rulesets, especially when an LLM may produce rules that are syntactically valid but semantically invalid for a specific chain type, hook, or family.

When to Use

Trigger on requests like:

  • "Write an nftables.conf"
  • "Review this .nft file"
  • "Why does nft -f / nft -c fail?"
  • "Which actions are valid on which hooks?"
  • "How do I write IPv4 + IPv6 rules in table inet?"
  • "Create a lint checklist for generated nftables rules"

What This Skill Covers

  • Quickstart ruleset patterns (safe defaults and common base chains)
  • Reusable nftables patterns for common host/router scenarios
  • Ops workflows (validate/apply/list/monitor/reload)
  • Persistence discovery (including systemd units and drop-ins that may load custom .nft files)
  • Hook / chain-type / family constraints
  • Statement-specific constraints (dnat, snat, masquerade, redirect, reject, tproxy, queue)
  • inet family IPv4/IPv6 pitfalls
  • Debugging workflow with nft -c and --debug
  • Source map to official docs and userspace code (nftables project)

Workflow (Authoring + Review)

  1. Identify the ruleset shape first:

- family (ip, ip6, inet, bridge, netdev) - table purpose (filter, nat, etc.) - chain type, hook, priority, policy - whether device is required (netdev, inet + ingress)

  1. If starting from scratch, use references/quickstart.md and references/nftables-patterns.md to pick a known-good template.
  2. Check structural legality in references/constraints-matrix.md:

- chain definition validity - statement vs hook compatibility

  1. Check common LLM mistakes in references/common-pitfalls.md.
  2. For fast triage, use references/hook-action-cheatsheet.md.
  3. If nft is available, run:

- nft -c -f <file> - nft -c -d parser,eval,netlink -f <file> (when error cause is unclear)

  1. For deployment/runtime concerns, use references/nftables-ops-cheatsheet.md and references/nftables-troubleshooting.md.
  2. If needed, use references/source-map.md to trace the constraint back to official docs or src/evaluate.c.

Quickstart First (Important)

Do not start by writing isolated rules. Start from a valid chain declaration and then add rules.

For common starting points:

  • Minimal host firewall: references/quickstart.md
  • Reusable practical patterns: references/nftables-patterns.md
  • NAT placement reminders: references/hook-action-cheatsheet.md
  • inet dual-stack gotchas: references/common-pitfalls.md

Review / Lint Output Format (Recommended)

When reviewing LLM-generated rules, output findings in this order:

  1. Issue (specific chain/rule)
  2. Why it is invalid or risky (hook/family/statement constraint)
  3. Fix (replacement snippet)
  4. Validation (nft -c / version-sensitive caveat)

Core Principles

  • Legality is layered:

- parser (scanner.l / parser_bison.y) - userspace semantic checks (src/evaluate.c) - kernel nf_tables support (final authority)

  • Many failures are not syntax errors. Common real causes:

- wrong chain type/hook - invalid statement in that chain/hook - missing device on netdev or inet ingress base chains - inet NAT address missing explicit ip/ip6 - conflicting protocol contexts (ip + ip6 in one rule)

  • If the target environment is unknown, say so explicitly and require nft -c -f on the target host.

Reference Navigation (Load Only What You Need)

  • references/quickstart.md

- Minimal and common ruleset templates to start from

  • references/hook-action-cheatsheet.md

- Fast hook/action legality reminders

  • references/nftables-patterns.md

- Reusable host/router patterns (sets, NAT, port forwarding, egress)

  • references/constraints-matrix.md

- Detailed constraints with doc/source rationale

  • references/common-pitfalls.md

- LLM-heavy mistakes and corrected examples

  • references/nftables-ops-cheatsheet.md

- Operational commands, persistence, systemd unit/drop-in scanning

  • references/debug-workflow.md

- nft -c, debug flags, and triage workflow

  • references/nftables-troubleshooting.md

- Runtime troubleshooting and multi-source persistence debugging

  • references/reference-index.md

- Topic map for this skill (what to open for what task)

  • references/source-map.md

- Official docs/source file map and search keywords

  • examples/nftables/

- Ready-to-edit example rulesets (web server, router NAT, dual-stack host)

Authoring Guardrails for Agents

  • Prefer explicit protocol context (tcp, udp, icmp, icmpv6) over ambiguous shorthand when generating code.
  • In table inet, prefer separate IPv4 and IPv6 rules unless there is a strong reason to merge.
  • Do not invent hook support. If unsure, check the matrix and verify with nft -c.
  • Treat wiki examples as useful examples, not the sole source of truth.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.74%
按下载量换算36

Claude

27.41%
按下载量换算26

Cursor

18.16%
按下载量换算17

Gemini CLI

8.83%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills