Logo Structured Doc Validate

Structured Doc Validate

Cộng đồng
PriNova
structured-doc-validate

Xác thực các artifact YAML có cấu trúc chuẩn về định dạng schema, tính toàn vẹn của tham chiếu, chất lượng bằng chứng, độ bao phủ và mức độ chi tiết. Mặc định chỉ đọc; không dùng tài liệu cũ dạng văn xuôi.

Add to TypingMind

Tổng quan

Nhà phát hànhPriNova
Kho mãpi-agent-codebase-workflows
Tên kỹ năngstructured-doc-validate
Sao
82
Bản fork
2
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được PriNova công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Structured Doc Validate trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/PriNova/pi-agent-codebase-workflows/tree/main/skills/structured-doc-validate
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/PriNova/pi-agent-codebase-workflows.git /tmp/pi-agent-codebase-workflows
mkdir -p .claude/skills
cp -r /tmp/pi-agent-codebase-workflows/skills/structured-doc-validate .claude/skills/structured-doc-validate
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Structured Doc Validate trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Structured Doc Validate ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Structured Doc Validate với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Structured Docs Validation

Goal: audit canonical structured YAML artifacts so agents can trust, repair, or safely avoid stale project context.

Structured Artifact API Contract

Legacy prose artifacts are deprecated. Do not create, update, or rely on docs/agent/*.md, scoped prose docs, or generated human-readable Markdown views. Use structured YAML as the source of truth. Root AGENTS.md is only harness interoperability output from workflows that explicitly produce it.

Resolved structured docs root:

Treat docs/agent/api as a logical layout rooted at a resolved structured docs root, not a fixed repo path.

Resolution rules:

  1. Resolve workspace_root with git rev-parse --show-toplevel 2>/dev/null or fallback to pwd.
  2. Canonicalize workspace_root before fingerprinting when possible (realpath, pwd -P, Path(...).resolve(), or equivalent).
  3. structured-doc-validate reads repo-local only when <workspace_root>/docs/agent/api already exists.
  4. Otherwise read the global overlay root: ~/.pi/agent/workspaces/<workspace-fingerprint>/docs/agent/api.
  5. Compute <workspace-fingerprint> exactly from canonical workspace_root: strip one leading slash/backslash, replace every slash, backslash, and colon with -, then wrap with --.
  6. Example: /data/data/com.termux/files/home/CodeProjects/pi-mono -> --data-data-com.termux-files-home-CodeProjects-pi-mono--.
  7. Do not create new repo-local structured docs in unadopted repos unless the user explicitly asks for repo-local adoption there.

Logical structured layout under the resolved docs root:

text
repo/
  scopes.yaml
  repo-inventory.yaml
  project-intent.yaml
  architecture.yaml
  data-flow.yaml
  data-model.yaml
  invariants.yaml
  dependency-rules.yaml
  design-issues.yaml
  risk-register.yaml
  change-guide.yaml
  testing-strategy.yaml
  validation-baseline.yaml
  contracts.yaml
  adr.yaml
  agent-operating-guide.yaml
scopes/
  by-path/<repo-relative-path>/...
  by-domain/<slug>/...

Every structured artifact should conform to ../_shared/references/schemas/common.schema.json plus its artifact-specific schema. Stable IDs include scope:*, component:*, entity:*, invariant:*, risk:*, contract:*, flow:*, command:*, issue:*, adr:*, and testplan:*.

Runtime Schema Loading

When validating structured artifacts, read ../_shared/references/artifact-api.md first. Then read only the shared skill package schemas needed for artifacts being validated:

  • ../_shared/references/schemas/common.schema.json
  • ../_shared/references/schemas/<artifact-file-base>.schema.json

Do not read all schemas unless the validation target is the whole docs root. Do not use templates. Schemas are runtime API contracts; project docs outside the shared runtime refs are maintainer aids unless the user asks about this package itself.

Invocation

Use this skill directly or use /validate-structured-docs as the prompt-template shortcut.

Supported tasks:

  • Validate structured docs for this repo/docs root.
  • Audit docs after this diff.
  • Check whether docs are granular enough for agent workflows.
  • Find stale evidence or invalid refs.
  • Report documentation quality without editing artifacts.

Rules

  • Read-only by default. Do not edit code or artifacts unless the user explicitly asks for repair.
  • Do not read legacy prose Markdown docs.
  • Resolve <docs-root> exactly before reading artifacts.
  • If a focus is provided, read <docs-root>/repo/scopes.yaml first when present and select matching scope artifacts by longest path prefix or explicit domain match.
  • If no focus is provided, validate repo-level artifacts first, then scoped artifacts as context budget allows.
  • Prefer exact, evidence-backed findings over broad opinions.
  • Broken schemas, missing shared schema coverage for canonical artifact files, parse failures, and dangling refs are errors. Fuzzy evidence, coverage, and granularity concerns are warnings unless they block safe use.
  • If structured artifacts predate newer schema requirements, missing now-required fields are schema errors, not compatibility notes.
  • Every finding must include artifact path, record ID when available, severity, evidence, impact, and recommended next step.
  • If a validation command exists in validation-baseline.yaml, prefer running or recommending that command; otherwise validate by inspection and targeted shell checks.

Four-Layer Validation Workflow

1. Schema validity

Check:

  • YAML parses cleanly.
  • Every canonical artifact file being validated has matching shared schema coverage.
  • Common envelope fields exist and are consistently shaped.
  • Artifact-specific top-level keys match the matching schema.
  • Required arrays/items are present, including newer required fields introduced by schema evolution.
  • Stable IDs use expected prefixes for artifact family.
  • Status, severity, confidence, and other constrained values match schemas.
  • Required refs/evidence fields are present where schemas or workflow rules require them.

Use best-effort schema validation by inspection when no validator command exists. When a JSON Schema validator is available, run it against only relevant files and include command/results.

2. Reference integrity

Build or inspect a canonical ID registry from artifacts read. Check:

  • Every *_ref, *_refs, depends_on, evidence_refs, scope ref, contract ref, invariant ref, risk ref, issue ref, ADR ref, and artifact ref points to a known canonical ID or is explicitly external/unknown.
  • Cross-scope refs have owner/consumer relationship support in scopes.yaml and, when API-like, contracts.yaml.
  • Router/checklist artifacts reference owner facts instead of duplicating them.
  • No record points to deleted, malformed, duplicate, or contradictory owner records.

Prefer compact missing-owner recommendations over leaving ambiguous dangling refs.

3. Evidence validity

For evidence-bearing records, check:

  • Referenced source paths exist under repo root when repo-aware validation is possible.
  • Line ranges exist and are ordered when present.
  • Referenced symbols/text are plausibly present near claimed paths or ranges.
  • Evidence belongs to claimed scope and owner artifact.
  • Observed records have evidence; planned records use explicit planned/low-confidence markers.
  • current/high-confidence claims are not supported only by stale, missing, or unrelated evidence.

Do not claim semantic proof. Report stale/missing evidence as actionable quality risk.

4. Coverage and granularity

Check:

  • Changed files or high-value source areas have relevant scope or owner-artifact representation.
  • Scope routing covers important paths without excessive overlap.
  • Components/entities/contracts/risks are neither too broad to guide changes nor so tiny they fragment ownership.
  • Repeated facts are owned once and referenced elsewhere.
  • Validation/testing artifacts cover commands and risks important to the requested change.

Granularity is heuristic. Use warnings with concrete split/merge suggestions, not automatic failure, unless the docs cannot guide safe work.

Diff-Aware Mode

When user asks to validate after a diff:

  1. Inspect changed files with git diff --name-only or user-specified base.
  2. Match changed paths to scopes from repo/scopes.yaml when present.
  3. Read only relevant owner artifacts plus directly referenced artifacts.
  4. Prioritize evidence paths, owner refs, contracts, invariants, risks, tests, and validation baseline entries touched by the diff.
  5. Report undocumented changed files or stale evidence first.

Output Format

Use concise human output. Include machine-shaped summary when useful:

yaml
verdict: pass | pass_with_warnings | fail | blocked
schema:
  status: pass | mixed | fail | blocked
  findings: []
refs:
  status: pass | mixed | fail | blocked
  findings: []
evidence:
  status: pass | mixed | fail | blocked
  findings: []
coverage:
  status: pass | mixed | fail | blocked
  findings: []
granularity:
  status: pass | mixed | fail | blocked
  findings: []
recommendations: []

Finding shape:

yaml
severity: error | warning | info
artifact_path: <path>
record_id: <id-or-null>
layer: schema | refs | evidence | coverage | granularity
problem: <concise problem>
evidence: <file/path/command observation>
impact: <why it matters for agent workflows>
recommended_next_step: <specific repair or follow-up>

Verdict Rules

  • fail: parse/schema errors, missing shared schema coverage for canonical artifacts, missing now-required fields, dangling required refs, missing required owner artifacts for selected scope, or missing evidence that makes current/high-confidence records unsafe.
  • pass_with_warnings: schema/required refs are usable, but evidence, coverage, or granularity issues need follow-up.
  • pass: no material issues found within inspected scope.
  • blocked: docs root, required files, repo root, schemas, or commands cannot be accessed enough to validate.

Follow-Up Routing

  • For broken artifact shape or invalid refs: recommend safe-change structured-docs-only repair or codebase-recon consolidation.
  • For missing scope coverage: recommend codebase-recon on the relevant path/domain focus.
  • For stale source evidence after code changes: recommend safe-change docs update for affected owner artifacts.
  • For architecture/code concerns discovered while validating docs: recommend arch-code-review; do not turn validation output into code review findings unless requested.

Stop Conditions

Stop once the requested focus is validated enough to give a verdict and actionable findings. Do not exhaustively read a large repo when targeted evidence already proves the result.

Câu hỏi thường gặp

Kỹ năng AI Structured Doc Validate làm được gì?

Xác thực các artifact YAML có cấu trúc chuẩn về định dạng schema, tính toàn vẹn của tham chiếu, chất lượng bằng chứng, độ bao phủ và mức độ chi tiết. Mặc định chỉ đọc; không dùng tài liệu cũ dạng văn xuôi.

Vì sao nên dùng Structured Doc Validate trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Structured Doc Validate là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Structured Doc Validate trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/PriNova/pi-agent-codebase-workflows/tree/main/skills/structured-doc-validate. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Structured Doc Validate?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Structured Doc Validate với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Structured Doc Validate với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Structured Doc Validate có miễn phí không?

Có. Kỹ năng này được PriNova phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