feat: add cadre init interactive scaffolding command (#15) (#15)#22
Merged
feat: add cadre init interactive scaffolding command (#15) (#15)#22
cadre init interactive scaffolding command (#15) (#15)#22Conversation
# Conflicts: # fix-result-integration-fix-test.md # src/index.ts
This was referenced Feb 23, 2026
jafreck
added a commit
that referenced
this pull request
Feb 26, 2026
When running in DAG mode, the fleet orchestrator now logs the computed wave plan before executing any waves. Example output: DAG wave plan: Wave 0 → [#10, #12] | Wave 1 → [#15] | Wave 2 → [#20, #22] This makes it easy to verify the dependency resolution and execution order from logs without inspecting the fleet checkpoint file.
jafreck
added a commit
that referenced
this pull request
Feb 26, 2026
When running in DAG mode, the fleet orchestrator now logs the computed wave plan before executing any waves. Example output: DAG wave plan: Wave 0 → [#10, #12] | Wave 1 → [#15] | Wave 2 → [#20, #22] This makes it easy to verify the dependency resolution and execution order from logs without inspecting the fleet checkpoint file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the
cadre initCLI subcommand that interactively scaffolds a complete CADRE project configuration. Users can now runnpx cadre initto launch a guided wizard that generates a validcadre.config.json, updates.gitignore, and creates the.github/agents/directory — eliminating the need to manually author the config from scratch.Closes #15
Changes
package.json/package-lock.json: Added@inquirer/promptsas a runtime dependency for interactive CLI prompts.src/cli/prompts.ts(new): Prompt definitions and isolated validator functions (validateProjectName,validateRepoPath,validateGitHubRepository,validateAzureDevOpsRepository,validateNonEmpty). ExportscollectAnswers(yes, repoPathOverride?)which returns a typed answers object.src/cli/init.ts(new): CorerunInit(opts)orchestrator that checks for a.gitdirectory, optionally prompts for overwrite confirmation on existing configs, assembles and validates aCadreConfigviaCadreConfigSchema.parse(), writescadre.config.jsonatomically, manages.gitignore, and creates.github/agents/.src/index.ts: Registered theinitsubcommand with Commander, including-y/--yes(non-interactive mode) and--repo-path <path>options, following the same pattern as existing commands.tests/init.test.ts(new): 25 unit tests covering git-check failure, overwrite confirmation,--yesmode, config schema validation,.gitignorededuplication, and.github/agents/directory creation.tests/prompts.test.ts(new): 30 unit tests for all validator functions (valid and invalid inputs forprojectName,repoPath, GitHub/Azure DevOps repository formats, and non-empty strings).Implementation Details
The implementation follows a clean separation of concerns:
prompts.tsowns all field-level validation logic and prompt definitions;init.tsowns orchestration and file I/O. The--yesflag short-circuits all interactive prompts and applies documented defaults (repoPath → cwd,baseBranch → main,issues → { query: { state: 'open', limit: 10 } },github.auth → { token: '${GITHUB_TOKEN}' }). Config assembly always runs throughCadreConfigSchema.parse()before any file is written, ensuring structural correctness. File writes use the existingatomicWriteJSONutility fromsrc/util/fs.ts.Testing
tests/init.test.tscovering allrunInitcode pathstests/prompts.test.tscovering all validatorsnpx vitest runtests/github-issues.test.tsis unrelated to this feature (stale MCP tool name assertion)Integration Verification
npm run buildexits 0)Notes
copilotfor now; adding theclaudeoption is deferred to issue Multi-backend agent launcher: native support for Copilot CLI, Claude CLI, and direct API #3..github/agents/directory is created but no stub prompt files are scaffolded; agent file scaffolding is delegated to a separate sub-issue per the original spec.tokenandapponly.--repo-pathflag is accepted as a CLI option and passed through torunInit; it overrides both the.gitcheck path and the defaultrepoPathin generated config.Cadre Process Challenges
--repo-pathflag appeared only in the acceptance criteria without being listed in the detailed prompt/flag spec; and the non-interactive defaults for issue selection mode and auth method were not fully enumerated.opts.repoPathfromrunInittocollectAnswers, requiring a fix-surgeon pass. The signature mismatch was subtle and not caught until tests were written.atomicWriteJSON,ensureDir) were discovered during exploration rather than documented in the issue.tests/github-issues.test.ts(staleget_issuevsissue_readMCP tool name). A fix-surgeon agent was dispatched to fix this test, but the fix introduced only a test assertion update — the production code was already correct.--yesdefaults) and once for the pre-existing test failure; both retries converged on correct fixes without additional iteration.--repo-pathscoping) that required judgment calls during code-writing, followed by a fix-surgeon pass to resolve the resulting issues found in code review.Closes #15