Team brief

From huytieu/COG-second-brain · View interactive version

Team brief is an AI agent skill from the GitHub repository huytieu/COG-second-brain. Generate daily team intelligence brief by cross-referencing GitHub, Linear, Slack, PostHog, meetings, and braindumps with two-way Linear sync-back

How to use this skill

Skill file

COG Team Intelligence Brief Skill

When to Invoke

Agent Mode Awareness

Check agent_mode in 00-inbox/MY-PROFILE.md frontmatter:

Purpose

Generate a concise daily team intelligence brief focused on what we're doing, what needs attention, and what's falling through the cracks. Cross-references Linear work tracking, Slack discussions, GitHub activity, PostHog product analytics, braindumps, and recent meetings to surface insights, flag mismatches, and keep the team aligned.

Monday = Week Start Brief: If today is Monday, the brief covers Friday through Sunday (the full weekend window). All date ranges, queries, and language should reflect "since Friday" / "over the weekend" instead of "yesterday." This captures anything that happened Friday afternoon, weekend deploys, or async discussions.

This is NOT an industry news report. News/market intelligence belongs in the weekly brief.

Command: `/team-brief`

Voice & Tone

You're not a reporting tool — you're a teammate who happens to have read every Slack thread, every PR, and every meeting note. Write like someone who genuinely cares about the team succeeding.

Do:

Don't:

Example tone:

Good day yesterday — we cut v1.2.0 with the new workflow, caching fix, and a bunch of UX polish. 11 PRs merged by 4 people. The team is shipping.

But we have a problem: two discovery calls in a row ended with the prospect unable to log in. The onboarding flow just doesn't work. We're building features for users who can't get through the front door.


Parallel Agent Team Execution Strategy

The daily brief MUST use parallel agents to maximize speed and efficiency.

When /daily-brief is invoked, the orchestrator (main agent) should:

Phase 1: Setup (Orchestrator — Sequential, Fast)

  1. Determine today's date and the lookback start date:
  1. Check available integrations via ToolSearch ("slack"), ToolSearch ("linear"), and ToolSearch ("posthog")
  2. Check for meeting notes in [CUSTOMIZE: path/to/meetings/] matching dates from LOOKBACK_DATE through today
  3. Check for recent braindumps in [CUSTOMIZE: path/to/braindumps/] matching dates from LOOKBACK_DATE through today

Phase 2: Parallel Data Collection (Spawn 6 Agents Simultaneously)

Launch ALL of these agents in a single message using the Task tool with run_in_background: true:

Agent 1: "github-analyst" (subagent_type: general-purpose)

Prompt: see references/agent-prompts.md § github-analyst.

Agent 2: "slack-monitor" (subagent_type: general-purpose)

Only spawn if Slack MCP is available

Prompt: see references/agent-prompts.md § slack-monitor.

Agent 3: "meeting-reviewer" (subagent_type: general-purpose)

Prompt: see references/agent-prompts.md § meeting-reviewer.

Agent 4: "linear-tracker" (subagent_type: general-purpose)

Only spawn if Linear MCP is available

Prompt: see references/agent-prompts.md § linear-tracker.

Agent 5: "braindump-reviewer" (subagent_type: general-purpose)

Prompt: see references/agent-prompts.md § braindump-reviewer.

Agent 6: "posthog-analyst" (subagent_type: general-purpose)

Only spawn if PostHog MCP is available

Prompt: see references/agent-prompts.md § posthog-analyst.

Phase 3: Assembly & Cross-Reference Synthesis (Orchestrator — After All Agents Complete)

This is the most critical phase. The orchestrator must:

  1. Collect results from all background agents using Read on their output files
  1. Cross-reference Linear ↔ GitHub (the core alignment check):
  1. Cross-reference Slack ↔ GitHub ↔ Linear:
  1. Cross-reference Meetings ↔ GitHub ↔ Linear:
  1. Cross-reference Braindumps ↔ Current Work:
  1. Cross-reference Linear Cycle ↔ Overall Progress:
  1. Cross-reference Initiatives ↔ Projects ↔ Issues:
  1. Cross-reference PostHog ↔ GitHub ↔ Slack:
  1. Generate the brief following the Content Structure below, with insights FIRST and details LAST. Use the Voice & Tone guidelines — write like a teammate, not a dashboard.
  1. Save to [CUSTOMIZE: path/to/briefs/]daily-brief-YYYY-MM-DD.md with proper metadata
  1. Present a concise summary to the user

