Skip to content

About

πŸƒ A modern WordPress framework powered by Tempest, featuring attribute-based auto-discovery for hooks, post types, blocks, and more.

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Repository files navigation

πŸƒ FΓΈhn

A modern WordPress framework powered by Tempest, featuring attribute-based auto-discovery for hooks, post types, blocks, and more.

Latest Version PHP Version Tests License

Warning

AI-Generated Project β€” This project was primarily built by AI coding agents (Claude). While functional and tested, it may contain bugs, security issues, or unexpected behavior. Use at your own risk, especially in production environments.

Packages

This monorepo contains the following packages:

Package Description Packagist
studiometa/foehn Core framework β€” auto-discovery, DI, blocks, hooks Latest
studiometa/foehn-acf ACF integration β€” blocks, field groups, options pages Latest
studiometa/foehn-installer Composer plugin β€” generates web root, symlinks, wp-config Latest
studiometa/foehn-starter Starter theme β€” the minimum a new project needs Latest
studiometa/foehn-demo Demo theme β€” every feature, and the end-to-end tests Latest

Quick Start

New project

composer create-project studiometa/foehn-starter my-project

Add to existing theme

composer require "nette/php-generator:4.2.3 as 4.2.1" studiometa/foehn

The nette/php-generator alias is necessary until Tempest fixes its requirement. See Installation.

<?php
// functions.php
use Studiometa\Foehn\Kernel;

Kernel::boot(__DIR__ . '/app');

Features

  • πŸš€ Zero configuration β€” Auto-discovery of components via PHP 8 attributes
  • 🎯 Modern DX β€” Type-safe, IDE-friendly, testable
  • πŸ”Œ WordPress native β€” Works with Timber, ACF, and Gutenberg blocks
  • ⚑ Minimal boilerplate β€” One line to boot your theme
  • πŸ“¦ Project generator β€” Full web root generation via Composer plugin
  • πŸ—οΈ Starter theme β€” Complete example with models, hooks, templates
  • 🐳 Runtime image β€” ghcr.io/studiometa/foehn-wordpress, NGINX and PHP with FΓΈhn's serving rules already installed

Available Attributes

Attribute Description
#[AsAction] Register a WordPress action hook
#[AsFilter] Register a WordPress filter hook
#[AsPostType] Register a custom post type
#[AsTaxonomy] Register a custom taxonomy
#[AsPostMeta] Register a meta key, with its REST schema
#[AsTimberModel] Register a Timber class map
#[AsBlock] Register a native Gutenberg block
#[AsBlockCategory] Register a block category
#[AsBlockBinding] Register a block bindings source
#[AsBlockPattern] Register a block pattern
#[AsContextProvider] Add data to specific views
#[AsTemplateController] Handle template rendering
#[AsTwigExtension] Register a Twig extension
#[AsShortcode] Register a shortcode
#[AsRestRoute] Register a REST API endpoint
#[AsRewriteRule] Register a rewrite rule and the class that answers
#[AsSettingsPage] Register an admin page with the Settings API
#[AsCustomizerSection] Add a section with native fields to the Customizer
#[AsMenu] Register a navigation menu
#[AsImageSize] Register a custom image size
#[AsCliCommand] Register a WP-CLI command
#[AsCron] Run a class on a schedule
#[AsJob] Handle a queued job
#[AsSeeder] Write the sample content of a site
#[AsDiscovery] Declare when a custom discovery applies
#[AsAcfBlock] Register an ACF block (studiometa/foehn-acf)
#[AsAcfFieldGroup] Register an ACF field group (studiometa/foehn-acf)
#[AsAcfOptionsPage] Register an ACF options page (studiometa/foehn-acf)

See the API Reference for each attribute.

Architecture

my-project/                     # What is VERSIONED
β”œβ”€β”€ theme/                      # The WordPress theme
β”‚   β”œβ”€β”€ app/                    # PHP classes (auto-discovered)
β”‚   β”œβ”€β”€ templates/              # Twig templates
β”‚   β”œβ”€β”€ functions.php           # Single Kernel::boot() call
β”‚   └── style.css               # Theme header
β”œβ”€β”€ config/                     # Configuration files
β”œβ”€β”€ mu-plugins/                 # Custom mu-plugins (if needed)
β”œβ”€β”€ public/                     # Copied into web/ (robots.txt, .well-known/)
β”œβ”€β”€ .env                        # Environment variables
└── composer.json               # Dependencies

web/                            # GENERATED (100% gitignored)
β”œβ”€β”€ wp/                         # WordPress core
β”œβ”€β”€ wp-content/
β”‚   β”œβ”€β”€ themes/my-theme β†’ symlink to /theme
β”‚   β”œβ”€β”€ plugins/                # Composer-managed plugins
β”‚   └── mu-plugins/             # Auto-loaded mu-plugins
β”œβ”€β”€ index.php                   # Generated front controller
β”œβ”€β”€ robots.txt                  # Copied from public/
└── wp-config.php               # Generated from config/

Documentation

πŸ“– Full Documentation

For AI Agents

Each package ships an Agent Skill: foehn, foehn-acf and foehn-vite-plugin. Install them pinned to the studiometa/foehn version in your composer.lock with npx skills add studiometa/foehn-framework#<version>. See AI Agents.

Development

# Install dependencies
composer install
npm install

# Run tests
composer test

# Lint & fix
composer lint
composer fix

# Format markdown
npm run fmt

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting a PR.

License

studiometa/foehn and studiometa/foehn-acf are released under the GNU General Public License v3.0 or later. See LICENSE.

studiometa/foehn-starter, studiometa/foehn-installer, @studiometa/foehn-vite-plugin and the demo are released under the MIT License, so the code that composer create-project copies into a project stays MIT.

Credits

About

πŸƒ A modern WordPress framework powered by Tempest, featuring attribute-based auto-discovery for hooks, post types, blocks, and more.

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages