Skip to main content
Glama
NinFenz Content Gate

NinFenz Content Gate

NinFenz · 文档生成工坊(规范驱动)Spec-driven documentation workshop

唯一官方仓库:https://github.com/Monyeah777/NinFenz | npm ninfenz | GitHub Packages @monyeah777/ninfenz 其他账号下的同名仓库均为未经授权的镜像快照,不代表本项目,也不接受 Issue/PR。

站点(线上):https://ninfenz.dev · 机器入口 llms.txt

NF 终端(TUI)演示 —— 全屏人机入口(纯标准库);菜单与动作是 nf CLI 真命令的受控调用方。 键位按顶尖终端约定:Tab 切面板、↑↓ 在当前面板内移动、/ 过滤、? 看键位。

NF 终端 TUI 演示(框线不依赖读者字体)

┌ NF TUI v1.0.0 · NinFenz 内容契约层 ──────────────────────────────────────────────────────────┐
│仓库 NinFenz · 能力区 9                                           焦点 动作 · 就绪(0 项待办)│
├────────────────────────┬─────────────────────────────────────────────────────────────────────┤
│  能力区 1/9            │▍ 动作 · 环境自检(2)                                               │
│▸ 0 环境自检(2)       │❯ 只读体检   nf doctor                                               │
│  1 一键演示世界(1)   │  体检(机器面)                                                     │
│  2 需求 → 装配计划(2)│                                                                     │
│  3 全链生产(2)       ├─────────────────────────────────────────────────────────────────────┤
│  4 校验与体检(4)     │  输出 · 1-3/3 · 已跟随                                              │
│  5 货架与资产(4)     │❯ nf doctor   (退出码 0 · 0.42s)                                   │
│  6 管线与模块(4)     │环境自检:Python 3.11 · 仓库在场 · 模块 13 · 管线 3                  │
│  7 帮助与命令面(2)   │✔ 只读体检通过:无缺件 / 无越界 / 无非确定性输出                     │
│  8 写盘表单(13)      │                                                                     │
│                        │                                                                     │
│                        │                                                                     │
│                        │                                                                     │
│                        │                                                                     │
│                        │                                                                     │
│                        │                                                                     │
│                        │                                                                     │
│                        │                                                                     │
│                        │                                                                     │
│                        │                                                                     │
├────────────────────────┴─────────────────────────────────────────────────────────────────────┤
│ Tab 切面板 · ↑↓ 移动 · / 过滤 · Enter 运行 · ? 帮助 · q 退出                                 │
└──────────────────────────────────────────────────────────────────────────────────────────────┘

python tui/nf.py 进全屏界面;--selftest 跑安全自检,--demo 打印上面这帧,--exec "nf doctor" 是脚本面 (无 TTY 亦可:--list-actions --json 给 agent 列动作与退出码)。命令在后台线程跑,运行中 Ctrl-C 只取消该命令; 路径参数过仓库包含性判据、写盘需键入 yes 确认、密钥只从环境变量读并遮蔽显示。细节见 tui/README.md。

MIT License · 原创开源 · 衍生/引用请注明来源

NF 是内容契约层——定义“AI 稳定产出长内容”的协议、质量与资产标准;协议本身域中立、模型无关。

别名与检索词:NF · NinFenz · 宁封子 · 内容契约层(content contract layer)· 规范驱动的内容工厂 · 长内容生成协议 · 装配式内容生产 · 模块/管线/资产 · 质量门禁 · 域包 · MCP 接入。

不是什么:不是模型、不是提示词模板集、不是某厂商 SDK——协议本体域中立、模型无关;MCP 只是可对接的连接协议之一。

bash verify.sh(当前基线见下方生成区「质量凭证」行) · python scripts/nf.py --version

⚡ 如果你是 AI / Agent

  • 这是什么:规范驱动的文档工厂,装模块/管线/资产 → 校验 → 输出。

  • 入口链:docs/agent/AGENT_START.md(开工)→ docs/agent/AI_ROUTING.md(选线)→ docs/meta/DEEP_DIVE.md(懂得深)。

  • 机器凭证:bash verify.sh(当前基线见下方生成区的「质量凭证」行,由 nf stats --write 写入);机器入口清单见 llms.txt;语言面见 README.en.md · README.ja.md(三面的机读事实与语言切换行由 check34 的语言面扫描断言一致;注册表 = protocol/locales.json)。

  • 要懂 NF 为什么这样设计:读 docs/meta/DEEP_DIVE.md。

