tools: add repl-block, check-tangle; move existing tools into memex

New tools (projects/<tool>/ — standalone, git-committed):
- repl-block: extract and pipe lisp blocks from org files to the REPL
- check-tangle: tangle + compile in one step, reports errors

Existing tools moved from ~/.opencode/bin/ into memex (survives reinstalls):
- repl, tangle, org-eval, verify-repl

AGENTS.md updated:
- Tool reference table with all 7 tools
- Package reference table for passepartout and cl-tty
- Updated tangle command to use project-local tools

.opencode/commands/ added: check-parens, repl-block, check-tangle commands
This commit is contained in:
2026-05-13 12:54:38 -04:00
parent b0b9a25fb3
commit c9cc874e53
10 changed files with 526 additions and 4 deletions

View File

@@ -125,13 +125,53 @@
goes to main. If it spans sessions or might be abandoned for a better
approach, it gets a branch.
## Tools
All tools are standalone scripts in `projects/<tool>/`, committed to the memex.
They survive upgrades, reinstalls, and new clones.
| Tool | What | Usage |
|------|------|-------|
| `check-parens` | Validate paren balance in org lisp blocks (uses SBCL reader) | `projects/check-parens/check-parens org/file.org` |
| `repl-block` | Extract and send an org lisp block to the daemon REPL | `projects/repl-block/repl-block org/file.org --function foo` |
| `check-tangle` | Tangle an org file and compile the result in SBCL | `projects/check-tangle/check-tangle org/file.org` |
| `repl` | Send lisp code to the running daemon | `projects/repl-tool/repl "(+ 1 2)"` |
| `tangle` | Tangle an org file via Emacs batch | `projects/tangle-tool/tangle org/file.org` |
| `org-eval` | Evaluate an org src block via Emacs | `projects/org-eval-tool/org-eval org/file.org` |
| `verify-repl` | Compliance: check defuns have REPL-VERIFIED comments | `projects/verify-repl-tool/verify-repl org/` |
## Package reference
When sending code to the REPL, use the correct `(in-package ...)` form first.
### Passepartout
| Package | When to use |
|---------|-------------|
| `:passepartout` | Core system — skills, gates, memory, dispatcher |
| `:passepartout.channel-tui` | TUI — event handlers, view, state |
| `<project>-tests` | Test suites — run with `(fiveam:run (intern ...))` |
### cl-tty
| Package | When to use |
|---------|-------------|
| `:cl-tty.backend` | Backend protocol — terminal init, draw-text, read-event |
| `:cl-tty.rendering` | Framebuffer — make-framebuffer, flush-framebuffer |
| `:cl-tty.input` | Input — key-event, defkeymap, dispatch-key-event |
| `:cl-tty.layout` | Layout — vbox, hbox, spacer, layout-calculate |
| `:cl-tty.dialog` | Dialog system — dialog stack, select-dialog |
| `:cl-tty.select` | Select widget — filter, handle-key |
| `:cl-tty.slot` | Slot/plugin system |
| `:cl-tty.markdown` | Markdown rendering |
## Commands
Tangle a single file:
emacs --batch --eval "(progn (require 'org) (find-file \"org/FILE.org\") (org-babel-tangle) (kill-buffer))"
projects/tangle-tool/tangle org/FILE.org
Validate structural integrity (org/ source files only):
emacs --batch -Q --eval '(progn (find-file "org/FILE.org") (check-parens) (kill-buffer))'
Or:
emacs --batch --eval "(progn (require 'org) (find-file \"org/FILE.org\") (org-babel-tangle) (kill-buffer))"
Run tests (from REPL):
(fiveam:run (intern "SUITE-NAME" :project-TESTS))
@@ -139,7 +179,6 @@ Run tests (from REPL):
Run tests (SBCL fallback — only when the runtime cannot start):
sbcl --noinform \
--eval '(load (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname)))' \
--eval '(ql:quickload :your-project :silent t)' \
--eval '(load "lisp/FILE.lisp")' \
--eval '(fiveam:run (intern "SUITE-NAME" :project-TESTS))' --quit