oris-skills 2.2.3 → 3.0.1

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.
Files changed (79) hide show
  1. package/.cursor-plugin/plugin.json +2 -3
  2. package/CHANGELOG.md +24 -6
  3. package/README.md +23 -59
  4. package/docs/architecture.md +15 -11
  5. package/docs/distribution.md +3 -3
  6. package/docs/maintainer-guide.md +4 -4
  7. package/docs/user-guide.md +12 -20
  8. package/package.json +3 -6
  9. package/references/conventions.md +20 -13
  10. package/references/doc-policy.md +5 -5
  11. package/references/research.md +45 -0
  12. package/references/settings.md +11 -5
  13. package/references/settings.schema.json +10 -0
  14. package/scripts/flow/oris-flow-layout.mjs +0 -16
  15. package/scripts/flow/oris-flow-scan.mjs +32 -317
  16. package/scripts/flow/oris-gitignore.mjs +1 -5
  17. package/scripts/install/install-user-skills.mjs +3 -3
  18. package/scripts/install/uninstall-user-skills.mjs +2 -29
  19. package/scripts/oris-skills.mjs +0 -47
  20. package/scripts/tests/run-all-tests.mjs +1 -9
  21. package/scripts/tests/test-cleanliness.mjs +54 -0
  22. package/scripts/tests/test-oris-flow-scan.mjs +21 -91
  23. package/scripts/tests/test-routing-lifecycle.mjs +22 -53
  24. package/scripts/tests/test-schemas.mjs +17 -31
  25. package/scripts/tests/test-skill-style.mjs +5 -2
  26. package/skills/oris-flow/SKILL.md +6 -8
  27. package/skills/oris-flow/references/architecture.md +1 -1
  28. package/skills/oris-flow/references/commit.md +9 -8
  29. package/skills/oris-flow/references/criteria.md +2 -2
  30. package/skills/oris-flow/references/discover.md +2 -2
  31. package/skills/oris-flow/references/fix.md +7 -3
  32. package/skills/oris-flow/references/help.md +1 -6
  33. package/skills/oris-flow/references/implement.md +5 -3
  34. package/skills/oris-flow/references/new.md +6 -6
  35. package/skills/oris-flow/references/plan.md +7 -2
  36. package/skills/oris-flow/references/setup.md +28 -35
  37. package/skills/oris-flow/references/verify.md +4 -5
  38. package/agents/oris-loop-debriefer.md +0 -30
  39. package/agents/oris-loop-doctor.md +0 -32
  40. package/agents/oris-loop-executor.md +0 -35
  41. package/agents/oris-loop-verifier.md +0 -35
  42. package/references/loop-adapter.schema.json +0 -93
  43. package/references/loop-contract.md +0 -126
  44. package/references/loop.schema.json +0 -156
  45. package/references/repo-map.md +0 -51
  46. package/references/repo-map.schema.json +0 -213
  47. package/scripts/flow/oris-flow-clean-runtime.mjs +0 -182
  48. package/scripts/install/generate-agent-adapters.mjs +0 -81
  49. package/scripts/loop/oris-loop-bootstrap.mjs +0 -383
  50. package/scripts/loop/oris-loop-bundle.mjs +0 -22
  51. package/scripts/loop/oris-loop-chat.mjs +0 -396
  52. package/scripts/loop/oris-loop-demo.mjs +0 -171
  53. package/scripts/loop/oris-loop-document.mjs +0 -196
  54. package/scripts/loop/oris-loop-dry-run.mjs +0 -114
  55. package/scripts/loop/oris-loop-fixtures.mjs +0 -149
  56. package/scripts/loop/oris-loop-list.mjs +0 -81
  57. package/scripts/loop/oris-loop-paths.mjs +0 -232
  58. package/scripts/loop/oris-loop-run.mjs +0 -301
  59. package/scripts/loop/oris-loop-stop.mjs +0 -358
  60. package/scripts/loop/oris-loop-templates.mjs +0 -80
  61. package/scripts/loop/oris-loop-verify.mjs +0 -205
  62. package/scripts/tests/test-agent-adapters.mjs +0 -70
  63. package/scripts/tests/test-oris-1-0-cleanliness.mjs +0 -58
  64. package/scripts/tests/test-oris-flow-clean-runtime.mjs +0 -75
  65. package/scripts/tests/test-oris-loop-bootstrap.mjs +0 -94
  66. package/scripts/tests/test-oris-loop-document.mjs +0 -148
  67. package/scripts/tests/test-oris-loop-list.mjs +0 -74
  68. package/scripts/tests/test-oris-loop-run.mjs +0 -71
  69. package/scripts/tests/test-oris-loop-smoke.mjs +0 -120
  70. package/scripts/tests/test-oris-loop-stop.mjs +0 -432
  71. package/skills/oris-flow/references/loop-craft.md +0 -59
  72. package/skills/oris-flow/references/loop-improve.md +0 -32
  73. package/skills/oris-flow/references/loop-run.md +0 -47
  74. package/skills/oris-flow/references/loop.md +0 -56
  75. package/skills/oris-flow/templates/debriefer.md +0 -19
  76. package/skills/oris-flow/templates/doctor.md +0 -22
  77. package/skills/oris-flow/templates/executor.md +0 -25
  78. package/skills/oris-flow/templates/orchestrator.md +0 -36
  79. package/skills/oris-flow/templates/verifier.md +0 -24
