diff --git a/AGENTS.md b/AGENTS.md index bae73f5..5f4ea2c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,7 +21,7 @@ Tests are colocated as `*.test.ts` files in `src/`. - `bun run lint`: lint with `oxlint src` (zero-warning gate; CI fails on warnings). - `bun test`: run all colocated Bun tests. - `bun run verify:agents-md`: validate the root `AGENTS.md` developer contract (structure, required sections, `.agents/rules/` reference integrity); wired into pre-commit (staged docs only) and CI. -- `bun run verify:skill-md`: validate the `skills/seal-use/SKILL.md` routing hub (size budget, bidirectional `references/` routing); wired into pre-commit (staged docs only) and CI. +- `bun run verify:skill-md`: validate the `skills/seal-use/SKILL.md` routing hub (structure and bidirectional `references/` routing); wired into pre-commit (staged docs only) and CI. - `bun run bump `: bump version across all manifest and skill files. - `bun run dev:override`: compile the host binary with Git dev version metadata, macOS sign, atomically override the existing global command found on PATH (falling back to a standalone bin directory), and sync the local Agent Skill. diff --git a/README.md b/README.md index 7d0fa98..f55029c 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,15 @@ Enterprise configs live only in the global directory `~/.config/seal-use/enterpr The canonical plugin skill lives at `skills/seal-use`. There is no in-repo `.agents/skills/seal-use` symlink; run `seal-use skill install` (or `seal-use skill install --dir `) to place it in a Codex skills directory such as `~/.agents/skills/seal-use` when you want Codex to invoke the workflow as `$seal-use`. The installer includes the full embedded manifest, including report references sourced outside that folder; manually copying only the skill folder omits those references. +## Governance Documentation + +Two instruction files serve two different audiences; both are gated by mechanical checks (`bun run verify:agents-md`, `bun run verify:skill-md`, wired into pre-commit and CI): + +- **`AGENTS.md` — the developer contract.** How contributors (human or agent) change this codebase: module boundaries, CLI stream/exit-code protocol, testing, release rules. +- **`skills/seal-use/SKILL.md` — the user/agent routing hub.** How an agent session uses the shipped skill: bootstrap, credential boundaries, and the `## 参考文档路由` table that routes intents to `skills/seal-use/references/*.md`, which stay the single source of truth for operational detail. + +Workflow rules live in `.agents/rules/*.md`; the root `AGENTS.md` indexes them and carries the enforced contract. + ## ZCode Plugin The repository is also a ZCode plugin. Install `seal-use` from the `yingqing-plugins` marketplace in **Settings → Plugin Management**, or add this repository as a local plugin directory while developing. The plugin ships the `skills/seal-use` skill; it has no MCP surface. For MCP locally, paste the snippet from `seal-use mcp-config` into your host — it starts `seal-use mcp` with `SEAL_USE_MCP_ENABLED=true`, which the server needs before it exposes any tool. diff --git a/scripts/check-skill-md.test.ts b/scripts/check-skill-md.test.ts index bd8c180..30b656b 100644 --- a/scripts/check-skill-md.test.ts +++ b/scripts/check-skill-md.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from "bun:test" import { readdirSync, readFileSync } from "node:fs" import { join } from "node:path" -import { SKILL_MAX_H2_SECTIONS, SKILL_MAX_LINES, validateSkillDoc } from "./check-skill-md.js" +import { validateSkillDoc } from "./check-skill-md.js" const REFERENCE_FILES = ["references/alpha.md", "references/beta.md"] @@ -31,23 +31,6 @@ describe("validateSkillDoc", () => { expect(validateSkillDoc(cleanSkill(), REFERENCE_FILES)).toEqual([]) }) - test("enforces the line budget as a hard error", () => { - const padded = Array.from({ length: SKILL_MAX_LINES }, () => "filler line") - const content = `${cleanSkill()}\n${padded.join("\n")}` - const issues = validateSkillDoc(content, REFERENCE_FILES) - expect(issues.some((issue) => issue.rule === "skill-budget-lines")).toBe(true) - }) - - test("enforces the H2 section budget as a hard error", () => { - const sections = Array.from( - { length: SKILL_MAX_H2_SECTIONS + 1 }, - (_, index) => `## Section ${index + 1}` - ) - const content = `${lines("# Demo Skill", "")}\n${sections.join("\n\n")}` - const issues = validateSkillDoc(content, REFERENCE_FILES) - expect(issues.some((issue) => issue.rule === "skill-budget-h2")).toBe(true) - }) - test("flags routing that points at a missing reference file", () => { const content = lines( "# Demo Skill", diff --git a/scripts/check-skill-md.ts b/scripts/check-skill-md.ts index 8dd409e..4877cb6 100644 --- a/scripts/check-skill-md.ts +++ b/scripts/check-skill-md.ts @@ -3,9 +3,11 @@ * Governance checks for skills/seal-use/SKILL.md (the user/agent-facing * traffic-routing hub, per .agents/rules/skill-documentation.md). * - * Scope: the routing-hub charter as hard numbers (size budget) and routing - * integrity (every reference file on disk is routed; every routed reference - * exists on disk). Not checked here: wording quality, table formatting. + * Scope: structure and routing integrity — every reference file on disk is + * routed from SKILL.md; every routed reference exists on disk. Size is + * deliberately NOT gated: where detail belongs (hub vs references/) is a + * review-time judgment, and an arbitrary numeric cap would erode the gate's + * credibility with false positives. * * Invoked as `bun run verify:skill-md` (CI + pre-commit) and with `--soft` * from the ZCode SessionStart hook, which emits hook-safe JSON and never @@ -24,14 +26,6 @@ import { export const SKILL_DOC_RELATIVE_PATH = "skills/seal-use/SKILL.md" export const REFERENCES_DIR_RELATIVE_PATH = "skills/seal-use/references" -/** - * The charter says SKILL.md is a lightweight routing hub, never a feature - * billboard. These budgets turn that into hard numbers; raising them must be - * a deliberate, reviewable diff, not silent growth. - */ -export const SKILL_MAX_LINES = 200 -export const SKILL_MAX_H2_SECTIONS = 12 - /** Backticked skill-relative references only: `references/.md`. */ const REFERENCE_MENTION = /`(references\/[A-Za-z0-9._-]+\.md)`/g @@ -43,27 +37,8 @@ export function validateSkillDoc(content: string, referenceFiles: readonly strin issues.push(...checkSingleLeadingH1(headings, file)) issues.push(...checkHeadingHierarchy(headings, file)) - const lineCount = content.split("\n").length - if (lineCount > SKILL_MAX_LINES) { - issues.push({ - file, - rule: "skill-budget-lines", - message: `SKILL.md is ${lineCount} lines (budget ${SKILL_MAX_LINES}); move detail into references/ per the routing-hub charter` - }) - } - const h2Count = headings.filter((heading) => heading.level === 2).length - if (h2Count > SKILL_MAX_H2_SECTIONS) { - issues.push({ - file, - rule: "skill-budget-h2", - message: `SKILL.md has ${h2Count} H2 sections (budget ${SKILL_MAX_H2_SECTIONS}); consolidate before adding more` - }) - } - const diskReferences = new Set(referenceFiles) - const mentioned = new Set() for (const match of content.matchAll(REFERENCE_MENTION)) { - mentioned.add(match[1]!) if (!diskReferences.has(match[1]!)) { issues.push({ file,