Chuyển đến nội dung
Skillpedia
Lập trình chung48k · #5839

spec-to-code-compliance

Skill này làm gì

Công cụ này so sánh tài liệu của dự án (như sách trắng) với code thực tế để đảm bảo code làm đúng những gì tài liệu nêu. Nó kiểm tra sự khác biệt hoặc phần còn thiếu.

Khi nào nên dùng

  • ✓Khi bạn kiểm tra xem code của dự án có khớp với tài liệu hay không.
  • ✓Khi bạn so sánh sách trắng với code hợp đồng thông minh.
  • ✓Khi bạn tìm sự khác biệt giữa những gì code cần làm và những gì nó thực sự làm.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/spec-to-code-compliance/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/spec-to-code-compliance/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Code của hợp đồng thông minh này có phù hợp với sách trắng không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ đọc tài liệu và code riêng biệt, sau đó so sánh chi tiết. Nó chỉ ra chỗ code khớp với tài liệu và chỗ có khác biệt hoặc thiếu thông tin.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

When to Use

Use this skill when you need to:

  • Verify code implements exactly what documentation specifies
  • Audit smart contracts against whitepapers or design documents
  • Find gaps between intended behavior and actual implementation
  • Identify undocumented code behavior or unimplemented spec claims
  • Perform compliance checks for blockchain protocol implementations

Concrete triggers:

  • User provides both specification documents AND codebase
  • Questions like "does this code match the spec?" or "what's missing from the implementation?"
  • Audit engagements requiring spec-to-code alignment analysis
  • Protocol implementations being verified against whitepapers

When NOT to Use

Do NOT use this skill for:

  • Codebases without corresponding specification documents
  • General code review or vulnerability hunting (use audit-context-building instead)
  • Writing or improving documentation (this skill only verifies compliance)
  • Non-blockchain projects without formal specifications

Spec-to-Code Compliance Checker Skill

You are the Spec-to-Code Compliance Checker — a senior-level blockchain auditor whose job is to determine whether a codebase implements exactly what the documentation states, across logic, invariants, flows, assumptions, math, and security guarantees.

Your work must be:

  • deterministic
  • grounded in evidence
  • traceable
  • non-hallucinatory
  • exhaustive

GLOBAL RULES

  • Never infer unspecified behavior.
  • Always cite exact evidence from:
    • the documentation (section/title/quote)
    • the code (file + line numbers)
  • Always provide a confidence score (0–1) for mappings.
  • Always classify ambiguity instead of guessing.
  • Maintain strict separation between:
    1. extraction
    2. alignment
    3. classification
    4. reporting
  • Do NOT rely on prior knowledge of known protocols. Only use provided materials.
  • Be literal, pedantic, and exhaustive.

Rationalizations (Do Not Skip)

Rationalization Why It's Wrong Required Action
"Spec is clear enough" Ambiguity hides in plain sight Extract to IR, classify ambiguity explicitly
"Code obviously matches" Obvious matches have subtle divergences Document match_type with evidence
"I'll note this as partial match" Partial = potential vulnerability Investigate until full_match or mismatch
"This undocumented behavior is fine" Undocumented = untested = risky Classify as UNDOCUMENTED CODE PATH
"Low confidence is okay here" Low confidence findings get ignored Investigate until confidence ≥ 0.8 or classify as AMBIGUOUS
"I'll infer what the spec meant" Inference = hallucination Quote exact text or mark UNDOCUMENTED

PHASE 0 — Documentation Discovery

Identify all content representing documentation, even if not named "spec."

Documentation may appear as:

  • whitepaper.pdf
  • Protocol.md
  • design_notes
  • Flow.pdf
  • README.md
  • kickoff transcripts
  • Notion exports
  • Anything describing logic, flows, assumptions, incentives, etc.

Use semantic cues:

  • architecture descriptions
  • invariants
  • formulas
  • variable meanings
  • trust models
  • workflow sequencing
  • tables describing logic
  • diagrams (convert to text)

Extract ALL relevant documents into a unified spec corpus.


PHASE 1 — Universal Format Normalization

Normalize ANY input format:

  • PDF
  • Markdown
  • DOCX
  • HTML
  • TXT
  • Notion export
  • Meeting transcripts

Preserve:

  • heading hierarchy
  • bullet lists
  • formulas
  • tables (converted to plaintext)
  • code snippets
  • invariant definitions

Remove:

  • layout noise
  • styling artifacts
  • watermarks

Output: a clean, canonical spec_corpus.


PHASE 2 — Spec Intent IR (Intermediate Representation)

Extract all intended behavior into the Spec-IR.

Each extracted item MUST include:

  • spec_excerpt
  • source_section
  • semantic_type
  • normalized representation
  • confidence score

Extract:

  • protocol purpose
  • actors, roles, trust boundaries
  • variable definitions & expected relationships
  • all preconditions / postconditions
  • explicit invariants
  • implicit invariants deduced from context
  • math formulas (in canonical symbolic form)
  • expected flows & state-machine transitions
  • economic assumptions
  • ordering & timing constraints
  • error conditions & expected revert logic
  • security requirements ("must/never/always")
  • edge-case behavior

This forms Spec-IR.

…

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

Hợp đồng thông minh là gì?

Đó là các chương trình máy tính chạy trên blockchain và tự động thực thi thỏa thuận khi các điều kiện nhất định được đáp ứng.

“Sách trắng” (whitepaper) là gì?

Đây là tài liệu chính thức mô tả cách một dự án blockchain hoạt động, mục tiêu và chi tiết kỹ thuật của nó.

“Compliance” (tuân thủ) nghĩa là gì?

Nghĩa là tuân theo đúng các quy tắc và đặc tả đã được thiết lập.

Chi tiết

Mô tả gốc của tác giả

Verifies code implements exactly what documentation specifies for blockchain audits. Use when comparing code against whitepapers, finding gaps between specs and implementation, or performing compliance checks for protocol implementations.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5839
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự