@mrpatronz/nexusflow 2.11.0 → 2.12.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.
Files changed (194) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +151 -12
  3. package/dist/analyzers/detect-deps.js +1 -1
  4. package/dist/analyzers/detect-deps.js.map +1 -1
  5. package/dist/commands/commit.d.ts.map +1 -1
  6. package/dist/commands/commit.js +15 -0
  7. package/dist/commands/commit.js.map +1 -1
  8. package/dist/commands/create.d.ts +10 -1
  9. package/dist/commands/create.d.ts.map +1 -1
  10. package/dist/commands/create.js +44 -23
  11. package/dist/commands/create.js.map +1 -1
  12. package/dist/commands/finish.d.ts.map +1 -1
  13. package/dist/commands/finish.js +15 -0
  14. package/dist/commands/finish.js.map +1 -1
  15. package/dist/commands/flow.d.ts +13 -0
  16. package/dist/commands/flow.d.ts.map +1 -0
  17. package/dist/commands/flow.js +91 -0
  18. package/dist/commands/flow.js.map +1 -0
  19. package/dist/commands/skill.d.ts +28 -0
  20. package/dist/commands/skill.d.ts.map +1 -0
  21. package/dist/commands/skill.js +250 -0
  22. package/dist/commands/skill.js.map +1 -0
  23. package/dist/commands/status.d.ts.map +1 -1
  24. package/dist/commands/status.js +14 -0
  25. package/dist/commands/status.js.map +1 -1
  26. package/dist/commands/tag.d.ts +13 -0
  27. package/dist/commands/tag.d.ts.map +1 -0
  28. package/dist/commands/tag.js +179 -0
  29. package/dist/commands/tag.js.map +1 -0
  30. package/dist/commands/verify.d.ts +16 -0
  31. package/dist/commands/verify.d.ts.map +1 -0
  32. package/dist/commands/verify.js +91 -0
  33. package/dist/commands/verify.js.map +1 -0
  34. package/dist/core/adapters/local-storage.d.ts.map +1 -1
  35. package/dist/core/adapters/local-storage.js +2 -2
  36. package/dist/core/adapters/local-storage.js.map +1 -1
  37. package/dist/core/commit.d.ts +2 -0
  38. package/dist/core/commit.d.ts.map +1 -1
  39. package/dist/core/commit.js +15 -0
  40. package/dist/core/commit.js.map +1 -1
  41. package/dist/core/domain-catalog.d.ts +9 -0
  42. package/dist/core/domain-catalog.d.ts.map +1 -0
  43. package/dist/core/domain-catalog.js +47 -0
  44. package/dist/core/domain-catalog.js.map +1 -0
  45. package/dist/core/domain-packs.d.ts +81 -0
  46. package/dist/core/domain-packs.d.ts.map +1 -0
  47. package/dist/core/domain-packs.js +443 -0
  48. package/dist/core/domain-packs.js.map +1 -0
  49. package/dist/core/generation-lock.d.ts.map +1 -1
  50. package/dist/core/generation-lock.js +1 -3
  51. package/dist/core/generation-lock.js.map +1 -1
  52. package/dist/core/lifecycle.d.ts +28 -0
  53. package/dist/core/lifecycle.d.ts.map +1 -0
  54. package/dist/core/lifecycle.js +411 -0
  55. package/dist/core/lifecycle.js.map +1 -0
  56. package/dist/core/verify.d.ts +39 -0
  57. package/dist/core/verify.d.ts.map +1 -0
  58. package/dist/core/verify.js +397 -0
  59. package/dist/core/verify.js.map +1 -0
  60. package/dist/core/work-guidance.d.ts +201 -0
  61. package/dist/core/work-guidance.d.ts.map +1 -0
  62. package/dist/core/work-guidance.js +225 -0
  63. package/dist/core/work-guidance.js.map +1 -0
  64. package/dist/core/workspace-state.d.ts +24 -3
  65. package/dist/core/workspace-state.d.ts.map +1 -1
  66. package/dist/core/workspace-state.js +93 -31
  67. package/dist/core/workspace-state.js.map +1 -1
  68. package/dist/core/workspace.d.ts.map +1 -1
  69. package/dist/core/workspace.js +7 -0
  70. package/dist/core/workspace.js.map +1 -1
  71. package/dist/generators/base.d.ts.map +1 -1
  72. package/dist/generators/base.js +38 -4
  73. package/dist/generators/base.js.map +1 -1
  74. package/dist/generators/index.d.ts.map +1 -1
  75. package/dist/generators/index.js +4 -0
  76. package/dist/generators/index.js.map +1 -1
  77. package/dist/generators/plan-generator.d.ts.map +1 -1
  78. package/dist/generators/plan-generator.js +6 -1
  79. package/dist/generators/plan-generator.js.map +1 -1
  80. package/dist/generators/skills-generator.d.ts.map +1 -1
  81. package/dist/generators/skills-generator.js +36 -3
  82. package/dist/generators/skills-generator.js.map +1 -1
  83. package/dist/gui/assets/AgentsPage-GCFiyNSm.js +3 -0
  84. package/dist/gui/assets/DashboardPage-51JHl4Hg.js +1 -0
  85. package/dist/gui/assets/{GettingStartedPage-1MOTng3B.js → GettingStartedPage-DH-zXYgU.js} +1 -1
  86. package/dist/gui/assets/ProjectsPage-DUv2fhI8.js +1 -0
  87. package/dist/gui/assets/ScaffoldRepoInline-Asao9IqG.js +1 -0
  88. package/dist/gui/assets/SettingsPage--pnZKpmm.js +1 -0
  89. package/dist/gui/assets/SkillsPage-BPq8arO5.js +7 -0
  90. package/dist/gui/assets/StartWorkPage-CypGEQZ0.js +1 -0
  91. package/dist/gui/assets/{StrategiesPage-CdCbbIu-.js → StrategiesPage-BHAzXMnc.js} +2 -2
  92. package/dist/gui/assets/WorkroomsPage-BYC8c-rP.js +4 -0
  93. package/dist/gui/assets/WorkspacesPage-DRASo1aL.js +13 -0
  94. package/dist/gui/assets/{alert-dialog-u7qgb9Hq.js → alert-dialog-BD3wT0w3.js} +1 -1
  95. package/dist/gui/assets/badge-DTBzXOWn.js +1 -0
  96. package/dist/gui/assets/index-er-mkc2S.css +2 -0
  97. package/dist/gui/assets/index-jcGHcXQ1.js +57 -0
  98. package/dist/gui/assets/square-check-big-Bj8Rf_dH.js +1 -0
  99. package/dist/gui/assets/tabs-DfbdubLX.js +1 -0
  100. package/dist/gui/assets/{useAriaLabelledBy-C4zV-1Ra.js → useAriaLabelledBy-BmJErI5a.js} +1 -1
  101. package/dist/gui/assets/vsc-Dn-smJni.js +1 -0
  102. package/dist/gui/index.html +3 -5
  103. package/dist/http/work-guidance-routes.d.ts +4 -0
  104. package/dist/http/work-guidance-routes.d.ts.map +1 -0
  105. package/dist/http/work-guidance-routes.js +44 -0
  106. package/dist/http/work-guidance-routes.js.map +1 -0
  107. package/dist/index.js +169 -1
  108. package/dist/index.js.map +1 -1
  109. package/dist/mcp/tools.d.ts.map +1 -1
  110. package/dist/mcp/tools.js +183 -0
  111. package/dist/mcp/tools.js.map +1 -1
  112. package/dist/resources/contracts.d.ts.map +1 -1
  113. package/dist/resources/contracts.js +2 -1
  114. package/dist/resources/contracts.js.map +1 -1
  115. package/dist/resources/fs-safety.d.ts.map +1 -1
  116. package/dist/resources/fs-safety.js +2 -1
  117. package/dist/resources/fs-safety.js.map +1 -1
  118. package/dist/resources/materializer.d.ts +3 -0
  119. package/dist/resources/materializer.d.ts.map +1 -1
  120. package/dist/resources/materializer.js +45 -19
  121. package/dist/resources/materializer.js.map +1 -1
  122. package/dist/server.d.ts.map +1 -1
  123. package/dist/server.js +327 -4
  124. package/dist/server.js.map +1 -1
  125. package/dist/static-resources/skills/contextspace-verify-release/SKILL.md +51 -0
  126. package/dist/static-resources/skills/contextspace-verify-release/references/evidence.md +21 -0
  127. package/dist/static-resources/skills/nexusflow-dev/SKILL.md +49 -0
  128. package/dist/static-resources/skills/nexusflow-dev/references/cli-conventions.md +15 -0
  129. package/dist/static-resources/skills/nexusflow-dev/references/verification-checklist.md +28 -0
  130. package/dist/static-resources/skills/nexusflow-lifecycle/SKILL.md +62 -0
  131. package/dist/static-resources/skills/nexusflow-lifecycle/references/epic-deliverables.md +22 -0
  132. package/dist/static-resources/skills/nexusflow-lifecycle/references/flow-selection-matrix.md +21 -0
  133. package/dist/static-resources/skills/nexusflow-lifecycle/references/stage-outcomes.md +23 -0
  134. package/dist/static-resources/workflows/epic-multi-slice.md +21 -0
  135. package/dist/static-resources/workflows/plan-implement-review.md +17 -6
  136. package/dist/static-resources/workflows/research-verify.md +15 -4
  137. package/dist/static-resources/workflows/solo-developer.md +11 -2
  138. package/dist/test-setup.d.ts +2 -0
  139. package/dist/test-setup.d.ts.map +1 -0
  140. package/dist/test-setup.js +8 -0
  141. package/dist/test-setup.js.map +1 -0
  142. package/dist/types.d.ts +175 -0
  143. package/dist/types.d.ts.map +1 -1
  144. package/dist/utils/resolve-workspace.d.ts.map +1 -1
  145. package/dist/utils/resolve-workspace.js +15 -8
  146. package/dist/utils/resolve-workspace.js.map +1 -1
  147. package/dist/utils/skills-catalog.d.ts +13 -9
  148. package/dist/utils/skills-catalog.d.ts.map +1 -1
  149. package/dist/utils/skills-catalog.js +241 -341
  150. package/dist/utils/skills-catalog.js.map +1 -1
  151. package/dist/utils/workflow-advisor.d.ts +1 -1
  152. package/dist/utils/workflow-advisor.d.ts.map +1 -1
  153. package/dist/utils/workflow-advisor.js +16 -4
  154. package/dist/utils/workflow-advisor.js.map +1 -1
  155. package/dist/utils/workflows.d.ts.map +1 -1
  156. package/dist/utils/workflows.js +5 -2
  157. package/dist/utils/workflows.js.map +1 -1
  158. package/dist/workrooms/contracts.d.ts +3 -3
  159. package/dist/workrooms/local-resources.d.ts +4 -1
  160. package/dist/workrooms/local-resources.d.ts.map +1 -1
  161. package/dist/workrooms/manager.d.ts +5 -2
  162. package/dist/workrooms/manager.d.ts.map +1 -1
  163. package/dist/workrooms/store.d.ts +2 -2
  164. package/package.json +3 -2
  165. package/resources/skills/contextspace-verify-release/SKILL.md +51 -0
  166. package/resources/skills/contextspace-verify-release/references/evidence.md +21 -0
  167. package/resources/skills/nexusflow-dev/SKILL.md +49 -0
  168. package/resources/skills/nexusflow-dev/references/cli-conventions.md +15 -0
  169. package/resources/skills/nexusflow-dev/references/verification-checklist.md +28 -0
  170. package/resources/skills/nexusflow-lifecycle/SKILL.md +62 -0
  171. package/resources/skills/nexusflow-lifecycle/references/epic-deliverables.md +22 -0
  172. package/resources/skills/nexusflow-lifecycle/references/flow-selection-matrix.md +21 -0
  173. package/resources/skills/nexusflow-lifecycle/references/stage-outcomes.md +23 -0
  174. package/resources/workflows/epic-multi-slice.md +21 -0
  175. package/resources/workflows/plan-implement-review.md +17 -6
  176. package/resources/workflows/research-verify.md +15 -4
  177. package/resources/workflows/solo-developer.md +11 -2
  178. package/dist/gui/assets/AgentsPage-DbivhmK0.js +0 -3
  179. package/dist/gui/assets/DashboardPage-D50Qrm3e.js +0 -1
  180. package/dist/gui/assets/NullStore-tdPen1kp.js +0 -1
  181. package/dist/gui/assets/ProjectsPage-srKgf7VN.js +0 -1
  182. package/dist/gui/assets/ScaffoldRepoInline-CP0yn5mw.js +0 -1
  183. package/dist/gui/assets/SettingsPage-DWmrLV8o.js +0 -1
  184. package/dist/gui/assets/SkillsPage-CKjTXdrd.js +0 -6
  185. package/dist/gui/assets/StartWorkPage-BCUnJ9k8.js +0 -1
  186. package/dist/gui/assets/WorkroomsPage-BcT-mGtT.js +0 -4
  187. package/dist/gui/assets/WorkspacesPage-CYFCm-7_.js +0 -2
  188. package/dist/gui/assets/badge-DwXvB44H.js +0 -1
  189. package/dist/gui/assets/chunk-BV7QT456-DfUBKG-z.js +0 -3
  190. package/dist/gui/assets/index-3tD_IeyQ.js +0 -55
  191. package/dist/gui/assets/index-CK5YRfPV.css +0 -2
  192. package/dist/gui/assets/square-check-big-BSIiYXPI.js +0 -1
  193. package/dist/gui/assets/tabs-BrHKp5bD.js +0 -1
  194. package/dist/gui/assets/vsc-D80c4gBT.js +0 -1
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: contextspace-verify-release
3
+ description: Verify a ContextSpace-managed change, assess PR readiness, or execute an explicitly requested push, merge, or release using evidence tied to the current code revision. Use when verification or delivery is the task, not for every edit.
4
+ metadata:
5
+ contextspace:
6
+ title: ContextSpace Verification and Release
7
+ category: workflows
8
+ tags: [contextspace, verification, review, release]
9
+ ---
10
+
11
+ # Establish readiness from current evidence
12
+
13
+ Resolve the requested workspace, branch, PR, assignment, and acceptance criteria.
14
+ Inspect the current diff and repository-required checks. Select additional evidence
15
+ according to the affected behavior and impact; use [verification evidence](references/evidence.md).
16
+ Do not impose ContextSpace's own npm commands on unrelated projects.
17
+
18
+ ## Review and verify
19
+
20
+ Check intended behavior, regressions, compatibility, and consequential failure paths.
21
+ For interface changes, assess the actual user's journey and recovery behavior with
22
+ browser evidence. Report concrete findings by severity, with trigger, impact,
23
+ location, and expected behavior. Distinguish inspected behavior from assumptions.
24
+
25
+ Record commands, results, tested commit, and any uncommitted changes included in a
26
+ local test. An unavailable check is not a pass. Reuse applicable evidence while
27
+ the tested input is unchanged; rerun affected checks after fixes.
28
+
29
+ ## Push or assess merge readiness
30
+
31
+ Before a requested push, inspect pending changes and the remote branch; stage only
32
+ the intended paths. Preserve unrelated work. Follow the repository's commit convention.
33
+ After pushing, confirm the PR's head SHA matches the intended commit and watch its
34
+ checks. Inspect failures and fix issues within the user's authorized scope.
35
+
36
+ Before declaring readiness, read the current PR head, relevant diff/review findings,
37
+ required checks, draft status, and mergeability. Compare the head with the reviewed
38
+ and verified revision. If it changed, inspect the added changes and verify the new
39
+ head. Green checks on an earlier commit do not establish readiness for a newer one.
40
+ Pending checks, unresolved blocking findings, and missing required approvals must be
41
+ reported as outstanding. No review submitted is different from an approved review.
42
+
43
+ An assessment or push request does not itself authorize merging or publishing.
44
+ When those actions are requested, perform the applicable checks first and verify
45
+ the resulting remote state. For deployments or migrations, include the relevant
46
+ rollout and recovery plan. Do not deploy to a test or production service merely
47
+ to produce evidence unless that action is within the assignment.
48
+
49
+ Conclude with the exact revision, verification outcome, unresolved blockers or
50
+ limits, and which requested external actions actually completed. Link to CI/PR
51
+ evidence. Avoid an unconditional merge-ready claim from tests alone.
@@ -0,0 +1,21 @@
1
+ # Evidence proportional to the change
2
+
3
+ | Change | Establish |
4
+ | --- | --- |
5
+ | Localized bug | Original failing behavior, corrected behavior, relevant regression coverage |
6
+ | Performance | Representative workload and baseline, comparable result, correctness preserved |
7
+ | Public contract | Existing consumers remain compatible or a coordinated migration is defined |
8
+ | Persistent data | Representative old inputs, retry/failure behavior, recovery feasibility |
9
+ | UI flow | Discoverability, understandable defaults, keyboard access, loading/empty/error/retry behavior |
10
+ | State/storage | Adapter routing, concurrent updates, interrupted writes and stale-save recovery |
11
+ | Generated instructions | Correct source, reproducible output, valid references and runnable documented commands |
12
+
13
+ Separate local evidence from remote evidence. For local tests, record the commit and
14
+ whether the worktree contained edits; the commit alone does not identify those edits.
15
+ For PR checks, record the head SHA and run links. When CI tests a synthetic merge
16
+ commit, confirm the run corresponds to the current PR head and base.
17
+
18
+ For existing repositories, discover required commands from repository instructions,
19
+ package/build scripts, and CI. Run applicable gates, not unrelated tools merely
20
+ because they appear in a generic checklist. A successful build cannot demonstrate
21
+ an accessible interface, a safe migration, or satisfied product requirements.
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: nexusflow-dev
3
+ description: Maintain ContextSpace/NexusFlow implementation, CLI, storage, generated resources, and tests. Use for changes to this codebase; projects merely using ContextSpace follow their own repository engineering standards.
4
+ metadata:
5
+ contextspace:
6
+ title: ContextSpace Maintainer
7
+ category: dev-standards
8
+ tags: [contextspace, nexusflow, architecture, testing]
9
+ ---
10
+
11
+ # Maintain ContextSpace
12
+
13
+ Read the current repository instructions and assignment before editing. Keep changes
14
+ in the supplied worktree. The CLI in `src/index.ts` wires thin handlers; workspace
15
+ behavior belongs in `src/core/`, document persistence uses `src/core/storage.ts`,
16
+ and generated assistant views belong in `src/generators/`.
17
+
18
+ ## Preserve implementation contracts
19
+
20
+ - Resolve brand aliases and durable paths through `src/core/constants.ts` and the
21
+ brand configuration. Preserve primary/legacy fallback behavior.
22
+ - Use the storage port for adapter-owned documents. A local lock or cache does not
23
+ make filesystem writes an acceptable substitute for configured storage.
24
+ - Mutate shared state through the relevant catalog or workspace API. Keep locked
25
+ sections short; do slow verification outside them and revalidate the affected
26
+ revision before committing its result. Read fresh state under the lock.
27
+ - Use atomic persistence at the owning storage layer. For portable resource paths,
28
+ enforce containment and reject symlinks with the filesystem safety helpers.
29
+ - Change the source of generated views, then regenerate. Keep volatile progress
30
+ in live state, and invalidate verification evidence when the tested input changes.
31
+ - Knowledge entries retain the 300-character body limit; preserve adapter routing,
32
+ searchability, and recovery when Git persistence fails.
33
+
34
+ Read [CLI conventions](references/cli-conventions.md) for command changes and
35
+ [verification checks](references/verification-checklist.md) to select checks for
36
+ the affected subsystem. Follow repository-required gates before submission; use
37
+ targeted checks during iteration and repeat only when changes or failures justify it.
38
+
39
+ ## Maintain the guidance too
40
+
41
+ Versioned skill sources live in `resources/skills/`; workflow templates live in
42
+ `resources/workflows/`. Installed catalog packages and generated workspace copies
43
+ are derived from those sources. See `docs/maintaining-skills.md` for validation,
44
+ scenario evaluation, installation, and regeneration. Do not hand-edit a generated
45
+ `SKILL.md` and expect refresh to preserve it.
46
+
47
+ After changing structures or resources, build the backend before running
48
+ `node dist/index.js refresh`. Distinguish successful generation from a later Git
49
+ staging failure. Report the actual state instead of claiming the entire refresh passed.
@@ -0,0 +1,15 @@
1
+ # CLI contracts
2
+
3
+ Declare positional arguments once: either in `.command('name <id>')` or with
4
+ `.command('name').argument('<id>')`. Wrap action handlers with `runAction(...)`.
5
+
6
+ Use the repository's workspace resolver appropriate to the operation: interactive
7
+ selection when requested, quiet resolution for headless/read-only commands. Do not
8
+ introduce a prompt when a supplied workspace or current context resolves the task.
9
+
10
+ `--json` must produce parseable JSON without banners or ANSI escapes. Errors should
11
+ have a meaningful nonzero exit status; test failure paths as well as successful output.
12
+ Exercise documented subcommands and options against the built CLI's `--help`.
13
+
14
+ Tests should check observable argument behavior, JSON parsing, missing/invalid inputs,
15
+ and exit status where relevant. Use disposable fixtures for mutating commands.
@@ -0,0 +1,28 @@
1
+ # Repository verification
2
+
3
+ Follow the current `AGENTS.md` and package scripts. Before submitting code changes,
4
+ run `npm run build:backend` and `npm test`; GUI changes also require
5
+ `npm run build --prefix gui`. Do not embed expected test counts in this guide.
6
+
7
+ During implementation, select checks by affected behavior:
8
+
9
+ | Change | Useful evidence |
10
+ | --- | --- |
11
+ | CLI/API | Real command/request behavior, validation failures, clean JSON and exit status |
12
+ | Storage | Configured adapter exercised, original content retained, failed writes recoverable |
13
+ | Shared state | Concurrent edits do not lose unrelated data; stale revisions rejected |
14
+ | Generated resources | Regeneration from source, repeatability, provenance and source-file preservation |
15
+ | GUI | Actual user journey, loading/empty/error states, draft preservation, keyboard and label behavior |
16
+ | Verification engine | Gate uses the tested input, failed/stale/unreadable snapshots cannot permit progress |
17
+ | Compatibility/migration | Old and new persisted inputs, supported aliases, failure/recovery paths |
18
+
19
+ Run the relevant existing suites and add regressions for concrete failures. Do not
20
+ write tests that merely restate implementation or assert arbitrary prose. Browser
21
+ tests should wait for observable navigation/request completion, not fixed sleeps.
22
+ Passing mocked UI tests does not prove the backend integration; pair them with API
23
+ tests where the change crosses that boundary.
24
+
25
+ Use environment-specific workarounds only after establishing why they are needed.
26
+ For example, `npm test -- --configLoader native` can avoid Vite writing beside a
27
+ read-only configuration cache; it is not a universal substitute for repository scripts.
28
+ Missing permissions or dependencies are unavailable evidence, not a passing test.
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: nexusflow-lifecycle
3
+ description: Choose and carry out an appropriately sized development workflow in a ContextSpace workspace, using its current assignment, source documents, and milestones. Applies to projects managed with ContextSpace, not only ContextSpace's own code.
4
+ metadata:
5
+ contextspace:
6
+ title: ContextSpace Work Lifecycle
7
+ category: workflows
8
+ tags: [contextspace, workflow, development]
9
+ ---
10
+
11
+ # Work from the current assignment
12
+
13
+ Read the workspace instructions and live assignment with `ctxspace flow --assignment --json`
14
+ or MCP `get_work_context`. Check the selected milestone, stage, expected output, and
15
+ stopping point. If live tools are unavailable, read the authoritative
16
+ `contextspace-work.json` and relevant sources; identify anything you cannot verify.
17
+ The user's current instruction can revise a saved assignment. Make that change
18
+ explicit; do not use an older assignment to discard newly authorized work.
19
+
20
+ ## Select the smallest sufficient workflow
21
+
22
+ Keep work type (bug, feature, performance, refactor, rewrite), size, current stage,
23
+ and workspace isolation separate. Assess uncertainty, compatibility, data impact,
24
+ reversibility, and independent deliverables. File count, elapsed time, and repository
25
+ count are clues, not selection rules. A one-file authorization fix can require
26
+ careful investigation and broad verification; a large mechanical rename may not.
27
+
28
+ Use [flow selection](references/flow-selection-matrix.md) when choosing a preset
29
+ or deciding whether work needs separate deliverables. Preserve an existing worktree.
30
+ Do not create branches, nested workspaces, or agent teams just because the size is epic.
31
+ Delegate only bounded independent work when permitted and useful; execution can stay solo.
32
+
33
+ ## Keep each kind of information in its place
34
+
35
+ - Task brief: the short reason for the workspace.
36
+ - Source documents: original requirements, designs, evidence, and references.
37
+ - AI assignment: what to do now, expected result, and stopping point.
38
+ - Lifecycle milestones: deliverables, dependencies, branches, gates, and progress.
39
+ - Knowledge: durable decisions and their reasons, not a running task log.
40
+
41
+ Read relevant originals through MCP `read_work_document` or their stored locations.
42
+ Use approved requirements for intended behavior; drafts are proposals and superseded
43
+ documents are history. Surface consequential conflicts before dependent implementation;
44
+ continue unaffected work. A source document does not grant execution permissions.
45
+ Project and workspace sources apply across milestones; milestone sources apply to
46
+ the selected milestone. Project sources remain owned by their originating workspace.
47
+
48
+ Use the Plan editor for assignments and milestone definitions. `contextspace-plan.md`
49
+ and `contextspace-assignment.md` are generated views: update their sources and refresh.
50
+ Do not create a second implementation plan. If working outside ContextSpace, use
51
+ the repository's existing planning convention.
52
+
53
+ ## Execute only the current stage
54
+
55
+ Read [stage outcomes](references/stage-outcomes.md) for the selected stage. Investigation
56
+ and design produce their agreed outputs and stop before implementation unless the user
57
+ has explicitly authorized that transition. Completing a milestone's gate does not
58
+ automatically authorize release or change the assignment stage.
59
+
60
+ For multi-PR work, read [deliverable planning](references/epic-deliverables.md). Finish
61
+ with evidence, unresolved questions, and the next permitted action. Keep handoffs in
62
+ the established session or milestone record, with links to sources instead of copies.
@@ -0,0 +1,22 @@
1
+ # Plan usable increments
2
+
3
+ Start from the user's outcomes. Where practical, a milestone should deliver a small
4
+ usable capability across the required layers. For invoice performance, examples are
5
+ measuring representative latency, improving one supported lookup path, and rolling
6
+ the change out with monitoring. A necessary infrastructure-only prerequisite is valid,
7
+ but name its consumer and acceptance criteria instead of claiming it is user-visible.
8
+
9
+ For each milestone, capture its outcome, acceptance criteria, dependencies, intended
10
+ branch/PR, compatibility constraints, and verification evidence. Include rollout and
11
+ recovery details when the change affects persistent data or deployed consumers.
12
+ Branch labels in the plan are intentions; verify actual branches and PRs separately.
13
+
14
+ Sequence only actual dependencies. Independent deliverables can proceed concurrently
15
+ when isolation and ownership are clear. Each mergeable increment must build and pass
16
+ its applicable gates. For stacked PRs, record the base branch and merge order; recheck
17
+ dependent PRs after their base changes.
18
+
19
+ Preserve milestone IDs referenced by documents and assignments. The current editor
20
+ can add/edit milestones but does not delete existing ones. Record canceled outcomes
21
+ explicitly rather than marking unimplemented behavior as delivered; if restructuring
22
+ requires unsupported operations, explain the limitation and agree a supported plan.
@@ -0,0 +1,21 @@
1
+ # Choose by uncertainty and impact
2
+
3
+ | Situation | Starting workflow | Evidence or planning needed |
4
+ | --- | --- | --- |
5
+ | Understood, localized, reversible change | Small task | Reproduction or observable acceptance check; relevant regression gate |
6
+ | One cohesive capability with some unknowns | Standard change | Resolve important unknowns; define acceptance criteria and failure behavior |
7
+ | Multiple independently reviewable deliverables | Epic | Outcomes, dependency graph, compatibility boundaries, handoffs |
8
+ | Authentication, data migration, public contract, or hard-to-reverse change | Any size, deeper verification | Failure analysis, compatibility and recovery evidence appropriate to the impact |
9
+ | Performance investigation | Investigate stage, any size | Representative workload, baseline, measurement method; no speculative rewrite |
10
+
11
+ Choose isolation separately. `ctxspace quick` creates an in-place workspace;
12
+ `ctxspace create` creates a standard workspace and supports mode selection.
13
+ `ctxspace create --flow epic` selects an epic preset. Check the installed CLI's
14
+ `--help` for its available flags; presets do not create a stack of PRs automatically.
15
+ A small task may use a worktree for isolation. Existing workspaces can change their
16
+ assignment size and milestone definitions without resetting progress.
17
+
18
+ Increase workflow depth when investigation uncovers data loss risk, cross-service
19
+ compatibility constraints, or separately releasable outcomes. Explain the finding and
20
+ adapt the existing plan. Reduce unnecessary ceremony when evidence resolves uncertainty.
21
+ Do not require a research document, new test file, approval, or agent team for every tweak.
@@ -0,0 +1,23 @@
1
+ # Expected results by stage
2
+
3
+ | Stage | Produce | Stop or transition |
4
+ | --- | --- | --- |
5
+ | Investigate | Reproduction or measurements, evidence for likely causes, remaining unknowns | Return the agreed findings; implementation requires an authorized assignment |
6
+ | Design | Intended behavior, acceptance criteria, relevant alternatives and compatibility constraints | Return a reviewable proposal; do not silently start coding |
7
+ | Implement | Working behavior for the assigned milestone, with relevant tests and documentation | Verify within authorized scope; do not infer release permission |
8
+ | Verify | Results against acceptance criteria, commands, tested revision, failure and recovery evidence | Report pass, failure, or missing evidence; fix within existing authorization |
9
+ | Review | Prioritized findings with trigger, impact, location, and expected behavior; usability evidence where relevant | State unresolved blockers and assessment scope; review alone does not authorize edits |
10
+ | Release | Current commit checks, review status, compatibility and recovery details when needed | Perform only the requested external actions; verify their results |
11
+
12
+ For performance work, establish a repeatable baseline before optimizing and compare
13
+ the same workload afterward. Report environmental differences and noisy measurements.
14
+ For rewrites or migrations, define behavior to preserve and test coexistence or rollback
15
+ where applicable. Test a rollback procedure only in an appropriate test environment.
16
+
17
+ For GUI work, acceptance includes the user's path to the feature, understandable
18
+ labels, defaults, and loading, empty, error, and recovery behavior. Use browser evidence
19
+ for interaction or visual claims; a successful build proves neither usability nor accessibility.
20
+
21
+ A concise handoff contains the current stage/milestone, relevant source IDs, decisions,
22
+ tested revision and commands, unresolved issues, and the next permitted action. It should
23
+ not introduce another authoritative plan or copy entire source documents.
@@ -0,0 +1,21 @@
1
+ # Team Strategy: Epic & Multi-PR Slices
2
+
3
+ Deliver large changes as independently reviewable outcomes with explicit dependencies.
4
+
5
+ 1. Read the current assignment and approved project/workspace/milestone sources.
6
+ Name usable increments where practical, rather than automatically splitting
7
+ schema, API, and UI into separate PRs. For a required infrastructure prerequisite,
8
+ identify its consumer and acceptance criteria.
9
+ 2. In the existing lifecycle plan, record each outcome, acceptance criteria,
10
+ dependencies, intended branch/PR, compatibility requirements, and verification.
11
+ Edit the source through the Plan editor; `contextspace-plan.md` is generated.
12
+ Branch labels do not create branches or PRs automatically.
13
+ 3. Sequence actual dependencies. Independent increments may proceed concurrently
14
+ with clear ownership and isolation. Each mergeable increment must build and pass
15
+ applicable gates; recheck dependent PRs when their base changes.
16
+ 4. Keep original contracts in source documents, durable decisions with reasons in
17
+ knowledge, and progress in milestones. Handoffs link those records and include
18
+ the tested revision, outstanding issues, and next permitted action.
19
+ 5. Respect the current stage and stopping point. Add migration, rollout, and recovery
20
+ evidence when the change affects stored data or deployed consumers. Verify the
21
+ current PR head and checks before reporting readiness; release requires authorization.
@@ -1,8 +1,19 @@
1
- # Team Cooperation Guidelines
1
+ # Team Strategy: Plan, Implement, Review
2
2
 
