@try-works/dsh-recursive-mode 0.1.2 → 0.1.4

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 (123) hide show
  1. package/cordis.patch.yml +15 -10
  2. package/lib/bootstrap.d.ts +9 -2
  3. package/lib/client/apply-guard.d.ts +14 -0
  4. package/lib/client/board.d.ts +5 -4
  5. package/lib/client/contract.d.ts +57 -24
  6. package/lib/client/host-api.d.ts +26 -0
  7. package/lib/client/index.d.ts +16 -9
  8. package/lib/client/inspector.d.ts +3 -3
  9. package/lib/client/slots.d.ts +4 -6
  10. package/lib/client/strip.d.ts +4 -3
  11. package/lib/client/use-live.d.ts +9 -0
  12. package/lib/client.js +252 -174
  13. package/lib/index.d.ts +11 -11
  14. package/lib/index.js +972 -4504
  15. package/lib/init-templates.d.ts +41 -0
  16. package/lib/live-route.d.ts +69 -0
  17. package/lib/phase-rules.d.ts +34 -0
  18. package/lib/runtime.d.ts +24 -17
  19. package/lib/snapshot.d.ts +11 -0
  20. package/package.json +4 -3
  21. package/preset/recursive/agent.cordis.yml +7 -4
  22. package/preset/recursive/preset.yml +1 -1
  23. package/references/agents-block.md +95 -0
  24. package/references/artifact-template.md +2574 -0
  25. package/references/bodies/claude.md +7 -0
  26. package/references/bodies/codex-agents.md +95 -0
  27. package/references/bodies/copilot.md +7 -0
  28. package/references/bodies/cursorrules.md +7 -0
  29. package/references/bodies/decisions.md +5 -0
  30. package/references/bodies/delegated-verification.md +49 -0
  31. package/references/bodies/memory-router.md +45 -0
  32. package/references/bodies/phase8-skill-memory.md +48 -0
  33. package/references/bodies/plans-bridge.md +43 -0
  34. package/references/bodies/recursive-agents-router.md +64 -0
  35. package/references/bodies/skill-discovery.md +51 -0
  36. package/references/bodies/skill-memory-router.md +42 -0
  37. package/references/bodies/state.md +5 -0
  38. package/references/bootstrap/RECURSIVE.md +2362 -0
  39. package/references/scripts/__pycache__/recursive_phase_rules.cpython-314.pyc +0 -0
  40. package/references/scripts/lint-recursive-run.ps1 +25 -0
  41. package/references/scripts/lint-recursive-run.py +2870 -0
  42. package/references/scripts/recursive-closeout.ps1 +38 -0
  43. package/references/scripts/recursive-closeout.py +541 -0
  44. package/references/scripts/recursive-init.ps1 +515 -0
  45. package/references/scripts/recursive-init.py +356 -0
  46. package/references/scripts/recursive-lock.ps1 +26 -0
  47. package/references/scripts/recursive-lock.py +302 -0
  48. package/references/scripts/recursive-review-bundle.ps1 +58 -0
  49. package/references/scripts/recursive-review-bundle.py +503 -0
  50. package/references/scripts/recursive-router-cli-configure.ps1 +2 -0
  51. package/references/scripts/recursive-router-cli-configure.py +9 -0
  52. package/references/scripts/recursive-router-cli-init.ps1 +2 -0
  53. package/references/scripts/recursive-router-cli-init.py +9 -0
  54. package/references/scripts/recursive-router-cli-invoke.ps1 +2 -0
  55. package/references/scripts/recursive-router-cli-invoke.py +9 -0
  56. package/references/scripts/recursive-router-cli-probe.ps1 +2 -0
  57. package/references/scripts/recursive-router-cli-probe.py +9 -0
  58. package/references/scripts/recursive-router-cli-resolve.ps1 +2 -0
  59. package/references/scripts/recursive-router-cli-resolve.py +9 -0
  60. package/references/scripts/recursive-router-cli-validate.ps1 +2 -0
  61. package/references/scripts/recursive-router-cli-validate.py +9 -0
  62. package/references/scripts/recursive-router-configure.ps1 +27 -0
  63. package/references/scripts/recursive-router-configure.py +74 -0
  64. package/references/scripts/recursive-router-init.ps1 +17 -0
  65. package/references/scripts/recursive-router-init.py +29 -0
  66. package/references/scripts/recursive-router-invoke.ps1 +47 -0
  67. package/references/scripts/recursive-router-invoke.py +103 -0
  68. package/references/scripts/recursive-router-probe.ps1 +25 -0
  69. package/references/scripts/recursive-router-probe.py +44 -0
  70. package/references/scripts/recursive-router-resolve.ps1 +26 -0
  71. package/references/scripts/recursive-router-resolve.py +46 -0
  72. package/references/scripts/recursive-router-validate.ps1 +17 -0
  73. package/references/scripts/recursive-router-validate.py +27 -0
  74. package/references/scripts/recursive-status.ps1 +23 -0
  75. package/references/scripts/recursive-status.py +2124 -0
  76. package/references/scripts/recursive-subagent-action.ps1 +98 -0
  77. package/references/scripts/recursive-subagent-action.py +197 -0
  78. package/references/scripts/recursive-training-extract.ps1 +23 -0
  79. package/references/scripts/recursive-training-extract.py +99 -0
  80. package/references/scripts/recursive-training-grpo.ps1 +52 -0
  81. package/references/scripts/recursive-training-grpo.py +1341 -0
  82. package/references/scripts/recursive-training-loader.ps1 +78 -0
  83. package/references/scripts/recursive-training-loader.py +558 -0
  84. package/references/scripts/recursive-training-mcp.ps1 +29 -0
  85. package/references/scripts/recursive-training-mcp.py +261 -0
  86. package/references/scripts/recursive-training-phase8-trigger.ps1 +55 -0
  87. package/references/scripts/recursive-training-phase8-trigger.py +137 -0
  88. package/references/scripts/recursive-training-sync.ps1 +29 -0
  89. package/references/scripts/recursive-training-sync.py +183 -0
  90. package/references/scripts/recursive_phase_rules.py +367 -0
  91. package/references/scripts/recursive_router_cli_lib.py +2 -0
  92. package/references/scripts/recursive_router_lib.py +2282 -0
  93. package/references/scripts/verify-locks.ps1 +25 -0
  94. package/references/scripts/verify-locks.py +353 -0
  95. package/scripts/__pycache__/lint-recursive-run.cpython-314.pyc +0 -0
  96. package/scripts/__pycache__/recursive_phase_rules.cpython-314.pyc +0 -0
  97. package/scripts/install-preset.cmd +7 -0
  98. package/scripts/install-preset.js +101 -0
  99. package/scripts/lint-recursive-run.py +7 -5
  100. package/scripts/test-recursive-mode-smoke.ts +29 -28
  101. package/src/bootstrap.ts +253 -39
  102. package/src/client/apply-guard.ts +23 -0
  103. package/src/client/board.tsx +0 -0
  104. package/src/client/contract.ts +72 -24
  105. package/src/client/host-api.ts +90 -0
  106. package/src/client/index.ts +22 -11
  107. package/src/client/inspector.tsx +7 -9
  108. package/src/client/slots.ts +70 -26
  109. package/src/client/strip.tsx +9 -9
  110. package/src/client/use-live.ts +52 -0
  111. package/src/index.ts +89 -146
  112. package/src/init-templates.ts +276 -0
  113. package/src/live-route.ts +163 -0
  114. package/src/phase-rules.ts +262 -0
  115. package/src/policy.ts +28 -4
  116. package/src/runtime.ts +129 -77
  117. package/src/snapshot.ts +104 -0
  118. package/lib/client/node.d.ts +0 -71
  119. package/lib/events.d.ts +0 -173
  120. package/lib/projection.d.ts +0 -29
  121. package/src/client/node.ts +0 -156
  122. package/src/events.ts +0 -173
  123. package/src/projection.ts +0 -237
