Pm restructure

From AMDResearch/omniprobe · View interactive version

Pm restructure is an AI agent skill from the GitHub repository AMDResearch/omniprobe. Execute structural recommendations from pm-reflect's reflection report — splits, merges, removals, and coverage gap fills — with explicit user approval for each change. Use after reviewing a pm-reflect report and deciding which recommendations to act on.

How to use this skill

Skill file

pm-restructure

Purpose

Close the gap between pm-reflect (analysis-only) and pm-update (content changes to existing units). This skill handles structural operations on PM units: splitting one unit into multiple, merging multiple into one, archiving obsolete units, and creating new units for uncovered areas. Each change requires explicit user approval.

Preconditions

Required Reads

  1. .agents/pm/reflection-report.md [required] -- the reflection report driving this session.
  2. .agents/pm/pm-index.md [required] -- current unit registry.
  3. .agents/pm/pm-current-state.md -- current project state summary.
  4. The unit files named in the recommendations you will act on (read on demand, not all at once).

Procedure

  1. Check for reflection report. If .agents/pm/reflection-report.md does not exist, stop

with: "No reflection report found. Run /pm-reflect first to generate recommendations."

  1. Parse recommendations. Read the reflection report and extract each recommendation as a

discrete action item. Classify each as one of:

Skip recommendations that describe content-level changes (e.g., "move this statement to a

workflow packet", "add negative knowledge about X"). Those are pm-update operations —

note them in the output as deferred to pm-update.

  1. Present recommendations. Show the user a numbered summary of all structural

recommendations with their type and affected units. Example:

```

Structural recommendations from reflection report:

1. [split] template-engine -- covers 4 unrelated topics (layout, content, skills, adapters)

2. [merge] auth-core + auth-middleware -- both cover authentication

3. [archive] legacy-migration -- referenced by 0 recent workflows

4. [create] ci-pipeline -- no PM unit covers CI/CD

Content-level items deferred to pm-update: 2 items (see reflection report)

```

  1. Process each recommendation. For each structural recommendation, in order:

a. Present the proposed change. Show what will happen:

sections will be distributed.

how conflicting content will be resolved.

(infrastructure 8-section or code-navigation 10-section).

b. Wait for user approval. Use AskUserQuestion to ask the user whether to proceed.

Options: "Approve", "Skip", "Modify" (let the user adjust the proposed change).

If the user skips, move to the next recommendation.

c. Execute the approved change. Perform the structural operation:

Split:

Every section from the original must appear in exactly one of the new units.

content present in one of the new units.

every column including Type and Always-Load (see the column rules below).

decide which of the new units inherits it — and it is at most one. A split is exactly

the moment an architecture overview gets carved out of a larger unit, and if nobody

decides, the flag is silently lost and every future session stops loading it.

Merge:

If two units have conflicting statements in the same section, present the conflict

to the user and ask which to keep (or keep both with a note).

content present in the merged unit.

every column including Type and Always-Load (see the column rules below).

unit almost certainly should. A merge is the mirror of the split case: an overview gets

absorbed, and the flag is dropped by default unless someone carries it across.

Archive:

Create:

schema (10 sections: Responsibility, Key Source Files, Key Types and Classes,

Key Functions and Entry Points, Data Flow, Invariants, Dependencies, Negative

Knowledge, Open Questions, Last Verified).

Boundaries and Dependencies, Anchors/References, Negative Knowledge, Open

Questions, Related Workflows, Last Verified).

from the reflection report and any context available. Mark unpopulated sections as

"None yet."

Always-Load (see the column rules below).

Column rules for every pm-index.md row this skill writes. The index is eight columns

wide — Unit, Type, Purpose, Status, Facet, Always-Load, When To Load,

Dependencies. Read the header; do not infer the shape from the row above, which is how the

two newest columns stopped being written after they were added.

pm-validate.

anything else — in practice the architecture overview, usually exactly one per project.

Default false. Every true is paid for on every session, so when unsure, false.

Always-Load is the flag this skill is most likely to be the only writer of. Splitting and

merging is precisely when an overview is carved out or absorbed, and no other skill revisits

the flag on an existing unit.

d. Report the result. After each operation, confirm what was done:

"Done: split template-engine into template-layout and template-content."

  1. Update cross-references. After all approved operations are complete:

units. Update them.

absorbed content from other units.

  1. Append Last Verified. For every unit file that was created or modified, append a

Last Verified entry dated today with a note like "Created by pm-restructure" or

"Merged from X + Y." The section is an append-only list; on a merged unit, carry the

source units' entries across rather than discarding their verification history.

  1. Produce summary. Output a summary of all changes made:

```

PM Restructure Summary:

Executed:

Skipped:

Deferred to pm-update:

Cross-references updated: pm-current-state.md, auth-core.md

```

Output

Completion Criteria

Error Handling

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.