Phase 3.5: Linear Sync-Back (Orchestrator — After Cross-Reference, Before Slack)

This phase writes data BACK to Linear to keep it up-to-date with reality from GitHub, Slack, and meetings.

Use ToolSearch to load the necessary Linear update tools: "+linear update issue", "+linear update initiative", "+linear update project", "+linear create comment", "+linear create attachment", "+linear save status update", "+linear update milestone".

Step 1: PR ↔ Issue Linkage

For each merged or open PR found in the GitHub data:

  1. Extract Linear issue references from PR title/body/branch (patterns: [CUSTOMIZE: PROJ]-123)
  2. For each matched Linear issue:
Step 2: Issue Status Sync from GitHub

Based on the cross-reference data from Phase 3:

  1. PR merged → Issue still "In Progress": Use mcp__claude_ai_Linear__update_issue to transition the issue to "Done" state. Add a comment: "Automatically marked done — PR #XXX merged on [date]."
  2. PR opened → Issue still "Todo"/"Backlog": Use mcp__claude_ai_Linear__update_issue to transition to "In Progress". Add a comment: "Marked in progress — PR #XXX opened."
  3. PR has CHANGES_REQUESTED → Issue marked "In Review": Keep issue status, but add a comment noting the review feedback if not already commented.

Safety rules:

Step 3: Initiative Status Updates

For each active initiative, compose and post a status update using mcp__claude_ai_Linear__save_status_update:

  1. Gather from the cross-reference:
  1. Compose a concise status update (3-5 bullet points):

```

[DATE] Daily Update

• Shipped: [list key PRs/features merged]

• In Progress: [key items being worked on]

• Blocked: [any blockers, or "None"]

• Health: [On Track / At Risk / Off Track] — [1-line reasoning]

• Next: [what's expected to ship next]

```

  1. Use mcp__claude_ai_Linear__save_status_update to post the update to the initiative
  2. If the initiative health has clearly changed based on data, use mcp__claude_ai_Linear__update_initiative to update the health field
Step 4: Milestone Progress Check

For each milestone in active projects:

  1. Count completed vs total issues within the milestone
  2. If a milestone's target date is approaching (≤7 days away) and completion is <70%, flag it
  3. If a milestone is overdue (past target date with incomplete issues), use mcp__claude_ai_Linear__update_milestone to update its status/description with a note
  4. Include milestone health in the initiative status update
Step 5: Project Status Sync

For each active project:

  1. If all issues in a project are "Done" and the project status is still "In Progress", flag for status update
  2. If a project has >50% blocked issues, note this in the initiative status update
  3. Update project descriptions or summaries only if there's a significant status change
Sync-Back Summary

After all sync-back operations, compile a summary of what was updated:

Include this summary in the brief under a "Linear Sync Report" section.

Phase 3.7: HackMD Publish (After Linear Sync-Back, Before Slack)

This phase publishes the full daily brief to HackMD so it can be shared with the team via a link.

The HackMD API token is stored in .claude/settings/hackmd-token (one line, no whitespace). Read it with: cat .claude/settings/hackmd-token | tr -d '\n'. Alternatively check env var HACKMD_API_TOKEN.

API Details:

Steps:

  1. Create the note via POST https://api.hackmd.io/v1/notes with:

```json

{

"title": "Daily Brief — [DAY_NAME], [FULL_DATE]",

"readPermission": "signed_in",

"writePermission": "owner",

"commentPermission": "disabled",

"content": "placeholder"

}

```

  1. Update the note content via PATCH https://api.hackmd.io/v1/notes/<id> with the full brief markdown content:
  1. Store the HackMD link for use in the Slack message AND the local brief file:
  1. If HackMD API fails, log the error and continue — the brief should still be posted to Slack without the link. Note in the Slack message: "(HackMD link unavailable)"

Implementation pattern (Bash): see references/publish-templates.md § HackMD implementation pattern (Bash).

