weavemindai/weft/weft-language

Claude Code and agent skill by weavemindai/weft

Trust tier 3
  • community
  • ext:[{"type":"plugin","description":"Custom plugin integration"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Read before writing or editing any .weft source: declarations, wiring, config literals, reserved keys, inline signatures and expressions, types, groups and the level rule, how names are spelled, included files, loops, the pulse model, @file, @asset and @include, and every compiler error slug.

Install

npx vskill@latest install weavemindai/weft/weft-language

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as weavemindai/weft/weft-language.

The weft language

One way to say each thing, and the compiler refuses everything else. This page is the whole surface as of this template; when it disagrees with your memory, this page wins.

Two words the whole page leans on. A [pulse] is one value emitted on one output port and addressed to one input port of one node; nothing walks the graph, a node fires when every required input holds a [pulse]. A [closed] pulse carries no value and means "nothing will ever arrive here"; a port that never receives anything is closed the same way.

Declaring a node

`weft
name = NodeType
name = NodeType { configField: value }
name = NodeType {}

name is the node id, unique in its scope, camelCase. NodeType must exist in the project's nodes/ catalog; you read its real ports with weft describe-nodes --node <Type> --compact, never from memory.

Spelling a name

Every name you choose in a program is camelCase: a node (sendReply), a group, a loop, an @include, and every port you declare on a node, a group, a loop or an included file's header (maxRetries: Number). On a node that takes added inputs, a key in the braces that creates a port counts too (userId: 3 on ExecPython). A node type is spelled the way the catalog spells it, which is PascalCase (ExecPython). A type you declare is PascalCase too (type Card = ...), though the compiler does not check it. Settings are spelled the way the node's interface names them, camelCase too (systemPrompt).

If a name you chose is spelled any other way, the program still runs, and the compiler warns not-camel-case, with the fix when it can work one out:

text
node 'send_reply' is not camelCase: write 'sendReply'

A few names keep another spelling. The gates, _should_flow and _should_not_flow, are the language's own names, so the warning skips them; the markers keep theirs too (@per_instance, @instance_filled, @require_one_of). A value you pick from a fixed list is written exactly as the list spells it (kind: "photo"). And on a node whose added ports are named after data from outside weft, a port keeps that data's spelling: Route for a path's captures, JsonObject for the keys of the object it builds, the Postgres query nodes for a query's $ holes, among others. body = JsonObject { user_id: ask.id } draws no warning for user_id; the name you give the node, body, is still checked. Such a node shows addedPortsAreDataKeys in the features block of its wiring view. The fields of a record type are never checked at all, so a request body's user_id keeps its spelling in the record you declare for it.

Connecting

`weft
target.inputPort = source.outputPort

Right to left: the value flows from source.outputPort into target.inputPort, and the types must be compatible. Every required input gets a wire or a literal; an optional one (port?) can stay unwired. This line is the longhand; [the shorthand] (next section) is the same wire inside the target's braces, and the one you write (answer = Reply { body: work.answer }, never answer = Reply with answer.body = work.answer under it). The longhand survives only where the language leaves no choice: a [boundary port], one of the ports a group, a loop, or an @include alias declares in its signature.

If you want one key of a record value, keep going with dots (wpm: reader.profile.stats.wpm in the braces, or speed.wpm = reader.profile.stats.wpm). Still one wire; the compiler checks every key against the record type at that level and the wire carries the last key's type. Only a record type has keys to read: a source typed JsonDict or Json, a Dict[String, String] (a route's query or headers) or a scalar has none (deref-path), and nothing reads one for you. Narrow the source port to the shape it carries (next), or cast it to a record type first. At run time a ? key found absent (or null) closes that wire alone; a required key absent fails the firing.

Narrowing a port to the shape it carries

A port's type is a contract, and on the arrow where you use the node you may write a TIGHTER one: on any input, and on an output the node marks narrowable in its metadata (a query's rows, a model's JSON response, a request's body, a socket's inbound items), where only the program knows what shape comes out; the last three take any JSON-made type, Json included. Every other output takes no type but its own. The compiler checks yours and refuses one that does not fit, naming the port (node 'ask': output port 'query' is declared Dict[String, Number], but Route always gives it Dict[String, String]: only an output its node marks narrowable takes the type the program declares), so a narrowing that compiles is one the node can honour. This is how a loose container becomes a shape you can read keys off, and it costs nothing at run time: the value is already that shape, the port now says so.

A port the node already declares takes the tighter type the same way one you add on the arrow does. Here the node's own rows port is List[JsonDict], which has no keys to read, and naming the row's shape makes .title legal:

`weft
type Card = { title: String, seen: Number }
rows = PostgresExecuteQuery -> (rows: List[Card]) {
account: store.access
query: "select title, seen from cards"
}

When you want one row, its row port (the first row) narrows the same way, and you read the pieces straight off it, look.row.title:

weft
look = PostgresExecuteQuery(id: String) -> (row: Card) {
account: db.access
query: "select title, seen from cards where id = $id"
}

A column that can be NULL is declared so in the shape: { title: String, extra: JsonDict | Null }. The declared type judges every row at run time, and a JsonDict alone refuses a null, so a day when every row has the column empty fails the node with emitted a value on port 'rows' that its declared type 'List[Card]' does not accept (got List[Dict[String, String | Null]]); the fix is the | Null on that field, never a looser row type.

A cast (a node carrying features.castPorts, the catalog's Cast being one) is for a value that has to CHANGE type while it travels. A value that already fits needs no node at all, only a port that names the type. If you catch yourself adding a cast to put a shape on a value that already has it, stop and write: "Wait. Narrow the port." Then write the type on the arrow and delete the cast.

What the outside world sends is narrowed only where the node lets you. A route's query and headers are not narrowable: they stay Dict[String, String], and you read a key off one with a Cast to an open record: utm = Cast -> (value: { utm: String, .. }) { value: ask.query }, then utm.value.utm. A request's body is, and a record declared there judges each request as it arrives: a body that does not fit is answered 400 naming the field, and nothing past the route runs. A record refuses a key it does not declare, so either declare every key the caller may send, optional ones with ?, or end the record with .. ({ email: String, .. }), which drops the keys it does not declare. A cast to a record is just as strict: an undeclared key fails the cast. If callers may send a list or a bare value, declare -> (body: Json).

Wherever you narrow, the value is checked against the type when it arrives, so a shape that fits flows and one that does not fails loudly, naming the field. Prefer a NAMED type over an inline one once more than one node speaks it: the name is the contract, and it is written once.

Config values

Typed JSON-ish literals:

`weft
t = Text { value: "a string" }
n = Range { to: 10, step: 2 }
flag = SomeNode { enabled: true }
arr = SomeNode { items: [1, 2, 3] }
obj = SomeNode { opts: { "k": "v" } }

Commas between fields are optional; a field per line with no commas reads the same. null is never a literal: omit the field instead (config-null-literal).

A field with a fixed list of choices (a dropdown in the editor) takes one of them and nothing else: any other written value is literal-not-an-option, and the message lists the choices. A list the node marks freeText (model ids, voices) only suggests: any value is accepted there.

A list or object literal holds plain values only, so params: [self.chatId, self.pushName] is refused. When a node needs several values from the graph, each one is its own input port. When a node accepts however many values you give it, declare them in its inline signature: PostgresExecuteQuery(chat_id: String, push_name: String) { ... } and the SQL reads $chat_id; Format(user: String) { template: "Hi {{user}}" }. How a node reads those ports (a query's parameters, a template's slots) is in that node's description.

A Python node whose code has no branch, no loop and no call is moving values, not deciding anything, and the language moves values. Read the code you are about to write and apply that test to it. Pulling a field out of a dict is the case you will meet most; the test is what catches the rest.

If you catch yourself writing one, stop and write: "Wait. That is plumbing." Then read the key with dots, narrow the port to the shape it carries, declare the ports on the consumer, or wire _should_flow (under Reserved keys).

Calling a library, parsing what no type describes, reshaping a list in memory: that is processing, and Python is the right answer for it. A branch or a loop that decides what the program does next (whether a node runs, which service is called, a call made once per item) is coordination, and it belongs in the graph, where each node is visible and journaled: a Boolean on _should_flow for the branch, a Loop for the repetition, one node per call.

Building an object out of values you already hold (a reply body, a payload) is the case you will meet most, and it has its own node: wire a value onto each key you want and the object comes out keyed by those names. An object LITERAL cannot hold a wire, which is what used to force a script here.

Wires in the braces

A field whose value is source.port is a wire, written inside the node it feeds. This is [the shorthand]: a node's wires sit next to its settings:

`weft
reply = TelegramSendMedia {
account: telegram.access
kind: "photo"
chatId: ask.chatId # same as `reply.chatId = ask.chatId`
file: picture.image
}

A Group is the exception: its braces hold its children, so the only field it reads there is _should_flow, and its [boundary port]s are wired from outside on their own lines.

A key that CREATES a port

Some node types accept extra inputs beyond the ones they declare, and on those a key naming no declared port creates one. A wire types it from the source, a literal from its own type, null is an error. Written key?:, the node runs without the created port even when it is wired and the wire closes; written without ?, the port is required.

Which types accept them is the node's to say, not this page's: its wiring view carries a features block, and canAddInputPorts there means you may add inputs, canAddOutputPorts that you may name outputs on the arrow. A node with neither key, or no features block at all, takes only the ports it declares.

`weft
score = ExecPython -> (out: String) {
code: @file("assets/scripts/score.py")
text: draft.answer # a String port, from the wire
limit: 3 # a Number port, from the literal
notes?: review.notes # optional: a closed pulse here does not skip the node
}

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1,987
Repository forks
221
7-day trend score
38

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • pluginCustom plugin integration

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/weavemindai/weft/weft-language/badge)](https://verified-skill.com/skills/weavemindai/weft/weft-language)

Something wrong with this skill or its page? Tell us.