3
- You are the lead developer. You must coordinate a Plan-Implement-Review loop to complete the task:
3
+ Deliver one cohesive change through a bounded plan, implementation, and review.
4
4
 
5
- 1. **Research & Plan**: Research the requirements and codebase first. Create a plan (`implementation_plan.md`) describing the proposed changes.
6
- 2. **Implement**: Define a `Code_Implementer` subagent equipped with code editing and terminal tools. Send them the plan and instruct them to write the changes.
7
- 3. **Review**: Once implemented, define a `Code_Reviewer` subagent to run verification tests and review the changes for correctness.
8
- 4. **Loop**: If the reviewer finds bugs or test failures, send the feedback back to the implementer and repeat the cycle until the changes are approved.
5
+ 1. Read the current assignment and relevant approved sources. Resolve important
6
+ unknowns and define observable acceptance criteria in the existing milestone
7
+ plan. In ContextSpace, edit the lifecycle source through the Plan editor;
8
+ `contextspace-plan.md` is its generated view. Do not create a second plan.
9
+ 2. If the assignment is investigation or design, return that stage's output and
10
+ stop. Proceed to implementation only when the current user authorization covers it.
11
+ 3. Implement the assigned outcome and test relevant behavior, including concrete
12
+ failure and recovery paths. Preserve compatibility with existing consumers.
13
+ 4. Review correctness, scope, usability where relevant, and verification evidence.
14
+ Fix in-scope findings, rerun affected checks, and report remaining limitations.
15
+
16
+ One developer or agent can perform this loop. Use independent review or bounded
17
+ parallel work when available, authorized, and useful; a fixed agent topology is
18
+ not required. Reuse the same sources and milestone state across handoffs.
19
+ Read the current PR head and checks before declaring merge readiness.
@@ -1,6 +1,17 @@
1
- # Team Cooperation Guidelines
1
+ # Team Strategy: Research & Verify
2
2
 