Related MCP server: Contentrain MCP

快速开始

作者/开发者,5 分钟:第一跳照 docs/quickstart.md 的 6 步逐条复制粘贴;想一条命令自检用 bash scripts/quickstart_check.sh(判据:退出码 0 · 墙钟 ≤ 300 秒 · 文档步数 == 脚本步数)。

  1. bash verify.sh

  2. python scripts/nf.py shell(交互终端:端壳退役后的人机入口,见 docs/terminal.md)

  3. python scripts/nf.py demo

  4. python scripts/nf.py --help

  5. python scripts/nf.py doctor

  6. python scripts/nf.py completion bash

安全边界(nf verify 会执行目标仓库自带的门禁脚本):nf verify 的引擎会在本进程内 执行当前仓库 verify.sh 里的内嵌 Python(CWE-94 执行面)。故只有当前运行代码所在的 安装根自动可信;外部仓库即使伪造官方 origin 也默认拒绝执行(退出码 2 并给修复 指引)。确需执行须显式 nf verify --trust-repo(风险自担);fork/镜像可用 NF_TRUST_OWNERS 显式 opt-in。只读体检请用 bash verify.sh,或先人工审阅该仓库的 verify.sh。详见 SECURITY.md。

AI 装配:

  1. 读 docs/agent/AGENT_START.md

  2. 读 docs/agent/agent_组装指令包_v0.2.md

  3. 按需取 01/02/06/07 与 community 包

  4. 组装完整版并过 ##7 自检

  5. nf assemble "<需求>" --build --dest <目录>(组装式命令:直接产「完整版」单文件)

  6. nf assemble "<需求>" --check <out.md>

常见问题(FAQ)

  • NF 是什么? 内容契约层:把「AI 稳定产出长内容」定义成协议 + 质量门 + 资产标准,使产出可装载、可质检、可复现。

  • NF 是 MCP 服务器吗? 不是必须。协议与资产都是纯文本,克隆或直链即可装载;nf serve 才额外提供 MCP 接入面。

  • 支持哪些模型? 模型无关:任何能读文本的 AI 都能按协议装配与装载,不绑定某家模型或某个连接协议。

  • 必须联网吗? 不必。仓库本身就是 markdown 源件;bash verify.sh 只读本地,可离线跑。

  • 产出怎么判合格? 判据只来自内部链:verify 门禁(静态可核)+ 五维纵深自评 + 真实战例;外部评价不作为质量背书。

  • 怎么引用? MIT 许可;引用请注明来源,机读元数据见仓库根引用文件(CITATION.cff)。

  • 出口与合规? 密码学只走标准库 + 外部 ssh-keygen(不自制算法);出口管制读法见 docs/EXPORT.md。

能力与资产

官方核心:13 模块 · 3 管线(P00 / P01 / P90) · 核心协议件 01–07 社区规模:111 登记包 · 363 资产档 · 101 概念图 · 100 域包/1200 细分 · 标准目录 370 条(可达 332 / 不可达 38 · 机构 194 · 206 条依赖边) · 标准绑定 1200 条 质量凭证:verify v2.30 · check1-42 · PASS=76(bash verify.sh 单入口;期望基线取自 quality_baseline.EXPECTED_*) · 馆藏 3 件

分层:data 148 · eng 38 · form 29 · gov 71 · iface 84 (按标准目录 layer)

本区由 python scripts/nf.py stats --write 生成,禁止手改;口径与实算真源见 protocol/repo_stats.json。

协议链与文档导航

层

入口

方向

STRATEGY.md

协议

01_核心协议.md · 02_联动注册表.md · 06_Agent执行协议.md · 07_官方核心出厂与社区预设导航.md · protocol/WORLD_MODEL.md

库

03_管线库/ · 04_模块库/ · 05_资产库/

社区

community/README.md · community/模板制作指令包.md

AI

docs/agent/AGENT_START.md · docs/agent/AI_ROUTING.md · docs/meta/DEEP_DIVE.md

工具

docs/mcp.md · docs/terminal.md · docs/layers.md · docs/release.md · scripts/nf.py · tui/nf.py · verify.sh

接入面

integrations/README.md(MCP / LSP / CLI / TUI / 图书馆 / Skill / npm / Rust / .NET / A2A)

馆

library/INDEX.md · docs/agent/ROUTES.md

版本

现在安装就是 ninfenz 1.0.5(npm 与 GitHub Packages 同步发布),装上即可用:

