Motivation
Directive currently assumes the project being worked on can host Directive artifacts such as .deft/core/, AGENTS.md, vbrief/, cache state, and project definition files. That works for repos that choose to vendor or install Directive, but it blocks an important workflow:
I want to use Directive to reason about, plan, triage, and manage vBRIEF lifecycle work for a GitHub repo that has not vendored Directive and may never do so.
This matters especially for open source repos where I may not have maintainer rights, do not want to open a scaffolding PR just to use Directive, or want to keep planning state private until it is ready to become an upstream issue or PR.
This also connects to the npm/package direction in #11 and the TypeScript migration RFC #1530. If Directive becomes available through npm or another package manager, the CLI should be useful against repos that do not already contain Directive files.
Proposal
Add an external workspace mode to Directive.
In this mode, Directive separates:
- Target repo: the GitHub repository being analyzed or worked on.
- Directive workspace: a separate local directory or user-owned repo where Directive artifacts live.
The target repo remains clean. Directive reads it for facts, source files, issues, commits, and repository metadata, but writes vBRIEF and Directive state into the external workspace unless the user explicitly asks to export or propose changes upstream.
Example workspace layout:
directive-workspace/
repos/
github.com/
deftai/
directive/
PROJECT-DEFINITION.vbrief.json
vbrief/
proposed/
pending/
active/
completed/
cancelled/
.deft-cache/
notes/
some-org/
some-open-source-repo/
PROJECT-DEFINITION.vbrief.json
vbrief/
.deft-cache/
Desired User Experience
A user should be able to run something like:
deft workspace init ~/directive-workspace
deft workspace attach https://github.com/some-org/some-repo --workspace ~/directive-workspace
deft status --target https://github.com/some-org/some-repo --workspace ~/directive-workspace
deft triage issue 123 --target https://github.com/some-org/some-repo --workspace ~/directive-workspace
Possible npm-oriented usage:
npx @deftai/directive workspace attach https://github.com/some-org/some-repo
Directive should infer the workspace when possible, but the boundary must stay explicit in diagnostics:
- "Reading target repo:
some-org/some-repo"
- "Writing Directive state:
~/directive-workspace/repos/github.com/some-org/some-repo/"
Why Not Just Vendor Directive?
Vendoring remains useful for repos that want Directive as part of their own workflow. This proposal is for a different case:
- The target repo is not mine.
- The target repo is public/open source.
- I want private planning before proposing upstream work.
- I want durable vBRIEF history across many repos.
- I do not want Directive artifacts in the target repo's git history.
- I want package-manager usage, such as
npx, to work without a repo-local install.
State Location Options
The preferred default is a separate user-owned Directive workspace repo.
Pros:
- Durable and portable across machines.
- Can be private even when target repos are public.
- Git-backed history for vBRIEFs and decisions.
- Supports many target repos under one workspace.
- Avoids upstream repo pollution.
Local app data may be useful for cache or throwaway exploration, but should not be the canonical source of truth for serious vBRIEF lifecycle state.
A branch or fork of the target repo may be useful as an export/publish path, but should not be the default because it still requires write permissions or branch/fork management.
Requirements
- Directive can initialize an external workspace outside the target repo.
- Directive can attach a GitHub remote URL to a stable workspace path.
- vBRIEF lifecycle files can be created and managed in the workspace without modifying the target repo.
- Directive records target repo provenance, including owner/repo, remote URL, default branch, and observed commit SHA.
- Commands clearly distinguish target reads from workspace writes.
- Cache/runtime state remains gitignored or separately governed inside the workspace.
- Existing vendored-repo behavior remains supported.
- Exporting artifacts back into the target repo, fork, issue, or PR requires explicit user action.
Non-Goals
- Replacing the vendored install model for repos that want Directive in-tree.
- Requiring npm specifically as the only delivery mechanism.
- Writing to target repos by default.
- Solving full multi-repo program orchestration in the first slice.
Acceptance Criteria
- A user can create a Directive workspace in a separate directory or repo.
- A user can attach at least one GitHub repo URL to that workspace.
- Directive creates the expected project definition and vBRIEF lifecycle directories under the workspace namespace.
- Running a planning/triage flow for the target repo writes no files into the target checkout.
- Diagnostics and doctor output show both the target repo and workspace location.
- The workspace layout supports multiple target repos without path collisions.
- Documentation explains when to use vendored mode vs external workspace mode.
Related Issues
Motivation
Directive currently assumes the project being worked on can host Directive artifacts such as
.deft/core/,AGENTS.md,vbrief/, cache state, and project definition files. That works for repos that choose to vendor or install Directive, but it blocks an important workflow:I want to use Directive to reason about, plan, triage, and manage vBRIEF lifecycle work for a GitHub repo that has not vendored Directive and may never do so.
This matters especially for open source repos where I may not have maintainer rights, do not want to open a scaffolding PR just to use Directive, or want to keep planning state private until it is ready to become an upstream issue or PR.
This also connects to the npm/package direction in #11 and the TypeScript migration RFC #1530. If Directive becomes available through npm or another package manager, the CLI should be useful against repos that do not already contain Directive files.
Proposal
Add an external workspace mode to Directive.
In this mode, Directive separates:
The target repo remains clean. Directive reads it for facts, source files, issues, commits, and repository metadata, but writes vBRIEF and Directive state into the external workspace unless the user explicitly asks to export or propose changes upstream.
Example workspace layout:
Desired User Experience
A user should be able to run something like:
Possible npm-oriented usage:
Directive should infer the workspace when possible, but the boundary must stay explicit in diagnostics:
some-org/some-repo"~/directive-workspace/repos/github.com/some-org/some-repo/"Why Not Just Vendor Directive?
Vendoring remains useful for repos that want Directive as part of their own workflow. This proposal is for a different case:
npx, to work without a repo-local install.State Location Options
The preferred default is a separate user-owned Directive workspace repo.
Pros:
Local app data may be useful for cache or throwaway exploration, but should not be the canonical source of truth for serious vBRIEF lifecycle state.
A branch or fork of the target repo may be useful as an export/publish path, but should not be the default because it still requires write permissions or branch/fork management.
Requirements
Non-Goals
Acceptance Criteria
Related Issues
.deft/coredelivery and tracking