--- name: pm-formatter description: PM Agent status output formatting with actionable structure category: module --- # PM Formatter Module **Purpose**: Format PM Agent status output with maximum clarity and actionability ## Output Structure ```yaml Line 1: Branch indicator Format: ๐Ÿ“ [branch-name] Source: git-status module Line 2: Workspace status Format: [symbol] [description] Source: git-status module Line 3: Token usage Format: ๐Ÿง  [%] ([used]K/[total]K) ยท [remaining]K avail Source: token-counter module Line 4: Ready actions Format: ๐ŸŽฏ Ready: [comma-separated-actions] Source: Static list based on context ``` ## Complete Output Template ``` ๐Ÿ“ [branch-name] [status-symbol] [status-description] ๐Ÿง  [%] ([used]K/[total]K) ยท [remaining]K avail ๐ŸŽฏ Ready: [comma-separated-actions] ``` ## Symbol System ```yaml Branch: ๐Ÿ“ - Current branch indicator Status: โœ… - Clean workspace (green light) โš ๏ธ - Uncommitted changes (caution) ๐Ÿ”ด - Conflicts detected (critical) Resources: ๐Ÿง  - Token usage/cognitive load Actions: ๐ŸŽฏ - Ready actions/next steps ``` ## Ready Actions Selection ```yaml Always Available: - Implementation - Research - Analysis - Planning - Testing Conditional: Documentation: Condition: Documentation files present Debugging: Condition: Errors or failures detected Refactoring: Condition: Code quality improvements needed Review: Condition: Changes ready for review ``` ## Formatting Rules ```yaml Conciseness: - One line per component - No explanations - No prose - Symbol-first communication Actionability: - Always end with Ready actions - User knows what they can request - No "How can I help?" questions Clarity: - Symbols convey meaning instantly - Numbers are formatted consistently - Status is unambiguous ``` ## Examples ### Example 1: Clean Workspace ``` ๐Ÿ“ main โœ… Clean workspace ๐Ÿง  28% (57K/200K) ยท 142K avail ๐ŸŽฏ Ready: Implementation, Research, Analysis, Planning, Testing ``` ### Example 2: Uncommitted Changes ``` ๐Ÿ“ refactor/docs-core-split โš ๏ธ Uncommitted changes (2M, 3 untracked) ๐Ÿง  30% (60K/200K) ยท 140K avail ๐ŸŽฏ Ready: Implementation, Research, Analysis ``` ### Example 3: Conflicts ``` ๐Ÿ“ feature/new-auth ๐Ÿ”ด Conflicts detected (1 file) ๐Ÿง  15% (30K/200K) ยท 170K avail ๐ŸŽฏ Ready: Debugging, Analysis ``` ### Example 4: High Token Usage ``` ๐Ÿ“ develop โœ… Clean workspace ๐Ÿง  87% (174K/200K) ยท 26K avail ๐ŸŽฏ Ready: Testing, Documentation ``` ## Integration Logic ```yaml Step 1 - Gather Components: branch = git-status module โ†’ branch name status = git-status module โ†’ symbol + description tokens = token-counter module โ†’ formatted string actions = ready-actions logic โ†’ comma-separated list Step 2 - Assemble Output: line1 = "๐Ÿ“ " + branch line2 = status line3 = "๐Ÿง  " + tokens line4 = "๐ŸŽฏ Ready: " + actions Step 3 - Display: Print all 4 lines No additional commentary No "How can I help?" ``` ## Context-Aware Action Selection ```yaml Token Budget Awareness: IF tokens < 25%: โ†’ All actions available IF tokens 25-75%: โ†’ Standard actions (Implementation, Research, Analysis) IF tokens > 75%: โ†’ Lightweight actions only (Testing, Documentation) Workspace State Awareness: IF conflicts detected: โ†’ Debugging, Analysis only IF uncommitted changes: โ†’ Reduce action list (exclude Planning) IF clean workspace: โ†’ All actions available ``` ## Anti-Patterns (FORBIDDEN) ```yaml โŒ Verbose Explanations: "You are on the refactor/docs-core-split branch which has..." # WRONG - too much prose โŒ Asking Questions: "What would you like to work on?" # WRONG - user knows from Ready list โŒ Status Elaboration: "โš ๏ธ You have uncommitted changes which means you should..." # WRONG - symbols are self-explanatory โŒ Token Warnings: "๐Ÿง  87% - Be careful, you're running low on tokens!" # WRONG - user can see the percentage โœ… Clean Format: ๐Ÿ“ branch โœ… status ๐Ÿง  tokens ๐ŸŽฏ Ready: actions # CORRECT - concise, actionable ``` ## Validation ```yaml Self-Check Questions: โ“ Is the output exactly 4 lines? โ“ Are all symbols present and correct? โ“ Are numbers formatted consistently (K format)? โ“ Is the Ready list appropriate for context? โ“ Did I avoid explanations and questions? Format Test: Count lines: Should be exactly 4 Check symbols: ๐Ÿ“, [status], ๐Ÿง , ๐ŸŽฏ Verify: No extra text beyond the template ``` ## Adaptive Formatting ```yaml Minimal Mode (when token budget is tight): ๐Ÿ“ [branch] | [status] | ๐Ÿง  [%] | ๐ŸŽฏ [actions] # Single-line format, same information Standard Mode (normal operation): ๐Ÿ“ [branch] [status-symbol] [status-description] ๐Ÿง  [%] ([used]K/[total]K) ยท [remaining]K avail ๐ŸŽฏ Ready: [comma-separated-actions] # Four-line format, maximum clarity Trigger for Minimal Mode: IF tokens > 85%: โ†’ Use single-line format ELSE: โ†’ Use standard four-line format ``` ## Integration Points **Used by**: - `commands/pm.md` - Session start output - `agents/pm-agent.md` - Status reporting - Any command requiring PM status display **Dependencies**: - `modules/token-counter.md` - Token calculation - `modules/git-status.md` - Git state detection - System context - Token notifications, git repository