Skip to content

Commit f8cfbca

Browse files
koki-developclaude
andcommitted
docs: update CLAUDE.md to reflect component refactoring
- Update Core Components section with new modular structure - Add Component Architecture section explaining design patterns - Document the src/components/ directory and its purpose - Replace Key Files section with architectural guidance 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 5c7454a commit f8cfbca

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

CLAUDE.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ This is a terminal-based chat UI CLI tool that simulates a conversation with a c
1616

1717
### Core Components
1818
- **CLI Entry Point** (`src/index.tsx`): Commander.js setup that renders the Ink app
19-
- **Chat Application** (`src/App.tsx`): React-based terminal UI using Ink framework
19+
- **Chat Application** (`src/App.tsx`): Main state management component for messages and loading state
20+
- **UI Components** (`src/components/`): Modular React components for terminal UI
21+
- `ChatHistory.tsx`: Message list rendering using Ink's Static component
22+
- `MessageItem.tsx`: Individual message display component
23+
- `InputField.tsx`: Text input with prompt styling
24+
- `Spinner.tsx`: Loading indicator during cat responses
25+
- `types.ts`: Shared TypeScript interfaces
2026
- **Build System** (`scripts/build.ts`): Custom Bun build script that creates executable CLI binary
2127

2228
### Technology Stack
@@ -42,12 +48,12 @@ The build process creates a standalone executable CLI tool:
4248
3. Adds Node.js shebang for CLI execution
4349
4. Makes output executable with chmod +x
4450

45-
### Key Files
46-
- `src/index.tsx` - Main entry point with Commander.js CLI setup (TSX for JSX support)
47-
- `src/App.tsx` - Main chat UI component with React hooks and Ink components
48-
- `scripts/build.ts` - Custom build script that outputs to `dist/` with shebang
49-
- `biome.json` - Biome configuration for linting and formatting
50-
- `tsconfig.json` - TypeScript configuration optimized for bundler mode with JSX support
51+
### Component Architecture
52+
The codebase follows a modular component structure:
53+
- **State Management**: Centralized in `App.tsx` using React hooks
54+
- **Component Separation**: Each UI piece is a separate component with clear responsibilities
55+
- **Type Safety**: Shared types in `components/types.ts` for consistency
56+
- **Prop Interface**: Components receive specific props rather than accessing global state
5157

5258
## Development Notes
5359

@@ -57,4 +63,5 @@ The build process creates a standalone executable CLI tool:
5763
- Package is configured as ESM with `"type": "module"`
5864
- Binary is published as `cat-code` command via `bin` field in package.json
5965
- Message state uses simple array with auto-incrementing IDs (length + 1/2)
60-
- Color scheme: cyan for user messages, green for cat messages, yellow for prompt
66+
- Color scheme: cyan for user messages, green for cat messages, yellow for prompt
67+
- Components are split into separate files in `src/components/` for maintainability

0 commit comments

Comments
 (0)