A feature release adding an order-creation tool, plus code-runner correctness fixes, a canonical .phtml template convention, and community/contribution docs. No breaking changes.
New tools (hidden, discover via search-tools)
order-create— build and place an order: line items by SKU, one billing/shipping address, chosen shipping and payment method. Supports all default product types (configurable, grouped, bundle, downloadable) with option data given by human-friendly codes/labels/SKUs, product custom options, existing-customer orders viacustomerId(0 = guest), and virtual/downloadable-only orders (shipping skipped automatically). Like other order-mutating tools it is disabled by default and blocked in production; enable viatools.order-create.enabled=truein.bricklayer.json.
Fixes
code-runner: a timeout no longer kills the MCP server. The execution limit is now enforced by a catchable wall-clock SIGALRM (wherepcntlis available) instead ofset_time_limit()'s uncatchable fatal: on timeout the transaction rolls back and the call returns a normal error (timed_out: true) — the server keeps running and session state (defined functions, bootstrap) survives. Wall-clock also means stalled DB queries now count toward the limit (CPU-timeset_time_limitnever saw them; it remains as backstop and as the only limit on platforms withoutpcntl).code-runner: fatals now report instead of silently dropping the connection. If user code still fatals the process (OOM, redeclare), a shutdown hook answers the in-flight request with a JSON-RPC tool error naming the fatal before the process dies, so the agent sees the real cause rather thanConnection closed.code-runner: define-mode helpers no longer fatal on the second use. Defined functions were prepended as raw declarations to every subsequent execute, so the second call in the long-lived server process fataled withCannot redeclare <fn>(). Functions are now declared once into the global namespace at define time (behind afunction_existsguard); syntax errors surface at define time, and redefining an already-declared name returns awarning(the original body stays in effect until the MCP server restarts) instead of fataling.code-runner:timeout=0no longer disables the execution limit. The effective timeout is now floored at 1s — previouslytimeout<=0reachedset_time_limit(0), which means unlimited, the inverse of the cap.database-query:SELECT(...)is no longer rejected. The SELECT guard now uses a word boundary instead of requiring whitespace, soSELECT(1) AS xpasses whileSELECTED...is still rejected.code-runner: state reset now clears repository identity maps (product, category,CustomerRegistry), so changes made outside the MCP process are no longer hidden by stale cached entities.code-runner: clearer message when writes are blocked by config. Ifallow_write=trueis requested but disabled in.bricklayer.json, the response now says so (write_blocked_by_config: true) and names the config key to enable, instead of suggesting a flag that was already set.
Guidelines & generated code
- Standard
.phtmltemplate convention (Luma and Hyvä): required header order (declare→use→@var) and clear escaping rules ($escaper, or/* @noEscape */for safe non-HTML output).generate-controlleroutput and all guideline examples now follow it.
Docs
- Added
CONTRIBUTING.md,CODE_OF_CONDUCT.md, andSECURITY.md.
A feature release adding runtime introspection for the view layer and message-queue wiring — three read-only tools that surface resolved/merged state no single source file shows. No breaking changes.
New tools (hidden, discover via search-tools)
layout-inspect— resolve a layout handle into its runtime-merged block/container tree (merged across every module and the active theme), showing appliedreferenceBlock/referenceContainer/move/removedirectives, declared and theme-resolved.phtmltemplate paths, and the page layout. Omit the handle to list every registered handle for an area (frontend/adminhtml). Config-gated, enabled by default.ui-component-inspect— resolve an admin grid/form UI component's runtime-merged configuration, showing the component tree, data source, and child components merged across modules. Config-gated, enabled by default.message-queue-inspect— the runtime-merged consumer → topic → queue → exchange topology with publisher and handler bindings, assembled acrosscommunication.xml,queue_consumer.xml,queue_topology.xml, andqueue_publisher.xml. Each section degrades independently when a sub-config is absent. Ungated.
Removed
- The static
layouts_referenceMCP resource (a hand-maintained handle catalogue) is retired in favour oflayout-inspect's runtime list mode — the registered handles are now read from the live install and cannot drift.
Internal (no behavior change)
AreaEmulator::emulateAreaCode()added — a restoring area-code swap (viaState::emulateAreaCode) so view tools can resolve frontend layout while the MCP server process is locked to the adminhtml area.
A patch release fixing a code-runner helper-function regression. No breaking changes.
Fixes
code-runnerbare helper functions now work in the PsySH runtime.get(),create(),repo(),config(),query(), andrunLog()— documented incode-runner-helpand used throughout its examples — only existed as global functions in theevalfallback engine. Under PsySH (the default when installed) they were exposed solely as the$get/$create/… scope closures, so the documented bare form fataled withCall to undefined function get(). The bare functions are now declared in the global namespace for both runtimes and stay bound to the live ObjectManager across calls.- Fixed a latent guard bug in the
evalfallback where the helper-functionfunction_exists()check resolved against the wrong namespace, which could fatally re-declare the helpers on a second invocation in a long-lived process.
A code-audit release: fixes a batch of correctness and security bugs, makes code-runner use PsySH as intended, and consolidates duplicated internal logic. No breaking changes.
Security & safety
- Environment-variable tool overrides now work for every tool.
BRICKLAYER_TOOLS_*settings were silently ignored for hyphenated tools (e.g.code-runner,product-delete), so disabling a tool via an env var had no effect. Use the full-path form, e.g.BRICKLAYER_TOOLS_CODE_RUNNER_ENABLED=false. code-runneris now reliably blocked in production even when the deploy mode can't be read (fails closed instead of open).
Fixes
code-runneractually runs through PsySH when it's installed — it previously fell back to a basicevalengine on every call while wrongly reporting "PsySH not available". Responses now report the activeruntime.diagnose-errorcounts error history from the log the error was actually found in, instead of alwaysexception.log.- GraphQL introspection labels input types correctly and returns type descriptions (both were broken).
database-schemanow respects its own enable/disable setting (it was tied todatabase-query).- The
mcpcommand honors--magento-rooton systems withoutpcntl. - Many smaller fixes: safer log-file handling, accurate text truncation, recursive module validation, correct config-write success reporting, dynamic (non-hardcoded) tool/category counts, data-URI image type detection, and more.
Internal (no behavior change)
- Consolidated duplicated logic — error responses, pagination, sensitive-value masking, time parsing, command setup, and log/markdown scanning — into shared traits and helpers.
- Removed dead code and wired up the previously-orphaned PhpStorm config writer, so
installnow generates.idea/mcp.json.
- New guideline: Pool pattern (
patterns/pool.md) — DI-based strategy resolution with extensible array injection, replacing if/else branching on type identifiers. Covers implementation, third-party extensibility, and chain of responsibility with sortOrder. - New guideline: Value Object / DTO (
patterns/value-object.md) — Immutable data carriers withpublic readonlyproperties,fromJson()/toJson()serialization for JSON columns, and comparison with Data Interfaces. - New guideline: Context Object (
patterns/context-object.md) — Bundling repeated request-scoped parameters (customerId, storeId, currencyCode) into a single immutable object with a Builder. - Updated: Plugin pattern (
patterns/plugin.md) — Added "Plugin Chain on Repositories" section showing how to chain multiplebeforeSaveplugins with sortOrder for cross-cutting concerns (validation, timestamps, encryption). - Updated: Coding Standards (
core/coding-standards-quality.md) — Added "Constants as Final Classes" section for grouping enum-like constants infinal classinstead of interfaces.
- Added Symfony Console 7 compatibility
- Project-local overrides — A new
.bricklayer/directory at the Magento root lets projects add or replace bundled content without forking the package. The path is the contract; no registration in.bricklayer.jsonrequired..bricklayer/project-context.md— free-form markdown appended to every generated agent file under a## Project-Specific Contextheading.bricklayer/decision-matrix.md— extra rows merged into the "Before Modifying Magento Code" table; malformed lines skipped.bricklayer/guidelines/{path}.md— files matching a bundled path override it; files with no bundled counterpart are compiled as new sections with headings derived from the directory and filename.bricklayer/skills/{category}/SKILL.md— overrides by category, or new local-only categories directly callable viadevelopment-context category={directory-name}and listed under a Project-specific row in the CLAUDE.md categories table- Optional YAML frontmatter (
name:anddescription:) for SKILL.md files — stripped before content is returned to agents, used as display metadata insearch-docsand the categories table - Local entries tagged
[Project]insearch-docsresults; override entries replace bundled ones in the merged index, no duplicates
bricklayer updatereports local changes — after regenerating agent files, the command lists every applied local override/addition and the number of local docs-index entriesbricklayer initcreates.bricklayer/— the project override directory is created automatically so developers know where to drop local content; subdirectories are created on first use, no placeholder files generated- New
Inchoo\MagentoBricklayer\Guidelines\LocalOverrideHelper— shared static helpers for parsing SKILL.md YAML frontmatter and stripping it from content. Used byGuidelinesCompiler,ContextTools, andSearchTools(no duplicated parser code) GuidelinesCompiler,ContextTools, andSearchToolsconstructors now accept optional$magentoRootand$packageRootarguments for testability (defaults preserve previous behavior)- Added
vendor/bricklayer config:setinteractive command to easily set and change config values in.bricklayer.json - Added Bricklayer SKILL.md file for agents to understand how Bricklayer works
- Fixed array_map error in InstallCommand when single AI agent is selected
- Added ArrayManager for checkout jsLayout manipulation in LayoutProcessor skill example
check-classtool — New Tier 1 tool combining plugin-list, di-configuration, and preference-list in one call for any class. The essential pre-modification check.- Behavioral triggers in server instructions — Server instructions now explain WHY agents should check runtime state before modifying code, not just how to use tools
- "Before Modifying Magento Code" section in agent guidelines — Generated CLAUDE.md/.cursorrules now include a task→tool→skill decision matrix that tells agents what to check before writing code
_skill_hintin introspection tool responses — Plugin-list, di-configuration, preference-list, eav-attributes, database-schema, graphql-inspect, route-list, api-endpoints, and diagnose-performance now hint whichdevelopment-contextcategory to load next_next_stepsin development-context responses — After loading guidelines, agents are told which introspection tools to call for the specific task- Rewrote Tier 1 tool descriptions — Descriptions now include WHEN to use each tool (e.g., "Check BEFORE writing a plugin"), not just what the tool does
- Removed generic architecture section from generated agent guidelines (duplicated training data)
- Simplified Context Quick Reference — Replaced 20-row file-pattern table with reference to the new decision matrix
- README rewritten — Added "How Agents Use Bricklayer" section, documented check→learn→write workflow, updated tool counts and feature descriptions
- Bug fix: Fixed preamble duplication in
code-runnermode=define— multi-function define calls no longer cause "Cannot redeclare" fatal errors - Bug fix: Fixed
$modevariable shadowing inCodeRunnerTools— responsemodefield now correctly reportsexecuteinstead of the Magento deploy mode - Added
diagnose-performanceto search indexes insearch-docsandsearch-tools(diagnostic and performance categories) - Added config gating to
diagnose-performancetool — now respectstools.diagnose-performance.enabledin.bricklayer.json - Removed phantom Integration test suite declaration from
phpunit.xml.dist - Reduced coupling:
PerformanceToolsnow uses a single lazy-initializedDevelopmentToolsinstance instead of creating new instances per check - Added unit tests for
FiltersFieldstrait,RequiresMagentotrait, andToolScanner
- Config staleness detection —
.bricklayer.jsonchanges are now detected automatically via mtime tracking; the MCP server reloads config on the next tool call without requiring a restart - Reusable code-runner functions — Added
mode=definetocode-runnerfor saving named PHP functions that persist across calls within a session; cleared onreinitialize; capped at 20 functions diagnose-performancetool — New diagnostic tool with 6 checks:indexes,cache,flat-tables,cron-backlog,config,queries; returns findings with severity levels (info/warning/critical) and fix suggestions- Added
PerformanceToolsto thediagnostictool group inToolRegistry - Updated
code-runner-helpwithmodeparameter documentation and reusable functions section
- Improved test coverage
- Security: Fixed
isProductionMode()to fail closed — returnstruewhen Magento bootstrap is unavailable, blocking destructive tools by default instead of allowing them - Tightened MCP SDK version constraint from
>=0.3to^0.3 || ^1.0to prevent accepting breaking future major versions - Improved
checkDiagnoseErrorin VerifyCommand to actually instantiate and testExceptionParserinstead of always reporting pass - Clarified
graphql-inspecttool description to note thatresolverstarget returns guidance only - Added inline comment in
MagentoBootstrap::reinitialize()explaining whyrequire_onceworks correctly during reinit
- Added
reinitializeMCP tool to rebuild the Magento ObjectManager on demand after external state changes (setup:upgrade, setup:di:compile, module:enable) - Added automatic staleness detection — the MCP server now tracks
app/etc/config.phpandgenerated/metadata/global.phpmtimes and auto-reinitializes when they change on disk - Added
MagentoBootstrap::reinitialize()method for programmatic ObjectManager rebuild - Added
MagentoBootstrap::isStale()andreinitializeIfStale()for sentinel-based staleness checks - Updated
RequiresMagentotrait to auto-reinitialize before every tool call when staleness is detected - Progressive tool disclosure — Added
meta: ['hidden' => true]to tier 2 tools so only 16 essential tools appear intools/list; all 78 tools remain callable and discoverable viasearch-tools - Compressed tool descriptions — Rewrote all tool descriptions to ≤80 words, removing redundant explanations already conveyed by parameter names and types
- Tool consolidation — Reduced tool count by merging related tools into single entry points with routing parameters:
- 5 GraphQL tools →
graphql-inspect(parameter:target= types|queries|mutations|resolvers, optionalnamefor type detail) - 4 Log tools →
log(parameter:action= read|list|search|analyze) - 5 System status tools →
system-status(parameter:check= cache|indexers|deploy-mode|cron|cron-history) store-configurationmerged intoapplication-info(parameter:include= stores)
- 5 GraphQL tools →
- Pagination metadata — Added
has_moreboolean to all list tool responses (product-list, order-list, customer-list, category-products, invoice-list, shipment-list, creditmemo-list, customer-orders) for reliable pagination signaling - Pruned guidelines duplication — Removed tool documentation tables from guidelines templates (CLAUDE.md, .cursorrules, etc.) since
tools/listalready provides this information - Minimal server instructions — Compressed MCP server instructions from multi-paragraph prose to 5 actionable lines
- Context-aware hints — Added conditional
_hintfield to tool responses guiding agents toward logical next steps:product-get/customer-get— hints when custom EAV attributes are presentsystem-status— hints when indexers are invalid or cache types are disableddiagnose-error— hints to checkplugin-listordi-configurationwhen relevant
- Added standalone
magewiredevelopment-context category for generic Magewire component development outside Hyvä Checkout - Refocused
hyva-checkoutcategory on checkout-specific patterns with condensed Magewire quick-reference
- Security: Fixed
requireNonProductionbypass when no.bricklayer.jsonexists — destructive tools are now blocked by default in production mode - Security: Fixed SQL injection vector in
DatabaseTools::getTableSchema— table names are now validated against actual database tables before use in queries - Removed unimplemented
production_safetyconfig field (strict/standard/unrestricted) — per-toolenabledflags already provide full control - Removed
getProductionSafety()fromConfigLoaderand updatedVerifyCommandto report disabled tool count instead - Added
max_linesconfig enforcement toLogTools::readLog— now respectstools.log-reader.max_linessetting (matchingDatabaseToolsmax_rowspattern) - Removed unused
ToolExceptionimport fromRequiresMagentotrait - Added file overwrite detection to
CodeGenerationTools::writeFiles— existing files now cause a conflict error instead of silent overwrite - Added
forceparameter to all 4 code generation tools (generate-module,generate-model,generate-controller,generate-api) - Added
new/existsfile status annotations in dry-run mode for code generation tools - Added unit tests for
ChecksConfigtrait (production safety, tool enable/disable, destructive tool defaults) - Added unit tests for
ConfigInitializer(production/developer config, file generation, deploy mode detection)
- Added production safety system with per-tool enable/disable via
.bricklayer.json - Added ChecksConfig trait providing
requireToolEnabled()andrequireNonProduction()for all tool classes - Added
production_safetyconfig flag with strict/standard/unrestricted levels - Enforced config checks on DatabaseTools —
database-queryanddatabase-schemanow respecttools.database-query.enabled - Enforced config checks on LogTools — all 4 log tools now respect
tools.log-reader.enabled - Enforced config checks on all 10 CatalogTools write operations (product-create, product-update, product-delete, etc.)
- Enforced config checks on all 8 OrderTools write operations (order-cancel, invoice-create, creditmemo-create, etc.)
- Enforced config checks on all 6 CustomerTools write operations (customer-create, customer-delete, etc.)
- Enforced config checks on all 4 CodeGenerationTools (generate-module, generate-model, etc.)
- Added production mode blocking for destructive tools: product-delete, category-delete, customer-delete, customer-address-delete, order-cancel, creditmemo-create
- Added production mode blocking for all code generation tools (file writes to live servers)
- Added
max_rowsconfig enforcement on DatabaseTools (previously hardcoded, now readstools.database-query.max_rows) - Added sensitive config path masking in database-query results (payment/, carriers/, oauth/*, etc.)
- Added path traversal protection to CodeGenerationTools
writeFiles()withrealpath()boundary check - Refactored CodeRunnerTools to use shared ChecksConfig trait (removes duplicate ConfigLoader logic)
- Extended ConfigLoader defaults to include all 26 write/destructive tools for per-tool configuration
- Added
bricklayer initcommand to generate.bricklayer.jsonwith deploy-mode-aware defaults - Added ConfigInitializer for shared config generation logic across init, install, and verify commands
- Added automatic
.bricklayer.jsongeneration inbricklayer verifywhen config file is missing - Integrated
initintobricklayer installflow — config file is now generated alongside.mcp.jsonand agent files
- Extracted ToolRegistry singleton for centralized tool scanning (replaces static caches in BatchTools/SearchTools)
- Extracted shared traits: FiltersFields, SecureArea, RequiresMagento
- Replaced hardcoded version constant with dynamic reading from composer.json
- Replaced static DOCUMENTATION_INDEX with runtime generation from CATEGORY_MAP
- Standardized error responses across CatalogTools, CustomerTools, OrderTools, CodeRunnerTools
- Applied RequiresMagento trait to all 15 Magento-dependent tool classes
- Used match expressions in BatchTools result summarization
- Fixed unit tests for BatchTools, SearchTools, and MagentoDetector
- Added root directory check to config loader
- Fixed layer resolver instantiation on code-runner
- Added application state reset before code-runner actions to remove stale app context
- Added automated verify command for installation verification
- Removed unused doc index files
- Fixed module generator
- Added MCP efficiency features (batch-execute, count_only, fields filter, verbosity, truncation)
- Added search-tools tool for discovering tools by keyword
- Added configuration-list, di-configuration, plugin-list, event-list, preference-list tools
- Added eav-entity-types tool
- Improved code-runner with code-runner-help companion tool
- Improved log tools with max_entry_length truncation support
- Added unit tests for batch tools, search tools, field filter, count only, truncation, and verbosity
- Fixed docker user for mcp server
- Fixed doc indexing on installation
- Added interactive env selection
- Added composer post install script
- Added verify command/tool for installation verification
- Fixed GraphQL available methods
- Added unit tests for diagnostic tools and exception parser
- Improved code-runner tool
- Improved log file reading with ReadsLogFiles concern
- Added autodiscovery for new functionalities
- Added ToolScanner for automatic tool detection
- Refactored guidelines resource and skills resource
- Improved context tools with dynamic category loading
- Updated guidelines compiler
- Simplified codebase
- Simplified error diagnostics and error discovery
- Removed unused exception classes
- Reduced code complexity across bootstrap, config, and tool classes
- Added missing tool to CLAUDE.md generator
- Improved code-runner tool with enhanced helpers and capabilities
- Added code-runner unit tests
- Added diagnose-error diagnostics tool with exception parser
- Added ReadsLogFiles concern for shared log reading
- Fixed route-list tool
- Added missing categories to search-docs tool
- Removed unneeded composer.lock file
- Fixed version number
- Fixed route-list tool, added missing categories to search-docs tool
- Added Hooli support
- Split skills and guidelines to smaller chunks for less context usage
- Added new split skill files for checkout, payment, theme, Hyva, import/export, and UI components
- Added development-context tool
- Added instructions for code to pass coding standards checks
- Enhanced guidelines and skills with additional patterns and examples
- Added general Hyva knowledge
- Added Hyva UI components knowledge
- Added Hyva checkout knowledge
- Updated readme
- Added interactive install
- Added missing features
- Added checkout customization, payment integration, and theme development skills
- Removed legacy test directory
- Added container auto discovery
- Initial release