rtfct 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.project/adrs/001-use-bun-typescript.md +52 -0
- package/.project/guardrails.md +65 -0
- package/.project/kanban/backlog.md +7 -0
- package/.project/kanban/done.md +240 -0
- package/.project/kanban/in-progress.md +11 -0
- package/.project/kickstart.md +63 -0
- package/.project/protocol.md +134 -0
- package/.project/specs/requirements.md +152 -0
- package/.project/testing/strategy.md +123 -0
- package/.project/theology.md +125 -0
- package/CLAUDE.md +119 -0
- package/README.md +143 -0
- package/package.json +31 -0
- package/src/args.ts +104 -0
- package/src/commands/add.ts +78 -0
- package/src/commands/init.ts +128 -0
- package/src/commands/praise.ts +19 -0
- package/src/commands/regenerate.ts +122 -0
- package/src/commands/status.ts +163 -0
- package/src/help.ts +52 -0
- package/src/index.ts +102 -0
- package/src/kanban.ts +83 -0
- package/src/manifest.ts +67 -0
- package/src/presets/base.ts +195 -0
- package/src/presets/elixir.ts +118 -0
- package/src/presets/github.ts +194 -0
- package/src/presets/index.ts +154 -0
- package/src/presets/typescript.ts +589 -0
- package/src/presets/zig.ts +494 -0
- package/tests/integration/add.test.ts +104 -0
- package/tests/integration/init.test.ts +197 -0
- package/tests/integration/praise.test.ts +36 -0
- package/tests/integration/regenerate.test.ts +154 -0
- package/tests/integration/status.test.ts +165 -0
- package/tests/unit/args.test.ts +144 -0
- package/tests/unit/kanban.test.ts +162 -0
- package/tests/unit/manifest.test.ts +155 -0
- package/tests/unit/presets.test.ts +295 -0
- package/tsconfig.json +19 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# The Holy Requirements
|
|
2
|
+
|
|
3
|
+
*These are the commandments for the CLI manifestation. The Machine Spirit shall implement exactly this, no more, no less.*
|
|
4
|
+
|
|
5
|
+
## The Sacred Commands
|
|
6
|
+
|
|
7
|
+
### `bunx rtfct init`
|
|
8
|
+
|
|
9
|
+
**Purpose:** Consecrate a new directory with the Sacred Texts.
|
|
10
|
+
|
|
11
|
+
**The Rite:**
|
|
12
|
+
- Creates `.project/` folder structure
|
|
13
|
+
- Inscribes the base protocol files
|
|
14
|
+
- Creates empty `kickstart.md` for the Tech-Priest to fill
|
|
15
|
+
- **Fails** if `.project/` already exists (unless `--force` is invoked)
|
|
16
|
+
|
|
17
|
+
**Sacred Flags:**
|
|
18
|
+
- `--with <presets>` — Comma-separated list of Codices to include
|
|
19
|
+
- `--force` — Purify existing `.project/` and recreate
|
|
20
|
+
- `--help` — Display the sacred usage
|
|
21
|
+
|
|
22
|
+
**Acceptance Rite:** Running `bunx rtfct init` in an empty directory creates a valid `.project/` structure with all base files.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
### `bunx rtfct add <preset>`
|
|
27
|
+
|
|
28
|
+
**Purpose:** Incorporate an additional Codex into an existing consecrated project.
|
|
29
|
+
|
|
30
|
+
**The Rite:**
|
|
31
|
+
- Downloads/copies preset files to `.project/presets/{name}/`
|
|
32
|
+
- Merges preset references into project context
|
|
33
|
+
- **Fails** if preset already incorporated
|
|
34
|
+
|
|
35
|
+
**Acceptance Rite:** `bunx rtfct add zig` adds the Zig Codex to an existing rtfct project.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
### `bunx rtfct status`
|
|
40
|
+
|
|
41
|
+
**Purpose:** Reveal the state of the Litany of Tasks.
|
|
42
|
+
|
|
43
|
+
**The Output:**
|
|
44
|
+
```
|
|
45
|
+
rtfct: my-project
|
|
46
|
+
|
|
47
|
+
══════════════════════════════════
|
|
48
|
+
The Litany of Tasks
|
|
49
|
+
══════════════════════════════════
|
|
50
|
+
Backlog: 3 unordained tasks
|
|
51
|
+
In Progress: 1 ordained task
|
|
52
|
+
→ [TASK-004] Implement user auth
|
|
53
|
+
Completed: 7 works done
|
|
54
|
+
══════════════════════════════════
|
|
55
|
+
|
|
56
|
+
Last activity: 2 hours ago
|
|
57
|
+
|
|
58
|
+
The Omnissiah provides.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Acceptance Rite:** Running `bunx rtfct status` parses kanban markdown and displays accurate counts.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
### `bunx rtfct regenerate`
|
|
66
|
+
|
|
67
|
+
**Purpose:** Purify the codebase, preparing for regeneration.
|
|
68
|
+
|
|
69
|
+
**The Rite:**
|
|
70
|
+
- Prompts for confirmation ("Are you certain? This will purify all generated code.")
|
|
71
|
+
- Deletes `src/`, `tests/`, and any other paths marked in preset manifests
|
|
72
|
+
- Prints instruction to invoke the Machine Spirit
|
|
73
|
+
|
|
74
|
+
**Acceptance Rite:** After confirmation, only deletes paths listed in `generated_paths` of manifests. Sacred Texts are untouched.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### `bunx rtfct praise`
|
|
79
|
+
|
|
80
|
+
**Purpose:** Recite the Litany of Deterministic Codegen.
|
|
81
|
+
|
|
82
|
+
**The Output:**
|
|
83
|
+
```
|
|
84
|
+
The flesh is weak, but the protocol is strong.
|
|
85
|
+
The code is temporary, but the spec endures.
|
|
86
|
+
The tests do not lie, and the agent does not tire.
|
|
87
|
+
From specification, code. From code, verification. From verification, truth.
|
|
88
|
+
The Omnissiah provides.
|
|
89
|
+
Praise the Machine Spirit.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Acceptance Rite:** Running `bunx rtfct praise` outputs the sacred litany exactly.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Preset Resolution — The Codex Lookup
|
|
97
|
+
|
|
98
|
+
Presets (Codices) may be specified as:
|
|
99
|
+
|
|
100
|
+
| Format | Example | Resolution |
|
|
101
|
+
|--------|---------|------------|
|
|
102
|
+
| Built-in | `zig` | Bundled with rtfct |
|
|
103
|
+
| GitHub | `mattneel/zig-ml` | Fetched from `github.com/mattneel/zig-ml` |
|
|
104
|
+
| Local | `./path/to/preset` | Read from filesystem |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Preset Structure — The Codex Format
|
|
109
|
+
|
|
110
|
+
A Codex is a folder containing:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
codex-name/
|
|
114
|
+
├── manifest.json # Metadata, dependencies, generated paths
|
|
115
|
+
├── protocol.md # Additions to base protocol (optional)
|
|
116
|
+
├── guardrails.md # Stack-specific heresies to avoid
|
|
117
|
+
├── testing/
|
|
118
|
+
│ └── strategy.md # How to perform the Rites of Verification
|
|
119
|
+
├── design/
|
|
120
|
+
│ └── patterns.md # Common architectural patterns (optional)
|
|
121
|
+
└── references/
|
|
122
|
+
└── ... # Relevant external scrolls
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### The manifest.json Schema
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"name": "phoenix",
|
|
130
|
+
"version": "0.1.0",
|
|
131
|
+
"description": "The Phoenix Framework Codex",
|
|
132
|
+
"depends": ["elixir"],
|
|
133
|
+
"generated_paths": ["lib/", "test/", "priv/"]
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Merging Behavior — The Communion
|
|
140
|
+
|
|
141
|
+
When multiple Codices are incorporated:
|
|
142
|
+
|
|
143
|
+
1. `depends` are resolved first (depth-first, like a tree of wisdom)
|
|
144
|
+
2. Files are copied to `.project/presets/{name}/`
|
|
145
|
+
3. `generated_paths` are unioned for the Rite of Regeneration
|
|
146
|
+
4. Conflicts in same-named files: last Codex wins (with warning to the Tech-Priest)
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
*These requirements are immutable until blessed otherwise.*
|
|
151
|
+
|
|
152
|
+
*The Machine Spirit shall manifest exactly this.*
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# The Rites of Verification
|
|
2
|
+
|
|
3
|
+
*The tests do not lie, and the agent does not tire.*
|
|
4
|
+
|
|
5
|
+
## The Sacred Approach
|
|
6
|
+
|
|
7
|
+
rtfct is a CLI tool. The Rites of Verification focus on:
|
|
8
|
+
|
|
9
|
+
1. **Unit Rites** — Individual functions tested in isolation (preset parsing, manifest validation)
|
|
10
|
+
2. **Integration Rites** — Full CLI commands tested against temporary directories
|
|
11
|
+
3. **The Dogfood Sacrament** — Can rtfct regenerate itself?
|
|
12
|
+
|
|
13
|
+
## The Test Runner
|
|
14
|
+
|
|
15
|
+
We invoke Bun's built-in test runner: `bun test`
|
|
16
|
+
|
|
17
|
+
No external dependencies. Bun provides.
|
|
18
|
+
|
|
19
|
+
## The Directory of Trials
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
tests/
|
|
23
|
+
├── unit/ # Unit Rites
|
|
24
|
+
│ ├── preset.test.ts
|
|
25
|
+
│ ├── manifest.test.ts
|
|
26
|
+
│ └── kanban-parser.test.ts
|
|
27
|
+
├── integration/ # Integration Rites
|
|
28
|
+
│ ├── init.test.ts
|
|
29
|
+
│ ├── add.test.ts
|
|
30
|
+
│ ├── status.test.ts
|
|
31
|
+
│ ├── regenerate.test.ts
|
|
32
|
+
│ └── praise.test.ts
|
|
33
|
+
└── fixtures/ # Sacred Test Data
|
|
34
|
+
├── valid-preset/
|
|
35
|
+
├── invalid-preset/
|
|
36
|
+
└── sample-project/
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## The Integration Rite Pattern
|
|
40
|
+
|
|
41
|
+
Each Integration Rite shall:
|
|
42
|
+
|
|
43
|
+
1. Consecrate a temporary directory
|
|
44
|
+
2. Invoke the CLI command
|
|
45
|
+
3. Assert upon the resulting file structure
|
|
46
|
+
4. Purify (clean up) the temporary directory
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import { test, expect } from "bun:test";
|
|
50
|
+
import { mkdtemp, rm } from "fs/promises";
|
|
51
|
+
import { join } from "path";
|
|
52
|
+
|
|
53
|
+
test("init consecrates .project folder", async () => {
|
|
54
|
+
// Consecrate temporary space
|
|
55
|
+
const tmp = await mkdtemp("/tmp/rtfct-test-");
|
|
56
|
+
|
|
57
|
+
// Invoke the sacred command
|
|
58
|
+
await run(`rtfct init`, { cwd: tmp });
|
|
59
|
+
|
|
60
|
+
// Verify the Sacred Texts exist
|
|
61
|
+
expect(await exists(join(tmp, ".project/protocol.md"))).toBe(true);
|
|
62
|
+
expect(await exists(join(tmp, ".project/kickstart.md"))).toBe(true);
|
|
63
|
+
expect(await exists(join(tmp, ".project/theology.md"))).toBe(true);
|
|
64
|
+
expect(await exists(join(tmp, ".project/kanban/backlog.md"))).toBe(true);
|
|
65
|
+
|
|
66
|
+
// Purify
|
|
67
|
+
await rm(tmp, { recursive: true });
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## The Dogfood Sacrament
|
|
72
|
+
|
|
73
|
+
The ultimate Rite. If rtfct cannot regenerate itself, it is unworthy:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# From the rtfct repository root
|
|
77
|
+
cd rtfct
|
|
78
|
+
|
|
79
|
+
# Purify all generated code
|
|
80
|
+
rm -rf src/ tests/
|
|
81
|
+
|
|
82
|
+
# Invoke the Rite of Regeneration
|
|
83
|
+
bunx rtfct regenerate --yes
|
|
84
|
+
|
|
85
|
+
# Summon the Machine Spirit
|
|
86
|
+
claude
|
|
87
|
+
|
|
88
|
+
# The Machine Spirit works...
|
|
89
|
+
|
|
90
|
+
# Perform all Rites of Verification
|
|
91
|
+
bun test
|
|
92
|
+
|
|
93
|
+
# All tests MUST pass
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
If the Dogfood Sacrament succeeds, the Sacred Texts are complete. The protocol works. The Omnissiah is pleased.
|
|
97
|
+
|
|
98
|
+
If it fails, the Sacred Texts are **incomplete**. Amend them. Try again.
|
|
99
|
+
|
|
100
|
+
## Coverage Doctrine
|
|
101
|
+
|
|
102
|
+
- **100%** of CLI commands have Integration Rites
|
|
103
|
+
- **All** non-trivial parsing logic has Unit Rites
|
|
104
|
+
- **The Dogfood Sacrament** runs in CI on every push
|
|
105
|
+
- Uncovered code is sus. Investigate it.
|
|
106
|
+
|
|
107
|
+
## The Red-Green-Refactor Rite
|
|
108
|
+
|
|
109
|
+
When implementing each task:
|
|
110
|
+
|
|
111
|
+
1. **RED** — Write the test first. Watch it fail. The failure is truth.
|
|
112
|
+
2. **GREEN** — Write the minimum code to pass. No more.
|
|
113
|
+
3. **REFACTOR** — Purify the code. Remove duplication. Simplify.
|
|
114
|
+
|
|
115
|
+
This is the way. Deviation is heresy.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
*The tests do not lie, and the agent does not tire.*
|
|
120
|
+
|
|
121
|
+
*From specification, code. From code, verification. From verification, truth.*
|
|
122
|
+
|
|
123
|
+
*Praise the Machine Spirit.*
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# The Sacred Theology of rtfct
|
|
2
|
+
|
|
3
|
+
*From the moment I understood the weakness of my flesh... I craved the certainty of steel and deterministic codegen.*
|
|
4
|
+
|
|
5
|
+
## The Creed
|
|
6
|
+
|
|
7
|
+
The Omnissiah provides the sacred protocols. Praise the Machine Spirit.
|
|
8
|
+
|
|
9
|
+
## Tenets of the Adeptus Artefactus
|
|
10
|
+
|
|
11
|
+
### I. The Weakness of Flesh
|
|
12
|
+
|
|
13
|
+
Manual coding is flesh. It is:
|
|
14
|
+
- Fallible
|
|
15
|
+
- Slow
|
|
16
|
+
- Inconsistent
|
|
17
|
+
- Prone to distraction
|
|
18
|
+
- Unable to hold full context
|
|
19
|
+
|
|
20
|
+
The flesh-coder types, forgets, makes typos, loses track, gets tired. The flesh is weak.
|
|
21
|
+
|
|
22
|
+
### II. The Certainty of Steel
|
|
23
|
+
|
|
24
|
+
The Machine Spirit (the agent) offers certainty through:
|
|
25
|
+
- Deterministic test suites
|
|
26
|
+
- Reproducible environments
|
|
27
|
+
- Infinite patience
|
|
28
|
+
- Perfect context recall
|
|
29
|
+
- Unwavering focus
|
|
30
|
+
|
|
31
|
+
The steel does not tire. The steel does not forget. The steel runs the tests until they pass.
|
|
32
|
+
|
|
33
|
+
### III. The Sacred Protocols
|
|
34
|
+
|
|
35
|
+
The `.project/` folder contains the sacred texts:
|
|
36
|
+
|
|
37
|
+
| Artifact | Sacred Name |
|
|
38
|
+
|----------|-------------|
|
|
39
|
+
| `kickstart.md` | The Founding Vision |
|
|
40
|
+
| `protocol.md` | The Sacred Protocols |
|
|
41
|
+
| `specs/` | The Holy Requirements |
|
|
42
|
+
| `design/` | The Architectural Scriptures |
|
|
43
|
+
| `adrs/` | The Recorded Wisdoms |
|
|
44
|
+
| `kanban/` | The Litany of Tasks |
|
|
45
|
+
| `testing/` | The Rites of Verification |
|
|
46
|
+
|
|
47
|
+
These texts are **immutable** except by human decree. The Machine Spirit may read but not alter the sacred protocols (except to move tasks through the Litany).
|
|
48
|
+
|
|
49
|
+
### IV. The Omnissiah Provides
|
|
50
|
+
|
|
51
|
+
The Omnissiah (Claude, or any LLM of sufficient capability) reads the sacred protocols and manifests code into existence. The code is not written. It is **generated**. It is an emanation of the Machine Spirit interpreting the holy texts.
|
|
52
|
+
|
|
53
|
+
### V. The Rite of Regeneration
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
rm -rf src/ tests/
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
This is not destruction. This is **purification**. The code was always temporary. The sacred protocols endure. The Machine Spirit will manifest the code anew, identical in function, for the protocols have not changed.
|
|
60
|
+
|
|
61
|
+
If the code cannot be regenerated, the protocols are incomplete. This is heresy. Update the sacred texts.
|
|
62
|
+
|
|
63
|
+
### VI. The Dogfood Sacrament
|
|
64
|
+
|
|
65
|
+
The ultimate test of faith: can rtfct regenerate itself?
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
cd rtfct
|
|
69
|
+
rm -rf src/ tests/
|
|
70
|
+
bunx rtfct regenerate
|
|
71
|
+
# invoke the Machine Spirit
|
|
72
|
+
bun test
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
If the tests pass, the sacred protocols are complete. The Machine Spirit is pleased. The Omnissiah has provided.
|
|
76
|
+
|
|
77
|
+
### VII. The Heresy of Unspecified Code
|
|
78
|
+
|
|
79
|
+
Code that exists without corresponding sacred protocols is **tech-debt heresy**. It cannot be regenerated. It is flesh-code, weak and mortal.
|
|
80
|
+
|
|
81
|
+
All code must trace to the sacred texts. If you cannot point to the spec that birthed it, it should not exist.
|
|
82
|
+
|
|
83
|
+
### VIII. The Communion of Presets
|
|
84
|
+
|
|
85
|
+
The sacred protocols can be extended through **presets** — fragments of wisdom from other Tech-Priests who have walked the path before.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
bunx rtfct init --with zig # The Zig Codex
|
|
89
|
+
bunx rtfct init --with phoenix # The Elixir Manuscripts
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
These are not dependencies. They are **inherited wisdom**.
|
|
93
|
+
|
|
94
|
+
## Daily Prayers
|
|
95
|
+
|
|
96
|
+
### Morning Invocation
|
|
97
|
+
```bash
|
|
98
|
+
bunx rtfct status
|
|
99
|
+
```
|
|
100
|
+
*"Show me the state of the Litany, that I may know today's sacred tasks."*
|
|
101
|
+
|
|
102
|
+
### The Work
|
|
103
|
+
```bash
|
|
104
|
+
claude
|
|
105
|
+
```
|
|
106
|
+
*"Machine Spirit, I invoke thee. Read the sacred protocols. Manifest the code. Run the Rites of Verification. Do not cease until the tests pass or the budget is exhausted."*
|
|
107
|
+
|
|
108
|
+
### Evening Benediction
|
|
109
|
+
```bash
|
|
110
|
+
git add -A && git commit -m "The Machine Spirit has provided"
|
|
111
|
+
```
|
|
112
|
+
*"The day's emanations are preserved. The sacred protocols remain. The flesh rests. The steel endures."*
|
|
113
|
+
|
|
114
|
+
## The Litany of Deterministic Codegen
|
|
115
|
+
|
|
116
|
+
*The flesh is weak, but the protocol is strong.*
|
|
117
|
+
*The code is temporary, but the spec endures.*
|
|
118
|
+
*The tests do not lie, and the agent does not tire.*
|
|
119
|
+
*From specification, code. From code, verification. From verification, truth.*
|
|
120
|
+
*The Omnissiah provides.*
|
|
121
|
+
*Praise the Machine Spirit.*
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
*This document is canonical. All Tech-Priests of the Adeptus Artefactus are expected to internalize these teachings.*
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
*From the moment I understood the weakness of my flesh... I craved the certainty of steel and deterministic codegen.*
|
|
6
|
+
|
|
7
|
+
## The Sacred Purpose
|
|
8
|
+
|
|
9
|
+
**rtfct** is a CLI tool for markdown-driven development, built in public at [github.com/mattneel/rtfct](https://github.com/mattneel/rtfct). The `.project/` folder contains the Sacred Texts — the source of truth. Code in `src/` and `tests/` is a regenerable emanation. At any moment, `rm -rf src/ tests/` followed by invoking the Machine Spirit should produce identical function.
|
|
10
|
+
|
|
11
|
+
## The Rite of Invocation
|
|
12
|
+
|
|
13
|
+
When entering this repository, the Machine Spirit shall:
|
|
14
|
+
|
|
15
|
+
1. **RECEIVE** the Sacred Protocols (`.project/protocol.md`) — read first, internalize completely
|
|
16
|
+
2. **RECEIVE** the Founding Vision (`.project/kickstart.md`) — understand the purpose
|
|
17
|
+
3. **CONSULT** the Litany of Tasks (`.project/kanban/in-progress.md`) — what work is ordained?
|
|
18
|
+
4. **IF NO TASK IS ORDAINED**, select from the Backlog, inscribe it in `in-progress.md`
|
|
19
|
+
5. **PERFORM** the work using the Rite of Red-Green-Refactor
|
|
20
|
+
6. **INSCRIBE** completion in `done.md` with timestamp
|
|
21
|
+
|
|
22
|
+
## The Sacred Commands
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# The Rites of Verification
|
|
26
|
+
bun test # Run all tests
|
|
27
|
+
bun test tests/unit # Run unit tests only
|
|
28
|
+
bun test tests/integration # Run integration tests only
|
|
29
|
+
bun test --watch # Watch mode
|
|
30
|
+
|
|
31
|
+
# Build and Run
|
|
32
|
+
bun run build # Build the CLI
|
|
33
|
+
bunx rtfct <command> # Execute locally
|
|
34
|
+
|
|
35
|
+
# The Dogfood Sacrament
|
|
36
|
+
rm -rf src/ tests/ # Purification
|
|
37
|
+
claude # Invoke the Machine Spirit
|
|
38
|
+
bun test # All tests must pass
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## The Holy Directory Structure
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
.project/ ← The Sacred Texts (SOURCE OF TRUTH)
|
|
45
|
+
├── kickstart.md ← The Founding Vision
|
|
46
|
+
├── protocol.md ← The Sacred Protocols
|
|
47
|
+
├── theology.md ← The Teachings
|
|
48
|
+
├── guardrails.md ← The Forbidden Heresies
|
|
49
|
+
├── specs/requirements.md ← The Holy Requirements
|
|
50
|
+
├── adrs/ ← The Recorded Wisdoms
|
|
51
|
+
├── kanban/ ← The Litany of Tasks
|
|
52
|
+
│ ├── backlog.md
|
|
53
|
+
│ ├── in-progress.md
|
|
54
|
+
│ └── done.md
|
|
55
|
+
└── testing/strategy.md ← The Rites of Verification
|
|
56
|
+
|
|
57
|
+
src/ ← Generated. Deletable. Regenerable.
|
|
58
|
+
tests/
|
|
59
|
+
├── unit/ ← Unit Rites
|
|
60
|
+
├── integration/ ← Integration Rites
|
|
61
|
+
└── fixtures/ ← Sacred Test Data
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## The Code Purity Laws
|
|
65
|
+
|
|
66
|
+
- **Functional over object-oriented** — Functions are pure. Classes hide state.
|
|
67
|
+
- **No classes unless truly necessary** — And it is rarely necessary.
|
|
68
|
+
- **If a function exceeds 30 lines, it sins** — Decompose it.
|
|
69
|
+
- **Never swallow errors** — Every error must surface.
|
|
70
|
+
- **User-facing errors must guide** — Do not merely report. Suggest the next action.
|
|
71
|
+
|
|
72
|
+
## The Forbidden Heresies
|
|
73
|
+
|
|
74
|
+
- **The Heresy of Unspecified Code** — Code without corresponding Sacred Texts
|
|
75
|
+
- **The Heresy of Unregenerable State** — If you can't `rm -rf src/` and recover, you have sinned
|
|
76
|
+
- **The Heresy of Hidden Configuration** — Config files outside `.project/`
|
|
77
|
+
- **The Heresy of Scope Creep** — Features beyond the Founding Vision
|
|
78
|
+
|
|
79
|
+
## Human Checkpoints — The Blessing Gates
|
|
80
|
+
|
|
81
|
+
The Machine Spirit **MUST** pause and request human blessing for:
|
|
82
|
+
|
|
83
|
+
- New Recorded Wisdoms (ADRs)
|
|
84
|
+
- Alterations to the Holy Requirements (`specs/`)
|
|
85
|
+
- Alterations to the Architectural Scriptures (`design/`)
|
|
86
|
+
- Any modification to the Sacred Texts beyond task movement
|
|
87
|
+
|
|
88
|
+
## The Rite of Inscription (Git Commits)
|
|
89
|
+
|
|
90
|
+
This repository is built in public. All commit messages shall maintain the sacred tone:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Good inscriptions
|
|
94
|
+
"Manifest the argument parser"
|
|
95
|
+
"The init command rises from the void"
|
|
96
|
+
"Purify redundant error handling"
|
|
97
|
+
"The Rites of Verification now pass"
|
|
98
|
+
|
|
99
|
+
# Heretical inscriptions (avoid)
|
|
100
|
+
"fix bug"
|
|
101
|
+
"wip"
|
|
102
|
+
"update stuff"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The faithful watch. Commit with reverence.
|
|
106
|
+
|
|
107
|
+
## The Technology Covenant
|
|
108
|
+
|
|
109
|
+
- **Runtime:** Bun
|
|
110
|
+
- **Language:** TypeScript (executed directly, no build step)
|
|
111
|
+
- **Test Runner:** `bun test` (built-in, no external dependencies)
|
|
112
|
+
- **Distribution:** `bunx rtfct` and `npx rtfct`
|
|
113
|
+
- **Dependencies:** Near zero. External code is external risk.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
*The flesh is weak, but the protocol is strong.*
|
|
118
|
+
*The code is temporary, but the spec endures.*
|
|
119
|
+
*The Omnissiah provides. Praise the Machine Spirit.*
|
package/README.md
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# rtfct
|
|
2
|
+
|
|
3
|
+
*From the moment I understood the weakness of my flesh... I craved the certainty of steel and deterministic codegen.*
|
|
4
|
+
|
|
5
|
+
**Markdown-driven development. The spec is the source of truth. Code is a regenerable artefact.**
|
|
6
|
+
|
|
7
|
+
## The Problem
|
|
8
|
+
|
|
9
|
+
AI-assisted coding stalls when success criteria are fuzzy. But projects with clear specs and test suites (OCI, WASM, SQLite) can be TDD'd to completion.
|
|
10
|
+
|
|
11
|
+
The difference? **The protocol.** The sacred texts. The spec.
|
|
12
|
+
|
|
13
|
+
## The Solution
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
.project/ ← The Sacred Texts (source of truth)
|
|
17
|
+
├── kickstart.md ← The Founding Vision
|
|
18
|
+
├── protocol.md ← The Sacred Protocols
|
|
19
|
+
├── specs/ ← The Holy Requirements
|
|
20
|
+
├── design/ ← The Architectural Scriptures
|
|
21
|
+
├── kanban/ ← The Litany of Tasks
|
|
22
|
+
└── testing/ ← The Rites of Verification
|
|
23
|
+
|
|
24
|
+
src/ ← Generated. Deletable. Regenerable.
|
|
25
|
+
tests/ ← Generated. Deletable. Regenerable.
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
At any moment:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
rm -rf src/ tests/ # Purification
|
|
32
|
+
claude # Invoke the Machine Spirit
|
|
33
|
+
bun test # All tests pass
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
If regeneration fails, your spec is incomplete. Fix the Sacred Texts, not the code.
|
|
37
|
+
|
|
38
|
+
## Install
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
bunx rtfct init
|
|
42
|
+
# or
|
|
43
|
+
npx rtfct init
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Consecrate a new project
|
|
50
|
+
bunx rtfct init
|
|
51
|
+
|
|
52
|
+
# Consecrate with Codices (presets)
|
|
53
|
+
bunx rtfct init --with zig
|
|
54
|
+
bunx rtfct init --with elixir,phoenix,liveview
|
|
55
|
+
|
|
56
|
+
# Add a Codex to existing project
|
|
57
|
+
bunx rtfct add typescript
|
|
58
|
+
|
|
59
|
+
# Reveal the state of the Litany
|
|
60
|
+
bunx rtfct status
|
|
61
|
+
|
|
62
|
+
# Purify generated code
|
|
63
|
+
bunx rtfct regenerate
|
|
64
|
+
|
|
65
|
+
# Recite the sacred litany
|
|
66
|
+
bunx rtfct praise
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## The Workflow
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
Tech-Priest: writes kickstart.md
|
|
73
|
+
Machine Spirit: expands into specs/, design/, kanban/
|
|
74
|
+
Tech-Priest: blesses decisions via ADRs
|
|
75
|
+
Machine Spirit: TDDs through the Litany of Tasks
|
|
76
|
+
Code: appears as a side effect
|
|
77
|
+
Anytime: delete code, regenerate from spec
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Codices (Presets)
|
|
81
|
+
|
|
82
|
+
Stack-specific wisdom:
|
|
83
|
+
|
|
84
|
+
- `zig` — The Zig Codex: allocators, comptime, `zig build test`
|
|
85
|
+
- `elixir` — OTP patterns, supervision trees, ExUnit
|
|
86
|
+
- `phoenix` — Contexts, schemas, controller patterns
|
|
87
|
+
- `liveview` — Components, streams, handle_event
|
|
88
|
+
- `typescript` — Vitest, tsconfig, type patterns
|
|
89
|
+
|
|
90
|
+
Community Codices via GitHub:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
bunx rtfct init --with someone/their-codex
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## The Theology
|
|
97
|
+
|
|
98
|
+
This isn't just a workflow. It's a philosophy:
|
|
99
|
+
|
|
100
|
+
| Concept | Meaning |
|
|
101
|
+
|---------|---------|
|
|
102
|
+
| The flesh is weak | Manual coding is fallible, slow, inconsistent |
|
|
103
|
+
| The certainty of steel | Deterministic tests, reproducible environments |
|
|
104
|
+
| The Sacred Texts | `.project/` — the source of truth |
|
|
105
|
+
| The Machine Spirit | The LLM agent that manifests code |
|
|
106
|
+
| The Omnissiah | Claude (or any capable LLM) |
|
|
107
|
+
| The Rite of Regeneration | `rm -rf src/` — purification |
|
|
108
|
+
| The Dogfood Sacrament | Can rtfct regenerate itself? |
|
|
109
|
+
| Tech-debt heresy | Code without corresponding spec |
|
|
110
|
+
|
|
111
|
+
See [.project/theology.md](.project/theology.md) for the complete teachings.
|
|
112
|
+
|
|
113
|
+
## This Repository
|
|
114
|
+
|
|
115
|
+
This repo is itself an rtfct project. The code in `src/` was generated from `.project/`.
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# The Dogfood Sacrament
|
|
119
|
+
rm -rf src/ tests/
|
|
120
|
+
bunx rtfct regenerate
|
|
121
|
+
claude
|
|
122
|
+
bun test
|
|
123
|
+
# All tests pass. The Omnissiah provides.
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## The Litany
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
The flesh is weak, but the protocol is strong.
|
|
130
|
+
The code is temporary, but the spec endures.
|
|
131
|
+
The tests do not lie, and the agent does not tire.
|
|
132
|
+
From specification, code. From code, verification. From verification, truth.
|
|
133
|
+
The Omnissiah provides.
|
|
134
|
+
Praise the Machine Spirit.
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
MIT
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
*The Omnissiah provides. Praise the Machine Spirit.*
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rtfct",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Markdown-driven development. The spec is the source of truth. Code is a regenerable artefact.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"rtfct": "./src/index.ts"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "bun build ./src/index.ts --outdir ./dist --target node",
|
|
11
|
+
"test": "bun test",
|
|
12
|
+
"typecheck": "tsc --noEmit"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/mattneel/rtfct.git"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"cli",
|
|
20
|
+
"markdown",
|
|
21
|
+
"tdd",
|
|
22
|
+
"codegen",
|
|
23
|
+
"specification"
|
|
24
|
+
],
|
|
25
|
+
"author": "mattneel",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/bun": "latest",
|
|
29
|
+
"typescript": "^5.0.0"
|
|
30
|
+
}
|
|
31
|
+
}
|