Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ say what is missing instead. `GET /api/tools/plan?id=<tool>` says whether a one-
exists; if it does, tell the user to press it (or run
`python3 -m nerveforge.toolkit --install <tool>`), and do not try to install anything yourself.

Skills are standard `SKILL.md` files (`skills/<id>/SKILL.md`), so they also work outside this
bridge: `GET /api/skills/<id>/SKILL.md` returns the same file as `text/markdown` with generated
front matter, and `GET /api/skills/bundle` returns all of them for writing into
`.agents/skills/`. Do not hand the `body` field to another agent when the file is what it needs —
the file carries `name`, `description` and the tool list in the shape a client reads.

### Step 6 — use an MCP server, if one is configured

`GET /api/mcp` lists sessions and `GET /api/mcp/presets` names what blocks each bridge. Call a tool
Expand Down
57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,63 @@

**English** · [Русский](docs/ru/CHANGELOG.md)

## 8.4.0

Skills become files somebody else can read. The twelve procedures were already
good advice and already carried a verdict computed from what this machine has
installed; they were written in a shape only this bridge understood. They now
follow the **Agent Skills** standard (`SKILL.md`), which Claude Code, Cursor,
Codex, Copilot and the rest of the agentskills.io clients load directly.

### One file, two audiences

The layout moved from `skills/<id>.md` to `skills/<id>/SKILL.md`, and the front
matter is generated by `skillcatalog.front_matter()` instead of being written by
hand: `name` (which the spec requires to match the folder, lowercase, no double
hyphens), `description` (what it does and when to use it, capped at 1024
characters), `license`, and everything the bridge needs under `metadata` —
category, tags, required and optional tools. A test checks the rules that a
client would otherwise enforce by silently refusing the file.

Three routes make the export real rather than nominal:

- `GET /api/skills/<id>/SKILL.md` answers `text/markdown`, front matter included,
ready to drop into `.agents/skills/<id>/`. `/skill.md` in lowercase answers the
same thing — an agent holding one spelling should not have to discover the other.
- `GET /api/skills/bundle` returns every skill as `{id, path, content}` plus the
version that produced them, so a dozen files can be written in one request.
- `GET /api/skills/<id>/validate` reports what would stop the file from loading:
the name rules, the description limit, and whether the folder, the file and the
name agree.

`GET /api/skills/<id>` still returns the procedure in `body`, but now without the
YAML block: the verdict and the tool list are already fields next to it, and two
copies of one fact are one copy too many.

### What did not travel

`metadata.tools` goes with the file, but the *check* of it cannot: another client
does not know what is installed on this machine. So the exported skill says what
it needs and the bridge says whether it is there — `ready`, `partial`, `blocked` —
and that split is documented instead of being left to be discovered.

### Everything else

- `firmware-iOT` is now `firmware-iot`. The standard permits lowercase letters,
digits and single hyphens; the old name would have been rejected by the clients
this release is for. The catalog id, the folder and the docs agree.
- `pyproject.toml` ships `toolkit/skills/*/SKILL.md` as package data, so an
installed bridge has the same procedures as a checkout instead of twelve
one-line summaries. Verified against a built wheel: 12 `SKILL.md` entries.
- The old flat layout is still read if it is found, so a tree that was installed
before this release keeps working.
- `/llms.txt` and `/api/agent-prompt` gained a `skills` section and the three new
routes: an agent should be told to read a procedure before improvising the
order of steps in a reversing job.
- Routes 63 → 66, tests 1680 → 1698. `Table.resolve` now prefers an exact path, then a
pattern, then a prefix: a prefix cannot say where a path ends, and this release is the first
to add routes underneath one.

## 8.3.0

Context7, on by default. The bridge has spoken MCP in both directions since
Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# NerveForge 8.3.0 ⚡ Arena.ai ↔ PC & Android Bridge
# NerveForge 8.4.0 ⚡ Arena.ai ↔ PC & Android Bridge

![NerveForge — Build boldly. Ship cleverly.](assets/nerveforge-lockup.png)

Expand Down Expand Up @@ -131,6 +131,11 @@ from what is actually installed, so an agent reading `read_skill` never starts a
cannot finish. On a clean container three are ready, one is one button away and eight are
blocked; that is the honest answer, not a bug.

Each skill is a standard `SKILL.md` under `skills/<name>/`, in the Agent Skills layout that Claude
Code, Cursor, Codex and Copilot read, so `GET /api/skills/<id>/SKILL.md` hands the same procedure
to another agent as a file it can drop into `.agents/skills/`. The verdict stays here, because
only this machine knows what is installed on it.

