Search by

rmb32 / barnscaff

rogerbarnfather

Filesystem projection for Barncept concept graphs

Package info

bitbucket.org/rmb32/barnscaff

pkg:composer/rmb32/barnscaff

Statistics

Installs: 202

Dependents: 5

Suggesters: 0

v2.0.1 2026-10-19 21:31 UTC

This package is auto-updated.

Last update: 2026-10-28 19:45:36 UTC


README

Part of Barn.

Turn a Barncept concept graph into real folders and files — and check that an existing folder still matches it. Use it from PHP, or from the command line via barnscaff-cli.

Requirements

Installation

composer require rmb32/barnscaff

Command line

Install barnscaff-cli to get barnscaff:

composer require rmb32/barnscaff-cli

vendor/bin/barnscaff scaffold Library Root ./generated           # preview the plan
vendor/bin/barnscaff scaffold Library Root ./generated --apply   # write it
vendor/bin/barnscaff scan Library Root ./generated               # exit 0 if conformant, 1 otherwise

PHP usage

use Rmb32\Barncept\Api\Factory\ConceptFactory;
use Rmb32\Barncept\Api\Factory\ResolverFactory;
use Rmb32\Barncept\Api\ValueObject\Key\ChoiceKey;
use Rmb32\Barnscaff\Api\Factory\ScaffolderFactory;
use Rmb32\Barnscaff\Api\Factory\ScannerFactory;

$concept = new ConceptFactory()->create($data);
$instance = new ResolverFactory()->create()
    ->resolve($concept, ChoiceKey::new('Root'));

$scaffolder = new ScaffolderFactory()->create();
$plan = $scaffolder->plan($instance, '/path/to/project');
$scaffolder->apply($plan); // writes to disk

$report = new ScannerFactory()->create()->scan($instance, '/path/to/project');
$report->isConformant(); // true

Each Part becomes a folder. Each Choice becomes a folder, or a .php file when nothing sits beneath it, and the Choices that fill one Slot are grouped in a folder named after that Slot's key. Barnscaff never reads a concept file itself: load one, and compose it if it borrows, with Barncept's ConceptRegistryFactory and ConceptComposerFactory.

Related packages

  • Barncept — defines the concepts and resolves them into the graph Barnscaff realises.
  • Barnscaff CLI — the barnscaff scaffold / barnscaff scan commands.
  • Barnark — architecture templates, built on Barncept and Barnscaff.

More docs

Internals · History · Known issues

License

Proprietary. See LICENSE. Copyright (c) Roger Barnfather.