You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Export stack scaffolding primitives for setup reuse #1600
propr setup needs to initialize a stack directory as one wizard step. The existing propr init stack implementation already has the correct behavior: create data/, logs/, repos/, copy .env.example, detect credential directories, and persist stackRoot. Setup should reuse that logic instead of duplicating it.
Requirements
Export the existing stack scaffolding function and result type from initStack.ts.
Keep the propr init stack command behavior unchanged.
Ensure setup can call stack scaffolding without forcing overwrite.
Implementation Specification
Modify packages/cli/src/commands/initStack.ts to export the relevant types and function. If the current function is private, convert it to an exported function without changing its implementation.
Acceptance Criteria
Existing propr init stack tests continue to pass.
New setup code can import scaffoldStack directly.
Re-running setup against an initialized root does not overwrite .env unless an explicit force option is added later.
This change deliberately reuses the existing stack initializer as the single source of truth. Duplicating directory creation and .env generation inside setup would create drift, especially around agent credential detection and file permissions. The rejected alternative was shelling out to propr init stack, but direct function reuse gives better error handling and avoids spawning a nested CLI process.
File: packages/cli/src/commands/initStack.ts
Why this file:initStack.ts already owns stack scaffolding. Setup needs access to that implementation so both commands create identical runtime directories and .env files.
--- a/packages/cli/src/commands/initStack.ts+++ b/packages/cli/src/commands/initStack.ts
@@
-interface StackScaffoldResult {+export interface StackScaffoldResult {
@@
-async function scaffoldStack(options: StackScaffoldOptions): Promise<StackScaffoldResult> {+export async function scaffoldStack(options: StackScaffoldOptions): Promise<StackScaffoldResult> {+ // Export this helper so `propr setup` can reuse the exact same stack+ // initialization behavior. Keeping one implementation avoids subtle drift in+ // .env defaults, credential detection, and stackRoot persistence.
@@
}
Activity
propr-dev commentedon Jun 22, 2026
Suggested Implementation:
Implementation Approach
This change deliberately reuses the existing stack initializer as the single source of truth. Duplicating directory creation and
.envgeneration inside setup would create drift, especially around agent credential detection and file permissions. The rejected alternative was shelling out topropr init stack, but direct function reuse gives better error handling and avoids spawning a nested CLI process.File:
packages/cli/src/commands/initStack.tsWhy this file:
initStack.tsalready owns stack scaffolding. Setup needs access to that implementation so both commands create identical runtime directories and.envfiles.propr-dev commentedon Jun 22, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-4-8 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-4-81600/claude-opus-4-8-export-stack-scaffolding--20260622-0947-l9p1599-epic-build-comprehensive-b5cissue-1600-20260622-0947-claude-opus-4-8-l9p🔍 Track Task Execution