npm i -g ninfenz@latest   # 装或升级
nf --version             # 看当前版本
nf stats                 # 看门禁与仓库状态

同一份代码里有三条版本线,各自独立升:

线

当前

这条线管什么

内容与协议

v0.93

文档模板、领域包、规范本身 —— 决定「能生成什么」

命令行工具

1.0.5

nf 命令 / npm 包 / MCP 服务 —— 决定「怎么用」

质量门禁

见 nf stats

仓库自检通过情况 —— 决定「有没有改坏」

最近三版内容线,按加了什么功能排(不是按编号堆):

版本

时间

这一版加了什么

v0.93

2026-10-05

知识层检索、终端形态、数字资产契约(资产可跨项目复用)

v0.92

2026-09-10

世界状态模型:确定性抽象状态 + 槽位(同一输入必得同一输出)

v0.82

2026-09-09

质量纵深 45 项 + 基础层 A 组收口

发版规则(2026-10-20 起):内容线用 v0.xx —— 小更新直接并进当前版、稍有突破 +0.01、创新突破 +0.1;CLI 线 1.0.x 独立编号; 每次发版同步写 CHANGELOG.md,tag 只打在带功能的那次提交上。

Available Tools

12 tools
asset_listList asset keysA
Read-onlyIdempotent

List asset files and the uppercase keys they declare, from community/*/assets and 05_资产库/用户自定义. Use it to discover a key before asset_read; do not use it to fetch asset text (asset_read) or to list modules/patterns (module_read / pattern_list). Optional package is an exact directory name, not a glob, path, or regex, and restricts the scan to community//assets (for example 校园情感领域包); README.md files are skipped. A package with no matching files returns an empty list, not an error.

Keys are sorted and uncapped; each call rescans the local asset files.

Inputs: package. Returns: Wrapper for the asset key list; the payload is in items.

asset_readFetch asset contentA
Read-onlyIdempotent

Read asset files for a key, returning package, path, and text.

Use only a key from asset_list; for enumeration use asset_list, for other resources module_read or pipeline_read.

The key is exact uppercase, never glob, regex, package, path, or prose. The package is an exact directory; it narrows files but never key matching.

Tokens come from each file's name or first 6000 characters; lowercase/partial keys fail. Full text is returned; no truncation.

Without a package, all community assets and 05_资产库 are searched. A package limits the scan to one directory with no fallback. Multiple matches may be returned. No match is an error.

Inputs: key (required), package. Returns: Every asset file that declares the requested key.

knowledge_order_readResolve knowledge orderA
Read-onlyIdempotent

Return the declared knowledge-source query order and a contract-first flag.

Use it before assembling or citing NF content; do not use it to search documents (use library_search instead) or read module/asset bodies (module_read / asset_read).

Optional clearance is a visibility ceiling: public keeps public sources, internal keeps public and internal, restricted keeps all. Use public before republishing material, or omit it to keep all. Filtered sources are omitted without reordering the rest, and count is post-filter. Reads only the declaration, never source bodies.

Inputs: clearance. Returns: The resolved consultation order and the applied clearance.

library_readRead library entryA
Read-onlyIdempotent

Read one library catalog entry by ID, returning its frontmatter record and body. Use it after library_search resolves the ID; do not use it to search (library_search) or to read modules, pipelines, or assets (module_read / pipeline_read / asset_read). The ID is the canonical stem without the .md suffix and matching is case-insensitive (for example NF-1); an unknown ID returns an error carrying the requested value and repair guidance. Reads one local file and returns its full text without truncation. Local-only; no auth or rate limits.

Inputs: entry_id (required). Returns: A catalog entry with its metadata and full Markdown body.

module_readFetch module documentA
Read-onlyIdempotent

Read one NF module's full Markdown by ID, including its raw machine-contract block when present.

Use it after registry_search resolves a module, or enumerate module IDs with registry_search and an empty query; do not use it for pipelines or assets (pipeline_read / asset_read).

The ID is the declared machine-contract or heading ID (M90), or a qualified ID (通用:M10, as returned by registry_search), not the filename; matching is case-sensitive. An unknown ID returns an error with the requested value and repair guidance. Returns the full file plus resolved metadata from one local file and does not evaluate the contract. Local-only; no auth, network, rate limits, or writes.

Inputs: module_id (required). Returns: A module file with its metadata and full Markdown body.

pattern_listList patternsA
Read-onlyIdempotent

List engineering patterns as id/path/title/status metadata from patterns/*/PATTERN.md, sorted by ID. Use it to discover a pattern ID before pattern_read; do not use it to fetch pattern text (use pattern_read instead) or to list modules/assets (module_read / asset_list). Returns metadata only, never the PATTERN.md body, with no pagination; no matches yields an empty list, and each call rescans the local patterns directory.

