Skip to content

feat: implement /init command for project documentation generation #6154

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

Closed
wants to merge 1 commit into from

Conversation

roomote[bot]
Copy link

@roomote roomote bot commented Jul 24, 2025

This PR implements the /init command as requested in issue #6153. The command scans the entire codebase and generates a comprehensive ROO.md file with project documentation.

Changes Made

  • Added /init command handler in Task.ts that intercepts the command before task creation

  • Created ProjectScanner module that analyzes:

    • Project structure and file statistics
    • Technologies and frameworks used
    • Configuration files
    • Dependencies (production and development)
    • Available scripts
    • Git information
    • Architecture patterns
  • Created DocumentationGenerator module that generates a well-formatted ROO.md file with:

    • Project overview
    • Table of contents
    • Technologies section grouped by type
    • Project structure visualization
    • Configuration files listing
    • Dependencies listing
    • Available scripts
    • Development setup instructions
    • Architecture patterns
    • Git information
  • Added comprehensive unit tests for both modules

  • Integrated with existing RooIgnore patterns for file filtering

Testing

  • Unit tests added for both ProjectScanner and DocumentationGenerator
  • All tests passing
  • Manual testing can be done by typing /init in the chat

Example Output

The /init command generates a ROO.md file similar to:

# Project Name

Project description

## Project Overview

This document provides a comprehensive overview...

## Table of Contents

- [Technologies](#technologies)
- [Project Structure](#project-structure)
- [Configuration Files](#configuration-files)
- [Dependencies](#dependencies)
- [Available Scripts](#available-scripts)
- [Development Setup](#development-setup)
- [Architecture Patterns](#architecture-patterns)
- [Git Information](#git-information)

## Technologies

### Languages
- **Node.js** - Config: `package.json`
- **TypeScript** (^5.0.0)

### Frameworks
- **React** (^18.0.0)

...

Closes #6153


Important

Implements /init command to generate comprehensive project documentation in ROO.md using new ProjectScanner and DocumentationGenerator modules.

  • Behavior:
    • Implements /init command in Task.ts to generate ROO.md documentation.
    • Scans project for structure, technologies, dependencies, scripts, and Git info.
    • Generates documentation with sections like project overview, technologies, and setup instructions.
  • Modules:
    • Adds ProjectScanner to analyze project structure, technologies, dependencies, and more.
    • Adds DocumentationGenerator to create ROO.md with project details.
  • Testing:
    • Adds unit tests for ProjectScanner and DocumentationGenerator in __tests__ directories.
    • Tests cover project scanning, documentation generation, and output validation.
  • Integration:
    • Integrates with RooIgnore for file filtering in ProjectScanner.

This description was created by Ellipsis for 44a6cd7. You can customize this summary. It will automatically update as commits are pushed.

- Add /init command handler in Task.ts that intercepts the command
- Create ProjectScanner module to analyze project structure and technologies
- Create DocumentationGenerator to generate comprehensive ROO.md file
- Add unit tests for both ProjectScanner and DocumentationGenerator
- Integrate with existing RooIgnore patterns for file filtering

Closes #6153
@roomote roomote bot requested review from mrubens, cte and jr as code owners July 24, 2025 07:22
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. documentation Improvements or additions to documentation enhancement New feature or request labels Jul 24, 2025

try {
// Notify user that we're starting the project scan
await this.say("text", "🔍 Scanning project structure and analyzing codebase...")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User-facing messages (e.g., '🔍 Scanning project structure and analyzing codebase...') should be wrapped with an i18n function to support localization.

This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 24, 2025
@daniel-lxs
Copy link
Collaborator

This implementation seems limited to typescript and python projects, it would be better to implement something similar to https://github.com/yamadashy/repomix

@daniel-lxs daniel-lxs closed this Jul 24, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 24, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add Project Initialization Command (/init) to Roocode
3 participants