smart-output
Purpose
Self-reflection, compression, and chain-of-thought refinement on structured outputs before delivery.
Inspired by PR-Agent's core abilities — adapted for general PA use beyond code review.
When to activate
- Any structured output with multiple items (briefings, lists, recommendations, action items)
- Long-form content before sending (LinkedIn posts, reports, summaries)
- Memory compaction passes (daily note → MEMORY.md promotion candidates)
- Multi-step tasks where intermediate output feeds the next stage
Do NOT activate
- Simple direct answers (one-liner replies)
- Heartbeat checks
- System ops (cron, gateway, git)
- When speed matters more than quality (urgent alerts)
Pipeline
Stage 1: Generate
Produce the raw output as normal. No filtering yet.
Stage 2: Self-Reflect (score + filter)
Review every item in the output. For each:
- Score 0-10 on relevance, accuracy, and value to the recipient
- Flag items scoring 0 as incorrect/irrelevant — remove them
- Flag items scoring 1-3 as low-value — remove unless nothing else remains
- Re-rank remaining items by score (descending)
Decision rule:
- If generating ≤3 items: skip scoring, just sanity-check each
- If generating 4+ items: full score-and-filter pass
- Threshold: configurable, default = 4 (drop items below this score)
Stage 3: Compress (token-aware fitting)
When output exceeds the delivery medium's practical limit:
- WhatsApp: ~800 chars ideal, 1500 max
- LinkedIn: ~1300 chars for posts, ~300 for comments
- Briefing DM: ~500 chars
- Internal/file: no hard limit, but prefer concise
Compression strategy:
- Prioritize additions/new info over restated context
- Sort items by score (from Stage 2)
- Fit highest-scored items first until limit approached
- Remaining items: collapse to one-line mentions ("Also: X, Y, Z")
- If still over: drop lowest-scored items entirely
Stage 4: Chain (multi-stage metadata injection)
When a task has multiple stages:
- Stage N produces a structured summary
- Stage N+1 receives that summary as injected context (not raw output)
- Each stage builds on the refined output of the previous one
Examples:
- Meeting notes → action item extraction → priority ranking → owner assignment
- Daily notes → theme extraction → MEMORY.md candidate scoring → promotion
- Content draft → self-review → revision → format for platform
No extra API calls — all stages run within the same session turn.
Asymmetric Context Rule
When retrieving context for any recall or analysis task:
- Pull MORE context from BEFORE the event/change (history, setup, motivation)
- Pull LESS context from AFTER (results, follow-ups)
- Prefer enclosing context (the project, the thread, the conversation) over isolated snippets
Ratio guideline: ~3:1 before:after when context budget is limited.
Configuration
smart_output:
self_reflect: true
score_threshold: 4 # drop items below this
min_items_for_scoring: 4 # skip scoring for tiny outputs
compress: true
chain: true
asymmetric_context: true
context_ratio: 3 # before:after ratio
Anti-patterns
- Do NOT self-reflect on self-reflection output (no recursion)
- Do NOT compress when the user explicitly asked for "everything" or "full list"
- Do NOT chain more than 3 stages without intermediate output review
- Do NOT apply to real-time/urgent sends (alerts, permission requests)
Interaction with other skills
- memory-tiering: Stage 2 scoring aligns with graduation gate criteria (score ≥ 0.70, recalls ≥ 2)
- eval: Self-reflection results feed eval_tracker silently (log quality improvements)
- proactive-pa: Proactive surface candidates go through Stage 2 before delivery
- owner-briefing: Morning briefing items go through full pipeline (generate → score → compress → send)
1---2name: smart-output3description: smart-output4---5# smart-output67## Purpose8Self-reflection, compression, and chain-of-thought refinement on structured outputs before delivery.9Inspired by PR-Agent's core abilities — adapted for general PA use beyond code review.1011## When to activate12- Any structured output with multiple items (briefings, lists, recommendations, action items)13- Long-form content before sending (LinkedIn posts, reports, summaries)14- Memory compaction passes (daily note → MEMORY.md promotion candidates)15- Multi-step tasks where intermediate output feeds the next stage1617## Do NOT activate18- Simple direct answers (one-liner replies)19- Heartbeat checks20- System ops (cron, gateway, git)21- When speed matters more than quality (urgent alerts)2223## Pipeline2425### Stage 1: Generate26Produce the raw output as normal. No filtering yet.2728### Stage 2: Self-Reflect (score + filter)29Review every item in the output. For each:30- Score 0-10 on relevance, accuracy, and value to the recipient31- Flag items scoring 0 as incorrect/irrelevant — remove them32- Flag items scoring 1-3 as low-value — remove unless nothing else remains33- Re-rank remaining items by score (descending)3435Decision rule:36- If generating ≤3 items: skip scoring, just sanity-check each37- If generating 4+ items: full score-and-filter pass38- Threshold: configurable, default = 4 (drop items below this score)3940### Stage 3: Compress (token-aware fitting)41When output exceeds the delivery medium's practical limit:42- WhatsApp: ~800 chars ideal, 1500 max43- LinkedIn: ~1300 chars for posts, ~300 for comments44- Briefing DM: ~500 chars45- Internal/file: no hard limit, but prefer concise4647Compression strategy:481. Prioritize additions/new info over restated context492. Sort items by score (from Stage 2)503. Fit highest-scored items first until limit approached514. Remaining items: collapse to one-line mentions ("Also: X, Y, Z")525. If still over: drop lowest-scored items entirely5354### Stage 4: Chain (multi-stage metadata injection)55When a task has multiple stages:561. Stage N produces a structured summary572. Stage N+1 receives that summary as injected context (not raw output)583. Each stage builds on the refined output of the previous one5960Examples:61- Meeting notes → action item extraction → priority ranking → owner assignment62- Daily notes → theme extraction → MEMORY.md candidate scoring → promotion63- Content draft → self-review → revision → format for platform6465No extra API calls — all stages run within the same session turn.6667## Asymmetric Context Rule68When retrieving context for any recall or analysis task:69- Pull MORE context from BEFORE the event/change (history, setup, motivation)70- Pull LESS context from AFTER (results, follow-ups)71- Prefer enclosing context (the project, the thread, the conversation) over isolated snippets7273Ratio guideline: ~3:1 before:after when context budget is limited.7475## Configuration76```yaml77smart_output:78 self_reflect: true79 score_threshold: 4 # drop items below this80 min_items_for_scoring: 4 # skip scoring for tiny outputs81 compress: true82 chain: true83 asymmetric_context: true84 context_ratio: 3 # before:after ratio85```8687## Anti-patterns88- Do NOT self-reflect on self-reflection output (no recursion)89- Do NOT compress when the user explicitly asked for "everything" or "full list"90- Do NOT chain more than 3 stages without intermediate output review91- Do NOT apply to real-time/urgent sends (alerts, permission requests)9293## Interaction with other skills94- **memory-tiering**: Stage 2 scoring aligns with graduation gate criteria (score ≥ 0.70, recalls ≥ 2)95- **eval**: Self-reflection results feed eval_tracker silently (log quality improvements)96- **proactive-pa**: Proactive surface candidates go through Stage 2 before delivery97- **owner-briefing**: Morning briefing items go through full pipeline (generate → score → compress → send)