UNPKG

context-forge

Version:

AI orchestration platform with autonomous teams, enhancement planning, migration tools, 25+ slash commands, checkpoints & hooks. Multi-IDE: Claude, Cursor, Windsurf, Cline, Copilot

149 lines (132 loc) 5.26 kB
# Context Forge Project Structure ## Directory Overview ``` context-forge/ ├── src/ # Source code │ ├── adapters/ # IDE-specific adapters │ │ ├── base.ts # Base adapter class │ │ ├── claude.ts # Claude Code adapter │ │ ├── cursor.ts # Cursor IDE adapter │ │ ├── windsurf.ts # Windsurf adapter │ │ ├── cline.ts # Cline adapter │ │ ├── copilot.ts # GitHub Copilot adapter │ │ ├── gemini.ts # Gemini adapter │ │ └── roo.ts # Roo Code adapter │ │ │ ├── cli/ # CLI implementation │ │ ├── index.ts # CLI entry point │ │ ├── commands/ # Command implementations │ │ │ ├── init.ts # Initialize command │ │ │ ├── analyze.ts # Analyze/retrofit command │ │ │ ├── migrate.ts # Migration command │ │ │ ├── run-prp.ts # PRP runner command │ │ │ └── copy-hooks.ts # Copy hooks command │ │ └── prompts/ # Interactive prompts │ │ ├── index.ts # Prompt orchestration │ │ ├── projectInfo.ts │ │ ├── techStack.ts │ │ ├── features.ts │ │ ├── migration.ts # Migration prompts │ │ └── checkpointConfig.ts │ │ │ ├── generators/ # File generators │ │ ├── index.ts # Generator orchestration │ │ ├── claudeMd.ts # CLAUDE.md generator │ │ ├── implementation.ts # Implementation plan │ │ ├── projectStructure.ts │ │ ├── prp.ts # PRP generator │ │ ├── slashCommands.ts # Slash commands │ │ ├── hooks.ts # Claude hooks │ │ ├── migrationPrp.ts # Migration PRPs │ │ ├── migrationCheckpoints.ts │ │ └── migrationHooks.ts │ │ │ ├── services/ # Business logic │ │ ├── projectAnalyzer.ts # Project analysis │ │ ├── migrationAnalyzer.ts # Migration logic │ │ ├── apiKeyManager.ts # API key handling │ │ └── validationExecutor.ts # Validation │ │ │ ├── types/ # TypeScript types │ │ └── index.ts # All type definitions │ │ │ └── utils/ # Utilities │ └── validator.ts # Path validation │ ├── templates/ # Handlebars templates │ ├── base-enhanced.hbs # Enhanced PRP template │ ├── planning.hbs # Planning PRP │ ├── spec.hbs # Specification PRP │ └── task.hbs # Task PRP │ ├── docs/ # User documentation │ ├── ide-configs/ # IDE-specific guides │ └── claude-features/ # Claude Code features │ ├── bin/ # Executable │ └── context-forge.js # CLI entry │ ├── .claude/ # Claude Code config (gitignored) │ ├── commands/ # Slash commands │ ├── hooks/ # Claude hooks │ ├── Docs/ # Project docs │ └── PRDs/ # Product requirements │ └── test/ # Tests └── __tests__/ # Jest tests ``` ## Key Files ### Entry Points - `bin/context-forge.js` - CLI executable - `src/cli/index.ts` - Command registration ### Core Services - `src/services/projectAnalyzer.ts` - Analyzes existing projects - `src/services/migrationAnalyzer.ts` - Plans migrations ### Type System - `src/types/index.ts` - Central type definitions ### Configuration - `package.json` - Project metadata - `tsconfig.json` - TypeScript config - `eslint.config.js` - Linting rules - `jest.config.js` - Test configuration ## File Naming Conventions ### TypeScript Files - **Services**: `camelCase.ts` (e.g., `projectAnalyzer.ts`) - **Types**: `camelCase.ts` for files, `PascalCase` for interfaces - **Generators**: `camelCase.ts` - **Commands**: `kebab-case.ts` matching command name ### Generated Files - **Markdown**: `UPPERCASE.md` or `snake_case.md` - **Commands**: `command-name.md` - **Hooks**: `PascalCase.py` ## Import Structure ### Standard Import Order 1. Node.js built-ins 2. External packages 3. Internal types 4. Internal services 5. Internal utilities ### Example: ```typescript import path from 'path'; import { Command } from 'commander'; import { ProjectConfig } from '../types'; import { ProjectAnalyzer } from '../services/projectAnalyzer'; import { validatePath } from '../utils/validator'; ``` ## Adding New Features ### New Command 1. Create command in `src/cli/commands/` 2. Register in `src/cli/index.ts` 3. Add types to `src/types/index.ts` 4. Create tests ### New IDE 1. Create adapter in `src/adapters/` 2. Extend `IDEAdapter` base class 3. Add to adapter factory 4. Create documentation ### New Generator 1. Create in `src/generators/` 2. Return `GeneratedFile[]` 3. Add to generation flow 4. Update types