PHPackages                             rnr1721/codecraft - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. rnr1721/codecraft

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

rnr1721/codecraft
=================

Universal code generation and manipulation library for PHP, JavaScript, CSS, JSON and more. Framework-agnostic with Laravel integration.

0.0.1(10mo ago)110411MITPHPPHP ^8.1

Since Jun 21Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/rnr1721/codecraft)[ Packagist](https://packagist.org/packages/rnr1721/codecraft)[ Docs](https://github.com/rnr1721/codecraft)[ GitHub Sponsors](https://github.com/sponsors/rnr1721)[ RSS](/packages/rnr1721-codecraft/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (1)

CodeCraft
=========

[](#codecraft)

[![PHP Version](https://camo.githubusercontent.com/0f16581d1180dbfd4c0e13166ec1267d4ad2f2fab8281ea6d6b284cf5c65d921/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d626c75652e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE)![Tests](https://camo.githubusercontent.com/3e5c58346fdf51e69f9b04f69e54d7fcdf9abb5b0bec88d687a4853ef02e1538/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54657374732d50617373696e672d627269676874677265656e2e737667)[![Latest Version](https://camo.githubusercontent.com/a8ab077368b0c596d62201f4ca60ce31c28d295bcbbb82c5b65914c5e10bdb98/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726e72313732312f636f646563726166742e737667)](https://packagist.org/packages/rnr1721/codecraft)

**Universal code generation and manipulation library for modern development**

CodeCraft is an experimental, AI-friendly library that provides a unified API for creating, editing, and analyzing code across multiple programming languages. Think of it as the "Swiss Army knife" for code generation - one simple interface for all your code generation needs.

I wouldn't write this library if I didn't want to test these features in my cyclic AI agent that can execute code -  . But I haven't found anything similar that fits. I don't plan to actively develop this library (at the moment), so if someone likes the idea, I'll be happy if this project is continued or a new one is created, I'll gladly use it :)

Features
--------

[](#features)

- **Simple Path-Based API** - Work with real file paths, not abstract types
- **AI-Friendly** - Built for AI agents and automated code generation
- **AST-Powered** - Uses Abstract Syntax Trees for precise PHP code manipulation
- **6 Languages Supported** - PHP, JavaScript, TypeScript, Python, CSS, JSON
- **Extensible** - Easy to add new language adapters
- **Validation** - Built-in syntax validation for all languages

Supported Languages &amp; Features
----------------------------------

[](#supported-languages--features)

LanguageClassesFunctionsComponentsModelsTestsConfigASTValidation**PHP**✓ Classes, Interfaces, Traits✓ Methods, Functions✘✘✘✓✓✓ php -l**JavaScript**✓ ES6 Classes✓ Functions, Arrow Functions✓ React Components✘✘✘✘✓ Syntax**TypeScript**✓ Classes, Generics✓ Functions, Async✓ React, Hooks✓ Api, Clients✘✓ tsconfig✘✓ Syntax**Python**✓ Classes, DataClasses✓ Functions, Async✘✓ Django, FastAPI✓ Pytest✘✘✓ Syntax**CSS**✘✘✓ BEM Components✘✘✘✘✓ Syntax**JSON**✘✘✘✘✘✓ Configs, Package.json✘✓ JSONQuick Start
-----------

[](#quick-start)

### Installation

[](#installation)

```
composer require rnr1721/codecraft
```

### Basic Usage

[](#basic-usage)

```
