Skip to content

playbook add silently drops standard Scope, per-rule examples, and extra markdown #432

Description

@mghantous

Description

packmind-cli playbook add silently drops parts of a standard markdown file: Scope is not stored, per-rule examples are not stored, and anything after the rule bullets is discarded with no error. The web UI still has those fields, so the same artifact is poorer (and incomplete) when submitted from the CLI.

This is adjacent to #392 (CLI cannot reliably edit/delete rules). That issue is about the edit lifecycle. This one is about which standard fields the markdown parser maps.

Current Behavior

Create a standard from the CLI documents this file shape:

# <Standard name>

A description of the standard (not mandatory)

- some rule that the agent should follow
- another rule the agent should follow

playbook add maps that to:

  • Name — CLI: # Title / UI: Standard
  • Description — CLI: paragraph after the H1 / UI: Description (markdown)
  • Scope — CLI: not parsed / UI: glob patterns (e.g. **/*.spec.ts)
  • Rules — CLI: - / * bullets / UI: Rules
  • Per-rule examples — CLI: not parsed / UI: Good / Bad examples on each rule

The same docs page's web example uses labeled fields (**Scope**, **Rules**, Good/Bad snippets). Those labels are UI layout, not CLI syntax. Putting ## Scope, **Scope**, extra headings, tables, or code fences in the markdown file does not fill the Scope field or attach examples.

Packmind's own packmind-update-playbook / create-standard procedure states this explicitly:

  • Only * / - bullets are parsed as rules (### subsections are not)
  • ## Scope is not parsed (always returns empty string)
  • The ## Rules heading is optional; the parser starts at the first bullet

Artifact rendering uses scope globs so Cursor / Claude Code / Copilot only load the standard on matching files. If Scope is empty after a CLI submit, those agents do not get glob filtering. Extra markdown after the rule list is dropped rather than stored.

The older standards create JSON path included scope and rules[].examples (and packmind-create-standard still describes that schema). standards create is deprecated in favor of playbook add, and the markdown importer did not keep those mappings.

Expected Behavior

playbook add of a .packmind/standards/*.md file should be able to set the same standard model as the UI:

  1. Scope as comma-separated globs (see Standard skill creator lacks context to create proper scope patterns #181 — globs, not natural language), so install/render can apply file-pattern filtering.
  2. Per-rule examples (positive / negative / language) from a documented markdown convention (for example Good/Bad fences under a rule), matching the UI and the old JSON schema.
  3. Documented, lossless mapping: content that is not stored as a field should fail validation rather than being silently dropped.

Optional but useful: keep extra markdown (subsections, tables) as part of description or a first-class body field, instead of truncating at the last rule bullet.

Motivation

Anyone authoring standards as markdown and submitting them with the CLI cannot set Scope or examples without a follow-up edit in the UI. That makes the two authoring surfaces diverge, and it is easy for Scope/examples to stay empty after a CLI publish.

Workarounds today:

  • Put a glob into a rule bullet — agents may read it; native glob filtering still does not run.
  • Set Scope and examples in the UI after submit — those values are not represented in the markdown file, so the next CLI update can drift or omit them.
  • Move long-form guidance into a skill (free-form body) — different artifact type and load behavior.

Proposed Solution

Extend the standard markdown parser used by playbook add / playbook submit so it fills UI fields, for example:

# Standard name

Description paragraph (index blurb).

## Scope

**/*.spec.ts,**/*.test.ts

- First rule
- Second rule

And/or restore a documented way to pass the full JSON model (scope, rules[].examples) that standards create used to accept, if markdown cannot express examples cleanly.

packmind-cli playbook diff should show Scope and example changes, not only rule-bullet diffs.

Impact Assessment

TODO

  • Documentation updated (CLI shape vs UI fields)
  • 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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions