Kraft for VS Code
Install the Kraft extension and end with the board in VS Code's sidebar, where you clear what Kraft is waiting on you for from the editor: approve or reject a gate, review a work item's branch, and edit Kraft's YAML config files with errors flagged as you type.
Before you start
- Kraft running on the same machine.
kraft admin startholds the terminal; add--detachto run it in the background. - A Kraft of the extension's own major release and at least its minor. Against any other, the extension is read-only: see If the extension is read-only.
Install
- Install Kraft (publisher
kraft-sdlc) from the VS Code Marketplace, or from Open VSX, the registry VSCodium and Cursor install from. Or search forkraft-sdlc.kraftin the Extensions view. - Optionally, for completion and instant structure checks in config files, install Red Hat YAML. The extension offers it once if it is missing.
Every release also attaches the extension as kraft-<version>.vsix. To install
one by hand, download it from the
GitHub release and run:
code --install-extension kraft-<version>.vsix
Check it worked
Open the Kraft view in the sidebar: it lists your work items. The status bar
shows a check mark beside Kraft while the extension is connected, and
Kraft (read-only) when the versions do not match.
Clear a gate
When a gate opens, VS Code shows a notification with Open, Approve and Reject.
- Open shows the gate's document in a tab.
- Approve and Reject are in that tab's title bar, and on the item in the sidebar.
The item leaves the Needs you group in the sidebar.
Review a branch
- Right-click the item in the Kraft view and run Review Changes, or run it from a gate document's title bar. The branch opens in the multi-file diff editor.
- Read the findings from the review agents. They show on the lines they name, as a colored bar with the message beside the line, and in the Problems panel.
- Add a comment on any line.
- Run Submit Review. Your comments go to the agent as one note.
What Submit Review does depends on the item:
| The item | What it does |
|---|---|
| At a gate | Rejects the gate, with your comments as the note. |
| Paused | Steers the item, with your comments as the note. |
Approving instead asks before it discards your comments.
Edit config files
Files under $KRAFT_HOME/config (policy.yaml, harnesses.yaml, chains/*.yaml
and the rest) get completion from Kraft's JSON Schemas, and the running Kraft
checks each edit and flags the line at fault. On a chain file, Show Resolved
Chain previews the chain after inheritance. On save, the extension offers to
reload Kraft, or to restart it for files Kraft reads only at startup.
Settings
| Setting | What it does |
|---|---|
kraft.url | Where Kraft listens. Empty reads KRAFT_HOST and KRAFT_PORT, then bind and port from access.yaml. |
kraft.notifications | all, gates or off: which states raise a notification. |
If the extension is read-only
The extension works with a Kraft of its own major release and at least its
minor: the 2.0 extension needs Kraft 2.0 or a later 2.x. Against any other, it
turns read-only. The board still updates, every action is disabled, and its
status bar item reads Kraft (read-only).
| The extension | The server | The fix |
|---|---|---|
| 2.0 | 1.4 | Upgrade from 1.4. |
| 1.4 | 2.0 | Update the extension. |
An extension newer than Kraft
- When it connects, it shows a warning that says which to update, and the status bar item's tooltip repeats it: against a 1.4 server, "This extension (2.0.0) needs Kraft 2.0 or later; this server runs 1.4.0. Update Kraft. Actions are disabled until they match."
- When you then try an action, it shows "Kraft is read-only: this server's version does not work with this extension. Hover Kraft in the status bar to see which one to update."
VS Code updates the extension on its own, so after a new major release this is what you see until you update Kraft from 1.4.
An extension older than Kraft
The rule holds the other way too: an extension from 1.4, one whose updates are off or that you pinned, is read-only against a 2.0 server. The 1.4 extension has no tooltip and says less. When it connects, it shows "Kraft 2.0.0 does not match this extension (1.4.0); actions are disabled until they match." When you try an action, it shows "Kraft is read-only: the daemon's version does not match this extension." Update the extension as well.
Next steps
- Use Kraft from your agent: clear the same gates from an agent session instead of the editor.
- Reviewing a change: what comment, approve and request changes do, and the CLI verbs.
- The extension's source: the repository's
vscode/directory, to read how it works or to report a bug.