@richjava/req0 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/LICENSE +21 -0
- package/README.md +117 -0
- package/cockpit/android-chrome-192x192.png +0 -0
- package/cockpit/android-chrome-512x512.png +0 -0
- package/cockpit/app.js +1710 -0
- package/cockpit/apple-touch-icon.png +0 -0
- package/cockpit/favicon-16x16.png +0 -0
- package/cockpit/favicon-32x32.png +0 -0
- package/cockpit/favicon.ico +0 -0
- package/cockpit/index.html +180 -0
- package/cockpit/markdown-editor.js +93 -0
- package/cockpit/req0-logo-horiz.png +0 -0
- package/cockpit/req0-logo-stacked.png +0 -0
- package/cockpit/site.webmanifest +19 -0
- package/cockpit/styles.css +1710 -0
- package/cockpit/tokens.css +118 -0
- package/dist/adapter.d.ts +5 -0
- package/dist/adapter.js +16 -0
- package/dist/browser.d.ts +33 -0
- package/dist/browser.js +524 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +265 -0
- package/dist/compile.d.ts +5 -0
- package/dist/compile.js +456 -0
- package/dist/diff.d.ts +15 -0
- package/dist/diff.js +114 -0
- package/dist/fix-from-proof.d.ts +13 -0
- package/dist/fix-from-proof.js +61 -0
- package/dist/gates.d.ts +7 -0
- package/dist/gates.js +7 -0
- package/dist/implement-brief.d.ts +9 -0
- package/dist/implement-brief.js +142 -0
- package/dist/implement.d.ts +70 -0
- package/dist/implement.js +615 -0
- package/dist/improve-log.d.ts +11 -0
- package/dist/improve-log.js +38 -0
- package/dist/improve-review.d.ts +45 -0
- package/dist/improve-review.js +182 -0
- package/dist/improve.d.ts +16 -0
- package/dist/improve.js +127 -0
- package/dist/jev-pack.d.ts +2 -0
- package/dist/jev-pack.js +114 -0
- package/dist/jev.d.ts +23 -0
- package/dist/jev.js +142 -0
- package/dist/pack.d.ts +101 -0
- package/dist/pack.js +609 -0
- package/dist/personas.d.ts +13 -0
- package/dist/personas.js +88 -0
- package/dist/proof-report.d.ts +8 -0
- package/dist/proof-report.js +82 -0
- package/dist/proof.d.ts +45 -0
- package/dist/proof.js +394 -0
- package/dist/qa-plan.d.ts +6 -0
- package/dist/qa-plan.js +58 -0
- package/dist/ready.d.ts +29 -0
- package/dist/ready.js +317 -0
- package/dist/runtime.d.ts +25 -0
- package/dist/runtime.js +125 -0
- package/dist/server.d.ts +15 -0
- package/dist/server.js +588 -0
- package/dist/stack.d.ts +35 -0
- package/dist/stack.js +220 -0
- package/dist/stages.d.ts +15 -0
- package/dist/stages.js +345 -0
- package/dist/template.d.ts +5 -0
- package/dist/template.js +55 -0
- package/dist/types.d.ts +282 -0
- package/dist/types.js +12 -0
- package/docs/requirement-template.md +341 -0
- package/package.json +81 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Richard Lovell
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="docs/brand/req0-logo-horiz.png" alt="Req0" width="100%" />
|
|
4
|
+
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
# Req0
|
|
8
|
+
|
|
9
|
+
Req0 is a **requirement operating system** for a product git repo. You write a structured requirement pack. The same pack drives definition, implementation, and proof — not a parallel ticket or test script.
|
|
10
|
+
|
|
11
|
+
A local **cockpit** shows health and the next action. A deterministic compiler checks the grammar. **Jev** (TypeSafe System One) judges whether the spec is ready to implement. Coding agents (Cursor or Copilot) implement; the browser proves the app.
|
|
12
|
+
|
|
13
|
+
Req0 is a CLI plus a thin HTML cockpit. It is not a hosted SaaS.
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
Node.js **22.15** or newer.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g @richjava/req0
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Or run without a global install:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx @richjava/req0 start
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
You can open the cockpit and compile a spec with that alone. **Judgment, Implement, and Prove need Jev:** set `TYPESAFE_API_KEY` in the product repo’s `.env` (TypeSafe System One). Without the key, Check fails closed and Ready stays Not yet.
|
|
30
|
+
|
|
31
|
+
## Quick start
|
|
32
|
+
|
|
33
|
+
From the **product** repo (the app you are specifying), not from inside this package:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cd /path/to/your-product
|
|
37
|
+
req0 start
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The cockpit opens at `http://127.0.0.1:4370` (or the next free port). From the requirement list, create a pack with a kebab-case id such as `001`. That writes `docs/requirements/<id>/` using the starter template.
|
|
41
|
+
|
|
42
|
+
Edit `requirement.md` on **Define**. Save compiles. Spec Valid means the [grammar](https://github.com/richjava/req0/blob/main/docs/grammar.md) parsed — it does not mean the spec is ready to implement.
|
|
43
|
+
|
|
44
|
+
## Commands
|
|
45
|
+
|
|
46
|
+
| Command | What it does |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `req0 start` | Local cockpit |
|
|
49
|
+
| `req0 create <id>` | Create a pack folder (kebab-case) |
|
|
50
|
+
| `req0 compile` | Compile the pack; exit 2 on grammar errors |
|
|
51
|
+
| `req0 check` | Ask Jev to judge the spec. Needs `TYPESAFE_API_KEY`. Exit 3 if the key is missing; exit 2 if Ready is blocked |
|
|
52
|
+
| `req0 implement` | Launch the recorded coding agent after Ready. `--adapter=cursor\|copilot\|manual`. `--stack=nextjs-default\|amplify-gen2` on an empty repo |
|
|
53
|
+
| `req0 prove` | Run compiled browser QA after Ready (and Build, unless Implement is off) |
|
|
54
|
+
|
|
55
|
+
`req0 compile`, `check`, `implement`, and `prove` resolve a pack from the current directory (a pack folder, or the only pack under `docs/requirements/`). The cockpit does not auto-open a pack from the product root — you pick one from the list.
|
|
56
|
+
|
|
57
|
+
## Setup
|
|
58
|
+
|
|
59
|
+
### In the product repo
|
|
60
|
+
|
|
61
|
+
Packs live at `docs/requirements/<kebab-id>/`:
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
docs/requirements/invoice-approval/
|
|
65
|
+
requirement.md
|
|
66
|
+
fixtures/personas.yaml # test users, never production credentials
|
|
67
|
+
fixtures/runtime.yaml # app URL and login selectors for Prove
|
|
68
|
+
derived/ # generated; do not hand-edit
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
First run in an empty product repo asks how code should be written (**I’ll write the code**, **Cursor**, or **Copilot**) and, if an agent will implement, which stack. That writes `req0.json`. Set `"implement": false` when Req0 should not own Implement.
|
|
72
|
+
|
|
73
|
+
Copy names-only env vars into `.env` as needed. Do not put secrets in `.env.example`.
|
|
74
|
+
|
|
75
|
+
| Variable | Used for |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| `TYPESAFE_API_KEY` | Judgment **Check** (Jev / TypeSafe System One) |
|
|
78
|
+
| `AWS_REGION` / `AWS_PROFILE` | Amplify Gen 2 implement only. `ampx` does not read `.env` — export the vars or run `npx ampx configure profile` |
|
|
79
|
+
|
|
80
|
+
### Prove
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npx playwright install chromium
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
`fixtures/runtime.yaml` must parse (`baseUrl`, login selectors). Personas supply test emails and passwords.
|
|
87
|
+
|
|
88
|
+
### Implement
|
|
89
|
+
|
|
90
|
+
Install the agent CLI you recorded: [Cursor](https://cursor.com) agent, or GitHub Copilot CLI. `--adapter=manual` skips launch.
|
|
91
|
+
|
|
92
|
+
## Grammar (short)
|
|
93
|
+
|
|
94
|
+
`requirement.md` needs one `#` title and these `##` sections: **Business Rules**, **Use Cases**, **Roles & Permissions**. Rules use `Id: BR-001` with Statement and Observable. Use cases use `Id: UC-001` with Actor, numbered Steps, and Outcome. The roles table cells are only `allow` or `deny`. Full rules: [docs/grammar.md](https://github.com/richjava/req0/blob/main/docs/grammar.md).
|
|
95
|
+
|
|
96
|
+
## Docs
|
|
97
|
+
|
|
98
|
+
- [What Req0 is](https://github.com/richjava/req0/blob/main/docs/product.md)
|
|
99
|
+
- [Cockpit](https://github.com/richjava/req0/blob/main/docs/cockpit.md)
|
|
100
|
+
- [Architecture and CLI](https://github.com/richjava/req0/blob/main/docs/architecture.md)
|
|
101
|
+
- [Glossary](https://github.com/richjava/req0/blob/main/docs/glossary.md)
|
|
102
|
+
|
|
103
|
+
## This git repository
|
|
104
|
+
|
|
105
|
+
Clone if you are changing Req0 itself:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
git clone https://github.com/richjava/req0.git
|
|
109
|
+
cd req0
|
|
110
|
+
npm install
|
|
111
|
+
npm test
|
|
112
|
+
npm start
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
`npm start` is `req0 start` via `tsx`. `npm run build` compiles the CLI to `dist/` (what npm publishes).
|
|
116
|
+
|
|
117
|
+
This repo also contains a sample Invoice Desk app (Amplify Gen 2 + Next.js) and the golden `invoice-approval` pack. That app is **not** part of the published npm package. To run it from a clone: copy `.env.example` to `.env`, then `npm run sandbox`, `npm run db:seed`, and `npm run dev`. Personas: `docs/requirements/invoice-approval/fixtures/personas.yaml`.
|
|
Binary file
|
|
Binary file
|