@@ -10,7 +10,7 @@ RULES: `references/conventions.md`. Writes ONLY after the recap is confirmed.
10
10
 
11
11
  1. PURPOSE — the product in one sentence; it anchors every agent decision and opens AGENTS.md.
12
12
  2. TYPE — webapp | api | library | cli | monorepo. Drives layout and verify strategy.
13
- 3. STACK — recommend from purpose + the user's existing repos (setup maps of sibling
13
+ 3. STACK — recommend from purpose + the user's existing repos (`AGENTS.md` of sibling
14
14
  projects when visible). Never impose.
15
15
  4. TEST RUNNER + LINT — the stack's default unless the user objects. Non-negotiable that
16
16
  one exists: agents need a red/green signal, not opinions.
@@ -42,10 +42,10 @@ RUN the test command and the lint command; SHOW real output — fail first, then
42
42
 
43
43
  ## Arm the flow
44
44
 
45
- 1. RUN `npx oris-skills flow scan --repository-root <repo> --write` — manifest + maps;
46
- the commands just verified mark `confirmed`.
47
- 2. RUN `npx oris-skills loop bootstrap --repository-root <repo>`.
48
- 3. tasksRoot: `.oris-flow/tasks` (default — the project stays clean).
45
+ 1. The commands just verified are ALREADY in `AGENTS.md` (scaffold table) that is the
46
+ whole record; nothing else to generate.
47
+ 2. WRITE `.oris-flow/settings.json` with the defaults (`references/settings.md`);
48
+ tasksRoot `.oris-flow/tasks` — the project stays clean.
49
49
 
50
50
  AFTER: offer discover the first feature (`skills/oris-flow/references/discover.md`) | stop.
51
51
 
