-
Notifications
You must be signed in to change notification settings - Fork 0
feat(outfitter): add init command with project scaffolding #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: p3-22/daemon/ipc-health
Are you sure you want to change the base?
Conversation
c4267ec to
e7c2227
Compare
c46e6c9 to
309bcd4
Compare
e7c2227 to
7cb5483
Compare
309bcd4 to
322e6c4
Compare
77259f9 to
445f46f
Compare
13942e6 to
42a3d3b
Compare
Greetings Summary
|
| Filename | Overview |
|---|---|
| apps/outfitter/src/commands/init.ts | Core scaffolding logic with potential binary name extraction bug in package.json parsing |
| apps/outfitter/package.json | New CLI package configuration establishing the umbrella tool with proper dependencies and binary setup |
Confidence score: 4/5
- This PR is generally safe to merge with careful review of the binary name logic
- Score reflects solid architecture and comprehensive implementation, but lowered due to potential bug in binary name resolution from package.json objects
- Pay close attention to
apps/outfitter/src/commands/init.tslines 222-232 for the binary name extraction logic
Sequence Diagram
sequenceDiagram
participant User
participant CLI as "CLI (cli.ts)"
participant InitCmd as "InitCommand"
participant FS as "File System"
participant Templates as "Template Directory"
participant Prompts as "@clack/prompts"
User->>CLI: "outfitter init [directory]"
CLI->>InitCmd: "runInit(options)"
InitCmd->>FS: "resolve target directory"
InitCmd->>FS: "read existing package.json"
InitCmd->>Prompts: "prompt for project name"
Prompts->>User: "Project name?"
User->>Prompts: "enter name"
InitCmd->>Prompts: "prompt for binary name"
Prompts->>User: "Binary name?"
User->>Prompts: "enter bin name"
InitCmd->>Templates: "validate template exists"
Templates->>InitCmd: "template path"
InitCmd->>Templates: "read template files"
InitCmd->>InitCmd: "replace placeholders in content"
InitCmd->>FS: "create target directory"
InitCmd->>FS: "copy processed files"
InitCmd->>CLI: "success result"
CLI->>User: "Project initialized successfully"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9 files reviewed, 1 comment
| if (typeof bin === "string") { | ||
| if (resolvedName) { | ||
| resolvedBin = deriveBinName(resolvedName); | ||
| } | ||
| } else if (typeof bin === "object" && bin !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Logic issue: when bin is a string, you derive the bin name from the project name, but you should use the string value of bin directly
| if (typeof bin === "string") { | |
| if (resolvedName) { | |
| resolvedBin = deriveBinName(resolvedName); | |
| } | |
| } else if (typeof bin === "object" && bin !== null) { | |
| if (typeof bin === "string") { | |
| resolvedBin = bin; | |
| } else if (typeof bin === "object" && bin !== null) { |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/outfitter/src/commands/init.ts
Line: 223:227
Comment:
**logic:** Logic issue: when `bin` is a string, you derive the bin name from the project name, but you should use the string value of `bin` directly
```suggestion
if (typeof bin === "string") {
resolvedBin = bin;
} else if (typeof bin === "object" && bin !== null) {
```
How can I resolve this? If you propose a fix, please make it concise.445f46f to
c054bed
Compare
42a3d3b to
2bc18cb
Compare
|
Updated init test to avoid interactive prompts (force isTTY false) and use .js ESM import. Pre-push test hook ran clean. |
|
Addressed review feedback: init now uses string "bin" values directly from package.json, and added outfitter init smoke coverage (missing-template error + public API export check) so bun test runs in the app package. |
2bc18cb to
a826534
Compare
c054bed to
4ea0f4d
Compare
|
Restacked after downstack update (formatRelative test stabilization); no additional changes in this PR. |
4ea0f4d to
1bf4162
Compare
a826534 to
4159d2a
Compare
|
Reviewed greptile note on bin handling — string values are used directly (no derivation) and the prompt flow remains name → bin with fallback. Restacked and resubmitted. |
1bf4162 to
aa9d003
Compare
4159d2a to
23f0e8b
Compare

Add outfitter CLI with init command for new projects:
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com
Contributes to #57