@flood-md/agent

中文文档
0.2.14发布于 2026/11/15MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 3203

Versioned Flood design instructions for coding agents.

原始使用文档

@flood-md/agent

Version-matched guidance for Flood React/Next.js projects. Read the installed contract before composing screens. The 0.2.11 reference bundle includes spacing guidance, routing and observable rules. These files grant no authority to modify external services.

The optional @flood-md/agent/inspect export supplies inspectRenderedUI for browser evaluation in local verification tooling. It reads the current rendered DOM without mutation/network access and returns bounded observations, copy and field geometry. See rendered review for execution, privacy, limits and contextual review. The main knowledge-reader entry remains Node-only. An empty observation list does not certify an interface's quality. The same optional entry exports inspectSourceUI for bounded text observations of host-owned JSX/CSS. It suggests owner review for native dialogs/controls and custom layouts without reading files or executing source. Text matches can be false positives or miss indirect code; see the rendered-review reference. For full-window AppShell routes, assertWorkspaceScroll fails a browser test when the document scrolls or the workspace loses its Flood scroll viewport. See the Playwright example.

The package also exposes a Node-only, read-only knowledge API with TypeScript declarations. No model provider, network service or MCP runtime is required.

import {createKnowledgeReader} from '@flood-md/agent';
const reader = createKnowledgeReader();
const context = await reader.info();
const page = await reader.list({kind: 'component', search: 'table'});
const material = await reader.read('component:data-table');

Follow nextCursor/nextOffset when present. Metadata is bounded separately from material bodies; a selected body is checked against the matching package catalog. The CLI adds host-version checks and preservation of project-owned guide copies. knowledge.json contains semantic annotations; build generates dist/catalog.json from the same canonical components, token manifest, guides and recipes used by the website. Do not hand-edit generated hashes or duplicate component contracts. See Agent knowledge for groups, capabilities, prerequisites, read budgets, compatibility and customization behavior.

The source bundle includes routed workflows for the existing dark base, including application structure, screen composition, layout composition, component composition, hierarchy, typography, decision design, spacing, motion, foundations, accessibility, forms, overlays, navigation, data display, records, feedback, interface content, visual review and verification. The lightweight flood-ui entry selects relevant skills; nested folders do not imply independent automatic discovery. workflows.json describes applicability. rules.json describes observable checks; neither is a completed component-audit report or executable enforcement engine.

SourceRole
DESIGN.mdShared versioned UI/component contract
SKILL.mdShort entry and task router
references/routing.mdApplicability, audience, prerequisites and governing source
references/composition.mdScreen/form composition workflow
references/flood-composition/SKILL.mdFull primitives-first composition skill routed from flood-ui
references/spacing.mdMeasured spacing, density, nested geometry and hit areas
references/accessibility.mdInteraction and perception checks
references/customization.mdScoped semantic customization
references/verification.mdEvidence before reporting completion
rules.jsonStable rule IDs with conditions, sources and observable checks
manifest.jsonSource → installed-path mapping used by the CLI
workflows.jsonComponent-family applicability and routed full-skill sources

CLI init copies every manifest entry into an unused owned path. Doctor checks expected regular files without linked destinations. Neither tool rewrites host instructions or proves agent compliance. The website serves these sources under /agent/ after a build. Read only relevant references; installed declarations govern available APIs. See the human guide.

DESIGN.md includes concrete composition rules: intrinsic action widths, responsive form parents, a close indicator/label pair, spacing between choices, and keyboard/native form requirements. Always check the declarations of the installed package before using APIs introduced by a later version. See the user-facing layout guide for complete examples.

Manifest entry/rule guide paths identify package sources; manifest.files maps them to project-root targets. installedEntry points directly to the project skill. Keep manifest.version aligned with the package and DESIGN header.

版本与发布记录

@flood-md/agent 共发布 17 个版本,首次发布于 2026/10/22;过去 12 个月发布了 17 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.2.14latest2026/11/15今天
0.2.132026/11/141 天前
0.2.122026/11/132 天前
0.2.112026/11/115 天前
0.2.102026/10/3115 天前
0.2.92026/10/3017 天前

关于 @flood-md/agent 的常见问题

@flood-md/agent 是什么?

Versioned Flood design instructions for coding agents.

如何安装 @flood-md/agent?

在项目目录运行 npm install @flood-md/agent,或使用 pnpm add / yarn add / bun add。

@flood-md/agent 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@flood-md/agent 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@flood-md/agent 可以商用吗?

@flood-md/agent 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@flood-md/agent 的下载量有多少?

根据 npm 官方下载统计,@flood-md/agent 在 2026/10/15 – 2026/11/13 这 30 天内被下载 3,203 次,日均约 107 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@flood-md/agent 还在维护吗?

最新版本 0.2.14 发布于 2026/11/15(今天);至今共发布 17 个版本,其中过去 12 个月发布了 17 个;首次发布于 2026/10/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。