Add security hardening, Ghidra, recreate skill, checkpoints, shells, web search and themes

- Sandbox (bubblewrap) for non-admin shell/git, MCP per-user rights, hard budgets and quotas,
  login rate limiting, audit log and backups
- Ghidra headless decompilation (ARM64 natives built from source), binary_info tool,
  clean room / deep workflow per session
- Recreate skill and commands for analysing and re-building old software
- File checkpoints with rewind/restore, background shells (bash_output, kill_shell)
- web_search tool (DuckDuckGo, SearXNG, Brave, Tavily)
- In-app dialogs and toasts instead of browser dialogs
- 15 base themes (trilium-themes palettes plus Nord, VS Code, GitHub, Catppuccin, One,
  Dracula, Rose Pine, Everforest, Kanagawa) with light/dark/auto switcher and license notes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-08 19:12:30 +01:00
1 parent fab9add5d5
commit 5b569b6835
108 files changed
+6785 -279

No files matched your search

@@ -0,0 +1,15 @@
---
description: Set up a project for re-creating existing software (folders, templates, .gitignore)
---
Load the skill "recreate" with the skill tool and set up the project layout it describes in the
current working directory:
1. Create the folders original/, original/extracted/, analysis/, docs/, spec/, proposal/, src/, tests/
(keep empty ones with a .gitkeep).
2. Copy the templates from the skill's templates/ folder: 01–06 into docs/, recreation-plan.md into proposal/.
3. Create or extend .gitignore with `original/`, `analysis/` and `.codecraft/`.
4. Create README.md (in English) describing the project's purpose and the layout, if it does not exist.
5. Do not commit. Finish with a short message telling the user to put the program, its
libraries, archives or installers into original/ and then run /recreate-start.
$ARGUMENTS
@@ -0,0 +1,10 @@
---
description: Analyse the software in original/, document it and propose how to re-create it
agent: craft
clean_room: false
---
Load the skill "recreate" with the skill tool and carry out phases 1–4 for the software in
original/ (inventory and unpacking, analysis, documentation and specification, proposal).
Track the phases with todo_write. Stop after the proposal and ask the user how to proceed.
Additional notes from the user: $ARGUMENTS
+92
View File
@@ -0,0 +1,92 @@
---
name: recreate
description: Re-create existing software (old DOS/Windows/Linux programs and games) as a new, modern implementation – project layout, unpacking, analysis, documentation, specification and a recreation proposal. Use for /recreate-init and /recreate-start.
---
# Re-creating software
Goal: understand an existing program well enough to build a **new, independent implementation**
that behaves like the original – on modern systems. We re-create, we do not copy: decompiled
code is a source of understanding, never of code. Everything we build comes from the
specification written in our own words.
## Project layout
```
original/ the user's files: program, libraries, archives, installers (never modified, not committed)
original/extracted/ unpacked archives and installers (one folder per source file)
analysis/ tool output: binary_info, decompile results, notes (not committed)
docs/ documentation of the original (from the templates)
spec/ specification of the re-creation – the only input for building
proposal/ the recreation proposal
src/ tests/ the new implementation and comparison tests (later)
```
`.gitignore` must exclude `original/` and `analysis/` (third-party binaries and decompiled code
stay out of the repository).
## Phase 1 – Inventory and unpacking
1. List everything in `original/` recursively with sizes (`find original -type f -printf '%s %p\n'`)
and identify each file with `file`.
2. Unpack every archive and installer **without running it**, each into
`original/extracted/<file name>/`, then repeat on the results (archives inside archives,
disk images, installers inside archives) until nothing is left to unpack:
| Found | Command |
|---|---|
| zip, 7z, tar(.gz/.bz2/.xz), iso, img, NSIS installer, MSI, CAB, many self-extracting .exe | `7z x -y -o<dir> <file>` |
| rar, lzh/lha, arj, sit, zoo and other old formats | `unar -o <dir> -f <file>` (or `arj x`, `lha x`) |
| Inno Setup installer (`file` or `innoextract -i` says so) | `innoextract -e -d <dir> <file>` |
| InstallShield (`data1.cab` + `data1.hdr`) | `unshield -d <dir> x data1.cab` |
| Microsoft CAB | `cabextract -d <dir> <file>` |
| MSI (if 7z gives no useful names) | `msiextract -C <dir> <file>` |
| DOS executables packed with PKLITE/LZEXE/EXEPACK (see `strings`, `binary_info`) | note it – decompile the unpacked image if an unpacker is available, otherwise analyse behaviour and data files |
If a format cannot be unpacked, record it and continue – never execute installers.
3. Write `docs/01-inventory.md` (template): every file with origin (which archive), type,
size, role guess (main program, overlay, library/driver, data, graphics, sound, music,
configuration, save game, documentation).
## Phase 2 – Analysis
1. `binary_info` for every executable and library: format (MZ/NE/PE/LE/ELF), CPU,
compiler/linker hints, imports, strings.
2. `decompile` the main executable(s); for big programs start with `max_functions` and widen.
3. Explore the output with grep/read: entry point and main loop, initialisation, input,
graphics (video modes, palettes, sprites), sound/music drivers, file I/O (which files are
opened, how they are parsed), game/application logic, timing, configuration, save games.
4. Data files: identify formats (headers, magic numbers, `xxd | head`), match them with the
loading code, decode them where possible (write small scripts in `analysis/tools/`).
5. Identify engines, libraries and middleware (strings, imports, copyright notices).
6. Keep working notes in `analysis/notes.md`. Ask the user (ask_user) when the purpose of
something is unclear and they may know it.
## Phase 3 – Documentation and specification
Fill the templates in `docs/` (02–06) from the analysis – in your own words, with function
addresses only as references. Then write `spec/spec.md`: the behaviour to re-create, screens
and controls, rules/logic, data and file formats (byte layouts are facts and may be
specified exactly for compatibility), timing, edge cases, and what counts as "done".
The spec must be complete enough that someone who never saw the decompiled code could
build the program from it.
## Phase 4 – Proposal
Write `proposal/recreation-plan.md` (template): 2–3 technology options (e.g. Rust + SDL2,
C++ + SDL, Godot, web/TypeScript) with fit, pros/cons and effort; the recommended option;
architecture sketch; milestones (first playable/usable version first); how original assets
are handled (loaded from the user's original files at runtime vs. new assets); comparison
tests against the original; risks and open questions.
Then **stop**: summarise the findings and the recommendation for the user and ask with
ask_user how to proceed. Do not start building before the user agrees.
## Rules
- Never paste or mechanically translate decompiled code into `src/`. Names, structure and
code are new. Facts needed for compatibility (file formats, constants, rules) are fine.
- Original assets (graphics, sounds, levels) stay the user's files: the re-creation may load
them from `original/` at runtime but does not copy them into the repository.
- Use todo_write for the phases; delegate broad searches through decompiled output to
explore subagents to keep your own context small.
@@ -0,0 +1,11 @@
# Inventory
| File | From (archive/installer) | Type (`file`) | Size | Role |
|---|---|---|---|---|
## Unpacking log
| Source | Tool | Result |
|---|---|---|
## Not unpacked / open questions
@@ -0,0 +1,6 @@
# Overview
- Name, publisher, year, platform, original system requirements:
- What the program does (from the user's perspective):
- Executables and how they relate (main program, setup, overlays, drivers):
- Engines, libraries, compilers detected:
@@ -0,0 +1,6 @@
# Architecture of the original
## Start-up and main loop
## Modules / subsystems (input, graphics, sound, logic, file I/O, configuration)
## Important functions (address → purpose)
## Memory and data structures
@@ -0,0 +1,4 @@
# File and data formats
For each format: files using it, header/magic, layout (offset, size, meaning), compression,
how the program reads/writes it (function references), decoding status and tools in analysis/tools/.
@@ -0,0 +1,7 @@
# User interface and behaviour
## Screens / windows / menus
## Controls and input
## Rules and logic
## Timing (frame rate, tick rate, delays)
## Sound and music
@@ -0,0 +1,4 @@
# Assets
Graphics, palettes, fonts, sounds, music, levels/maps, texts: where they are, format, how many,
how the re-creation will use them.
@@ -0,0 +1,13 @@
# Recreation proposal
## Summary
## Technology options
| Option | Fit | Pros | Cons | Effort |
|---|---|---|---|---|
## Recommendation
## Architecture sketch
## Milestones
1. First runnable version:
## Handling of original assets
## Comparison tests against the original
## Risks and open questions