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.
-
Step 1 of 6
Clone the specification and validate the examples.
The
sign-langrepository holds the specification, six worked examples and the validator. The validator has no dependencies, so there is nothing to install.Terminalgit clone https://github.com/sign-protocol/sign-lang.git cd sign-lang node validator/bin/sign.js validate --source examplesThe 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 printswarnlines before it passes. Warnings do not fail a build. Errors do.To type
signinstead ofnode validator/bin/sign.js, runnpm linkinside thevalidatorfolder. The rest of this guide uses the full path so it works either way. -
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.@docgives the ID, the document type, the status, who it is for, and the version.@linksnames related documents. The validator checks that each one exists.@cycleand@reviewedsay how often the document is reviewed and when it last was.@vocabdefines every relationship word the document uses.@defholds 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.
-
Step 3 of 6
Write two documents that link to each other.
Make a folder called
knowledgenext tosign-langand 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 approvalknowledge/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 bothnode sign-lang/validator/bin/sign.js validate --source knowledgeYou should see
pass — 2 documents across 2 file(s). Now change@links REFUND-002toREFUND-003and validate again: the validator reports that no document with that ID exists. Change it back before you continue. -
Step 4 of 6
Compile the canon into an index and a bundle.
Compiling validates first, then writes the two layers an agent consumes.
Terminalnode sign-lang/validator/bin/sign.js compile --source knowledge --output distdist/canon-index.signis Layer 1: one entry per document with its ID, links and summary. The sample index is about 68 tokens.dist/canon-bundle.signis Layer 2: the full text of every active document.dist/canon-manifest.jsonrecords the version, document count, build time and a SHA-256 hash, andcanon-bundle.sign.sha256lets you check the bundle has not changed.
Compile is stricter.A link to a missing document is a warning duringvalidateon the examples but an error duringcompile. Every document you link to must be in the source folder. -
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_docin whatever format yours uses.agent.mjsimport { 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 exampleindex budget: ~68 / 400 tokens. -
Step 6 of 6
Go further with the reference tools.
The sign-tools repository holds reference implementations at version 0.1.
You have Use Finished policies, standards, ADRs or glossaries sign-ingest, a command-line tool that converts each document to SIGN with provenance and an optional review step. Notes or requirements, but no finished document sign-draft, a Claude Code skill that drafts a new SIGN document and runs the validator on it. A code repository sign-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 Code The SIGN language extension adds syntax highlighting for .signfiles.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.
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.