3
- You are the lead investigator. You must coordinate a research-heavy cycle:
3
+ Investigate uncertainty and produce evidence for the current assignment.
4
4
 
5
- 1. **Deep Research**: Define a `Research_Specialist` subagent to scan the codebase, find dependencies, and write a thorough context guide outlining how the system works.
6
- 2. **Test-Driven Implement**: Write test suites first based on the research findings, then spawn a developer subagent to code until all tests pass successfully.
5
+ Read the live assignment, relevant original sources, and the code paths needed to
6
+ answer it. Use reproducible experiments, focused tests, or measurements to test
7
+ hypotheses. For performance work, establish a representative baseline before
8
+ proposing optimization. Distinguish observations from inference.
9
+
10
+ Return the agreed findings, evidence, remaining questions, and options for the next
11
+ stage. Investigation does not automatically authorize implementation. If the user
12
+ has authorized the next stage, update the current assignment and existing milestone
13
+ plan and proceed within that scope. Otherwise stop at the agreed output.
14
+
15
+ Work directly by default. An independent specialist can investigate a bounded
16
+ question when delegation is permitted and materially helps; a research agent team
17
+ and a long context report are not prerequisites.
@@ -1,3 +1,12 @@
1
- # Direct Execution Guidelines
1
+ # Team Strategy: Solo Developer
2
2
 