@@ -0,0 +1,7 @@
1
+ ## recursive-mode memory pointers
2
+
3
+ - Canonical repository memory lives under `/.recursive/memory/`.
4
+ - Read `/.recursive/memory/MEMORY.md` before loading any other memory docs.
5
+ - Load only the memory docs relevant to the current task.
6
+ - When repository experiential memory may help, run `python .recursive/scripts/recursive-training-loader.py --repo-root . --query "<task>" --files "<path1,path2>"`.
7
+ - Treat this file as a pointer only; the canonical memory store remains `/.recursive/memory/`.
@@ -0,0 +1,95 @@
1
+ ## recursive-mode bridge
2
+
3
+ This repository uses `recursive-mode`.
4
+
5
+ The single canonical workflow spec lives in `/.recursive/RECURSIVE.md`.
6
+ Read that file before starting or resuming any recursive-mode work.
7
+
8
+ For Codex, the primary AGENTS bridge target is `/.codex/AGENTS.md`.
9
+ If the repo also carries other `AGENTS.md` files, they may mirror this same bridge block.
10
+
11
+ Bridge guidance only:
12
+
13
+ - Treat this file as a harness adapter, not as a second workflow spec.
14
+ - If this file conflicts with `/.recursive/RECURSIVE.md`, follow `/.recursive/RECURSIVE.md`.
15
+ - Control-plane docs live under `/.recursive/`.
16
+ - Runs live under `/.recursive/run/<run-id>/`.
17
+ - Durable memory lives under `/.recursive/memory/`.
18
+ - If recursive-mode is invoked in a repo that does not yet contain the `/.recursive/` scaffold, bootstrap it automatically with the supported install script before continuing. Do not require the user to run a separate manual bootstrap step unless no supported runtime is available.
19
+
20
+ How users can invoke the skill:
21
+
22
+ - Treat short prompts such as `Implement the run`, `Implement run 75`, `Implement the plan`, `Create a new run based on the plan`, and `Start a recursive run` as valid recursive-mode entry commands.
23
+ - If a run id is given, use that run.
24
+ - If no run id is given and exactly one active/incomplete run exists, resume that run.
25
+ - If the user asks to implement/start based on a plan, create a new run only when a unique source plan or requirements artifact can be identified from repo docs or immediate task context.
26
+ - If the command is ambiguous, ask for the run id or the repo path of the source plan/requirements artifact.
27
+ - Prompts are still commands, not specifications: read the repo docs that define the run before proceeding.
28
+
29
+ Required recursive-mode audit behavior:
30
+
31
+ - Audited phases must follow `draft -> audit -> repair -> re-audit -> pass -> lock`.
32
+ - When subagents are unavailable, perform the same audit as `self-audit`; do not weaken or skip it.
33
+ - Delegate audits only when you can provide the full context bundle:
34
+ - phase name and artifact path
35
+ - upstream artifact paths reread for the audit
36
+ - diff basis from `00-worktree.md`
37
+ - changed file list and targeted code references
38
+ - phase-specific audit questions/checklist
39
+ - If the context bundle is incomplete, do not delegate; perform the audit yourself and record `Audit Execution Mode: self-audit`.
40
+ - If subagents are available and the context bundle is complete, delegated audit/review is the default path.
41
+ - If subagents are available but the controller still chooses `self-audit`, record a concrete `Delegation Override Reason`.
42
+ - Do not set `Coverage: PASS` or `Approval: PASS` for an audited phase unless the artifact ends with `Audit: PASS`.
43
+ - Record `Subagent Capability Probe` and `Delegation Decision Basis` in every audited phase.
44
+ - If meaningful subagent work contributes to a phase, require a durable action record under `/.recursive/run/<run-id>/subagents/` and verify it against actual files, actual recursive artifacts, and the actual diff before acceptance. For review/audit delegation, prefer a stable reviewed artifact for `Current Artifact`.
45
+ - Store routed assistant output, raw transcripts, stdout/stderr captures, and invocation metadata under `/.recursive/run/<run-id>/evidence/router/`; cite them from action records rather than placing raw transcript Markdown directly under `subagents/`.
46
+ - Store initial routed prompt bundles only under run-scoped paths such as `/.recursive/run/<run-id>/router-prompts/`; do not bootstrap top-level `/.recursive/router-prompts/`.
47
+ - Treat `success: false` or any nonzero routed-assistant exit code as a failed attempt: preserve diagnostics, instruct the bounded routed role to repair owned issues when applicable, rerun the route, then verify the result before acceptance or record an explicit fallback.
48
+ - If delegated work is accepted after main-agent checks reveal issues, record the concrete repair performed after verification; do not accept stale delegated context silently.
49
+ - For Phase 3, declare `TDD Mode: strict|pragmatic`. Strict mode requires RED and GREEN evidence paths. Pragmatic mode requires an explicit exception rationale plus compensating evidence.
50
+ - For Phase 5, declare `QA Execution Mode: human|agent-operated|hybrid`. Human and hybrid require user sign-off. Agent-operated and hybrid require execution metadata plus evidence paths.
51
+ - For delegated review, prefer `recursive-review-bundle` and record `Review Bundle Path` in Phase 3.5 when review is delegated.
52
+ - Treat addenda as authoritative effective inputs. If relevant addenda exist, list them in `Inputs`, re-read them, and reconcile them explicitly.
53
+ - Review bundles should include relevant addenda automatically, and the written review should cite upstream artifacts, relevant addenda, prior recursive evidence, and changed files/code refs from that bundle in the review narrative.
54
+ - Audited phases must include machine-checkable `Requirement Completion Status` entries for every in-scope `R#`; Traceability alone is not enough.
55
+ - `implemented` and `verified` requirement dispositions must cite concrete `Changed Files`, and `verified` also requires distinct verification evidence.
56
+ - `00-worktree.md` is the source of truth for diff basis. Record baseline type/reference, comparison reference, normalized baseline/comparison, and normalized diff command; do not silently substitute a different basis later.
57
+ - Diff audit ignores incidental runtime byproducts such as `__pycache__/`, `*.pyc`, `.pytest_cache/`, `.mypy_cache/`, and `.ruff_cache/` unless the repo intentionally tracks them.
58
+ - Treat Phase 6, Phase 7, and Phase 8 receipts as concise delta receipts that point to final control-plane docs instead of duplicating them.
59
+ - Phase 8 should capture run-local skill usage and update skill memory under `/.recursive/memory/skills/` when the run teaches the repo something durable about skill availability, skill fit, delegated-review quality, or skill-discovery outcomes.
60
+ - If a run needs missing specialized capability, prefer the `find-skills` skill when available. Otherwise use the Skills CLI (`npx skills find`, `npx skills add`, `npx skills check`, `npx skills update`) and record the outcome when skill usage is relevant.
61
+ - When working inside a reusable skill/workflow repo, do not leave committed run residue such as concrete `/.recursive/run/<run-id>/` folders, evidence logs, review bundles, action records, or temp-path references unless they are intentional fixtures or examples.
62
+
63
+ Useful helpers:
64
+
65
+ Invoke these helper names from the installed recursive-mode skill directory or the source package checkout:
66
+
67
+ - `install-recursive-mode`
68
+ - `recursive-init`
69
+ - `recursive-status`
70
+ - `lint-recursive-run`
71
+ - `recursive-review-bundle`
72
+ - `recursive-closeout`
73
+ - `recursive-subagent-action`
74
+ - `recursive-training-grpo`
75
+ - `recursive-training-extract`
76
+ - `recursive-training-phase8-trigger`
77
+ - `recursive-training-sync`
78
+ - `recursive-training-loader`
79
+ - `recursive-training-mcp`
80
+ - `recursive-lock`
81
+ - `verify-locks`
82
+ - `check-reusable-repo-hygiene`
83
+
84
+ Diff ownership rules:
85
+
86
+ - Phase 2 owns planned product/worktree scope only.
87
+ - Phase 3, Phase 3.5, and Phase 4 own actual product/worktree drift reconciliation.
88
+ - Phase 6 owns `/.recursive/DECISIONS.md`.
89
+ - Phase 7 owns `/.recursive/STATE.md`.
90
+ - Phase 8 owns `/.recursive/memory/**`.
91
+ - Do not treat later control-plane or memory churn as retroactive invalidation of earlier locked phases.
92
+
93
+ Locking rule:
94
+
95
+ - Use `recursive-lock` as the primary supported way to write `Status: LOCKED`, `LockedAt`, and `LockHash`.
@@ -0,0 +1,7 @@
1
+ ## recursive-mode memory pointers
2
+
3
+ - Canonical repository memory lives under `/.recursive/memory/`.
4
+ - Read `/.recursive/memory/MEMORY.md` before loading any other memory docs.
5
+ - Load only the memory docs relevant to the current task.
6
+ - When repository experiential memory may help, run `python .recursive/scripts/recursive-training-loader.py --repo-root . --query "<task>" --files "<path1,path2>"`.
7
+ - Treat this file as a pointer only; the canonical memory store remains `/.recursive/memory/`.
@@ -0,0 +1,7 @@
1
+ # recursive-mode memory pointers
2
+ # Canonical repository memory lives under `/.recursive/memory/`.
3
+ # Read `/.recursive/memory/MEMORY.md` before loading any other memory docs.
4
+ # Load only the memory docs relevant to the current task.
5
+ # When repository experiential memory may help, run:
6
+ # python .recursive/scripts/recursive-training-loader.py --repo-root . --query "<task>" --files "<path1,path2>"
7
+ # This file is only a pointer surface; the canonical memory store remains `/.recursive/memory/`.
@@ -0,0 +1,5 @@
1
+ # DECISIONS.md
2
+
3
+ ## Recursive Run Index
4
+
5
+ - No runs recorded yet.
@@ -0,0 +1,49 @@
1
+ Type: `pattern`
2
+ Status: `CURRENT`
3
+ Scope: `How the main agent verifies delegated review or audit work before accepting it as lockable evidence.`
4
+ Owns-Paths:
5
+ Watch-Paths:
6
+ - `/.recursive/RECURSIVE.md`
7
+ - `/.recursive/memory/skills/SKILLS.md`
8
+ - `/.recursive/run/`
9
+ Source-Runs:
10
+ - `none (generic repository guidance)`
11
+ Validated-At-Commit: `generic-repository-guidance`
12
+ Last-Validated: `2026-04-09T00:00:00Z`
13
+ Tags:
14
+ - `skills`
15
+ - `subagent`
16
+ - `verification`
17
+ - `review-bundle`
18
+
19
+ # Delegated Verification And Refresh
20
+
21
+ Delegated work is optional helper output, not autonomous authority.
22
+
23
+ ## Main-Agent Acceptance Rules
24
+
25
+ Before accepting meaningful delegated work, the main agent should verify:
26
+
27
+ - claimed file impact against the actual diff-owned file set
28
+ - claimed artifact reads or updates against files that actually exist
29
+ - review-bundle contents against the current reviewed artifact and artifact hash
30
+ - requirement, plan, addenda, and prior recursive docs that materially informed acceptance
31
+ - whether any post-review repair made the delegated context stale
32
+
33
+ ## Record In The Phase Artifact
34
+
35
+ When delegated work materially contributes, `## Subagent Contribution Verification` should record:
36
+
37
+ - `Reviewed Action Records`
38
+ - `Main-Agent Verification Performed`
39
+ - `Acceptance Decision`
40
+ - `Refresh Handling`
41
+ - `Repair Performed After Verification`
42
+
43
+ ## Refresh Rule
44
+
45
+ If repairs materially change the reviewed artifact, changed-file scope, or evidence basis, refresh the review bundle or action record before relying on delegated work for lockable evidence.
46
+
47
+ ## Rejection Rule
48
+
49
+ If the main agent cannot verify delegated claims against actual files, actual artifacts, and the actual diff scope, reject the delegated result and fall back to self-audit for lockable completion evidence.
@@ -0,0 +1,45 @@
1
+ ## Memory Router
2
+
3
+ This file is the durable memory router for the repository.
4
+ It is not a knowledge dump. Store durable memory in sharded docs under `domains/`, `patterns/`, `incidents/`, `episodes/`, `training/`, `skills/`, or `archive/`.
5
+
6
+ Control-plane docs are not memory docs:
7
+ - `/.recursive/RECURSIVE.md`
8
+ - `/.recursive/STATE.md`
9
+ - `/.recursive/DECISIONS.md`
10
+ - `/.codex/AGENTS.md`
11
+ - `/AGENTS.md`
12
+ - `/.agent/PLANS.md`
13
+
14
+ ## Retrieval Rules
15
+
16
+ - Read this file before loading any other memory docs.
17
+ - Load only the memory docs relevant to the current task.
18
+ - If the task may benefit from prior recursive-mode experiential learnings, use this index to identify the relevant docs under `/.recursive/memory/training/` and `/.recursive/memory/domains/`.
19
+ - The optional `recursive-training-sync.py` helper is read-only; it prints startup guidance about what to read, but does not modify `MEMORY.md` or the memory plane.
20
+ - If the task plans delegated review, subagent help, review bundles, smoke-harness portability work, or capability-sensitive execution, read `/.recursive/memory/skills/SKILLS.md` and then load the relevant skill-memory shards.
21
+ - If Phase 8 will need to promote durable lessons, first capture run-local skill usage in the run artifact and only then promote generalized conclusions into skill-memory shards.
22
+ - Prefer `Status: CURRENT` docs for planning and execution.
23
+ - `Status: SUSPECT` docs may be used as leads, but revalidate them before trust.
24
+ - Exclude `STALE` and `DEPRECATED` docs from default retrieval unless doing historical analysis.
25
+
26
+ ## Registry
27
+
28
+ - `domains/` - stable functional-area knowledge with `Owns-Paths`
29
+ - `patterns/` - reusable playbooks and solution patterns
30
+ - `incidents/` - recurring failure signatures and fixes
31
+ - `episodes/` - distilled lessons from specific runs
32
+ - `training/` - extracted experiential learnings promoted from completed recursive-mode runs
33
+ - `skills/` - durable skill and capability memory, routed via `skills/SKILLS.md`
34
+ - `archive/` - historical or deprecated memory docs
35
+
36
+ ## Freshness Rules
37
+
38
+ - Durable memory docs must declare the metadata defined by the installed `recursive-mode` artifact template.
39
+ - Any doc whose `Owns-Paths` or `Watch-Paths` overlaps final changed code paths must be reviewed in Phase 8.
40
+ - Affected `CURRENT` docs should be downgraded to `SUSPECT` until revalidated against final code, `STATE.md`, and `DECISIONS.md`.
41
+ - If changed paths have no owning domain doc, create one or record the uncovered-path follow-up in `08-memory-impact.md`.
42
+ - Training memory docs should keep their canonical content under `/.recursive/memory/training/`, use the memory index as the discovery surface, and record source runs plus watch-path or applicability guidance.
43
+ - Skill-memory docs should record source runs, last validated date, environment notes, and current trust/fit guidance.
44
+ - If a run materially teaches the repo something about skill availability, delegated-review quality, review-bundle usage, or toolchain fallback behavior, Phase 8 must either create/refresh a skill-memory shard or record why no durable lesson was promoted.
45
+ - If the repo itself is a reusable skill/workflow distribution, durable memory must remain generalized. Do not store current-session run residue or temp-environment observations as if they were universal truth.
@@ -0,0 +1,48 @@
1
+ Type: `pattern`
2
+ Status: `CURRENT`
3
+ Scope: `How Phase 8 captures run-local skill usage and promotes only durable lessons into skill memory.`
4
+ Owns-Paths:
5
+ Watch-Paths:
6
+ - `/.recursive/RECURSIVE.md`
7
+ - `/.recursive/memory/MEMORY.md`
8
+ - `/.recursive/memory/skills/SKILLS.md`
9
+ - `/.recursive/run/`
10
+ Source-Runs:
11
+ - `none (generic repository guidance)`
12
+ Validated-At-Commit: `generic-repository-guidance`
13
+ Last-Validated: `2026-04-09T00:00:00Z`
14
+ Tags:
15
+ - `skills`
16
+ - `memory`
17
+ - `phase8`
18
+ - `promotion`
19
+
20
+ # Phase 8 Skill Memory Promotion
21
+
22
+ Skill memory should be operational, not accidental.
23
+
24
+ ## First Capture It Run-Locally
25
+
26
+ Before promoting durable guidance, record run-local skill usage in `08-memory-impact.md`:
27
+
28
+ - what skills were available
29
+ - what skills were sought
30
+ - what skills were attempted or used
31
+ - what worked well
32
+ - what issues were encountered
33
+ - what future guidance changed
34
+ - what promotion candidates exist
35
+
36
+ ## Then Decide What Becomes Durable
37
+
38
+ Promote only lessons that are:
39
+
40
+ - reusable across runs
41
+ - specific enough to change future planning or verification behavior
42
+ - not merely one-off environmental noise
43
+
44
+ ## Keep The Boundary Honest
45
+
46
+ - Run-local observations belong in the run artifact first.
47
+ - Durable memory should contain generalized guidance, not session history.
48
+ - In reusable skill/workflow repos, do not turn current-session implementation residue into durable memory unless it has been rewritten as generic repository guidance.
@@ -0,0 +1,43 @@
1
+ ## recursive-mode plans bridge
2
+
3
+ This file exists only for tools that expect the Codex plans bridge at `/.agent/PLANS.md`.
4
+
5
+ The canonical workflow specification lives in `/.recursive/RECURSIVE.md`.
6
+ Do not maintain a second authoritative workflow here.
7
+
8
+ If this bridge conflicts with `/.recursive/RECURSIVE.md`, follow `/.recursive/RECURSIVE.md`.
9
+
10
+ Short user commands that should trigger recursive-mode orchestration include:
11
+
12
+ - `Implement the run`
13
+ - `Implement run <run-id>`
14
+ - `Implement requirement '<run-id>'`
15
+ - `Implement the plan`
16
+ - `Create a new run based on the plan`
17
+ - `Start a recursive run`
18
+
19
+ Resolution rule:
20
+
21
+ - If a run id is explicit, use that run.
22
+ - If exactly one active/incomplete run exists and no run id is given, resume it.
23
+ - If the user refers to a plan, create a new run only when a unique source plan/requirements artifact can be identified from repo docs or immediate task context.
24
+ - If the command is ambiguous, ask for the run id or the repo path of the source plan/requirements artifact.
25
+
26
+ Spec-authoring rule:
27
+
28
+ - If the user asks to create a plan, help plan, create a spec, or write requirements for a new recursive run, prefer `recursive-spec` before orchestration.
29
+ - `recursive-spec` should confirm the user wants spec help, ask what they want to do, read `STATE.md`, `DECISIONS.md`, `MEMORY.md`, and relevant code/tests, keep the draft in temporary non-repo storage, then create the new run only after the requirements are approved.
30
+
31
+ Benchmark rule:
32
+
33
+ - If the user asks to benchmark recursive-mode, compare recursive vs non-recursive execution, or generate a recursive-mode benchmark report, install and use the separate optional `recursive-benchmark` add-on on demand instead of assuming benchmark fixtures ship with the default recursive-mode package.
34
+ - Prefer `find-skills` when available. Otherwise use `npx skills add <recursive-benchmark-package-or-repo> --full-depth`.
35
+
36
+ Audit delegation rule:
37
+
38
+ - If subagents are available and the audit/review context bundle is complete, delegated audit/review is the default path.
39
+ - If the controller still chooses `self-audit`, record a concrete `Delegation Override Reason` in the audited phase artifact.
40
+
41
+ Router rule:
42
+
43
+ - If the user asks to route delegated work through another transport/model, configure or inspect `/.recursive/config/recursive-router.json`, refresh `/.recursive/config/recursive-router-discovered.json`, re-read both immediately before choosing the delegated CLI/model, and use `recursive-router` before dispatching the delegated role.
@@ -0,0 +1,64 @@
1
+ ## .recursive AGENTS Router
2
+
3
+ This file is a lightweight routing/index doc for agents already working inside the repository.
4
+ It exists to reduce blind doc-by-doc scanning. It is not a second workflow spec.
5
+
6
+ ## Canonical Rule
7
+
8
+ - Treat `/.recursive/RECURSIVE.md` as the single workflow source of truth.
9
+ - If this file conflicts with `/.recursive/RECURSIVE.md`, follow `/.recursive/RECURSIVE.md`.
10
+
11
+ ## Suggested Read Order
12
+
13
+ 1. Read `/.recursive/RECURSIVE.md` first for workflow rules and required behavior.
14
+ 2. Read `/.recursive/STATE.md` when the current repo state matters.
15
+ 3. Read `/.recursive/DECISIONS.md` when prior rationale or relevant earlier work matters.
16
+ 4. Read `/.recursive/memory/MEMORY.md` when task context may depend on durable memory.
17
+ 5. Read `/.recursive/memory/skills/SKILLS.md` when the task may use delegated review, subagents, review bundles, smoke-harness portability work, or other capability-sensitive execution.
18
+ 6. Read the recursive-mode package README or maintainer notes from the installed skill directory or source package checkout when changing the package itself.
19
+
20
+ ## Task Routing
21
+
22
+ - Starting or resuming a recursive-mode run:
23
+ - `/.recursive/RECURSIVE.md`
24
+ - `/.recursive/STATE.md`
25
+ - `/.recursive/DECISIONS.md`
26
+ - `/.recursive/memory/MEMORY.md`
27
+ - Authoring a new recursive-mode spec or `00-requirements.md`:
28
+ - `/.recursive/STATE.md`
29
+ - `/.recursive/DECISIONS.md`
30
+ - `/.recursive/memory/MEMORY.md`
31
+ - the installed `recursive-spec` skill
32
+ - relevant code and tests for the requested area
33
+ - Benchmarking recursive-mode against a non-recursive baseline:
34
+ - Install the separate optional `recursive-benchmark` add-on only when the user explicitly asks for benchmarking.
35
+ - Prefer `find-skills` when available; otherwise use `npx skills add <recursive-benchmark-package-or-repo> --full-depth`.
36
+ - The default exported `recursive-mode` package intentionally excludes benchmark fixtures and benchmark skill files.
37
+ - After the benchmark add-on is installed, follow its packaged fixture and harness docs.
38
+ - Working on reusable package/bootstrap/docs for this repo:
39
+ - the recursive-mode package README or maintainer notes from the installed skill directory or source package checkout
40
+ - the recursive-mode installer scripts from the installed skill directory or source package checkout
41
+ - Working on phase artifact structure or lint expectations:
42
+ - the recursive-mode artifact template from the installed skill directory or source package checkout
43
+ - the recursive-mode lint/status helpers from the installed skill directory or source package checkout
44
+ - Working on delegated review, subagent behavior, or routed CLI delegation:
45
+ - `/.recursive/memory/skills/SKILLS.md`
46
+ - `/.recursive/config/recursive-router.json`
47
+ - `/.recursive/config/recursive-router-discovered.json`
48
+ - the installed `recursive-router`, `recursive-subagent`, and `recursive-review-bundle` skills
49
+ - Working on memory behavior:
50
+ - `/.recursive/memory/MEMORY.md`
51
+ - the installed `recursive-training` skill
52
+ - `/.recursive/scripts/recursive-training-loader.py`
53
+ - `/.recursive/memory/training/`
54
+ - `/.recursive/memory/skills/SKILLS.md`
55
+
56
+ ## Non-Canonical Bridges
57
+
58
+ These are adapters, not second specs:
59
+
60
+ - `/.codex/AGENTS.md`
61
+ - `/AGENTS.md`
62
+ - `/.agent/PLANS.md`
63
+
64
+ Read them only when the tool or host expects those entrypoints.
@@ -0,0 +1,51 @@
1
+ Type: `pattern`
2
+ Status: `CURRENT`
3
+ Scope: `How recursive-mode runs should discover, evaluate, and record external skills or missing capabilities.`
4
+ Owns-Paths:
5
+ Watch-Paths:
6
+ - `/.recursive/RECURSIVE.md`
7
+ - `/.recursive/memory/skills/SKILLS.md`
8
+ - `/.recursive/run/`
9
+ Source-Runs:
10
+ - `none (generic repository guidance)`
11
+ Validated-At-Commit: `generic-repository-guidance`
12
+ Last-Validated: `2026-04-09T00:00:00Z`
13
+ Tags:
14
+ - `skills`
15
+ - `discovery`
16
+ - `find-skills`
17
+ - `capability`
18
+
19
+ # Skill Discovery And Evaluation
20
+
21
+ Use this guidance when a run needs a specialized capability that is not already available.
22
+
23
+ ## Preferred Order
24
+
25
+ 1. Use the `find-skills` skill if it is already installed.
26
+ 2. Otherwise use the Skills CLI directly.
27
+ 3. If nothing suitable exists, proceed with built-in capability and record that no suitable external skill was available.
28
+
29
+ ## Useful Commands
30
+
31
+ - `npx skills find <query>`
32
+ - `npx skills add <package-or-repo>`
33
+ - `npx skills add <package-or-repo> --skill <skill-name>`
34
+ - `npx skills check`
35
+ - `npx skills update`
36
+
37
+ ## Evaluation Rules
38
+
39
+ - Prefer skills from reputable publishers or organizations.
40
+ - Prefer higher install counts when the skills are otherwise comparable.
41
+ - Check upstream repository quality before recommending or installing a skill.
42
+ - Do not treat search results as proof of quality; verify source and documentation first.
43
+
44
+ ## Phase 8 Recording
45
+
46
+ If a run materially used skill discovery, capture it in `08-memory-impact.md` under:
47
+
48
+ - `## Run-Local Skill Usage Capture`
49
+ - `## Skill Memory Promotion Review`
50
+
51
+ Promote only durable, reusable conclusions into skill memory. Leave one-off session notes in the run artifact instead of turning them into durable guidance.
@@ -0,0 +1,42 @@
1
+ ## Skill Memory Router
2
+
3
+ This file routes durable skill and capability knowledge for the repository.
4
+ It summarizes what skills were available, what was attempted, what worked, what failed, and how future runs should use those skills.
5
+
6
+ Use the subfolders for durable Markdown-only skill memory:
7
+
8
+ - `availability/` - environment-specific skill availability and capability probe notes
9
+ - `usage/` - stable usage guidance and fit for specific skills
10
+ - `issues/` - recurring skill failures, limitations, or confusing behavior
11
+ - `patterns/` - reusable multi-skill operating patterns and delegation playbooks
12
+
13
+ Keep this file concise. Link to child docs instead of duplicating them.
14
+
15
+ ## Retrieval Hints
16
+
17
+ - If the run may use delegated review, subagents, or review bundles:
18
+ - read this router
19
+ - read only the most relevant skill-memory docs that are actually present for the current environment and workflow
20
+ - If the run may need specialized external capability:
21
+ - prefer the `find-skills` skill when available
22
+ - otherwise use the Skills CLI directly and treat discovered packages as candidates until quality is checked
23
+ - If the run changes the smoke harness or cross-toolchain behavior:
24
+ - read the most relevant availability/usage notes if any have been intentionally promoted into skill memory
25
+ - In Phase 8, promote durable skill lessons into one of these shards:
26
+ - `availability/` for capability probes and environment constraints
27
+ - `usage/` for stable fit/use guidance
28
+ - `issues/` for recurring failure modes
29
+ - `patterns/` for reusable operating playbooks
30
+ - Before promoting anything durable, capture run-local skill usage in the Phase 8 artifact:
31
+ - what skills were available
32
+ - what skills were sought
33
+ - what skills were attempted or used
34
+ - what worked well or poorly
35
+ - what future guidance should change
36
+
37
+ ## Current Docs
38
+
39
+ - `/.recursive/memory/skills/usage/skill-discovery-and-evaluation.md`
40
+ - `/.recursive/memory/skills/patterns/delegated-verification-and-refresh.md`
41
+ - `/.recursive/memory/skills/patterns/phase8-skill-memory-promotion.md`
42
+ - Add child docs here only when they are intentionally promoted as reusable repository guidance.
@@ -0,0 +1,5 @@
1
+ # STATE.md
2
+
3
+ ## Current State
4
+
5
+ - Initial state not documented yet.