Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Example: add this file to your repo at .github/workflows/patch-pulse-bot.yml
# Example: add this file to your repo at .github/workflows/patchpulse.yml
#
# This workflow runs PatchPulse weekly and opens one PR per outdated package (or
# package group). PRs include the version diff, release notes links, a
Expand Down
5 changes: 1 addition & 4 deletions packages/docs/.astro/content-assets.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@


export default new Map([]);

export default new Map();
1 change: 1 addition & 0 deletions packages/docs/.astro/content-modules.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export default new Map([
["src/content/docs/cli/commands.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fcli%2Fcommands.mdx&astroContentModuleFlag=true")],
["src/content/docs/cli/configuration.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fcli%2Fconfiguration.mdx&astroContentModuleFlag=true")],
["src/content/docs/cli/overview.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fcli%2Foverview.mdx&astroContentModuleFlag=true")],
["src/content/docs/discord-bot.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fdiscord-bot.mdx&astroContentModuleFlag=true")],
["src/content/docs/github-action/configuration.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fgithub-action%2Fconfiguration.mdx&astroContentModuleFlag=true")],
["src/content/docs/github-action/overview.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fgithub-action%2Foverview.mdx&astroContentModuleFlag=true")],
["src/content/docs/index.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Findex.mdx&astroContentModuleFlag=true")],
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/.astro/data-store.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default defineConfig({
],
},
{ label: 'Slack Bot', link: '/slack-bot' },
{ label: 'Discord Bot', link: '/discord-bot' },
],
}),
],
Expand Down
56 changes: 56 additions & 0 deletions packages/docs/src/components/AddToDiscordButton.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
interface Props {
href: string;
}

const { href } = Astro.props;
---

<a class="discord-button" href={href}>
<span class="discord-button__label">Add to Discord</span>
</a>

