What Is the Diversification Rule in Hallmark's Macrostructure Pick?

The diversification rule requires that each new Hallmark page use a different macrostructure from the most recent output in the same project.

This rule is central to Hallmark's design philosophy and ensures visual variety across multi-page sites. Before generating any new page, Hallmark scans existing CSS files for a specific comment stamp that records which macrostructure was previously used.

How the Diversification Rule Works

The rule operates as a mandatory pre-selection check enforced before any other design decisions—hero polish, enrichment, navigation, or footer styling. As documented in skills/hallmark/references/macrostructures.md, the process follows three strict steps:

  1. Scan existing CSS files for a comment stamp formatted as:

    /* Hallmark · macrostructure: <name> · … */
  2. Extract the macrostructure name if a stamp is found.

  3. Select any macrostructure other than the one identified in step 2.

Where the Stamp Lives

The diversification rule inspects CSS files across your project, typically located in site/css/*.css. Each Hallmark output leaves a persistent record of its macrostructure choice, enabling future runs to enforce variety.

From the source documentation:

"Before picking, check the target codebase for a /* Hallmark · macrostructure: <name> · … */ comment in any existing CSS file. If you find one, your pick must be a different macrostructure. No two consecutive Hallmark outputs in the same project share a macrostructure."

Practical Example: Manual Application

Consider a project with an existing Hallmark page using the Bento Grid macrostructure:

/* Existing file: site/css/base.css */
/* Hallmark · macrostructure: Bento Grid · v1.2 */

For your new page, the diversification rule prohibits Bento Grid. You must choose an alternative, such as Marquee Hero:

/* New file: site/css/main.css */
/* Hallmark · macrostructure: Marquee Hero · v1.0 */

Automated Enforcement in Build Scripts

You can programmatically enforce the diversification rule using a regex match against the stamp pattern. This pseudo-code demonstrates the logic as implemented in the Hallmark reference:

const fs = require('fs');
const macroStamp = /\/\*\s*Hallmark\s·\smacrostructure:\s(\w[\w\s]+)\s·/;

// Read any existing CSS file
const existing = fs.readFileSync('site/css/base.css', 'utf8');
const match = existing.match(macroStamp);

if (match) {
  console.log(`Current macrostructure: ${match[1]}`);
  console.log('Pick a different macrostructure for the new page.');
}

The regex /\/\*\s*Hallmark\s·\smacrostructure:\s(\w[\w\s]+)\s·/ captures the macrostructure name following the standardized Hallmark · macrostructure: prefix.

Key Source Files for the Diversification Rule

File Purpose
skills/hallmark/references/macrostructures.md Defines the diversification rule and catalogs all 21 available macrostructures
site/css/*.css Contains the inspection stamps that trigger rule enforcement
Generated CSS outputs (e.g., base.css, main.css) Persistent records of macrostructure selections per the Hallmark convention

Why the Rule Is Mandatory

The diversification rule in Hallmark's macrostructure pick exists to prevent visual monotony. By guaranteeing that no two consecutive pages share the same structural approach, Hallmark maintains design freshness across project iterations. This enforcement occurs before aesthetic refinements, making it a foundational constraint rather than an optional guideline.

Summary

  • The diversification rule forbids reusing the most recently applied macrostructure in a Hallmark project.
  • Enforcement depends on scanning CSS files for the /* Hallmark · macrostructure: <name> · … */ stamp.
  • The rule is mandatory and executes before all other design-stage decisions.
  • Reference skills/hallmark/references/macrostructures.md for the complete list of 21 macrostructures available for rotation.

Frequently Asked Questions

What happens if no macrostructure stamp exists in the CSS files?

If no stamp is found, the diversification rule imposes no constraint. You may select any of the 21 macrostructures documented in skills/hallmark/references/macrostructures.md. The rule only activates when a previous Hallmark output is detected.

Can I override the diversification rule for specific projects?

No. According to the source documentation, the diversification rule is mandatory for every Hallmark run. The reference explicitly states this enforcement occurs before hero polish, enrichment, navigation, and footer decisions.

How does Hallmark handle multiple CSS files with different stamps?

The rule requires scanning any existing CSS file for the stamp pattern. If multiple files contain stamps, standard practice selects the most recent or project-relevant file to determine the excluded macrostructure. The core requirement remains: your new pick must differ from the identified previous selection.

Where are the 21 macrostructures defined?

All available macrostructures are cataloged in skills/hallmark/references/macrostructures.md within the Hallmark repository. This file pairs each macrostructure with implementation details and the mandatory diversification rule specification.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →