For engineers · about 30 minutes

From your first SIGN file to an agent that uses it.

Six steps. You will validate the official examples, write and compile two documents of your own, and wire the result into an agent. You need Git and Node.js 18 or later. Every command below was run against the current specification.

  1. Step 1 of 6

    Clone the specification and validate the examples.

    The sign-lang repository holds the specification, six worked examples and the validator. The validator has no dependencies, so there is nothing to install.

    Terminal
    git clone https://github.com/sign-protocol/sign-lang.git
    cd sign-lang
    node validator/bin/sign.js validate --source examples

    The last line of the output should read:

    pass — 11 documents across 6 file(s)
    Expect warnings.The examples link to documents that are not in the folder, so the validator prints warn lines before it passes. Warnings do not fail a build. Errors do.

    To type sign instead of node validator/bin/sign.js, run npm link inside the validator folder. The rest of this guide uses the full path so it works either way.

  2. Step 2 of 6

    Read one document before you write one.

    Open examples/02-full-document.sign. Each block starts with a sigil: a symbol that tells the agent what kind of content follows. These are the first lines:

    @doc WFI-008 [std, active, agents+employees] v2 sha:7d4a1f
    @links WFI-001,WFI-002,WFI-003,WFI-009
    @cycle 90d
    @reviewed 2026-04-14
    
    @vocab
      depends_on    | skill cannot be effectively applied without target present
      adjacent_to   | skills frequently co-occur and complement; symmetric
    
    @def skill
      Atomic, distinct, demonstrable capability enabling effective task performance.
    • @doc gives the ID, the document type, the status, who it is for, and the version.
    • @links names related documents. The validator checks that each one exists.
    • @cycle and @reviewed say how often the document is reviewed and when it last was.
    • @vocab defines every relationship word the document uses.
    • @def holds a definition.

    Keep the sigil quick reference open while you write. Block order matters: the validator fails a document whose blocks are out of order.

  3. Step 3 of 6

    Write two documents that link to each other.

    Make a folder called knowledge next to sign-lang and add these two files. They describe a refund rule and the role it depends on. The ## line is the one-sentence summary that goes into the index.

    knowledge/REFUND-001.sign
    @doc REFUND-001 [std, active, agents+employees] v1
    @links REFUND-002
    @cycle 90d
    @reviewed 2026-11-09
    ## Refunds over 500 dollars need a manager's approval before an agent issues them.
    
    @vocab
      approved_by | the refund is approved by the named role before it is issued
    
    @def refund
      Money returned to a customer against a paid invoice.
    
    @rules
      1. An agent may issue a refund of 500 dollars or less without approval.
      2. A refund over 500 dollars needs approval from a support manager first.
    
    @constraints
      manager-approval
        requires: support-manager approval on any refund over 500 dollars
        forbids: an agent issuing a refund over 500 dollars without that approval
    knowledge/REFUND-002.sign
    @doc REFUND-002 [ref, active, agents] v1
    @links REFUND-001
    @cycle 180d
    @reviewed 2026-11-09
    ## Who counts as a support manager for refund approvals.
    
    @def support-manager
      A person in the Support Managers group in the HR system.
    Terminal, from the folder that holds both
    node sign-lang/validator/bin/sign.js validate --source knowledge

    You should see pass — 2 documents across 2 file(s). Now change @links REFUND-002 to REFUND-003 and validate again: the validator reports that no document with that ID exists. Change it back before you continue.

  4. Step 4 of 6

    Compile the canon into an index and a bundle.

    Compiling validates first, then writes the two layers an agent consumes.

    Terminal
    node sign-lang/validator/bin/sign.js compile --source knowledge --output dist
    • dist/canon-index.sign is Layer 1: one entry per document with its ID, links and summary. The sample index is about 68 tokens.
    • dist/canon-bundle.sign is Layer 2: the full text of every active document.
    • dist/canon-manifest.json records the version, document count, build time and a SHA-256 hash, and canon-bundle.sign.sha256 lets you check the bundle has not changed.
    Compile is stricter.A link to a missing document is a warning during validate on the examples but an error during compile. Every document you link to must be in the source folder.
  5. Step 5 of 6

    Load the index into the prompt and serve documents through a tool.

    The agent always sees the index, so it knows which documents exist and what each one covers. It calls a tool to fetch the full text only when a task needs it. This file works with any model or agent framework that supports tools; register get_canon_doc in whatever format yours uses.

    agent.mjs
    import { readFileSync } from "node:fs";
    
    const index = readFileSync("dist/canon-index.sign", "utf8");
    const bundle = readFileSync("dist/canon-bundle.sign", "utf8");
    
    // Split the Layer 2 bundle into documents, keyed by ID.
    const docs = new Map();
    for (const chunk of bundle.split(/^# --- .+ ---$/m)) {
      const id = chunk.match(/^@doc (\S+)/m)?.[1];
      if (id) docs.set(id, chunk.trim());
    }
    
    // Layer 1 goes into every system prompt.
    export const systemPrompt = `You work under the following knowledge canon:
    ${index}
    Call get_canon_doc with a document ID when you need its full rules.`;
    
    // Layer 2 is served on demand through a tool.
    export function get_canon_doc({ id }) {
      return docs.get(id) ?? `No active document with ID ${id}.`;
    }

    Ask the agent to issue a 700 dollar refund. It should see REFUND-001 in the index, fetch it, and ask for a support manager's approval.

    Measure the difference.Before you switch a real agent over, run a few of its usual tasks with your current prompts and record the tokens each call uses. Run the same tasks with the SIGN index and compare. The validator prints the index size on every run, for example index budget: ~68 / 400 tokens.
  6. Step 6 of 6

    Go further with the reference tools.

    The sign-tools repository holds reference implementations at version 0.1.

    You haveUse
    Finished policies, standards, ADRs or glossariessign-ingest, a command-line tool that converts each document to SIGN with provenance and an optional review step.
    Notes or requirements, but no finished documentsign-draft, a Claude Code skill that drafts a new SIGN document and runs the validator on it.
    A code repositorysign-encode-repo, a Claude Code skill that writes four documents describing the repository: overview, architecture, dependencies and standards. It does not edit source code or send repository content over the network.
    VS CodeThe SIGN language extension adds syntax highlighting for .sign files.

    Run sign-encode-repo on a small or sample repository first, so you can check its output before it touches your main codebase. If your security team needs to approve the tools, the team guide has a note you can send them.

    To propose a new sigil or report a problem in the specification, open an issue on sign-lang before you write code. The contributing guide explains how proposals are reviewed.

Explaining SIGN to your team

Send them the team guide.

It covers what SIGN changes, how to adopt it on one body of knowledge, and what stays under your company's control, without the code.