-
Notifications
You must be signed in to change notification settings - Fork 0
feat(templates): add daemon project template #94
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: p6/templates/mcp
Are you sure you want to change the base?
Conversation
e41a0ed to
ffb2001
Compare
e0d862c to
cb01622
Compare
cb01622 to
0e991da
Compare
ffb2001 to
08c120b
Compare
0e991da to
f30bd92
Compare
Greptile Summary
|
| Filename | Overview |
|---|---|
apps/outfitter/templates/daemon/src/daemon-main.ts.template |
Core daemon implementation with Unix socket server, health endpoints, lock management, and signal handling |
apps/outfitter/templates/daemon/src/cli.ts.template |
CLI control interface with start/stop/status commands, foreground/background execution modes, and HTTP-based daemon communication |
apps/outfitter/templates/cli/tsconfig.json.template |
TypeScript configuration with conflicting noEmit: true and output directory settings that prevents compilation |
apps/outfitter/templates/cli/src/program.ts.template |
CLI program template with redundant logging output using both structured logger and console.log |
Confidence score: 4/5
- This PR is mostly safe to merge but requires attention to several configuration issues and implementation details
- Score lowered due to TypeScript configuration conflicts in CLI template, redundant logging patterns, and missing strict TypeScript settings across multiple templates that don't fully align with project standards documented in CLAUDE.md
- Pay close attention to
apps/outfitter/templates/cli/tsconfig.json.templatewhich has conflicting compiler options, and review logging patterns in CLI program template for potential duplicate output
Sequence Diagram
sequenceDiagram
participant User
participant CLI as "CLI ({{binName}})"
participant DaemonProcess as "Daemon Process"
participant LockSystem as "Lock System"
participant UnixSocket as "Unix Socket Server"
participant FileSystem as "File System"
User->>CLI: "{{binName}} start"
CLI->>LockSystem: "isDaemonAlive(lockPath)"
LockSystem-->>CLI: "false"
CLI->>DaemonProcess: "spawn daemon process"
DaemonProcess->>FileSystem: "mkdir daemonDir"
DaemonProcess->>LockSystem: "acquireDaemonLock(lockPath)"
LockSystem-->>DaemonProcess: "lock acquired"
DaemonProcess->>UnixSocket: "Bun.serve({ unix: socketPath })"
UnixSocket-->>DaemonProcess: "server started"
DaemonProcess->>DaemonProcess: "setup signal handlers"
CLI-->>User: "Daemon started"
User->>CLI: "{{binName}} status"
CLI->>LockSystem: "isDaemonAlive(lockPath)"
LockSystem-->>CLI: "true"
CLI->>UnixSocket: "fetch /health"
UnixSocket-->>CLI: "health info"
CLI-->>User: "status and health data"
User->>CLI: "{{binName}} stop"
CLI->>LockSystem: "isDaemonAlive(lockPath)"
LockSystem-->>CLI: "true"
CLI->>UnixSocket: "POST /shutdown"
UnixSocket->>DaemonProcess: "shutdown signal"
DaemonProcess->>LockSystem: "releaseDaemonLock(lock)"
DaemonProcess->>UnixSocket: "server.stop()"
DaemonProcess->>DaemonProcess: "process.exit(0)"
CLI-->>User: "Daemon stopped"
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.
40 files reviewed, 10 comments
| logger.info`Hello, ${name}!`; | ||
| console.log(`Hello, ${name}!`); |
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.
style: Both structured logging and console.log output the same message, which may result in duplicate output. Should the console.log be removed since structured logging is already handling the output?
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/outfitter/templates/cli/src/program.ts.template
Line: 21:22
Comment:
**style:** Both structured logging and console.log output the same message, which may result in duplicate output. Should the console.log be removed since structured logging is already handling the output?
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.| "noEmit": true, | ||
| "declaration": true, | ||
| "declarationDir": "dist", | ||
| "outDir": "dist", |
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: Configuration conflict: noEmit: true prevents TypeScript from generating any files, but declaration, declarationDir, and outDir are set to produce outputs. Either remove noEmit to allow file generation or remove the output directory settings.
| "noEmit": true, | |
| "declaration": true, | |
| "declarationDir": "dist", | |
| "outDir": "dist", | |
| "declaration": true, | |
| "declarationDir": "dist", | |
| "outDir": "dist", |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/outfitter/templates/cli/tsconfig.json.template
Line: 9:12
Comment:
**logic:** Configuration conflict: `noEmit: true` prevents TypeScript from generating any files, but `declaration`, `declarationDir`, and `outDir` are set to produce outputs. Either remove `noEmit` to allow file generation or remove the output directory settings.
```suggestion
"declaration": true,
"declarationDir": "dist",
"outDir": "dist",
```
How can I resolve this? If you propose a fix, please make it concise.| "strict": true, | ||
| "noImplicitAny": true, | ||
| "strictNullChecks": true, | ||
| "noUncheckedIndexedAccess": true, | ||
| "noImplicitReturns": true, | ||
| "noFallthroughCasesInSwitch": true, |
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.
style: Missing exactOptionalPropertyTypes and noPropertyAccessFromIndexSignature settings mentioned in CLAUDE.md development principles
| "strict": true, | |
| "noImplicitAny": true, | |
| "strictNullChecks": true, | |
| "noUncheckedIndexedAccess": true, | |
| "noImplicitReturns": true, | |
| "noFallthroughCasesInSwitch": true, | |
| "strict": true, | |
| "noImplicitAny": true, | |
| "strictNullChecks": true, | |
| "noUncheckedIndexedAccess": true, | |
| "exactOptionalPropertyTypes": true, | |
| "noPropertyAccessFromIndexSignature": true, | |
| "noImplicitReturns": true, | |
| "noFallthroughCasesInSwitch": true, |
Context Used: Context from dashboard - CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/outfitter/templates/basic/tsconfig.json.template
Line: 10:15
Comment:
**style:** Missing `exactOptionalPropertyTypes` and `noPropertyAccessFromIndexSignature` settings mentioned in CLAUDE.md development principles
```suggestion
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
```
**Context Used:** Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=72baf8a2-698b-40bf-966d-5b799d03ad3b))
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.| "noEmit": true, | ||
| "declaration": true, | ||
| "declarationDir": "dist", | ||
| "outDir": "dist", |
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: noEmit conflicts with declaration generation - declarations won't be written to disk
| "noEmit": true, | |
| "declaration": true, | |
| "declarationDir": "dist", | |
| "outDir": "dist", | |
| "declaration": true, | |
| "declarationDir": "dist", | |
| "outDir": "dist", |
Prompt To Fix With AI
This is a comment left during a code review.
Path: templates/daemon/tsconfig.json.template
Line: 9:12
Comment:
**logic:** noEmit conflicts with declaration generation - declarations won't be written to disk
```suggestion
"declaration": true,
"declarationDir": "dist",
"outDir": "dist",
```
How can I resolve this? If you propose a fix, please make it concise.| "noImplicitAny": true, | ||
| "strictNullChecks": true, | ||
| "noUncheckedIndexedAccess": true |
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.
style: Missing strict checks: exactOptionalPropertyTypes, noPropertyAccessFromIndexSignature, and verbatimModuleSyntax from project standards
| "noImplicitAny": true, | |
| "strictNullChecks": true, | |
| "noUncheckedIndexedAccess": true | |
| "noImplicitAny": true, | |
| "strictNullChecks": true, | |
| "noUncheckedIndexedAccess": true, | |
| "exactOptionalPropertyTypes": true, | |
| "noPropertyAccessFromIndexSignature": true, | |
| "verbatimModuleSyntax": true |
Context Used: Context from dashboard - CLAUDE.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: templates/daemon/tsconfig.json.template
Line: 15:17
Comment:
**style:** Missing strict checks: exactOptionalPropertyTypes, noPropertyAccessFromIndexSignature, and verbatimModuleSyntax from project standards
```suggestion
"noImplicitAny": true,
"strictNullChecks": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noPropertyAccessFromIndexSignature": true,
"verbatimModuleSyntax": true
```
**Context Used:** Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=72baf8a2-698b-40bf-966d-5b799d03ad3b))
How can I resolve this? If you propose a fix, please make it concise.| "noEmit": true, | ||
| "declaration": true, | ||
| "declarationDir": "dist", | ||
| "outDir": "dist", |
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: noEmit: true conflicts with declaration: true - TypeScript cannot generate declaration files when emission is disabled
| "noEmit": true, | |
| "declaration": true, | |
| "declarationDir": "dist", | |
| "outDir": "dist", | |
| "declaration": true, | |
| "declarationDir": "dist", | |
| "outDir": "dist", |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/outfitter/templates/daemon/tsconfig.json.template
Line: 9:12
Comment:
**logic:** `noEmit: true` conflicts with `declaration: true` - TypeScript cannot generate declaration files when emission is disabled
```suggestion
"declaration": true,
"declarationDir": "dist",
"outDir": "dist",
```
How can I resolve this? If you propose a fix, please make it concise.| "noImplicitAny": true, | ||
| "strictNullChecks": true, | ||
| "noUncheckedIndexedAccess": true |
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.
style: Missing exactOptionalPropertyTypes, noPropertyAccessFromIndexSignature, and verbatimModuleSyntax options specified in CLAUDE.md
| "noImplicitAny": true, | |
| "strictNullChecks": true, | |
| "noUncheckedIndexedAccess": true | |
| "noImplicitAny": true, | |
| "strictNullChecks": true, | |
| "noUncheckedIndexedAccess":true, | |
| "exactOptionalPropertyTypes": true, | |
| "noPropertyAccessFromIndexSignature": true, | |
| "verbatimModuleSyntax": true |
Context Used: Context from dashboard - CLAUDE.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/outfitter/templates/daemon/tsconfig.json.template
Line: 15:17
Comment:
**style:** Missing `exactOptionalPropertyTypes`, `noPropertyAccessFromIndexSignature`, and `verbatimModuleSyntax` options specified in CLAUDE.md
```suggestion
"noImplicitAny": true,
"strictNullChecks": true,
"noUncheckedIndexedAccess":true,
"exactOptionalPropertyTypes": true,
"noPropertyAccessFromIndexSignature": true,
"verbatimModuleSyntax": true
```
**Context Used:** Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=72baf8a2-698b-40bf-966d-5b799d03ad3b))
How can I resolve this? If you propose a fix, please make it concise.| if (response.ok) { | ||
| logger.info`Daemon stopped`; | ||
| } |
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: Missing error handling when response.ok is false - daemon stop command may appear successful but actually fail
| if (response.ok) { | |
| logger.info`Daemon stopped`; | |
| } | |
| if (response.ok) { | |
| logger.info`Daemon stopped`; | |
| } else { | |
| logger.error`Failed to stop daemon: ${response.status} ${response.statusText}`; | |
| process.exit(1); | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/outfitter/templates/daemon/src/cli.ts.template
Line: 66:68
Comment:
**logic:** Missing error handling when response.ok is false - daemon stop command may appear successful but actually fail
```suggestion
if (response.ok) {
logger.info`Daemon stopped`;
} else {
logger.error`Failed to stop daemon: ${response.status} ${response.statusText}`;
process.exit(1);
}
```
How can I resolve this? If you propose a fix, please make it concise.| "noEmit": true, | ||
| "declaration": true, | ||
| "declarationDir": "dist", | ||
| "outDir": "dist", |
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: Configuration conflict: noEmit: true prevents TypeScript from generating output files, but declaration, declarationDir, and outDir are set for file generation
| "noEmit": true, | |
| "declaration": true, | |
| "declarationDir": "dist", | |
| "outDir": "dist", | |
| "declaration": true, | |
| "declarationDir": "dist", | |
| "outDir": "dist", |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/outfitter/templates/mcp/tsconfig.json.template
Line: 9:12
Comment:
**logic:** Configuration conflict: `noEmit: true` prevents TypeScript from generating output files, but `declaration`, `declarationDir`, and `outDir` are set for file generation
```suggestion
"declaration": true,
"declarationDir": "dist",
"outDir": "dist",
```
How can I resolve this? If you propose a fix, please make it concise.| "noImplicitAny": true, | ||
| "strictNullChecks": true, | ||
| "noUncheckedIndexedAccess": true |
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.
style: Missing strict TypeScript settings mentioned in CLAUDE.md: exactOptionalPropertyTypes, noPropertyAccessFromIndexSignature, and verbatimModuleSyntax
| "noImplicitAny": true, | |
| "strictNullChecks": true, | |
| "noUncheckedIndexedAccess": true | |
| "noImplicitAny": true, | |
| "strictNullChecks": true, | |
| "noUncheckedIndexedAccess": true, | |
| "exactOptionalPropertyTypes": true, | |
| "noPropertyAccessFromIndexSignature": true, | |
| "verbatimModuleSyntax": true |
Context Used: Context from dashboard - CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/outfitter/templates/mcp/tsconfig.json.template
Line: 15:17
Comment:
**style:** Missing strict TypeScript settings mentioned in CLAUDE.md: `exactOptionalPropertyTypes`, `noPropertyAccessFromIndexSignature`, and `verbatimModuleSyntax`
```suggestion
"noImplicitAny": true,
"strictNullChecks": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noPropertyAccessFromIndexSignature": true,
"verbatimModuleSyntax": true
```
**Context Used:** Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=72baf8a2-698b-40bf-966d-5b799d03ad3b))
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.218d1dc to
9e371ae
Compare
f30bd92 to
ca74b08
Compare
|
Addressed greptile notes in outfitter templates: aligned CLI tsconfig (schema/lib/types/strict options; removed conflicting noEmit), removed extra console.log in CLI program template, and tightened MCP tool dispatch with handler map + arg guard. Restacked and resubmitted. |

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com