Skip to content

Commit 843e807

Browse files
Jonathan D.A. Jewellclaude
andcommitted
feat: complete project scaffold for Formatrix Docs
Initial scaffold with: - Cargo workspace with 4 crates: - formatrix-core: Unified AST and format converters (MD, TXT working) - formatrix-gui: Tauri 2.0 commands - formatrix-db: ArangoDB client - formatrix-pipeline: Nickel pipeline executor - Ada TUI structure with AdaCurses (tui/) - ReScript/Deno UI scaffold (ui/) - Guix channel and Nix flake for packaging - Wolfi container configs with nerdctl-compose - Standard RSR files: STATE.scm, META.scm, ECOSYSTEM.scm, PLAYBOOK.scm, AGENTIC.scm, NEUROSYM.scm - justfile based on mustfile pattern - CLAUDE.md for AI interaction All tests pass (6/6). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent dd7c17c commit 843e807

44 files changed

Lines changed: 11618 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/CLAUDE.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Formatrix Docs - Claude Code Instructions
2+
3+
## Project Overview
4+
5+
Cross-platform document editor with format tabs, allowing users to view and edit the same document in multiple markup formats (TXT, MD, ADOC, DJOT, ORG, RST, TYP).
6+
7+
## Architecture
8+
9+
- **Core**: Rust library with unified AST for format conversion
10+
- **GUI**: Tauri 2.0 with ReScript frontend (not TypeScript!)
11+
- **TUI**: Ada with AdaCurses (matches gitvisor pattern)
12+
- **Storage**: ArangoDB for graph + document hybrid
13+
- **Pipelines**: Nickel for import/export transformations
14+
15+
## Language Policy
16+
17+
### ALLOWED
18+
- ReScript (UI components)
19+
- Rust (core, GUI backend)
20+
- Ada (TUI)
21+
- Nickel (pipelines, config)
22+
- Guile Scheme (SCM files)
23+
- Deno (runtime)
24+
25+
### BANNED - Do Not Use
26+
- TypeScript (use ReScript)
27+
- Node.js/npm/bun (use Deno)
28+
- Go (use Rust)
29+
- Python (not applicable here)
30+
- Makefiles (use justfile)
31+
32+
## Key Directories
33+
34+
```
35+
crates/
36+
├── formatrix-core/ # AST, parsers, renderers
37+
├── formatrix-gui/ # Tauri commands
38+
├── formatrix-db/ # ArangoDB client
39+
└── formatrix-pipeline/ # Nickel executor
40+
41+
tui/src/ # Ada TUI source
42+
ui/src/ # ReScript components
43+
pipelines/ # Nickel pipeline definitions
44+
container/ # Wolfi container configs
45+
guix/ # Guix channel + packages
46+
nix/ # Nix flake (fallback)
47+
```
48+
49+
## Build Commands
50+
51+
```bash
52+
just build # Build all
53+
just build-core # Build Rust core only
54+
just build-tui # Build Ada TUI only
55+
just build-ui # Build ReScript UI only
56+
just test # Run all tests
57+
just fmt # Format all code
58+
just lint # Lint all code
59+
```
60+
61+
## Checkpoint Files
62+
63+
Read at session start:
64+
- `STATE.scm` - Project state and milestones
65+
- `ECOSYSTEM.scm` - Position in ecosystem
66+
- `META.scm` - Architecture decisions
67+
- `PLAYBOOK.scm` - Operational procedures
68+
- `AGENTIC.scm` - AI interaction patterns
69+
- `NEUROSYM.scm` - Neurosymbolic config
70+
71+
## Format Conversion
72+
73+
The core library provides a unified AST:
74+
- `Document` → contains metadata + blocks
75+
- `Block` → paragraph, heading, list, code block, etc.
76+
- `Inline` → text, emphasis, link, code span, etc.
77+
78+
Each format implements:
79+
- `Parser` trait: raw content → AST
80+
- `Renderer` trait: AST → raw content
81+
82+
## ReScript Conventions
83+
84+
- Use `@rescript/core` for stdlib
85+
- TEA pattern: Model.res, Msg.res, Update logic in App.res
86+
- Components in `src/components/`
87+
- Bindings in `src/bindings/`
88+
89+
## Ada Conventions (TUI)
90+
91+
- Package specs in `.ads`, bodies in `.adb`
92+
- Use `Terminal_Interface.Curses` for ncurses
93+
- C FFI bindings to formatrix-core in `bindings/`
94+
- Follow gitvisor hybrid pattern for widgets
95+
96+
## Testing
97+
98+
```bash
99+
just test-core # Rust unit tests
100+
just test-tui # Ada compilation check
101+
just test-ui # ReScript tests
102+
just test-integration # Full integration tests
103+
```
104+
105+
## Container Usage
106+
107+
```bash
108+
just container-build # Build Wolfi image
109+
just compose-up # Start with ArangoDB
110+
just container-run-tui # Run TUI in container
111+
```

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
target/
2+
/target/
3+
.cache/
4+
node_modules/
5+
ui/dist/
6+
ui/lib/
7+
tui/obj/
8+
tui/bin/
9+
*.pyc
10+
__pycache__/
11+
.DS_Store
12+
*.swp
13+
*.swo
14+
*~
15+
.env
16+
.env.local

AGENTIC.scm

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
;; SPDX-License-Identifier: AGPL-3.0-or-later
2+
;; AGENTIC.scm - AI agent interaction patterns
3+
;; Copyright (C) 2025 Jonathan D.A. Jewell
4+
5+
(define agentic-config
6+
`((version . "1.0.0")
7+
8+
(claude-code
9+
((model . "claude-opus-4-5-20251101")
10+
(tools . ("read" "edit" "bash" "grep" "glob" "task"))
11+
(permissions . "read-all")))
12+
13+
(patterns
14+
((code-review . "thorough")
15+
(refactoring . "conservative")
16+
(testing . "comprehensive")
17+
(documentation . "asciidoc-preferred")))
18+
19+
(constraints
20+
((languages . ("rescript" "rust" "ada" "nickel" "scheme"))
21+
(banned . ("typescript" "go" "python" "node" "makefile"))
22+
(runtime . "deno")
23+
(package-manager . "deno")))
24+
25+
(project-specific
26+
((format-handlers . "src/formats/*.rs - implement Parser + Renderer traits")
27+
(tui-widgets . "tui/src/ui/*.ads - Ada widget specs")
28+
(ui-components . "ui/src/components/*.res - ReScript React components")
29+
(pipelines . "pipelines/*.ncl - Nickel pipeline definitions")))
30+
31+
(checkpoint-files
32+
((state . "STATE.scm")
33+
(ecosystem . "ECOSYSTEM.scm")
34+
(meta . "META.scm")
35+
(playbook . "PLAYBOOK.scm")
36+
(agentic . "AGENTIC.scm")
37+
(neurosym . "NEUROSYM.scm")))))

0 commit comments

Comments
 (0)