<style>
.discord-button {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 2.75rem;
padding: 0.75rem 1.1rem;
margin: 1rem 0 1.5rem;
border-radius: 0.75rem;
border: 1px solid rgba(255, 255, 255, 0.12);
background:
linear-gradient(180deg, #6a75f7 0%, #5865f2 100%);
box-shadow:
0 12px 28px rgba(88, 101, 242, 0.28),
inset 0 1px 0 rgba(255, 255, 255, 0.14);
color: #fff;
font-weight: 700;
font-size: 0.95rem;
line-height: 1;
letter-spacing: 0.01em;
text-decoration: none;
transition:
transform 160ms ease,
box-shadow 160ms ease,
filter 160ms ease;
}

.discord-button:hover {
transform: translateY(-1px);
box-shadow:
0 16px 36px rgba(88, 101, 242, 0.34),
inset 0 1px 0 rgba(255, 255, 255, 0.18);
filter: brightness(1.03);
}

.discord-button:focus-visible {
outline: 2px solid #e0e3ff;
outline-offset: 3px;
}

.discord-button__label {
white-space: nowrap;
}
</style>
57 changes: 57 additions & 0 deletions packages/docs/src/content/docs/discord-bot.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: Discord Bot
description: Get Discord notifications for new package releases in your server channels.
---

import { Aside } from '@astrojs/starlight/components';
import AddToDiscordButton from '../../components/AddToDiscordButton.astro';

The Patch Pulse Discord Bot notifies your server whenever a package you depend on releases a new version.

<AddToDiscordButton href="https://grand-yak-92.convex.site/discord/install" />

<Aside type="note">
Discord currently gets the base release notification flow. GitHub link
backfill and AI-generated release summaries remain Slack-only for now.
</Aside>

## How it works

Once installed, the bot monitors packages you care about and sends a Discord message when a new version is published to the npm registry.

Discord tracking is channel-based:

- every subscription targets an explicit channel
- the same package can be tracked in multiple channels
- filters can be set to patch, minor, or major updates

## Slash commands

Use these commands in your server:

- `/npmtrack package:react`
- `/npmtrack package:react channel:#frontend`
- `/npmtrack package:react filter:minor`
- `/npmuntrack package:react`
- `/npmuntrack package:react channel:#frontend`
- `/npmlist`

Command responses are ephemeral, while update notifications are posted into the subscribed channel.

## Install and setup

To add Patch Pulse to your server:

- open [grand-yak-92.convex.site/discord/install](https://grand-yak-92.convex.site/discord/install)
- choose the target server
- approve the requested permissions

If you are self-hosting Patch Pulse rather than using the hosted bot, the Discord app setup and environment configuration live in the notifier package docs, not the public user docs site.

## Slack vs Discord

Slack and Discord support the same core package tracking model, but there are a few operational differences:

- Slack has a workspace default channel; Discord does not
- Slack receives delayed GitHub link backfill and AI summaries; Discord currently does not
- Discord commands use typed slash-command options instead of Slack's free-text command parsing
2 changes: 1 addition & 1 deletion packages/docs/src/content/docs/github-action/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The Patch Pulse GitHub Action runs on a schedule, detects outdated dependencies

## Quick start

Add the following workflow to your repository at `.github/workflows/patch-pulse-bot.yml`:
Add the following workflow to your repository at `.github/workflows/patchpulse.yml`:

```yaml
name: PatchPulse Dependency Bot
Expand Down
5 changes: 5 additions & 0 deletions packages/docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ import { CardGrid, LinkCard } from '@astrojs/starlight/components';
href="./slack-bot"
description="Get Slack release alerts with GitHub release links and AI-generated summaries for tracked packages."
/>
<LinkCard
title="Discord Bot"
href="./discord-bot"
description="Get Discord release alerts in your server channels for the packages you track."
/>
<LinkCard
title="VS Code Extension"
href="./vscode/overview"
Expand Down
1 change: 1 addition & 0 deletions packages/docs/src/content/docs/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Patch Pulse is a suite of tools that help you keep your npm dependencies up to d
| [GitHub Action](../github-action/overview) | Automatically open PRs for outdated dependencies on a schedule |
| [VS Code Extension](../vscode/overview) | Inline version information directly in your `package.json` files |
| [Slack Bot](../slack-bot) | Get Slack release alerts with GitHub release links and AI summaries |
| [Discord Bot](../discord-bot) | Get Discord release alerts in your server channels |

## Core concepts

Expand Down
2 changes: 2 additions & 0 deletions packages/docs/src/content/docs/slack-bot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ For supported releases, Patch Pulse also enriches that notification after the in
- it posts a short AI-generated thread summary of what changed when upstream release evidence is strong enough

That gives your team the version bump, the release source, and a quick readable summary without leaving Slack.

If you use Discord instead, see the [Discord Bot](../discord-bot) docs.
47 changes: 47 additions & 0 deletions packages/notifier-bot/.agents/skills/convex/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: convex
description: Routing skill for Convex work in this repo. Use when the user explicitly invokes the `convex` skill, asks which Convex workflow or skill to use, or says they are working on a Convex app without naming a specific task yet. Do not prefer this skill when the request is clearly about setting up Convex, authentication, components, migrations, or performance.
---

# Convex

Use this as the routing skill for Convex work in this repo.

If a more specific Convex skill clearly matches the request, use that instead.

## Start Here

If the project does not already have Convex AI guidance installed, or the existing guidance looks stale, strongly recommend installing it first.

Preferred:

```bash
npx convex ai-files install
```

This installs or refreshes the managed Convex AI files. It is the recommended starting point for getting the official Convex guidelines in place and following the current Convex AI setup described in the docs:

- [Convex AI docs](https://docs.convex.dev/ai)

Simple fallback:

- [convex_rules.txt](https://convex.link/convex_rules.txt)

Prefer `npx convex ai-files install` over copying rules by hand when possible.

## Route to the Right Skill

After that, use the most specific Convex skill for the task:

- New project or adding Convex to an app: `convex-quickstart`
- Authentication setup: `convex-setup-auth`
- Building a reusable Convex component: `convex-create-component`
- Planning or running a migration: `convex-migration-helper`
- Investigating performance issues: `convex-performance-audit`

If one of those clearly matches the user's goal, switch to it instead of staying in this skill.

## When Not to Use

- The user has already named a more specific Convex workflow
- Another Convex skill obviously fits the request better
1 change: 1 addition & 0 deletions packages/notifier-bot/.claude/skills/convex
7 changes: 5 additions & 2 deletions packages/notifier-bot/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ OPENAI_API_KEY=
OPENAI_SUMMARY_NANO_MODEL=
OPENAI_SUMMARY_MINI_MODEL=
GITHUB_TOKEN=
DISCORD_APPLICATION_ID=
DISCORD_CLIENT_ID=
DISCORD_PUBLIC_KEY=
DISCORD_BOT_TOKEN=
DISCORD_REGISTER_COMMANDS_SECRET=

# Deployment used by `npx convex dev`
CONVEX_DEPLOYMENT=

CONVEX_URL=

CONVEX_SITE_URL=
37 changes: 30 additions & 7 deletions packages/notifier-bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,40 @@

<a href="https://grand-yak-92.convex.site/slack/install"><img alt="Add to Slack" height="40" src="https://platform.slack-edge.com/img/add_to_slack.png" srcset="https://platform.slack-edge.com/img/add_to_slack.png 1x, https://platform.slack-edge.com/img/add_to_slack@2x.png 2x"></a>

[Add to Discord](https://grand-yak-92.convex.site/discord/install)

> **Help us reach the Slack Marketplace!** We need at least 5 active workspace installs before Slack will approve PatchPulse for the official Marketplace. If the bot looks useful to you, installing it now is a huge help — it's free and takes about 30 seconds.

This package contains the Convex-powered notifier backend for Patch Pulse.

It currently supports:

- Slack workspace subscriptions
- Discord server subscriptions
- npm package polling
- Multi-channel Slack tracking per workspace
- Multi-channel Slack and Discord tracking
- Delayed GitHub metadata enrichment and AI release summaries

More detailed docs live here:

- [`docs/discord.md`](./docs/discord.md): Discord install flow, slash commands, and channel behavior
- [`docs/slack.md`](./docs/slack.md): Slack install flow, slash commands, list formatting, and channel behavior
- [`docs/architecture.md`](./docs/architecture.md): schema, polling flow, metadata enrichment, and implementation notes
- [`docs/deployment.md`](./docs/deployment.md): environment variables, Slack endpoint setup, and deployment checks
- [`docs/runbook.md`](./docs/runbook.md): troubleshooting common Slack, polling, and `/npmlist` issues
- [`docs/deployment.md`](./docs/deployment.md): environment variables, Slack and Discord endpoint setup, and deployment checks
- [`docs/runbook.md`](./docs/runbook.md): troubleshooting common Slack, Discord, polling, and `/npmlist` issues

## What This Package Does

The notifier stores tracked packages, Slack workspace details, and per-channel subscriptions in Convex.
The notifier stores tracked packages, subscriber details for Slack workspaces and Discord servers, and per-channel subscriptions in Convex.

An hourly cron checks tracked packages for updates. When a newer version is found:

1. The package record is updated in Convex.
2. GitHub repo metadata is stored on the package when it can be derived from npm metadata.
3. Matching subscribers are grouped by Slack target channel.
3. Matching subscribers are grouped by delivery target.
4. Slack notifications are sent to the relevant channel or the workspace default channel.
5. If upstream metadata is incomplete, Patch Pulse retries later, updates the original post with release links, and adds an AI summary in the thread when the evidence is strong enough.
5. Discord notifications are sent to the explicit subscribed channel.
6. If upstream metadata is incomplete, Patch Pulse retries later, updates the original Slack post with release links, and adds an AI summary in the thread when the evidence is strong enough.

## Slack Summary

Expand All @@ -50,6 +55,24 @@ Examples:
- `/npmuntrack react #frontend`
- `/npmlist`

## Discord Summary

Discord tracking is channel-based:

- A Discord server has no default channel.
- Every subscription targets an explicit channel.
- A subscription is effectively scoped by `(guild, package, channel)`.
- `/npmlist` groups subscriptions by channel.

Examples:

- `/npmtrack package:react`
- `/npmtrack package:react channel:#frontend`
- `/npmtrack package:react filter:minor`
- `/npmuntrack package:react`
- `/npmuntrack package:react channel:#frontend`
- `/npmlist`

## Development

Useful commands from this package directory:
Expand All @@ -63,4 +86,4 @@ Useful commands from this package directory:
- `/npmlist` does not perform live npm lookups. It uses stored package metadata so the response stays fast.
- GitHub links in `/npmlist` appear after polling has enriched a package with repo metadata.
- Update notifications can include richer release links because polling already fetches npm manifests during the update check.
- Patch Pulse uses status reactions on the original Slack post: `⏳` queued/pending, `📝` summary added, `⚠️` no trustworthy release details found after retries, `❌` processing failed.
- Slack-only enrichment uses status reactions on the original Slack post: `⏳` queued/pending, `📝` summary added, `⚠️` no trustworthy release details found after retries, `❌` processing failed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"guidelinesHash": "62d72acb9afcc18f658d88dd772f34b5b1da5fa60ef0402e57a784d97c458e57",
"agentsMdSectionHash": "bbf30bd25ceea0aefd279d62e1cb2b4c207fcb712b69adf26f3d02b296ffc7b2",
"claudeMdHash": "bbf30bd25ceea0aefd279d62e1cb2b4c207fcb712b69adf26f3d02b296ffc7b2",
"agentSkillsSha": "4de8fba05b0a506661116985649072777049f67b",
"agentSkillsSha": "231a67aa8a5b29cc2794cbc8298335a71aaa6d0e",
"installedSkillNames": [
"convex",
"convex-create-component",
"convex-migration-helper",
"convex-performance-audit",
Expand Down
Loading