peer-ai-workflow 1.0.0-next.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 +129 -0
- package/dist/config.d.ts +750 -0
- package/dist/config.js +392 -0
- package/dist/ids.d.ts +67 -0
- package/dist/ids.js +199 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +51 -0
- package/dist/report.d.ts +108 -0
- package/dist/report.js +169 -0
- package/dist/state.d.ts +261 -0
- package/dist/state.js +132 -0
- package/package.json +40 -0
- package/schemas/config-layer.schema.json +997 -0
- package/schemas/config.schema.json +1002 -0
- package/schemas/map.schema.json +102 -0
- package/schemas/review-report.schema.json +312 -0
- package/schemas/work-item.schema.json +415 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Qudus Lawal
|
|
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,129 @@
|
|
|
1
|
+
# peer-ai-workflow
|
|
2
|
+
|
|
3
|
+
The vocabulary Peer AI is built on, and the schemas for the files a project keeps: `peer-ai.config.json` for its settings and customisations, and `.peer-ai/` for its state.
|
|
4
|
+
|
|
5
|
+
> Private for now. It is published with Peer AI's first release.
|
|
6
|
+
|
|
7
|
+
## What's here
|
|
8
|
+
|
|
9
|
+
| Path | Holds |
|
|
10
|
+
|------|-------|
|
|
11
|
+
| `src/ids.ts` | The fixed lists: 14 activities, 29 skills, supported tools, and the items on the project map |
|
|
12
|
+
| `src/config.ts` | The schema for `peer-ai.config.json` and for shared base configs, plus `mergeConfigs` and `resolveConfig` |
|
|
13
|
+
| `src/state.ts` | The schemas for `.peer-ai/map.json` and `.peer-ai/work/<id>.json` |
|
|
14
|
+
| `src/report.ts` | The schema for review reports, the four severity levels, and `deriveResult`, which works out a review's result from its report |
|
|
15
|
+
| `src/index.ts` | `validateConfig`, `validateConfigLayer`, `validateMap`, `validateWorkItem` and `validateReport`, which return every problem with its location |
|
|
16
|
+
| `schemas/` | The same schemas as JSON Schema, generated, for editors and non-TypeScript tools |
|
|
17
|
+
| `examples/` | Fictional projects, one per shape (see below) |
|
|
18
|
+
|
|
19
|
+
## `peer-ai.config.json`
|
|
20
|
+
|
|
21
|
+
One file replaces everything a project used to get by editing or patching the playbook's own files. Point `$schema` at `schemas/config.schema.json` and an editor will autocomplete every key and flag mistakes as you type.
|
|
22
|
+
|
|
23
|
+
Only `version`, `project.name` and `tracks` are required. This is a complete config:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"version": 1,
|
|
28
|
+
"project": { "name": "Weekend Planner", "stage": "prototype" },
|
|
29
|
+
"tracks": [{ "id": "app", "kind": "web", "status": "active" }]
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
| Key | What it sets |
|
|
34
|
+
|-----|--------------|
|
|
35
|
+
| `extends` | A shared base config to inherit, such as a studio's defaults. The project's values win; objects merge key by key and lists are replaced. |
|
|
36
|
+
| `project` | Name; stage (`prototype`, `mvp`, `production`), which sets how strict the gates are; origin (`new` or `existing`); team (`solo` or `team`) |
|
|
37
|
+
| `project.traits` | What the product is or does that switches on extra rules: `money`, `safety-critical`, `several-audiences`, `offline`, `real-time`, `uploads`, `ai-features`. `peer-ai assess` suggests the ones it finds evidence for. |
|
|
38
|
+
| `tools` | Which AI tools to render instructions for |
|
|
39
|
+
| `skills` | `commit`: whether to commit the skills `peer-ai render` writes, for AI tools that can't run a setup step first. By default they're left out of git, and each tool's setup step writes them. |
|
|
40
|
+
| `design` | Whether designs exist, are still to be produced, or there are none; where they live; whether they are authoritative |
|
|
41
|
+
| `tracks` | Each part of the system. See below. |
|
|
42
|
+
| `apis` | Each interface between parts, or to a third-party service: its kind, which track provides it, and where its contract comes from |
|
|
43
|
+
| `environments` | Such as staging and production |
|
|
44
|
+
| `repo`, `tracker`, `commands` | Git host, remote, branch naming, commit style, merge policy; the issue tracker; the verify command |
|
|
45
|
+
| `delivery` | Whether CI already exists. If it does, Peer AI extends it and never adds a second pipeline. |
|
|
46
|
+
| `standards` | Core principles on or off, stack profiles, the project's own standards documents, and which side wins a conflict |
|
|
47
|
+
| `standards.overrides` | A stack profile rule's default changed for this project, such as a larger size limit, with the reason |
|
|
48
|
+
| `standards.exceptions` | Rules the project sets aside, each with a reason, who decided, and an optional end date. `peer-ai doctor` lists them all, and warns when one has ended. |
|
|
49
|
+
| `compliance` | Where the product operates, its industries, and the rule packs that apply |
|
|
50
|
+
| `rules` | Project rules every activity respects, wherever they are written |
|
|
51
|
+
| `models` | `none`, `tiers`, or `pinned` with the project's own model names. Model names live only here, never in Peer AI itself. |
|
|
52
|
+
| `gates` | The finding severity that blocks a merge |
|
|
53
|
+
| `capabilities` | Per skill: add-ons from other tools that feed it (`plugin:skill` or `/command`), extra checklists, notes |
|
|
54
|
+
| `activities` | Per activity: files to read first, and project-specific instructions |
|
|
55
|
+
| `docs` | Where docs live, whether to keep their structure, and where out-of-scope ideas go |
|
|
56
|
+
|
|
57
|
+
Every object is strict. A misspelt key, activity or skill is an error, never a setting that silently does nothing. References are checked too: a track can only consume an API that exists, use a track that exists, and deploy to an environment that exists.
|
|
58
|
+
|
|
59
|
+
### Tracks and APIs: any architecture
|
|
60
|
+
|
|
61
|
+
A track is one part of the system: a web app, a mobile app, a service, a shared library, infrastructure. Each has a kind, a stack, an optional `architecture` label (such as `layered`, `modular-monolith`, `microservice`, `feature-first` or `mvvm`), the platforms it ships to (`targets`), where it deploys, and a status:
|
|
62
|
+
|
|
63
|
+
| Status | Meaning |
|
|
64
|
+
|--------|---------|
|
|
65
|
+
| `active` | Being built or changed |
|
|
66
|
+
| `dormant` | Not started; its activities do not run |
|
|
67
|
+
| `frozen` | Exists and is documented, not redesigned |
|
|
68
|
+
| `retiring` | Being replaced by the tracks in `replacedBy`; its behaviour is the reference until then |
|
|
69
|
+
| `external` | Lives in another repository (`repo`); read here, never changed |
|
|
70
|
+
|
|
71
|
+
APIs connect tracks. Each has a kind (`http`, `graphql`, `rpc`, `websocket`, `events`, `in-process`, `package`, `cli`), the track that provides it (omitted for a third-party service), and a contract source (`openapi`, `asyncapi`, `graphql-schema`, `protobuf`, `types`, `docs` or `handwritten`). Tracks list the APIs they `consume` and the tracks whose code they `use`.
|
|
72
|
+
|
|
73
|
+
The examples show one project per shape:
|
|
74
|
+
|
|
75
|
+
| Example | Shape |
|
|
76
|
+
|---------|-------|
|
|
77
|
+
| `informal-prototype` | A solo prototype: three lines of settings |
|
|
78
|
+
| `web-app-with-api` | A web app and its API in one repository |
|
|
79
|
+
| `local-first-app` | No server; the boundary is an in-process interface to a shared core library |
|
|
80
|
+
| `existing-mobile-app` | A mobile rebuild on a frozen backend, replacing a retiring app |
|
|
81
|
+
| `multi-app-mobile` | Two mobile apps on different stacks, sharing a library, on one backend, with halal and allergen rule packs |
|
|
82
|
+
| `frontend-only` | A web portal whose backend lives in another repository, plus a hosted sign-in service |
|
|
83
|
+
| `microservices` | Several services with their own APIs and events, replacing a monolith |
|
|
84
|
+
| `studio/` | A shared base config, and a project that inherits it |
|
|
85
|
+
|
|
86
|
+
### Compliance and rule packs
|
|
87
|
+
|
|
88
|
+
`compliance` says where the product operates (`jurisdictions`: ISO 3166 codes such as `NG` or `US-CA`, or zone ids such as `eu` or `difc`), what it does (`industries`), and which rule packs apply (`packs`). A rule pack is any outside rulebook the software must follow: a law such as the NDPA, an industry standard such as PCI DSS, a religious or cultural standard such as halal, labelling rules such as allergens, or a platform policy such as the App Store's. The packs themselves aren't built yet.
|
|
89
|
+
|
|
90
|
+
## Project state
|
|
91
|
+
|
|
92
|
+
State is split across files so that parallel sessions never edit the same one:
|
|
93
|
+
|
|
94
|
+
- **`.peer-ai/map.json`** records what `peer-ai assess` found: each item on the map as present, partial, missing or not applicable, with the evidence behind it. An item found by reading the code rather than a document is marked `inferred` until someone confirms it.
|
|
95
|
+
- **`.peer-ai/work/<id>.json`** holds one file per work item: its kind, stage, the activities it has called, where work stopped, its last verify and reviews, and a one-line `next`. It can also carry its plan (RFC 0005): a `goal`, `acceptance` criteria, the `sources` it implements, and the items it `dependsOn`, which must ship before it can.
|
|
96
|
+
|
|
97
|
+
- **`.peer-ai/reports/<work item>/<skill>-<time>.json`** holds a review's report: what it looked at, what it read first, every rule it checked and how each went, and every problem it found, with file, line and evidence. See [RFC 0002](https://github.com/AbuMahir980/peer-ai/blob/main/rfcs/0002-review-reports-and-evals.md).
|
|
98
|
+
|
|
99
|
+
A session finds its work item from the git branch it is on, so there is no shared "current phase" for two sessions to fight over. `next` is capped at 200 characters: the fuller story lives in the item's goal, acceptance criteria and sources, and in its review reports.
|
|
100
|
+
|
|
101
|
+
## Changing the schemas
|
|
102
|
+
|
|
103
|
+
The Zod definitions in `src/` are the source. After changing one, regenerate the JSON Schema files:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
pnpm --filter peer-ai-workflow generate
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
A test fails if the committed files fall behind. Changing either schema needs an RFC; see [rfcs/README.md](https://github.com/AbuMahir980/peer-ai/blob/main/rfcs/README.md).
|
|
110
|
+
|
|
111
|
+
## Review reports
|
|
112
|
+
|
|
113
|
+
A review's result is worked out from its report, not taken on the agent's word. `deriveResult` decides it:
|
|
114
|
+
|
|
115
|
+
1. **fail** when an open problem is at or above the project's blocking level, `gates.blockOn` (critical unless the project sets it lower)
|
|
116
|
+
2. **incomplete** when a rule wasn't checked
|
|
117
|
+
3. **pass** otherwise
|
|
118
|
+
|
|
119
|
+
Fixed problems, and risks a person has accepted with a reason, never block.
|
|
120
|
+
|
|
121
|
+
A report can't stay silent about a rule: a pass must say what was checked, a fail must name the problem it found, and "doesn't apply" or "not checked" must give a reason. Every problem must belong to a failed check on the same rule.
|
|
122
|
+
|
|
123
|
+
| Level | Means |
|
|
124
|
+
|-------|-------|
|
|
125
|
+
| critical | It causes harm now: a security hole, data lost or exposed, a law broken, or the service going down |
|
|
126
|
+
| high | It is likely to hurt users or the business soon |
|
|
127
|
+
| medium | A real problem with limited reach |
|
|
128
|
+
| low | It makes the code harder to change safely |
|
|
129
|
+
|