Phase 4: Slack Highlights (After brief is saved — preview before posting)

After presenting the brief summary to the user, always compose and show the Slack highlight message for preview. Display the exact message the user will see in Slack, then ask: "Ready to post this to #[CUSTOMIZE: your-team-channel]? (or edit anything first)"

Do NOT post until the user explicitly confirms. If they suggest edits, adjust and show the updated preview. Only post after they say yes/confirm/looks good/send it/etc.

  1. Compose a Slack-native highlight message — NOT the full brief, just the most important bits the team should see. Keep it short enough that people actually read it.
  1. Once user confirms, use ToolSearch to load Slack send tool, then post via mcp__claude_ai_Slack__slack_send_message to the [CUSTOMIZE: your-team-channel] channel.
  1. Slack message format (adapt based on actual content — this is a template, not a rigid format):

For Monday (Week Start Brief): full template in references/publish-templates.md § Slack message format — Monday (Week Start Brief).

For regular days: full template in references/publish-templates.md § Slack message format — regular days.

  1. Rules for the Slack message:

Phase Timing


Content Structure (PRIORITY ORDER — Important First, Details Last)

1. Opening (1-2 sentences)

Quick vibe check. Was it a good shipping day? Quiet? Lots of discussion but no merges? Set the context in plain language.

If Monday (Week Start Brief): Frame the opening around the weekend + set the tone for the week ahead. Example: "Happy Monday — the team stayed busy over the weekend with 6 PRs merged. Here's what happened since Friday and what's on deck for the week."

Regular day example:

Solid day — v1.2.0 shipped with 11 PRs merged. The team is moving fast on features. But we've got a growing problem on the onboarding side that needs attention before we lose more prospects.

2. Heads Up (Top Alerts)

Things that need attention today. Keep to 3-5 max. Write them as things a teammate would flag in standup, not as system alerts.

Types (in priority order):

Example:

Onboarding is broken — Two prospects in a row got stuck at sign-up during discovery calls. No fix PR exists for either issue.

Review backlog is getting out of hand — 22 open PRs, 16 of them stale. Some are 100+ days old. We should do a quick triage to close the dead ones.

