Skip to content

Rendering: include rule code examples in the distributed/local playbook files #393

Description

@ppotin-aaisa

Description

Rule code examples shown in the Packmind UI are dropped from the rendered files distributed to repos (.packmind/standards/*.md and .claude/rules/packmind/*.md). They should be included in the rendered output, not kept UI only.

Current Behavior

Using packmind-cli v0.30.1: in the UI, a standard's rules can carry positive/negative code examples. When the standard is distributed to a repo (via install or the packmind-update workflow), the rendered files keep only the rule text; the examples are gone.

Verified in a consumer repo: zero fenced code blocks in either render target (.packmind/standards/*.md and .claude/rules/packmind/*.md), across all standards, though the same rules have examples in the UI. The rendering docs do not mention this omission.

Motivation

Examples are often the clearest part of a rule and the strongest signal for a coding agent applying it from context. Packmind's own guidance recommends every rule carry positive/negative examples, and the standard model (including standards create) stores them, yet the rendered output drops them. The result: the copy an agent actually reads is weaker than the UI, and it undercuts the "single source of truth, multi-agent rendering" promise.

Proposed Solution

Render each rule's examples into every target that supports fenced code (at least the .packmind source form and the Claude Code rendering), as labeled code blocks (for example "correct" / "incorrect", with language when known). Targets that cannot represent examples fall back to the current text only output.

Impact Assessment

  • User impact: agents and humans reading the repo copies get the same guidance as the UI, so rule intent is clearer and application more accurate.
  • Performance impact: negligible; rendered files grow by the size of the examples (modest extra artifact size and context tokens).

TODO

  • Documentation updated
  • Update changelog

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions