SLOPSHOPPER

doc-editor-symlink-probe

Phase 0 spike: a hooks module importing a symlink that points outside the plugin directory.

new
A shopper browsing a rack in a slop shop
Preview could not run: harness produced no result (1 | ../../../../../../../plugins/doc-editor/core/vendor/mdast.js ^ error: Unexpected . at /home/runner/work/slopshopper/slopshopper/.cache/src/sergeiwallace-doc-edi
README

doc-editor

A doc viewer and editor inside the Claude Code terminal UI, built as a Claude Code mod. It renders markdown, HTML, PDF and other doc formats as interactive documents you can read and edit without leaving the session.

The aim is a reading and editing experience close to Notion, Confluence, Google Docs or Word, adapted to a terminal: headings and a table of contents to navigate by, rendered tables and code, links that open, and edits that save back to the file on disk.

Status

The plugin scaffold is in place: the repository is a Claude Code marketplace, the plugin loads and registers /doc, and the test gate runs at commit and at push. The first reader, a Markdown pane with Claude-mediated editing, is in progress; until it lands, /doc answers with one line saying the reader is not built yet. The design is docs/designs/doc-editor-design.md, and the research behind it is in docs/research/.

The work is tracked in this repo's own Beads store (prefix DED).

Install

/plugin install doc-editor --marketplace sergeiwallace/doc-editor

To load it from a clone instead, run claude --plugin-dir plugins/doc-editor. The install note covers requirements, both routes and the test gate.

Repository structure

  • .claude-plugin/marketplace.json: the marketplace, listing one plugin.
  • plugins/doc-editor/: the plugin. hooks/register.ts holds every call to the mods API, and core/ is the dependency-free document core.
  • scripts/ and test/: the repository's gates and their Vitest suites.
  • packages/: later surfaces, a web app and an MCP App, which will import the same core.

See CONTRIBUTING.md to work on it and SECURITY.md to report a vulnerability.

Open source

This repository is public and MIT licensed. It holds no secrets, credentials or private data, and nothing of that kind may be committed to it. Copy .env.example to .env for local settings; .env is gitignored.

Repository setup

The scaffold comes from a Copier template that is private, so copier update works only for the maintainer; .copier-answers.yml records the answers it was generated with. Contributors need neither. Git hooks install with bash .githooks/install.sh (needs pre-commit).

License

MIT

Source 2 files
hooks/register.ts 20 lines
1import type { On } from "claude-code";
2
3// mdast-link.js is a symlink to plugins/doc-editor/core/vendor/mdast.js, outside this plugin.
4import { fromMarkdown } from "./mdast-link.js";
5
6export function register(on: On) {
7  on("session.start", async ($, e, next) => {
8    await $.command.register({ name: "symprobe", description: "Parse a sample through the symlink" });
9    return next(e);
10  });
11
12  on("command.run", { command: "symprobe" }, () => {
13    const tree = fromMarkdown("# Heading\n\nA paragraph.\n") as {
14      children: { type: string; position: { start: { line: number } } }[];
15    };
16    const kinds = tree.children.map((node) => `${node.type}@${node.position.start.line}`);
17    return { text: `SYMPROBE loaded through the symlink: ${kinds.join(", ")}` };
18  });
19}
20
hooks/mdast-link.js 1 lines
1../../../../../../../plugins/doc-editor/core/vendor/mdast.js