**Tools** (`GET /api/tools`). 24 entries across reverse engineering, debugging, mobile, forensics
and networking, each with the GitHub release asset a download would use. The **install** button
and the CLI follow the same rule as cloudflared: release asset only, SHA-256 from the same API
Expand Down Expand Up @@ -227,14 +232,15 @@ Every protected call needs `Authorization: Bearer <token>`.
| `POST /api/public/scripts` | public | Create a new `.cs` file (legacy) in the workspace root |
| `POST /api/public/assets` | public | Create a text file with an allowlisted extension |
| `GET /api/skills`, `GET /api/skills/<id>` | bearer | Skill catalogue with `ready`/`partial`/`blocked` and the body of one skill |
| `GET /api/skills/<id>/SKILL.md`, `/bundle` | bearer | Portable Agent Skills files, with generated front matter |
| `GET /api/tools` | bearer | Tool catalogue: what is installed, what is missing, what can be downloaded |
| `POST /api/tools/install` | bearer | `{"id": "jadx"}` — download, verify the SHA-256, unpack into the data dir; `201` |
| `GET /api/mcp/presets` | bearer | Thirteen MCP bridges and what blocks each one |
| `GET /api/mcp/docs`, `POST /api/mcp/docs/call` | bearer | Current library documentation from Context7, on by default |
| `POST /api/mcp/connect`, `/call`, `/disconnect` | bearer | Drive an MCP server; mutations need `allow_mutating` |
| `GET /api/mcp/server/tools` | bearer | This bridge as an MCP server: nine tools, write and run annotated |

The reference lists all 63 routes; [docs/API.md](docs/API.md) is generated from the table, so it cannot drift.
The reference lists all 66 routes; [docs/API.md](docs/API.md) is generated from the table, so it cannot drift.

Full allowlist: `GET /api/quick` → `capabilities.public_upload.extensions`; add your own with
`NERVEFORGE_PUBLIC_UPLOAD_EXTRA`. Details: [docs/PUBLIC_UPLOAD.md](docs/PUBLIC_UPLOAD.md).
Expand All @@ -243,11 +249,11 @@ Full allowlist: `GET /api/quick` → `capabilities.public_upload.extensions`; ad

## 🧪 Tests and code quality

