PHPackages                             duanestorey/ai-tools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. duanestorey/ai-tools

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

duanestorey/ai-tools
====================

Tools for generating AI-friendly project overviews

1.2.0(12mo ago)010[1 issues](https://github.com/duanestorey/ai-tools/issues)MITPHPPHP ^8.0

Since May 11Pushed 12mo ago2 watchersCompare

[ Source](https://github.com/duanestorey/ai-tools)[ Packagist](https://packagist.org/packages/duanestorey/ai-tools)[ RSS](/packages/duanestorey-ai-tools/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (9)Versions (13)Used By (0)

AI Tools
========

[](#ai-tools)

A Composer package for generating AI-friendly project overviews. This tool creates a comprehensive markdown file that provides AI assistants with a complete overview of your project structure and key files, making it easier for AI to understand your codebase context.

Installation
------------

[](#installation)

### Via Composer

[](#via-composer)

```
composer require duanestorey/ai-tools --dev
```

### Manual Installation

[](#manual-installation)

1. Clone this repository
2. Run `composer install` in the cloned directory
3. Link the executable to your project's vendor/bin directory

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

After installation, you can generate an AI-friendly overview of your project:

```
# Initialize configuration file
vendor/bin/ai-overview init

# Generate overview once
vendor/bin/ai-overview generate

# Generate and watch for changes
vendor/bin/ai-overview generate --watch

# Generate overview with all code files included
vendor/bin/ai-overview generate-all
```

This will create an `ai-overview.md` file in your project root with:

1. **Project Information**: Details about the detected project type and framework
2. **Directory Tree**: A complete ASCII representation of your project structure (excluding directories and files specified in the configuration)
3. **Package JSON**: Contents of package.json (if exists in your project)
4. **Composer JSON**: Contents of your composer.json file
5. **README**: Contents of your project's README.md file (if exists)
6. **Git Information**: Repository URL, branches, and git configuration
7. **Environment Variables**: Keys from .env files (values omitted for security)

For Laravel projects, additional sections are automatically included:

8. **Laravel Routes**: API and web routes with their controllers
9. **Database Schema**: Table structure extracted from migrations and models

For comprehensive AI analysis, you can also generate a complete overview that includes the full content of all code files:

```
vendor/bin/ai-overview generate-all
```

This will create an `ai-overview-all.md` file that includes everything in the regular overview plus the full content of all code files in your project (respecting the exclusion settings in your configuration). This is particularly useful when you want to provide a complete view of your codebase to AI tools for deep analysis.

### Code Quality Tools

[](#code-quality-tools)

This package includes several tools to maintain code quality:

- **Laravel Pint**: A PHP code style fixer based on PHP-CS-Fixer
- **PHPStan/Larastan**: A static analysis tool to find bugs and errors

You can run these tools using the following commands:

```
# Format code using Laravel Pint
composer pint

# Check code style without making changes
composer pint-test

# Run static analysis with PHPStan
composer phpstan

# Run all quality checks (format, test, and analyse)
composer quality
```

### Integrating with Build Processes

[](#integrating-with-build-processes)

#### Composer Scripts

[](#composer-scripts)

Add the command to your `composer.json` scripts section for easy execution:

```
"scripts": {
    "generate-ai-overview": "ai-overview generate",
    "build": [
        "@other-build-commands",
        "@generate-ai-overview"
    ]
}
```

Now you can run `composer generate-ai-overview` to generate the overview, or it will automatically run as part of your build process when you execute `composer build`.

#### CI/CD Integration

[](#cicd-integration)

Add the overview generation to your CI/CD pipeline to ensure it's always up-to-date:

```
# Example GitHub Actions workflow step
- name: Generate AI Overview
  run: vendor/bin/ai-overview generate
```

#### Git Hooks

[](#git-hooks)

You can use Git hooks to automatically generate the overview before commits or pushes:

```
# In .git/hooks/pre-commit or using husky with package.json
vendor/bin/ai-overview generate
```

Configuration
-------------

[](#configuration)

The tool can be configured using a `.ai-tools.json` file in your project root. To create an example configuration file, run:

```
php bin/ai-overview init
```

This will create a `.ai-tools.json` file with default settings and add it to your `.gitignore` file if one exists.

Here's an example configuration file:

```
{
  "output_file": "ai-overview.md",
  "excluded_directories": [".git", "vendor", "node_modules", "path/to/specific/directory"],
  "excluded_files": [".env"],
  "directory_tree": {
    "max_depth": 4
  },
  "viewers": {
    "project_info": true,
    "directory_tree": true,
    "composer_json": true,
    "package_json": true,
    "readme": true,
    "git_info": true,
    "env_variables": true,
    "laravel_routes": true,
    "laravel_schema": true
  },
  "code_files": {
    "extensions": [
      ".php", ".blade.php", ".js", ".css",
      ".rb", ".erb", ".yml", ".json"
    ]
  }
}
```

### Configuration Options

[](#configuration-options)

- **output\_file**: The name of the generated overview file (default: `ai-overview.md`). When using `generate-all`, it will create a file with "-all" appended before the extension (e.g., `ai-overview-all.md`)
- **excluded\_directories**: Directories to exclude from the directory tree, file watching, and code file inclusion when using `generate-all`. Supports both simple directory names (e.g., `vendor`) and path-based exclusions (e.g., `path/to/directory`)
- **excluded\_files**: Files to exclude from the directory tree, file watching, and code file inclusion when using `generate-all`
- **directory\_tree**: Configuration options for the directory tree viewer
    - **max\_depth**: Maximum depth to display in the directory tree (default: `4`)
- **viewers**: Enable or disable specific viewers
- **code\_files**: Configuration options for the code files included in `generate-all` command
    - **extensions**: Array of file extensions to include when using the `generate-all` command. If not specified, default extensions for PHP/Laravel and Ruby on Rails will be used.

How It Works
------------

[](#how-it-works)

### Project Type Detection

[](#project-type-detection)

The tool automatically detects the type of project you're working with. Currently, it can identify:

- **Laravel Projects**: Detected by the presence of artisan file, app/Http/Controllers directory, or Laravel dependencies
- **PHP Projects**: Any PHP project that isn't a recognized framework

Based on the detected project type, the tool automatically includes framework-specific information in the overview.

### Viewer Architecture

[](#viewer-architecture)

The tool uses a plugin-based architecture with "viewers" for different content types. Each viewer is responsible for generating a specific section of the overview file. The current viewers include:

#### Core Viewers (Always Included)

[](#core-viewers-always-included)

- **ProjectInfoViewer**: Provides information about the detected project type, PHP version, and project metadata
- **DirectoryTreeViewer**: Generates an ASCII representation of your project structure, respecting excluded directories/files and max depth settings
- **ComposerJsonViewer**: Includes the contents of your composer.json file
- **PackageJsonViewer**: Includes the contents of your package.json file (if present)
- **ReadmeViewer**: Includes the contents of your README.md file (if present)
- **GitInfoViewer**: Shows Git repository information including repository URL and branches
- **EnvVariablesViewer**: Shows environment variable keys from .env files (values omitted for security)

#### Framework-Specific Viewers

[](#framework-specific-viewers)

**Laravel Viewers** (Only included for Laravel projects):

- **RoutesViewer**: Shows API and web routes with their controllers
- **SchemaViewer**: Extracts database schema from migrations and models

The tool detects changes in your project and only regenerates the overview file when necessary, making it efficient even in watch mode.

Benefits for AI Assistants
--------------------------

[](#benefits-for-ai-assistants)

When working with AI coding assistants, the `ai-overview.md` file provides:

1. Immediate project structure understanding without requiring multiple queries
2. Context about dependencies and project configuration
3. Access to your project's documentation

This helps AI assistants provide more accurate and contextually relevant assistance from the start of your conversation.

Extending the Tool
------------------

[](#extending-the-tool)

You can extend the tool with custom viewers by implementing the `ViewerInterface`. This allows you to include additional project information that might be helpful for AI assistants.

License
-------

[](#license)

MIT

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance50

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

12

Last Release

361d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c3678b43d6295dd2bc70e261515a0a7ca3bb738b62914f5e6413f65ba260580d?d=identicon)[duanestorey](/maintainers/duanestorey)

---

Top Contributors

[![duanestorey](https://avatars.githubusercontent.com/u/366185?v=4)](https://github.com/duanestorey "duanestorey (18 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/duanestorey-ai-tools/health.svg)

```
[![Health](https://phpackages.com/badges/duanestorey-ai-tools/health.svg)](https://phpackages.com/packages/duanestorey-ai-tools)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
