PHPackages                             valksor/php-dev-snapshot - 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. valksor/php-dev-snapshot

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

valksor/php-dev-snapshot
========================

MCP snapshot generation tool for AI-optimized project documentation

00PHPCI passing

Since Dec 28Pushed 3mo agoCompare

[ Source](https://github.com/valksor/php-dev-snapshot)[ Packagist](https://packagist.org/packages/valksor/php-dev-snapshot)[ RSS](/packages/valksor-php-dev-snapshot/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

ValksorDev Snapshot
===================

[](#valksordev-snapshot)

[![valksor](https://camo.githubusercontent.com/2af5a6a7e5f7da47cd0a924c8b00038f208f45f9b0d5be8d7a497a9808168187/68747470733a2f2f62616467656e2e6e65742f7374617469632f6f72672f76616c6b736f722f677265656e)](https://github.com/valksor)[![BSD-3-Clause](https://camo.githubusercontent.com/72547f8afb6b5ace804caebbf95c3bcbfc027ce9214777bc452f308f3165db01/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4253442d2d332d2d436c617573652d677265656e3f7374796c653d666c6174)](https://github.com/valksor/php-dev-snapshot/blob/master/LICENSE)[![Coverage Status](https://camo.githubusercontent.com/2a96306192d5add06c44689cb9ac52e7c0201391a7310d0d111c31027c056aef/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f76616c6b736f722f7068702d6465762d736e617073686f742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/valksor/php-dev-snapshot?branch=master)[![php](https://camo.githubusercontent.com/77da2f7bbc049873edb2d1045a756d7a32e3ba50440a8e0e76a9109f62f0771b/68747470733a2f2f62616467656e2e6e65742f7374617469632f7068702f2533453d382e342f707572706c65)](https://www.php.net/releases/8.4/en.php)

A powerful PHP snapshot generation tool that creates AI-optimized Markdown Context Pack (MCP) documentation from project files. Designed for AI code analysis, project documentation generation, and knowledge base creation with intelligent file filtering and content processing.

What It Does
------------

[](#what-it-does)

The snapshot generator provides comprehensive project documentation with:

- **Intelligent File Filtering**: Automatically excludes dependencies, build artifacts, and irrelevant files
- **Binary File Detection**: Skips binary files and focuses on source code only
- **Content Limiting**: Configurable limits for file size, line count, and total files processed
- **MCP Format Output**: Generates AI-optimized markdown documentation with structured metadata
- **Gitignore Integration**: Respects existing exclusion patterns and supports custom rules
- **Multi-Path Support**: Can scan multiple directories and merge results

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

[](#configuration)

### Basic Setup

[](#basic-setup)

```
# config/packages/valksor.yaml
valksor:
    snapshot:
        enabled: true
        max_files: 500
        max_lines: 1000
        max_file_size: 1024 # KB
```

### Complete Configuration Reference

[](#complete-configuration-reference)

```
# config/packages/valksor.yaml
valksor:
    snapshot:
        enabled: true

        # File Processing Limits
        max_files: 500 # Maximum files to process
        max_lines: 1000 # Maximum lines per file
        max_file_size: 1024 # Maximum file size in KB

        # Exclusion Patterns (Gitignore-style)
        exclude:
            # Test and build directories (anywhere in project)
            - "tests"
            - "Tests"
            - "coverage"
            - ".coverage"
            - "build"
            - "dist"
            - "out"

            # Cache and temporary directories (anywhere in project)
            - ".phpunit.cache"
            - "cache"
            - "tmp"
            - "temp"

            # Large dependency directories (anywhere in project)
            - "node_modules"
            - "vendor"

            # File extensions (match files ending with extension)
            - ".neon"
            - ".md"
            - ".lock"

            # Root-only exclusions (only at project root)
            - "config/"
```

### Pattern Types Explained

[](#pattern-types-explained)

#### Directory Patterns

[](#directory-patterns)

- `vendor` - Excludes any directory named "vendor" anywhere in the project
- `node_modules` - Excludes any directory named "node\_modules" anywhere
- `tests` - Excludes any directory named "tests" or "Tests" anywhere

#### File Extension Patterns

[](#file-extension-patterns)

- `.neon` - Excludes all files ending with `.neon`
- `.md` - Excludes all markdown files
- `.lock` - Excludes lock files

#### Root-Only Patterns

[](#root-only-patterns)

- `config/` - Excludes `config/` directory only at project root (not `src/config/`)

#### Glob Patterns

[](#glob-patterns)

- `**/coverage/**` - Excludes any directory named "coverage" and its contents
- `**/*.log` - Excludes all `.log` files anywhere in the project

Usage
-----

[](#usage)

### Command Line Interface

[](#command-line-interface)

```
# Generate snapshot of entire project
php bin/console valksor:snapshot

# Scan specific directory
php bin/console valksor:snapshot --path=src/

# Scan multiple directories
php bin/console valksor:snapshot --path=src/ --path=config/

# Custom output file
php bin/console valksor:snapshot --output_file=project_docs.mcp

# Custom limits
php bin/console valksor:snapshot --max_files=1000 --max_lines=2000

# Custom file size limit (in KB)
php bin/console valksor:snapshot --max_file_size=2048
```

### Command Options

[](#command-options)

OptionDescriptionDefault`--path`Directory(s) to scan (can be used multiple times)Project root`--output_file`Output file path`snapshot_YYYY_MM_DD_HHMMSS.mcp``--max_files`Maximum files to process500`--max_lines`Maximum lines per file1000`--max_file_size`Maximum file size in KB1024### Output Format

[](#output-format)

The snapshot generates an MCP (Markdown Context Pack) file with:

```
# Project Name Snapshot

This is a comprehensive MCP snapshot of the Project Name project generated on...

## Summary

- **Files Processed:** 42
- **Total Size:** 156.7 KB
- **Generated:** 2024-01-15 14:30:22

## Files

### src/Controller/UserController.php

**Path:** `src/Controller/UserController.php`
**Lines:** 85
**Size:** 3,245 bytes

```php