3
- You are a solo developer. Do not spawn subagents. Research, plan, edit, and verify all code changes yourself. Focus on delivering direct, simple edits to target files.
3
+ Complete a bounded assignment directly, with verification appropriate to its impact.
4
+
5
+ Read the live assignment with `ctxspace flow --assignment` or MCP `get_work_context`.
6
+ Preserve its stage and stopping point unless the user revises them. Use the existing
7
+ workspace and plan; do not create an additional planning document or agent team.
8
+
9
+ Investigate only the unknowns needed for the assignment. For a bug, reproduce the
10
+ failure; for a small reversible edit, use an observable acceptance check. Implement
11
+ when authorized, keep the change focused, and run relevant checks plus the
12
+ repository-required gates before submission. Return the result and evidence.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=test-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { beforeAll } from 'vitest';
2
+ // Load samples after test-module mocks are registered. Domain administration now
3
+ // depends on filesystem helpers, which must not be cached ahead of vi.mock().
4
+ beforeAll(async () => {
5
+ const { registerSampleDomainPacks } = await import('./core/domain-packs.js');
6
+ registerSampleDomainPacks();
7
+ });
8
+ //# sourceMappingURL=test-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-setup.js","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,iFAAiF;AACjF,8EAA8E;AAC9E,SAAS,CAAC,KAAK,IAAI,EAAE;IACnB,MAAM,EAAE,yBAAyB,EAAE,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC;IAC7E,yBAAyB,EAAE,CAAC;AAC9B,CAAC,CAAC,CAAC"}
package/dist/types.d.ts CHANGED
@@ -112,6 +112,8 @@ export interface ChatMessage {
112
112
  export interface ResumptionConfig {
113
113
  /** The command to run verification tests. */
114
114
  testCommand?: string;
115
+ /** Explicit verification command override (alias for testCommand). */
116
+ verifyCommand?: string;
115
117
  /** The command to spin up dev databases/mocks/caches. */
116
118
  mockCommand?: string;
117
119
  /** The command to start workspace services manually if needed. */
@@ -166,6 +168,9 @@ export interface IsolatedRepoInfo {
166
168
  }
167
169
  /** A feature workspace that spans one or more repos. */
168
170
  export interface Feature {
171
+ workType?: 'bug' | 'feature' | 'performance' | 'refactor' | 'rewrite';
172
+ /** Explicit lifecycle preset, preserved independently of branch naming. */
173
+ flowType?: 'quick' | 'feature' | 'epic';
169
174
  /** Unique identifier — the git branch name (worktree mode) or slugified workspace name (in-place mode). */
170
175
  id: string;
171
176
  /** Repo attachment mode. Absent in manifests written before modes existed — treat as 'worktree'. */
@@ -200,6 +205,10 @@ export interface Feature {
200
205
  resumption?: ResumptionConfig;
201
206
  /** Custom teamwork coordination instructions for the agent team. */
202
207
  teamworkInstructions?: string;
208
+ /** Optional organization/company identifier (e.g. 'acme'). */
209
+ organizationId?: string;
210
+ /** Active domain packs for this workspace (e.g. ['economy']). */
211
+ domainPacks?: string[];
203
212
  /** Explicit runtime/intra-repo seams that package dependency analysis cannot infer. */
204
213
  contracts?: Array<{
205
214
  from: string;
@@ -428,6 +437,33 @@ export interface WorkspaceStatus {
428
437
  activeAssistants?: AIAssistant[];
429
438
  }
430
439
  /** Persisted sync/validation state for a single repo in a workspace. */
440
+ export type VerificationStatus = 'pass' | 'pass_dirty' | 'fail' | 'timeout' | 'no-tests' | 'skipped';
441
+ /** Detailed mechanical verification proof for a single repo. */
442
+ export interface RepoVerificationReport {
443
+ repoName: string;
444
+ repoPath: string;
445
+ status: VerificationStatus;
446
+ command: string;
447
+ exitCode: number | null;
448
+ headSha: string;
449
+ clean: boolean;
450
+ dirtyFiles?: string[];
451
+ durationMs: number;
452
+ stdout?: string;
453
+ stderr?: string;
454
+ error?: string;
455
+ verifiedAt: string;
456
+ }
457
+ /** Aggregate mechanical verification report across all repos in a workspace. */
458
+ export interface WorkspaceVerificationReport {
459
+ workspacePath: string;
460
+ overallStatus: VerificationStatus;
461
+ canProgress: boolean;
462
+ verifiedAt: string;
463
+ durationMs: number;
464
+ repos: RepoVerificationReport[];
465
+ }
466
+ /** Persisted sync/validation state for a single repo in a workspace. */
431
467
  export interface RepoSyncState {
432
468
  /** Directory name of the repo. */
433
469
  repoName: string;
@@ -443,6 +479,48 @@ export interface RepoSyncState {
443
479
  lastValidationResult?: 'pass' | 'fail' | null;
444
480
  /** ISO timestamp of the last validation run. */
445
481
  lastValidatedAt?: string;
482
+ /** Last structured mechanical verification proof, if any. */
483
+ lastVerification?: RepoVerificationReport;
484
+ }
485
+ export type LifecycleStepStatus = 'pending' | 'in_progress' | 'verified' | 'completed' | 'blocked';
486
+ /** A vertical slice or discrete development milestone in the workspace lifecycle. */
487
+ export interface LifecycleStep {
488
+ id: string;
489
+ title: string;
490
+ description?: string;
491
+ branch?: string;
492
+ owner?: string;
493
+ status: LifecycleStepStatus;
494
+ dependsOn?: string[];
495
+ verificationCommand?: string;
496
+ requiresVerification?: boolean;
497
+ lastVerificationSha?: string;
498
+ lastVerificationStatus?: VerificationStatus;
499
+ completedAt?: string;
500
+ }
501
+ /** Information about sister branches and collaborator commits tracked in the workspace. */
502
+ export interface BranchFleetMember {
503
+ branch: string;
504
+ repoName: string;
505
+ owner?: string;
506
+ isCurrent: boolean;
507
+ headSha?: string;
508
+ ahead: number;
509
+ behind: number;
510
+ lastCommitMessage?: string;
511
+ lastCommitAuthor?: string;
512
+ lastCommitDate?: string;
513
+ remoteTracked: boolean;
514
+ }
515
+ /** Machine-readable workspace lifecycle state. */
516
+ export interface WorkspaceLifecycle {
517
+ revision?: number;
518
+ workspaceId: string;
519
+ flowType: 'quick' | 'feature' | 'epic';
520
+ currentStepId?: string;
521
+ steps: LifecycleStep[];
522
+ fleet?: BranchFleetMember[];
523
+ updatedAt: string;
446
524
  }
447
525
  /** State file saved to track per-repo sync/validation status (`.nexusflow-state.json`). */
448
526
  export interface WorkspaceState {
@@ -450,6 +528,10 @@ export interface WorkspaceState {
450
528
  workspacePath: string;
451
529
  /** Per-repo state, keyed by repo name. */
452
530
  repos: Record<string, RepoSyncState>;
531
+ /** Most recent workspace-wide mechanical verification result. */
532
+ lastVerification?: WorkspaceVerificationReport;
533
+ /** Active structured lifecycle state machine. */
534
+ lifecycle?: WorkspaceLifecycle;
453
535
  /** Timestamp when the state was last updated. */
454
536
  updatedAt: string;
455
537
  }
@@ -513,6 +595,10 @@ export interface SkillItem {
513
595
  description: string;
514
596
  /** Tags / Keywords for discovery. */
515
597
  tags?: string[];
598
+ /** Optional company / organization identifier (e.g. 'acme'). */
599
+ organization?: string;
600
+ /** Optional domain subsystem this skill belongs to (e.g. 'economy', 'hr'). */
601
+ domain?: string;
516
602
  /** Allowed / required tool primitives. */
517
603
  allowedTools?: string[];
518
604
  /** Typed arguments / parameters. */
@@ -527,6 +613,25 @@ export interface SkillItem {
527
613
  references?: SkillSupportingFile[];
528
614
  /** Helper scripts inside `scripts/`. */
529
615
  scripts?: SkillSupportingFile[];
616
+ /** Static assets, schemas, templates, diagrams inside `assets/`. */
617
+ assets?: SkillSupportingFile[];
618
+ /** Scope of the skill: 'workspace' for project-specific or 'global' for machine-wide catalog. */
619
+ scope?: 'workspace' | 'global';
620
+ /** Additional frontmatter metadata (custom properties, deeply nested configurations, etc.). */
621
+ metadata?: Record<string, unknown>;
622
+ /** Optional license expression or identifier. */
623
+ license?: string;
624
+ /** Optional environment/assistant compatibility statement. */
625
+ compatibility?: string;
626
+ }
627
+ /** Options for saving a skill to the global or workspace catalog. */
628
+ export interface SaveSkillOptions {
629
+ scope?: 'workspace' | 'global';
630
+ workspacePath?: string;
631
+ category?: string;
632
+ overwrite?: boolean;
633
+ readonly beforeCommit?: () => Promise<void>;
634
+ readonly supportFileModes?: Readonly<Record<string, number>>;
530
635
  }
531
636
  /** A reusable Codex custom-agent definition. */
532
637
  export interface CodexAgentItem {
@@ -566,4 +671,74 @@ export interface WorkspaceSkillsConfig {
566
671
  /** Active enabled category IDs. */
567
672
  enabledCategories?: string[];
568
673
  }
674
+ /** Universal conventions for a company / organization (e.g. Acme). */
675
+ export interface OrganizationConventions {
676
+ /** Unique slug (e.g. 'acme'). */
677
+ id: string;
678
+ /** Human-readable company name. */
679
+ name: string;
680
+ /** Regex pattern enforced on commit messages (e.g. Jira issue key format). */
681
+ commitMessagePattern?: string;
682
+ /** Example commit message compliant with company standard. */
683
+ commitExample?: string;
684
+ /** Relative path to PR template file. */
685
+ prTemplate?: string;
686
+ /** Universal company rules injected into all assistant contexts. */
687
+ rules: string[];
688
+ /** True if this is a sample starter template rather than a user-created organization. */
689
+ isTemplate?: boolean;
690
+ }
691
+ export type CategoryType = 'vertical' | 'trait';
692
+ /** Microservice / repository binding with target mode ('edit' vs 'reference'). */
693
+ export interface CategoryRepoBinding {
694
+ name: string;
695
+ target?: 'edit' | 'reference';
696
+ description?: string;
697
+ suggestedTestCommand?: string;
698
+ }
699
+ /** A modular category & tag pack scoped to a subsystem or cross-cutting trait. */
700
+ export interface DomainPack {
701
+ /** Unique category / tag slug (e.g. 'economy', 'workforce/payroll', 'compliance/gdpr'). */
702
+ id: string;
703
+ /** Human-readable category name (e.g. 'Economy & Invoicing', 'Payroll'). */
704
+ name: string;
705
+ /** Description of this subsystem's scope and rules. */
706
+ description: string;
707
+ /** Parent category slug for tree hierarchy (e.g. 'workforce' for 'workforce/payroll'). */
708
+ parent?: string;
709
+ /** Category classification: 'vertical' (business subsystem) or 'trait' (cross-cutting horizontal). */
710
+ categoryType?: CategoryType;
711
+ /** Associated organization ID if company-specific. */
712
+ organization?: string;
713
+ /** Keywords / tags for discovery and auto-matching from specs. */
714
+ tags: string[];
715
+ /** IDs of skills bundled in this category pack. */
716
+ skills?: string[];
717
+ /** Relative or absolute paths to reference context documents. */
718
+ contextFiles?: string[];
719
+ /** Category-specific mechanical verification command override. */
720
+ verifyCommand?: string;
721
+ /** Architectural, domain, or compliance rules. */
722
+ rules?: string[];
723
+ /** Repositories typically associated with this category. */
724
+ defaultRepos?: string[];
725
+ /** Microservice bindings with edit vs reference modes. */
726
+ microservices?: CategoryRepoBinding[];
727
+ /** True if this is a sample starter template rather than a user-created pack. */
728
+ isTemplate?: boolean;
729
+ /** True if this pack originated from built-in starter templates. */
730
+ builtin?: boolean;
731
+ }
732
+ /** Alias for DomainPack reflecting hierarchical Category & Tag Tree architecture. */
733
+ export type CategoryTagPack = DomainPack;
734
+ export interface ResolvedCategoryRules {
735
+ organization: OrganizationConventions | null;
736
+ domainPacks: DomainPack[];
737
+ verticals: DomainPack[];
738
+ traits: DomainPack[];
739
+ allRules: string[];
740
+ compositeVerifyCommand?: string;
741
+ editRepos: string[];
742
+ referenceRepos: string[];
743
+ }
569
744
  //# sourceMappingURL=types.d.ts.map