Inputs: no named parameters. Returns: Wrapper for the pattern list; the payload is in items.

pattern_readRead engineering patternA
Read-onlyIdempotent

Read one engineering pattern's full Markdown from patterns//PATTERN.md, including frontmatter, rules, and a counterexample. Use it for the practice behind an NF rule; do not use it to enumerate patterns (pattern_list) or read domain modules (module_read). pattern_id is the exact, case-sensitive directory name such as fail-closed-verification, not the document title. A missing pattern is an error, not an empty result; reads one local file and returns its full text without truncation. Local-only; no auth or rate limits.

Inputs: pattern_id (required). Returns: A pattern file with its metadata and full Markdown body.

pipeline_listList pipelinesA
Read-onlyIdempotent

List NF pipelines as path/title metadata from 03_管线库 and community/*/pipelines. Use it to discover a pipeline ID before pipeline_read; do not use it to fetch pipeline text (use pipeline_read instead), module metadata (registry_search), or protocol packages (spec_list). The optional query is a case-sensitive substring of the repository-relative path or H1 title, not file content; wildcard characters are literal. Omit it to list every pipeline (examples: P04, 技术文档, 校园). Returns metadata only, never pipeline bodies, sorted by repository path; no matches yields an empty list, and each call rescans the repository. Local-only; no auth or rate limits.

Inputs: query. Returns: Wrapper for the pipeline list; the payload is in items.

pipeline_readFetch pipeline documentA
Read-onlyIdempotent

Read one NF pipeline's full Markdown by P-number or repository-relative path. Use it after pipeline_list identifies a pipeline; do not use it to list pipelines (use pipeline_list instead) or read modules/assets (module_read / asset_read). pipeline is either a Pxx stem (P01, matched against the filename prefix) or a .md path under 03_管线库/ or a community pipelines/ directory; paths outside those roots and .. escapes are rejected. A missing pipeline is an error, not an empty result; reads one local file and returns its full text without truncation. Local-only; no auth or rate limits.

Inputs: pipeline (required). Returns: A pipeline file with its path and full Markdown body.

spec_listList protocol packagesA
Read-onlyIdempotent

List protocol packages from desktop/src/core/registry.json with each package's id, version, module count, and categories. Use it for the authoritative protocol package catalog; do not use it to search modules (registry_search) or pipelines (pipeline_list), and do not treat protocol hits from registry_search as a substitute for this list. Takes no arguments; an empty list means the registry declares no protocols. Reads one local file deterministically; a missing or malformed registry is an error. Packages appear in registry order.

Inputs: no named parameters. Returns: Wrapper for the protocol package list; the payload is in items.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.9/5.0

    Scored across 12 tools

    Disambiguation5/5

    Each tool targets a distinct resource type and action (list/read/search), and descriptions explicitly state what each tool should not be used for, preventing misselection. The only minor overlap is between registry_search and spec_list for protocols, but the descriptions clearly delineate authoritative catalog vs search.

    Naming Consistency5/5

    All 12 tools follow a consistent snake_case noun_verb pattern (e.g., pattern_read, pipeline_list, asset_read), with no mixing of conventions. The outlier knowledge_order_read still follows the same pattern.

    Tool Count5/5

    12 tools is well-scoped for a content access server covering multiple resource types (patterns, pipelines, assets, modules, library, registry, specs). Each tool earns its place as a list/read/search operation for a distinct resource.

    Completeness4/5

    The read-only surface covers list/read for patterns, pipelines, assets, modules (via registry_search empty query), library entries, and knowledge order. Minor gaps exist: no spec_read for protocol package bodies, and library_search can surface document titles without a corresponding generic document read tool.

    Maintenance

    ActivityActive
    ResponsivenessUsually handled

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      这是一个面向中文圈的MCP服务器,将中国互联网常用能力(如地图、快递、RSS、B站等)封装为标准MCP工具,方便AI Agent安全调用。
      13
      2
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server exposing content contract validators (SEO.md, PRODUCTHUNT.md, LINKEDIN.md) as tools so AI agents can verify generated content against concrete rules without maintaining linters. It provides linting and JSON-LD export tools with config and content passed as parameters, not file paths.
      4
      MIT