This rune is part of @refrakt-md/plan. Install with npm install @refrakt-md/plan and add "@refrakt-md/plan" to the plugins array in your refrakt.config.json.
Plan History
Renders a timeline of lifecycle events for plan entities, derived directly from git history. Every status transition, priority change, criteria check-off, and resolution is extracted from consecutive commits — no separate activity log or event database required.
This is a self-closing aggregation rune. The pipeline's aggregate hook extracts history from git during the build, and the postProcess hook resolves the sentinel into a styled vertical timeline.
Per-entity timeline
Show the full history for a single entity by passing its ID.
{% plan-history id="WORK-024" /%}
Each event in the timeline shows:
- Date and commit hash (linked to the repository when a remote is configured)
- Attribute changes —
status: ready → done,priority: low → high - Criteria progress — checked/unchecked acceptance criteria with ☑/☐ markers
- Resolution events — when a
## Resolutionsection is added - Content edits — body changes with no structured diff
Events are displayed newest-first. When more than 3 criteria change in a single event, the list collapses with a "+N more criteria" summary.
Visual language
- Filled circle markers (●) for events with structured changes
- Open circle markers (○) for creation events
- Attribute values use
data-type="add|remove"with diff-style background tints — green for new values, red (with strikethrough) for old values
Global activity feed
Omit the id attribute for a project-wide feed grouped by commit.
{% plan-history /%}
{% plan-history limit=10 /%}
{% plan-history type="work" /%}
{% plan-history since="7d" /%}
In global mode, events from the same commit are grouped together, showing the commit message and a compact summary for each affected entity. This makes atomic operations visible — when a spec is accepted and 5 work items are created in one commit, they appear as a single grouped entry.
Content-only events (body edits with no attribute/criteria/resolution change) are omitted from the global feed to reduce noise.
Attributes
| Attribute | Type | Required | Description |
|---|---|---|---|
id | string | — | Entity ID for single-entity mode. Omit for global feed. |
limit | number | — | Maximum number of events (per-entity) or commits (global) to show. |
type | string | — | Entity type filter: work, bug, spec, decision, or comma-separated. |
since | string | — | Time filter: "7d", "30d", or ISO date. |
group | string | — | Global mode grouping: commit or entity. |
Universal attributes
bg
The background layer (SPEC-088): image, video, gradient, flat overlay wash and legibility scrim, in a single injected layer behind the rune's content.
| Attribute | Type | Required | Description |
|---|---|---|---|
bg | string | — | Background preset applied to this block |
bg-from | string | — | Gradient start colour — a semantic token name (→ var(--rf-color-*)) |
bg-gradient | "to-t" | "to-b" | "to-l" | "to-r" | "to-tr" | "to-br" | "to-bl" | "to-tl" | — | Gradient direction (bounded named set) |
bg-gradient-type | "linear" | "radial" | "conic" | — | Gradient type |
bg-to | string | — | Gradient end colour — a semantic token name |
bg-via | string | — | Optional middle gradient stop — a semantic token name |
scrim | "top" | "bottom" | "left" | "right" | "none" | — | Scrim direction (heaviest edge); presence turns the scrim on, "none" opts out of the default cover scrim |
scrim-blur | "none" | "sm" | "md" | "lg" | — | Frost scrim blur amount |
scrim-strength | "sm" | "md" | "lg" | — | Gradient scrim strength |
scrim-tone | "dark" | "light" | — | Whether the scrim darkens (for light text) or lightens (for dark text) |
scrim-type | "gradient" | "frost" | — | Scrim treatment: gradient (default) or frost (backdrop blur) |
elevation
The chrome/depth ladder (SPEC-107). The skin maps each rung to a chrome bundle by attribute, so there is no BEM class.
| Attribute | Type | Required | Description |
|---|---|---|---|
elevation | "sunken" | "flush" | "flat" | "raised" | "floating" | "overlay" | "none" | "sm" | "md" | "lg" | — | Surface depth on the SPEC-107 ladder (sunken→overlay); none/sm/md/lg are deprecated aliases |
inset
Internal padding override.
| Attribute | Type | Required | Description |
|---|---|---|---|
inset | "flush" | "tight" | "default" | "loose" | "breathe" | — | Inner padding of this block |
motion
Scroll-reveal entrance (SPEC-105). The author declares the character, the theme owns the choreography, a behaviour owns the timing.
| Attribute | Type | Required | Description |
|---|---|---|---|
reveal | "none" | "fade" | "slide" | "scale" | "blur" | — | Scroll-reveal entrance character (none|fade|slide|scale|blur); the theme owns the choreography |
stagger | boolean | — | Cascade this block's items in as it reveals (no-op on single-child runes) |
spacing
Block-level rhythm override.
| Attribute | Type | Required | Description |
|---|---|---|---|
spacing | "flush" | "tight" | "default" | "loose" | "breathe" | — | Vertical spacing above and below this block |
substrate
Generated pattern fills (SPEC-087). Markers only — the engine sets the attributes and cell/opacity custom properties, CSS draws the pattern.
| Attribute | Type | Required | Description |
|---|---|---|---|
substrate | "dots" | "grid" | "lines" | "cross" | "checker" | "none" | — | Generated surface pattern |
substrate-fill | "inherit" | "inset" | — | Surface fill the pattern sits on (full colour stays with tint) |
substrate-opacity | "sm" | "md" | "lg" | — | Pattern ink strength |
substrate-size | "sm" | "md" | "lg" | — | Pattern cell size |
substrate-target | "self" | "media" | — | Which surface the pattern fills (overrides the rune/theme default) |
tint
Per-rune colour override (SPEC-053): a named tint from the theme registry, with inline per-token overrides layered on top.
| Attribute | Type | Required | Description |
|---|---|---|---|
tint | string | — | Color tint preset applied to this block |
tint-mode | "auto" | "dark" | "light" | — | Whether the tint adapts to auto, dark, or light mode |
width
The track a block rune occupies.
| Attribute | Type | Required | Description |
|---|---|---|---|
width | "compact" | "narrow" | "content" | "wide" | "full" | — | Maximum width constraint for this block |
| Not available | Why |
|---|---|
| dropcap, reading | this rune declares no prose body |
| frame | this rune declares neither a `frameTarget` nor a media section |
| prominence | this rune has no page-section header |
Event types
The history extractor classifies each commit into one of five event kinds:
| Kind | Meaning |
|---|---|
created | Entity file first appeared in git |
attributes | One or more tag attributes changed (status, priority, etc.) |
criteria | Acceptance criteria checkboxes were checked or unchecked |
resolution | A ## Resolution section was added or modified |
content | File changed but no attribute/criteria/resolution diff detected |
How it works
History is derived from git commits, not a separate event store:
git log --followretrieves the ordered commit list for each entity filegit show <hash>:<path>retrieves the file contents at each commit- The opening Markdoc tag (line 1) is parsed for attribute changes
- Checkbox lines (
- [ ]/- [x]) are diffed for criteria changes - The
## Resolutionsection is checked for appearance or modification - Consecutive versions are compared to emit typed events
Results are cached in .plan-history-cache.json, keyed by each file's latest commit hash. Subsequent builds skip files whose history hasn't changed.
Shallow clones
In shallow clones (common in CI), only available commits are processed. The timeline may be incomplete — earlier events are simply absent rather than fabricated.
Rename tracking
git log --follow tracks files across renames, so entity history is preserved even when files are reorganised. The rename itself is not surfaced as an event.
Output structure
Per-entity HTML
<section class="rf-plan-history" data-rune="plan-history">
<ol class="rf-plan-history__events">
<li class="rf-plan-history__event" data-kind="attributes">
<time class="rf-plan-history__date">Apr 12</time>
<code class="rf-plan-history__hash">a295513</code>
<div class="rf-plan-history__changes">
<span class="rf-plan-history__change">
<span class="rf-plan-history__field">status</span>
<span class="rf-plan-history__value" data-type="remove">ready</span>
<span class="rf-plan-history__arrow">→</span>
<span class="rf-plan-history__value" data-type="add">done</span>
</span>
</div>
</li>
</ol>
</section>
Global feed HTML
The global feed adds the rf-plan-history--global modifier and uses __commit-message and __entity-summary elements for the commit-grouped layout.
CLI companion
The refrakt plan history command provides the same history data in the terminal, with additional filtering options (--author, --status).