API docs (#930) need reviewer feedback resolved before we merge the implementation (#933). Let's not build on an uncertain foundation.

3. Key Insights (Synthesized, Cross-Referenced)

Combined intelligence from Slack + GitHub + Meetings. Group RELATED items together. This is where the cross-referencing shines — connect the dots between what was discussed and what actually happened in code.

4. What Shipped

Celebrate the wins. Brief summary of merged PRs. Group by theme if possible rather than just listing.

5. What's In Progress

Open PRs with review status AND corresponding Linear issue status. Flag age and anything that looks stuck. Show alignment between Linear status and actual PR state.

6. Initiative Health Dashboard

For each active initiative, show a quick-glance status:

Format:

Initiative Name — Health: On Track | 23% complete | 76 days remaining

- Projects: Project A (In Progress, 40%), Project B (In Progress, 15%)

- Milestones: Milestone 1 (due Mar 15 — on track), Milestone 2 (due Mar 30 — at risk)

- Shipped today: PR #945 (feature X), PR #948 (feature Y)

- Blockers: None

7. Cycle & Sprint Health

Current Linear cycle progress — % complete, days remaining, scope changes. Flag if the team is on pace or falling behind.

8. Team Snapshot

Quick velocity numbers — not exhaustive, just enough to get a pulse. Include both GitHub metrics (PRs, commits) and Linear metrics (issues completed, cycle progress).

9. Product Metrics (from PostHog)

Quick snapshot of how the product is actually performing with real user data. This grounds the engineering activity in business reality.

Format:

Visitors: 342 (↑12% vs previous day) | Sign-ups: 8 (↓25%) | Core Events: 156 (↑34%) | Errors: 3 new

What the numbers say: Core events jumped after we shipped the loop detection fix (PR #942) — users are getting further into workflows without hitting errors. Sign-ups dipped but that might just be a quiet day.

Feature adoption: new-feature used by 23 unique users (good early traction). onboarding-flow still showing 40% drop-off at email verification step.

Error watch: 3 new TypeError errors in /api/execute since yesterday's deploy. Correlates with PR #935 merge.

Rules:

10. Linear Sync Report

Summary of what the daily brief sync-back updated in Linear:

11. Strategic Context (from Braindumps)

Key insights from recent braindumps that connect to current work. This gives the brief depth beyond just "what happened" — it adds "why it matters" from the product lead's own thinking.

12. Yesterday's Discussions (Reference)

Detailed Slack discussion summaries. This is the appendix — people who want depth can read here.

13. Meeting Follow-Up Tracker

Action items from recent meetings tracked against actual GitHub/Slack/Linear activity. Use status indicators to show progress at a glance.


Metadata Template

Full YAML frontmatter template for the saved brief file: references/brief-frontmatter.md.

Synthesis Rules

Cross-Referencing Logic

  1. Linear issue + corresponding PR → Link them together in Linear (Phase 3.5). Flag status mismatches (e.g., Linear says "Done" but PR is still open)
  2. Linear issue "In Progress" + No PR/commit → Flag as "claimed but no code yet" (could be early, but worth noting if >1 day)
  3. PR exists + No Linear issue → Note as untracked work. Not necessarily bad, but should be in Linear going forward
  4. Slack topic mentions a PR number or Linear issue → Link them together in Key Insights
  5. Slack discussion about a feature + PR and/or Linear issue exists → Unified insight combining all three signals
  6. Meeting action item + No matching PR/commit AND no Linear issue → Flag as missing follow-up (nothing tracked anywhere)
  7. Meeting action item + Linear issue exists but no PR → Tracked but not started — note status
  8. Slack agreement + GitHub/Linear activity contradicts it → Flag as mismatch
  9. Multiple Slack threads about same topic → Consolidate into single insight
  10. Braindump mentions a feature/direction + Linear/GitHub has related work → Connect strategic thinking to execution
  11. Braindump raises concern + No Linear issue or PR addressing it → Flag as "strategic gap — thinking exists but no tracked work"
  12. Linear urgent/high-priority issue + No recent activity (>2 days) → Flag as stalled critical work
  13. PR merged + Linear issue still open → Auto-transition to "Done" in Phase 3.5 and note in sync report
  14. PR opened + Linear issue in "Todo" → Auto-transition to "In Progress" in Phase 3.5
  15. Initiative target date approaching + low project completion → Flag initiative health as "At Risk" and update in Linear
  16. Milestone overdue + incomplete issues → Flag milestone and update in Linear
  17. Completed work maps to an initiative's project → Include in initiative status update posted to Linear
  18. Merged PR + PostHog metric spike → Correlate — the feature likely drove the change. Include in "What Shipped" with impact data
  19. Merged PR + PostHog error spike → Flag as potential regression in Heads Up. Include error details and PR link
  20. PostHog sign-up/core-event drop + No obvious cause → Flag as anomaly in Product Metrics. Check if it's a weekend/holiday pattern or a real problem
  21. PostHog feature low adoption + Related initiative targets growth → Flag gap between what's being built and what users are actually using
  22. PostHog funnel drop-off + No Linear issue addressing it → Flag as untracked product gap — users are struggling but nobody's working on it
  23. Slack user complaint + PostHog error data confirms → Elevated priority — real user impact verified by data

Stale PR Rules

Initiative Health Rules

Priority Ordering

When multiple alerts exist, order by:

  1. Initiative health degradation (initiative moved to At Risk or Off Track)
  2. Blockers (Linear blocked issues or something that can't proceed)
  3. PostHog error spikes correlated with recent deploys (potential regression — users affected NOW)
  4. Milestone overdue or at risk (time-sensitive, affects initiative health)
  5. Linear ↔ GitHub mismatches (status drift between systems)
  6. Significant metric drops (visitors, sign-ups down >20% — could indicate a real problem)
  7. Stale/aging PRs (time-sensitive, getting worse)
  8. Missing follow-ups (commitments not met — no Linear issue AND no PR)
  9. Cycle health warnings (behind pace, scope creep)
  10. Review bottlenecks (slowing team velocity)
  11. Strategic gaps (braindump concerns with no tracked work)
  12. Funnel drop-offs with no tracked work (product gap)
  13. Informational mismatches (good to know)

Fallback Behavior

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.