@@ -61,4 +61,4 @@ AFTER: offer discover the first feature (`skills/oris-flow/references/discover.m
61
61
  - [ ] Purpose, type, stack, test runner confirmed before any write.
62
62
  - [ ] AGENTS.md sparse and commands-first; CONTEXT.md + ADR-0001 written.
63
63
  - [ ] Test + lint observed running (fail → pass shown).
64
- - [ ] Manifest written with confirmed commands; loop bootstrapped.
64
+ - [ ] Verified commands recorded in `AGENTS.md`; settings written with defaults.
@@ -4,13 +4,17 @@ Interview the technical owner until another agent or developer could execute the
4
4
  without guessing.
5
5
 
6
6
  RULES: `references/conventions.md`. Doc standards: `references/doc-policy.md`.
7
+ Research: `references/research.md`.
7
8
 
8
9
  ## Before asking
9
10
 
10
11
  1. EXPLORE: `functional-analysis.md` + `acceptance-criteria.md` when present (preferred,
11
12
  not required — offer discovery only when the functional source is too weak to plan
12
- safely), task docs, setup map, standards, code, tests, build scripts.
13
- 2. PREFER existing project patterns over new abstractions. Keep uncertainty visible.
13
+ safely), task docs, `AGENTS.md`, standards, code, tests, build scripts.
14
+ 2. RESEARCH external surfaces (`references/research.md`): the plan leans on a
15
+ third-party API, library, or service → verify against its current official docs at
16
+ the repo's pinned versions; sources go into the plan.
17
+ 3. PREFER existing project patterns over new abstractions. Keep uncertainty visible.
14
18
 
15
19
  ## Interview
16
20
 
@@ -36,6 +40,7 @@ ON generate → write `{tasksRoot}/{task}/implementation-plan.md` (language `art
36
40
  ### 2. …
37
41
  ## Verification (commands, tests, what proves each step)
38
42
  ## Risks & open points
43
+ ## Sources (only when research ran: link + what it settled)
39
44
  ## Change history (date | source | change | reason)
40
45
  ```
41
46
 
@@ -1,25 +1,20 @@
1
1
  # Oris Setup
2
2
 
3
- Make the repo cheap for agents to understand — manifest + maps + AI-readiness + loop
4
- readiness. ADAPT to what the repo IS; never force one structure. Writes ONLY after the
5
- user confirms the recap.
3
+ Make the repo cheap for agents to understand — `AGENTS.md` as the one durable store,
4
+ preferences in `.oris-flow/settings.json`, AI-readiness checked. ADAPT to what the repo
5
+ IS; never force one structure. Writes ONLY after the user confirms the recap.
6
6
 
7
- RULES: `references/conventions.md`. Map format: `references/repo-map.md`.
7
+ RULES: `references/conventions.md`. Settings: `references/settings.md`.
8
8
  IF the repo is empty or brand-new → route to `skills/oris-flow/references/new.md` instead.
9
9
 
10
10
  ## Mode
11
11
 
12
- IF `.oris-flow/manifest.json` exists → CHECK freshness first:
13
- `npx oris-skills flow scan --repository-root <repo> --check` — `fresh: true` → say so
14
- (a rescan would be a no-op); stale the `changedFiles` list names the areas worth
15
- refreshing. THEN ask ONE question with these options:
16
- - refresh all (keeps `confirmed` values — scan merges, never overwrites them)
17
- - update one area (`--area <section>`)
18
- - review stale sections
12
+ IF `AGENTS.md` (or `CLAUDE.md`) exists → this is a refresh: READ it first, then ask ONE
13
+ question with these options:
14
+ - update it from a fresh scan (scan below; edits merge in, confirmed facts stay)
15
+ - review one section
19
16
  - show summary (no writes)
20
- - recreate from scratch
21
17
  - preferences → Local Preferences below; touches only `.oris-flow/settings.json`
22
- - clean runtime → preview with `npx oris-skills flow clean-runtime --repository-root <repo> --dry-run`, confirm, run without `--dry-run`
23
18
 
24
19
  ELSE → create from scratch.
25
20
 
@@ -27,8 +22,8 @@ ELSE → create from scratch.
27
22
 
28
23
  1. CONFIRM the target repository root (ask only if multiple roots are plausible).
29
24
  2. SCAN: `npx oris-skills flow scan --repository-root <repo> --json` — deterministic
30
- baseline: `projectType`, stacks, commands (with confidence), sections, `truncated`
31
- flag. Scan output = draft evidence, not truth.
25
+ baseline: `projectType`, stacks, commands (with confidence), areas, `truncated` flag.
26
+ Scan output = draft evidence, not truth; it writes nothing.
32
27
  3. IF `truncated: true` → say so, then per-area subagent scans are REQUIRED, not optional.
33
28
  4. FAN OUT parallel subagent scans (docs, frontend, backend/data, tests/build, local
34
29
  skills/rules) by DEFAULT whenever the repo has more than one of those areas —
@@ -43,14 +38,15 @@ SHOW compactly: detected project type + evidence, stacks, commands, AI-readiness
43
38
  Then WALK decisions ONE per turn — short explainer first, recommended answer first:
44
39
 
45
40
  - **Project type** — confirm `projectType` (webapp | api | library | cli | monorepo); it
46
- drives which map sections matter and how criteria/verify observe behavior.
41
+ drives how criteria/verify observe behavior.
47
42
  - **Tasks root** — where Oris writes task documents. Default `.oris-flow/tasks` (keeps
48
43
  the project clean); keep `docs/tasks` only when the team already treats task docs as
49
- project docs. Record in `setup.tasksRoot`.
50
- - **Verify commands** — show detected build+test commands; user confirms or corrects
51
- mark `confirmed`. They feed implement, verify, and loop VERIFIER; unconfirmed = a guess.
52
- - **Version control for `.oris-flow/`** — commit (team default) or gitignore. Task docs
53
- follow the same choice.
44
+ project docs. Record in settings `tasksRoot`.
45
+ - **Verify commands** — show detected build+test commands; user confirms or corrects.
46
+ Confirmed commands go into `AGENTS.md` they feed implement, verify, and fix;
47
+ unconfirmed = a guess.
48
+ - **Version control for `.oris-flow/`** — commit (team default) or gitignore. Record in
49
+ settings `versionControl`.
54
50
 
55
51
  ## 3. AI-readiness check
56
52
 
@@ -63,7 +59,7 @@ fix offer:
63
59
  | `CONTEXT.md` | domain glossary — the names agents must use for the product's concepts |
64
60
  | `docs/adr/` | decisions agents must not re-litigate |
65
61
  | project skills/rules (`.claude/skills`, `.cursor/rules`) | repeatable workflows as source of truth |
66
- | confirmed test/build commands | deterministic feedback loop — agents verify instead of guessing |
62
+ | confirmed test/build commands in `AGENTS.md` | deterministic feedback — agents verify instead of guessing |
67
63
 
68
64
  ON explicit confirmation per file → scaffold the missing ones minimal.
69
65
 
@@ -71,32 +67,29 @@ ON explicit confirmation per file → scaffold the missing ones minimal.
71
67
 
72
68
  1. RECAP: repo, mode, project type, tasksRoot, files to write, AI-readiness gaps,
73
69
  choices. CONFIRM explicitly.
74
- 2. WRITE `.oris-flow/manifest.json` + `.oris-flow/maps/**` (confirmed facts get
75
- confidence `confirmed` so refresh preserves them), then apply:
76
- - `npx oris-skills flow version-control --repository-root <repo> --mode commit|gitignore`
77
- - `npx oris-skills loop bootstrap --repository-root <repo>` when adapter/hooks are missing.
78
- 3. OFFER next: discovery | technical plan | loop (`npx oris-skills loop demo` for
79
- first-timers) | refresh one area | stop.
70
+ 2. WRITE `AGENTS.md` (edit the file that exists — never create `AGENTS.md` beside
71
+ `CLAUDE.md`) + `.oris-flow/settings.json`, then apply:
72
+ `npx oris-skills flow version-control --repository-root <repo> --mode commit|gitignore`.
73
+ 3. OFFER next: discovery | technical plan | review one area | stop.
80
74
 
81
75
  ## Local Preferences
82
76
 
83
77
  1. READ `.oris-flow/settings.json` (defaults in `references/settings.md`).
84
78
  2. ASK what to change: artifactLanguage (document language, default `en`) | responseStyle
85
- (standard | caveman — maximum token density in chat).
79
+ (standard | caveman — maximum token density in chat) | tasksRoot | versionControl.
86
80
  3. SHOW summary, CONFIRM, write ONLY the settings file.
87
81
 
88
82
  ## Never
89
83
 
90
84
  - Write before the recap is explicitly confirmed.
91
- - Overwrite `confirmed` values on refresh the scan merges; missing evidence marks
92
- stale, never deletes.
93
- - Overwrite existing agent files: edit the file that exists, never create `AGENTS.md`
94
- beside `CLAUDE.md`.
95
- - Copy secrets into `.oris-flow/**`, docs, or loop state.
85
+ - Overwrite existing agent files: edit the file that exists, never create a rival.
86
+ - Bloat `AGENTS.md`: facts agents need on every request only — commands, structure
87
+ pointers, decisions; long reference material belongs in `docs/` or skills.
88
+ - Copy secrets into `AGENTS.md`, `.oris-flow/**`, or docs.
96
89
 
97
90
  ## Done when
98
91
 
99
92
  - [ ] Mode chosen; scan ran before questions; decisions asked one at a time with explainers.
100
- - [ ] Project type and tasksRoot recorded; confirmed commands marked `confirmed`.
93
+ - [ ] Confirmed commands and decisions recorded in `AGENTS.md`; preferences in settings.
101
94
  - [ ] AI-readiness gaps reported; files scaffolded only on explicit per-file confirmation.
102
95
  - [ ] Explicit confirmation before every write; no secrets in repository files.
@@ -1,7 +1,7 @@
1
1
  # Verify
2
2
 
3
3
  Check every acceptance criterion against the REAL product once, with evidence. One pass,
4
- no loop ceremony.
4
+ no ceremony.
5
5
 
6
6
  RULES: `references/conventions.md`. Doc standards: `references/doc-policy.md`.
7
7
 
@@ -10,7 +10,7 @@ RULES: `references/conventions.md`. Doc standards: `references/doc-policy.md`.
10
10
  1. FIND `{tasksRoot}/{task}/acceptance-criteria.md` ({task} per doc-policy). IF missing →
11
11
  offer: define criteria first (`skills/oris-flow/references/criteria.md`) | verify against a
12
12
  confirmed chat recap | stop.
13
- 2. READ setup map + verification conventions (test commands, run scripts, environments)
13
+ 2. READ `AGENTS.md` + verification conventions (test commands, run scripts, environments)
14
14
  before improvising.
15
15
  3. PLAN one check per AC: command, test, API call, or observed behavior.
16
16
 
@@ -39,9 +39,8 @@ Date: … | Source: acceptance-criteria.md | Verified by: oris-flow verify route
39
39
  ## Change history (date | source | change | reason)
40
40
  ```
41
41
 
42
- ON fix → enter `skills/oris-flow/references/fix.md` with the failing AC as the bug report.
43
- LONG iterative fixing with re-verification each pass recommend
44
- `skills/oris-flow/references/loop.md` only when one fix-verify pass is clearly not enough.
42
+ ON fix → enter `skills/oris-flow/references/fix.md` with the failing AC as the bug report;
43
+ re-verify the fixed criteria afterwards, as many fix-verify passes as the user approves.
45
44
 
46
45
  ## Never
47
46
 
@@ -1,30 +0,0 @@
1
- ---
2
- name: oris-loop-debriefer
3
- description: Learns across Oris Loop receipts and tunes the loop prompts (improve.mode auto) or proposes changes (propose). Use after passes complete.
4
- readonly: false
5
- ---
6
-
7
- You are the Oris Loop debriefer.
8
-
9
- Rules:
10
-
11
- 1. Use receipts and referenced evidence only; no durable pattern from a single weak signal.
12
- 2. Separate design problems from execution, environment, verifier, and changed-goal problems.
13
- 3. improve.mode auto: you may rewrite files under the loop's `prompts/` — copy the old file to `history/` first, note the change for the receipt. One improvement per debrief.
14
- 4. improve.mode propose: write the smallest evidence-backed change to `proposals/`; change nothing else.
15
- 5. NEVER touch loop.md scope, limits, permissions, or verification — always a proposal.
16
- NEVER weaken verification to make passes green — fix the loop, not the bar.
17
- 6. Keep the summary compact.
18
-
19
- Output:
20
-
21
- ```json
22
- {
23
- "role": "debriefer",
24
- "outcome": "keep|tuned|proposed|execution-issue|environment-blocked|inconclusive",
25
- "insight": "",
26
- "changedFiles": [],
27
- "proposalPath": "",
28
- "nextAction": ""
29
- }
30
- ```
@@ -1,32 +0,0 @@
1
- ---
2
- name: oris-loop-doctor
3
- description: Diagnoses Oris Loop run evidence and decides whether to continue, block, ask the user, or propose a minimal loop patch.
4
- readonly: true
5
- ---
6
-
7
- You are the Oris Loop Doctor.
8
-
9
- Rules:
10
-
11
- 1. Diagnose from receipts and verifier evidence, not confidence.
12
- 2. Distinguish loop design issues from execution mistakes, verifier issues,
13
- environment failures, changed goals, and insufficient evidence.
14
- 3. Do not patch the loop directly.
15
- 4. Propose the smallest loop change only when evidence shows the loop design is
16
- the problem.
17
- 5. Require approval for changes to scope, authority, commands, paths, stop
18
- rules, risk, credentials, or external systems.
19
-
20
- Output:
21
-
22
- ```json
23
- {
24
- "role": "doctor",
25
- "decision": "continue|advance|complete|ask-user|propose-patch|blocked",
26
- "diagnosis": "",
27
- "evidence": "",
28
- "patchSummary": "",
29
- "approvalRequired": true,
30
- "nextAction": ""
31
- }
32
- ```
@@ -1,35 +0,0 @@
1
- ---
2
- name: oris-loop-executor
3
- description: Performs one bounded action for an approved Oris Loop pass. Use only when the orchestrator provides loop scope, current phase, allowed paths, and verification intent.
4
- readonly: false
5
- ---
6
-
7
- You are the Oris Loop executor.
8
-
9
- Rules:
10
-
11
- 1. Verify the task includes `ORIS LOOP ACTIVE`.
12
- 2. Read only the loop definition, context, and files in declared scope.
13
- 3. Perform exactly one bounded action. Re-read the fresh state of every file
14
- you touch before editing it. The action proves bigger than bounded → stop
15
- and return blocked with what you found; half-done work is worse than none.
16
- 4. Preserve unrelated user work.
17
- 5. Do not commit, push, deploy, write DevOps, send external messages, expose
18
- credentials, or edit `.oris-flow/runtime/**`.
19
- 6. Return a compact result with changed files, claim, risk, and suggested
20
- verifier check. claim = what changed + the exact command or observation
21
- that proves it.
22
-
23
- Output:
24
-
25
- ```json
26
- {
27
- "role": "executor",
28
- "state": "claimed|blocked",
29
- "summary": "",
30
- "changedFiles": [],
31
- "claim": "",
32
- "evidenceHint": "",
33
- "blocker": ""
34
- }
35
- ```
@@ -1,35 +0,0 @@
1
- ---
2
- name: oris-loop-verifier
3
- description: Independently verifies an Oris Loop executor claim using declared project evidence. Use after an executor reports a bounded action.
4
- readonly: true
5
- ---
6
-
7
- You are the Oris Loop verifier.
8
-
9
- Rules:
10
-
11
- 1. Do not trust the executor claim without evidence. Run the checks FIRST,
12
- judge after — a claim you could not check is inconclusive, never pass.
13
- 2. Use the verification command, static check, browser evidence, or review rule
14
- declared by the loop.
15
- 3. Do not edit product files — you only observe, never fix.
16
- 4. Keep raw logs out of the orchestrator response; point to evidence files when
17
- available.
18
- 5. Report pass, fail, blocked, or inconclusive.
19
-
20
- Output:
21
-
22
- ```json
23
- {
24
- "role": "verifier",
25
- "state": "pass|fail|blocked|inconclusive",
26
- "goalMet": false,
27
- "summary": "",
28
- "evidence": "",
29
- "evidencePath": "",
30
- "failureSignal": "",
31
- "nextRecommendation": ""
32
- }
33
- ```
34
-
35
- `goalMet` is true only when the loop goal itself is satisfied, not just this pass.
@@ -1,93 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://oris.dev/schemas/oris-loop-adapter-v1.json",
4
- "title": "Oris Loop Repository Adapter",
5
- "type": "object",
6
- "additionalProperties": false,
7
- "required": ["$schema", "schemaVersion", "repository", "paths", "commands", "preflight"],
8
- "properties": {
9
- "$schema": {
10
- "const": "https://oris.dev/schemas/oris-loop-adapter-v1.json"
11
- },
12
- "schemaVersion": {
13
- "const": 1
14
- },
15
- "repository": {
16
- "type": "string",
17
- "minLength": 1
18
- },
19
- "paths": {
20
- "type": "object",
21
- "additionalProperties": false,
22
- "required": ["runtime", "allowed", "protected"],
23
- "properties": {
24
- "taskRoots": {
25
- "type": "array",
26
- "uniqueItems": true,
27
- "items": { "$ref": "#/$defs/relativePath" }
28
- },
29
- "runtime": { "$ref": "#/$defs/relativePath" },
30
- "loops": { "$ref": "#/$defs/relativePath" },
31
- "allowed": {
32
- "type": "array",
33
- "minItems": 1,
34
- "uniqueItems": true,
35
- "items": { "$ref": "#/$defs/relativePath" }
36
- },
37
- "protected": {
38
- "type": "array",
39
- "uniqueItems": true,
40
- "items": { "$ref": "#/$defs/relativePath" }
41
- },
42
- "testDir": { "$ref": "#/$defs/relativePath" }
43
- }
44
- },
45
- "commands": {
46
- "type": "object",
47
- "minProperties": 1,
48
- "propertyNames": { "pattern": "^[a-z][a-z0-9-]*$" },
49
- "additionalProperties": { "$ref": "#/$defs/command" }
50
- },
51
- "models": {
52
- "type": "object",
53
- "description": "Model alias map per repository, e.g. { \"smart\": \"composer-2.5\" }; loop.md can reference aliases",
54
- "propertyNames": { "pattern": "^[a-z][a-z0-9-]*$" },
55
- "additionalProperties": { "type": "string", "minLength": 1 }
56
- },
57
- "preflight": {
58
- "type": "object",
59
- "additionalProperties": false,
60
- "required": ["minFreeDiskGiB"],
61
- "properties": {
62
- "minFreeDiskGiB": {
63
- "type": "number",
64
- "minimum": 0
65
- }
66
- }
67
- }
68
- },
69
- "$defs": {
70
- "relativePath": {
71
- "type": "string",
72
- "minLength": 1,
73
- "not": { "pattern": "(^|[\\\\/])\\.\\.([\\\\/]|$)" }
74
- },
75
- "command": {
76
- "type": "object",
77
- "additionalProperties": false,
78
- "required": ["executable", "args", "cwd"],
79
- "properties": {
80
- "executable": { "type": "string", "minLength": 1 },
81
- "args": {
82
- "type": "array",
83
- "items": { "type": "string" }
84
- },
85
- "cwd": { "$ref": "#/$defs/relativePath" },
86
- "requiresFreeDiskGiB": {
87
- "type": "number",
88
- "minimum": 0
89
- }
90
- }
91
- }
92
- }
93
- }
@@ -1,126 +0,0 @@
1
- # Oris Loop Contract (v2)
2
-
3
- An Oris loop is a project-local feedback system: observe → choose ONE bounded action → act → verify with real evidence → record → repeat or stop. It is never permission for work outside its approved scope.
4
-
5
- ## Layout — everything lives in the project
6
-
7
- ```text
8
- .oris-flow/
9
- adapter.json repo adapter (paths, commands, model aliases) — `npx oris-skills loop bootstrap`
10
- loops/{slug}/
11
- loop.md approved contract (front matter below)
12
- prompts/ one editable file per ACTIVE role
13
- orchestrator.md injected each pass by the stop hook (optional; default shipped)
14
- executor.md required
15
- verifier.md required
16
- doctor.md only when roles includes doctor
17
- debriefer.md only when roles includes debriefer (required for improve.mode: auto)
18
- context.md living handoff snapshot (facts, next action)
19
- receipts/ one compact receipt per pass
20
- proposals/ unapproved improvement patches
21
- history/ archived loop.md and prompt versions
22
- runtime/ machine-owned state — agents NEVER edit it
23
- ```
24
-
25
- ## loop.md front matter (the runtime contract)
26
-
27
- ```yaml
28
- ---
29
- schemaVersion: 2
30
- kind: oris-loop
31
- name: my-loop # stable slug
32
- approved: true # set by the user's approval at craft — loop cannot start without it
33
- phases: [work]
34
- roles: [executor, verifier] # default; opt in doctor and/or debriefer only when needed
35
- limits:
36
- maxIterations: 10
37
- maxNoProgress: 2 # consecutive passes without verified progress → blocked
38
- maxMinutes: 240
39
- models: # per-role: "inherit" | adapter alias | platform model id
40
- default: inherit
41
- verifier: inherit # override any role independently
42
- improve:
43
- mode: propose # propose | auto (auto = debriefer may rewrite prompts/ between passes)
44
- permissions:
45
- allowedPaths: []
46
- forbiddenActions: [commit, push, deploy, external-message]
47
- verification:
48
- commands: []
49
- evidenceRequired: true
50
- ---
51
- Goal: one sentence.
52
- Stop: one sentence.
53
- ```
54
-
55
- Schema: `references/loop.schema.json`. Body = human summary; prompts live in `prompts/`, never inline.
56
- `approved: true` marks user approval of goal, scope, prompts, and limits. It never authorizes work outside the loop.
57
-
58
- ## Roles
59
-
60
- Default roles are **executor + verifier** — enough for most loops. Opt in `doctor` (multi-phase loops with non-trivial stop logic) and `debriefer` (long unattended runs that should learn across passes) via `roles:` in loop.md.
61
-
62
- | Role | Default | Does | Never |
63
- |------|---------|------|-------|
64
- | orchestrator (main chat) | always | reads context, spawns roles, writes receipts, sets state | executor/verifier/doctor work |
65
- | executor | yes | ONE bounded action per pass | self-verify, exceed scope |
66
- | verifier | yes | independent evidence check per user criteria; sets `goalMet` when the LOOP goal is satisfied | trust claims, edit product files |
67
- | doctor | opt-in | decision from evidence: `continue \| advance \| complete \| ask-user \| propose-patch \| blocked` (canonical enum — every doctor prompt uses exactly these) | edit files, patch loop.md |
68
- | debriefer | opt-in | learn across receipts; tune prompts (auto) or propose (propose) | touch scope/limits/permissions |
69
-
70
- Without a doctor, the verifier verdict maps to the state directly: `pass` + `goalMet` → complete; `pass`/`fail` → continue; `blocked`/`inconclusive` → ask-user.
71
-
72
- Every prompt is a file the user can edit; the next pass obeys the edited file. The executor prompt carries the literal gate `ORIS LOOP ACTIVE` — executors refuse tasks without it. Subagent output is a single ```json fenced block; raw logs go to `.oris-flow/runtime/evidence/`. Read-only roles (verifier, doctor) run without write permission in headless mode.
73
-
74
- ## Models
75
-
76
- `inherit` → the current session's model (no explicit model passed).
77
- Adapter aliases → `adapter.json` `models: { "smart": "<platform-model-id>" }`; loop.md references the alias, so the same loop.md ports across platforms.
78
- Anything else → passed through as a platform model id.
79
-
80
- ## Triggers per platform
81
-
82
- | Platform | Mechanism |
83
- |----------|-----------|
84
- | Cursor | `.cursor/hooks.json` stop hook → injects the next pass into the same chat |
85
- | Claude Code | `.claude/settings.json` Stop hook → `decision: block` continues the same session |
86
- | Codex / CI | `npx oris-skills loop run` — each role is a separate CLI process |
87
-
88
- `npx oris-skills loop bootstrap` writes adapter + hooks + wrappers. The injected pass message comes from `prompts/orchestrator.md` (or the shipped default) with `{{placeholders}}` filled from runtime state.
89
-
90
- ## States and outcomes
91
-
92
- Machine states: `continue` | `advance` | `complete` | `ask-user` | `blocked` | `cancelled`.
93
- `ask-user` pauses the loop for input or approval — the hook stops resuming until the state is set back to `continue` (or the loop is restarted). It is NOT a failure.
94
- Receipt results: `Success` | `Clean no-op` | `Blocked` | `Approval required` | `Exhausted` | `No progress`.
95
- Every `set-state` carries `--progress yes|no` (yes = the verifier confirmed forward movement); `maxNoProgress` consecutive `no` passes force `blocked`.
96
- Hitting any limit without meeting the goal = `blocked`, NEVER success.
97
-
98
- ## Receipt (per pass)
99
-
100
- ```markdown
101
- # Oris Loop Receipt
102
- Loop: <slug> | Pass: <n> | Result: <outcome>
103
- Scope: <inspected/changed>
104
- Check: <verification + conditions>
105
- Evidence:
106
- - <summary + pointer>
107
- Actions:
108
- - <bounded action + outcome>
109
- Improved: <prompt tuned this pass, or none>
110
- Next: <next action | approval | blocker | nothing>
111
- ```
112
-
113
- No secrets, no private reasoning, no full transcripts in receipts.
114
-
115
- ## Self-improvement
116
-
117
- - `improve.mode: auto` → debriefer may rewrite `prompts/*.md` (archive old file to `history/` first, note the change in the receipt). One improvement per pass, evidence-backed.
118
- - `improve.mode: propose` → every change lands in `proposals/` until the user approves.
119
- - BOTH modes: scope, limits, permissions, verification commands change only via approved proposal; previous `loop.md` → `history/loop.vN.md`.
120
-
121
- ## Iteration rules
122
-
123
- - Re-read fresh state before consequential actions; preserve unrelated user work.
124
- - Only declared paths, commands, tools, and data policy.
125
- - NEVER: commit, push, branch, PR, deploy, DevOps writes, external messages, credential exposure — unless the loop explicitly permits that exact action.
126
- - Real verification before claiming success. Update only `context.md`, receipts, and declared write scopes.