The repository ships **1680 automated unit tests** (Linux, Windows, Android/Termux, API, security,
The repository ships **1698 automated unit tests** (Linux, Windows, Android/Termux, API, security,
tunnels). CI runs them on Linux and Windows:

```bash
python3 -m unittest discover -s tests -v # 1680 tests
python3 -m unittest discover -s tests -v # 1698 tests
python3 -m compileall -q src tests run.py # Python bytecode
find static -name '*.js' -print0 | xargs -0 -n1 node --check # JavaScript syntax # JS syntax
bash -n setup.sh && bash -n setup_termux.sh # shell installers
Expand Down Expand Up @@ -310,7 +316,7 @@ nerveforge/
│ ├── uzhas_manager.py # Shell runner with timeout and tree cancellation
│ └── workspace_manager.py # File operations, bwrap sandbox, public uploads
├── static/ # Web panel assets (HTML, CSS, JS)
├── tests/ # Unit tests (1680 tests)
├── tests/ # Unit tests (1698 tests)
├── pyproject.toml # PEP 517/518 build metadata
├── run.py # Run in place
├── setup.sh / setup_windows.ps1 / setup_termux.sh
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Security policy — NerveForge 8.3.0
# Security policy — NerveForge 8.4.0

**English** · [Русский](docs/ru/SECURITY.md)

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.3.0
8.4.0
3 changes: 3 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ the public uploads are reachable. Bodies are JSON objects; errors are
|---|---|---|---|
| `GET` | `/api/skills` | Bearer | **Skills.** The skill catalogue with readiness computed from what is installed: `ready`, `partial` (a required tool is missing) or `blocked`. Each row names the missing tools, so an agent can see what this machine can actually do. |
| `GET` | `/api/skills/*` | Bearer | **Read a skill.** One skill with its full procedure in `body`, plus `note`: advice built from the tool registry (what to install, or where to stop). |
| `GET` | `^/api/skills/[^/]+/[Ss][Kk][Ii][Ll][Ll]\.md$` | Bearer | **One skill as SKILL.md.** `/api/skills/<id>/SKILL.md` — `text/markdown`: the agent-skills standard file for this skill, front matter included. `/skill.md` and `/SKILL.md` both answer. Drop it into `.agents/skills/<id>/` and another client has the same procedure. |
| `GET` | `/api/skills/bundle` | Bearer | **Every skill as SKILL.md.** `{version, skills: [{id, path, content}]}` — the whole catalogue ready to be written to disk in one request. |
| `GET` | `^/api/skills/[^/]+/validate$` | Bearer | **Check a skill against the spec (path /api/skills/<id>/validate).** `{valid, problems}`: the name rules, the 1024-character description limit and whether the folder, the file and the name agree. |
| `GET` | `/api/tools` | Bearer | **Tool registry.** External programs and libraries (ghidra, yara, volatility3...) with `available`, `via` (`binary`|`module`), `path`, `downloadable` and package names per manager. |
| `GET` | `/api/tools/plan` | Bearer | **Tool install plan.** What a download would fetch for `?id=`: repo, asset name, target path. `downloadable: false` comes with the reason and the packages. |
| `POST` | `/api/tools/install` | Bearer | **Install a tool.** `{"id": "radare2"}`. Fetches the latest release asset, verifies the SHA-256 from the same GitHub response and writes it to the data dir with mode `0700`. `409` when the download fails or a digest is missing; no partial file is left. Only tools that publish a standalone asset can be installed this way. |
Expand Down
2 changes: 1 addition & 1 deletion docs/REFACTORING_PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> version 7.0.7). The analysis covered `src/`, `static/`, `tests/`, the installers and the
> documentation. Test suite at the time of analysis: **66/66 green**.
>
> **Status: all eight stages are done. Nine releases later the project is at 8.3.0 with 1680
> **Status: all eight stages are done. Nine releases later the project is at 8.3.0 with 1698
> tests.** The "before" numbers below are kept as the record of what motivated each stage; the
> tables say what each stage started from, not what the suite contains today.
>
Expand Down
58 changes: 42 additions & 16 deletions docs/TOOLKIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Three ideas, deliberately separate:

| Term | What it is | Where it lives |
|---|---|---|
| **Skill** | A written procedure plus the tools it declares | `src/nerveforge/toolkit/skills/*.md` |
| **Skill** | A written procedure plus the tools it declares | `src/nerveforge/toolkit/skills/<id>/SKILL.md` |
| **Tool** | An external program or Python module, with the release asset a download would use | `src/nerveforge/toolkit/tools.py` |
| **MCP server** | Somebody else's tool server, spoken to over JSON-RPC | `src/nerveforge/toolkit/registry.py` |

Expand All @@ -20,26 +20,30 @@ which tools it needs. Execution stays where it already was: the approval queue o

## Skills

A skill is a Markdown file whose name is the id (`binary-triage.md`). The catalogue
(`skillcatalog.CATALOGUE`) carries the metadata; the file carries the prose, and the two are checked
against each other by a test. The head of `binary-triage.md`:
A skill is a folder whose name is the id, holding a `SKILL.md`
(`skills/binary-triage/SKILL.md`) — the **Agent Skills** layout that Claude Code, Cursor, Codex,
Copilot and the other clients of [agentskills.io](https://agentskills.io) read. The catalogue
(`skillcatalog.CATALOGUE`) carries the tool list; the file carries the YAML front matter and the
prose, and tests check all three against each other. The head of `binary-triage/SKILL.md`:

```
---
id: binary-triage
category: re
tools: [strings, objdump]
optional: [binwalk, yara, lief, capstone]
name: binary-triage
description: "First ten minutes with an unknown file: what it is, what it links, whether it is packed. Use when working on: reversing, triage, static."
license: MIT
metadata:
category: re
tags: reversing, triage, static
tools: strings, objdump
optional-tools: binwalk, yara, lief, capstone
---

# Binary triage

The first ten minutes decide whether the next two hours are wasted. ...
```

The body is written for an agent, in the imperative, with the commands it would actually type. The
`tools` list is the contract: `GET /api/skills` resolves each name against what is installed here
and reports one of three states.
Two of those fields are the standard's: `name` must be the folder, lowercase, and `description` is
the only thing another agent reads before deciding to open the file. The rest live under
`metadata`, where the spec puts anything a client does not interpret — `category`, `tags`, and the
`tools` list that is this bridge's own contract: `GET /api/skills` resolves each name against what
is installed here and reports one of three states.

| State | Meaning | What the agent should do |
|---|---|---|
Expand All @@ -64,7 +68,7 @@ Twelve ship:
| `malware-static` | malware | strings | yara, binwalk, exiftool, ghidra | Indicators without executing anything |
| `protocol-reversing` | protocol | tshark | scapy, strings | Reconstruct a wire format from a capture |
| `android-apk` | mobile | jadx | apktool, adb, frida | Manifest, permissions, Java from an APK |
| `firmware-iOT` | forensics | binwalk | strings, ghidra, sleuthkit | Unpack an image, find the root filesystem |
| `firmware-iot` | forensics | binwalk | strings, ghidra, sleuthkit | Unpack an image, find the root filesystem |
| `disk-forensics` | forensics | sleuthkit | plaso, exiftool | Partitions, deleted files, file carving |
| `memory-forensics` | forensics | volatility3 | yara | Processes, connections, injected code from a dump |
| `yara-authoring` | forensics | yara | strings | Turn indicators into a rule that can be run again |
Expand All @@ -77,6 +81,28 @@ one can stand in for the other.
Adding a skill is one file plus one entry in `skillcatalog.CATALOGUE`; a test checks that every
declared tool exists in the catalogue and that every file is present and non-trivial.

### Taking a skill somewhere else

The point of following the standard is that the file is not ours alone. A skill can be handed to
another agent as it stands:

| Route | Answers | Use |
|---|---|---|
| `GET /api/skills/<id>` | JSON with `body` (the procedure) and the verdict | This bridge's own screens |
| `GET /api/skills/<id>/SKILL.md` | `text/markdown`, a complete standard file | Drop into `.agents/skills/<id>/` |
| `GET /api/skills/bundle` | Every skill as `{path, content}`, plus the version | Install all of them at once |
| `GET /api/skills/<id>/validate` | `{valid, problems}` against the spec's rules | Before publishing one |

`/skill.md` in lowercase answers the same thing as `/SKILL.md`; the name of the file is a
convention, and an agent holding one spelling should not have to discover the other. The front
matter is generated by `skillcatalog.front_matter()` rather than written into the files, so the
version of the bridge that produced a copy is recorded in it and the two representations cannot
argue about the tool list.

The verdict travels with the file only as far as `metadata.tools`: another client will read it but
cannot check it, because it does not know what is installed on this machine. That check stays here,
where the answer is real.

---

## Tools
Expand Down
6 changes: 6 additions & 0 deletions docs/ru/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ curl -H "Authorization: Bearer <TOKEN>" https://<TUNNEL_URL>/api/tools
кнопкой; если есть — попросите пользователя нажать её (или выполнить
`python3 -m nerveforge.toolkit --install <инструмент>`) и не пытайтесь устанавливать сами.

Скиллы — это стандартные файлы `SKILL.md` (`skills/<id>/SKILL.md`), поэтому они работают
и вне этого моста: `GET /api/skills/<id>/SKILL.md` отдаёт тот же файл как `text/markdown` со
сгенерированным front matter, а `GET /api/skills/bundle` — все сразу, чтобы записать их в
`.agents/skills/`. Не передавайте другому агенту поле `body`, если ему нужен файл: имя,
описание и список инструментов в форме, которую клиент читает, есть только в файле.

### Шаг 6: Вызвать MCP-инструмент, если сервер настроен

`GET /api/mcp` перечисляет сессии, `GET /api/mcp/presets` называет, что мешает каждому мосту.
Expand Down
3 changes: 3 additions & 0 deletions docs/ru/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
|---|---|---|---|
| `GET` | `/api/skills` | Bearer | **Навыки.** Каталог навыков с готовностью, посчитанной по установленному: `ready`, `partial` (нет обязательного инструмента) или `blocked`. В каждой строке перечислены недостающие инструменты — агент видит, что машина умеет на самом деле. |
| `GET` | `/api/skills/*` | Bearer | **Читать навык.** Один навык с полной процедурой в `body` и `note` — советом, собранным по реестру инструментов (что доустановить или где остановиться). |
| `GET` | `^/api/skills/[^/]+/[Ss][Kk][Ii][Ll][Ll]\.md$` | Bearer | **Навык как SKILL.md.** `text/markdown`: файл стандарта agent-skills для этого навыка вместе с front matter. Отвечают и `/skill.md`, и `/SKILL.md`. Положите его в `.agents/skills/<id>/` — и у другого клиента та же процедура. |
| `GET` | `/api/skills/bundle` | Bearer | **Все навыки как SKILL.md.** `{version, skills: [{id, path, content}]}` — весь каталог, готовый лечь на диск одним запросом. |
| `GET` | `^/api/skills/[^/]+/validate$` | Bearer | **Проверка навыка по спецификации.** `{valid, problems}`: правила имени, лимит описания в 1024 символа и совпадение папки, файла и имени. |
| `GET` | `/api/tools` | Bearer | **Реестр инструментов.** Внешние программы и библиотеки (ghidra, yara, volatility3...) с `available`, `via` (`binary`|`module`), `path`, `downloadable` и именами пакетов по менеджерам. |
| `GET` | `/api/tools/plan` | Bearer | **План установки инструмента.** Что скачает кнопка для `?id=`: репозиторий, имя ассета, путь. При `downloadable: false` — причина и пакеты. |
| `POST` | `/api/tools/install` | Bearer | **Установить инструмент.** `{"id": "radare2"}`. Берёт последний ассет релиза, сверяет SHA-256 из того же ответа GitHub и кладёт в папку данных с правами `0700`. `409`, если скачивание сорвалось или нет digest; недокачанный файл не остаётся. Так ставятся только инструменты с отдельным ассетом. |
Expand Down
Loading
Loading