Variables
Arguments: $ARGUMENTS
Configured active profile: ${user_config.active_profile}
Purpose
Bring a repository-owned briefing profile to a working state and, only when explicitly
requested, install the optional deterministic presentation build toolchain. The plugin is
repository- and organization-agnostic; consumers supply their own authorized sources,
audience lens, and branding.
Check-centric per the uniform setup contract (docs/PLUGIN-PHILOSOPHY.md
"Setup is explicit and repeatable" in the marketplace repository): check inspects and
reports, apply scaffolds the profile, and the build-toolchain install is a distinct
opt-in subaction rather than fused behind a flag. Tracked profile configuration belongs in
the consuming repository, never in ${CLAUDE_PLUGIN_DATA}, which is reserved for
machine-local state and generated artifacts.
Action routing: no argument or check runs the check; apply runs the check first, then
scaffolds; apply install-build-deps additionally authorizes the build-toolchain install
below. --profile <name> selects the profile for either action and wins over the configured
active profile. All actions are non-interactive when the profile is unambiguous. Never
prompt when the action and profile are given.
Profile contents
Files at .claude/ai-briefing/ form the default profile. Each
.claude/ai-briefing/<name>/ directory is a named profile. Selecting a named
profile is profile selection, not resolution of a *.local.* cascade layer.
| Artifact |
Purpose |
sources.md |
Approved RSS/Atom feeds, official release pages, GitHub repositories, and user-supplied URLs. |
brand.json (optional) |
Declarative organization name, tagline, local logo assets, and theme tokens. |
audience.md (optional) |
Stack/audience lens used for impact annotations. |
check (read-only)
Resolve the profile, then probe its state and the build toolchain and report a
PASS/FAIL/INFO table with one remediation line per FAIL. Do not create, modify, or install
anything.
- Resolve the profile. Parse
--profile <name> from $ARGUMENTS; otherwise use the
rendered ${user_config.active_profile} value when non-empty, else the root default
profile. A per-run --profile wins. Require a 1-63 character lowercase-kebab slug and
reject reserved Windows device names. Report the resolved profile path, which of the three
sources supplied it. When the resolved value came from ${user_config.active_profile} or
the configured value is wrong for this repository, also report the reconfiguration route:
- Interactive, any time:
/plugin configure ai-briefing@<marketplace>. The recommended
route; this skill never writes pluginConfigs.
- Headless: rerun the install with the new value, per the marketplace's
plugin-reconfiguration convention
(https://github.com/melodic-software/claude-code-plugins/blob/main/docs/conventions/plugin-reconfiguration/README.md,
which owns the verified-version record):
claude plugin install ai-briefing@<marketplace> -s <scope> --config active_profile=<name> (repeatable per key) — against an
already-installed plugin it prints already installed and still writes the value. Do
not uninstall to reconfigure: that drops this plugin's entire stored pluginConfigs
entry, resetting every option in the README's Options reference to its manifest default.
-s defaults to user; pass the scope claude plugin list reports for this plugin, and
run from that project's directory for a project/local scope, or the write lands at a
scope that does not load. Afterwards rerun check in a fresh session — the rendered
${user_config.*} is injected at skill load, so a same-session check still reports the
OLD value; report the observed effective value, never an unobserved change.
- Neither, for a one-off: a per-run
--profile <name> selects a different profile without
touching stored config.
sources.md. FAIL if the resolved profile has no sources.md: /ai-briefing:generate
has no authorized sources to collect from. Remediation: apply.
- Optional profile files. INFO: report whether
audience.md and declarative brand.json
exist; their absence is expected and never a FAIL.
- Build toolchain. INFO unless the consumer intends
--format html/--format slides.
Report whether the locked runtime at ${CLAUDE_PLUGIN_DATA}/runtime/build exists and its
.version matches the plugin's plugin.json version (a mismatch means a rebuild is due).
Read-only: never launch a browser here. Missing or stale is INFO with remediation
apply install-build-deps, because the toolchain is opt-in. Markdown output needs none
of it.
- Build preflight. INFO: report
node --version, npm --version, and the OS family
against Playwright's current supported environment matrix. The README's matrix is a dated
snapshot (verified against
Playwright system requirements);
the linked page is authoritative. Re-check it before installing.
apply (idempotent)
Run check, then scaffold the resolved profile. Re-running after everything passes changes
nothing and reports "already configured".
Scaffold authorized sources. Create the profile directory when absent. If sources.md
does not exist, create it with short sections for official vendor feeds, GitHub
repositories/releases, reputable secondary sources, and user-supplied URLs. Leave an
existing file unchanged. Do not seed X handles, navigate X, scrape following graphs, or
install an X API provider. Note the current X access restriction and link the
authoritative terms: https://x.com/en/tos.
Offer optional profile files. Offer audience.md and declarative brand.json, creating only
the files the consumer requests. Keep local logo assets beside brand.json. These files are
team-tracked in the selected profile directory. This surface has no gitignored *.local.*
overlay.
apply install-build-deps installs the optional build toolchain. Parse the subaction
before invoking a shell and never interpolate raw arguments into a command. Without it,
skip this step and change no existing runtime. With it, build and validate a temporary
locked runtime first, then replace the current runtime with same-filesystem renames. A
dependency, browser-install, or launch failure must leave the working runtime untouched.
The plugin cache is read-only, and Node ESM does not use NODE_PATH for bare-package
resolution.
command -v node >/dev/null 2>&1 || {
echo "ai-briefing setup requires Node.js" >&2
exit 1
}
command -v npm >/dev/null 2>&1 || {
echo "ai-briefing setup requires npm" >&2
exit 1
}
NODE_MAJOR=$(node -p "Number(process.versions.node.split('.')[0])")
case "$NODE_MAJOR" in
22|24|26) ;;
*) echo "ai-briefing setup requires the latest Node.js 22.x, 24.x, or 26.x" >&2; exit 1 ;;
esac
PLATFORM=$(uname -s)
case "$PLATFORM" in
Linux|Darwin|MINGW*|MSYS*|CYGWIN*) ;;
*) echo "ai-briefing setup does not support platform: $PLATFORM" >&2; exit 1 ;;
esac
VER=$(node -p "require('${CLAUDE_PLUGIN_ROOT}/.claude-plugin/plugin.json').version")
RT="${CLAUDE_PLUGIN_DATA}/runtime"
CURRENT="$RT/build"
if [ "$(cat "$CURRENT/.version" 2>/dev/null)" != "$VER" ]; then
mkdir -p "$RT"
STAGE=$(mktemp -d "$RT/.build-stage.XXXXXX")
BACKUP="$RT/.build-backup.$$"
cleanup() { rm -rf "$STAGE"; }
trap cleanup EXIT INT TERM
cp -R "${CLAUDE_PLUGIN_ROOT}/skills/generate/output/build/." "$STAGE"
if ! (
cd "$STAGE" &&
npm ci --no-fund --no-audit &&
case "$(uname -s)" in
Linux*) npx playwright install --with-deps --only-shell chromium ;;
*) npx playwright install --only-shell chromium ;;
esac &&
node --input-type=module -e \
"import { chromium } from 'playwright'; const b = await chromium.launch(); await b.close();" &&
printf '%s' "$VER" > .version
); then
echo "ai-briefing build setup failed; preserved the existing runtime" >&2
exit 1
fi
rm -rf "$BACKUP"
if [ -d "$CURRENT" ] && ! mv "$CURRENT" "$BACKUP"; then
echo "ai-briefing could not preserve the existing runtime; refusing to replace it" >&2
exit 1
fi
if mv "$STAGE" "$CURRENT"; then
STAGE=""
rm -rf "$BACKUP"
trap - EXIT INT TERM
else
if [ -d "$BACKUP" ]; then mv "$BACKUP" "$CURRENT"; fi
exit 1
fi
fi
npm ci uses the committed lockfile and fails on dependency drift. Playwright is retained
only to render and inspect generated local HTML/PDF artifacts; it must not be used as a
collection browser. On Linux, Playwright's documented --with-deps path installs required
operating-system packages. Other supported platforms install the browser shell and rely
on their platform prerequisites. Supported OS and Node targets are whatever
Playwright's system requirements
currently list (the README's matrix is a dated snapshot of that page. The link is
authoritative). The launch probe runs before the runtime swap.
After the install, re-run the check build-toolchain probe and report its actual result.
Never claim the toolchain is ready on the swap's exit code alone.
Confirm. Report the profile path, whether sources.md was created or preserved, which
optional profile files were created, and whether build dependencies were installed or
intentionally skipped. Point the consumer to /ai-briefing:generate.
This skill does not
- Run a briefing.
- Write curated configuration into
${CLAUDE_PLUGIN_DATA}.
- Automate X/Twitter access or configure an X API provider.
- Install the optional build tree unless
apply install-build-deps is invoked.
- Write the plugin cache, Claude Code user settings, or
pluginConfigs.
1---2name: setup-233description: Verify or configure an ai-briefing profile and, only when explicitly requested, install the deterministic HTML/PDF/PPTX build toolchain. Use when: 'set up ai-briefing', 'configure ai-briefing', 'add an ai-briefing profile', 'is ai-briefing working', or 'ai-briefing setup'. Actions: check (read-only verification, default) | apply (scaffold the profile) | apply install-build-deps (also install the build toolchain). Idempotent — safe to re-run.4---56## Variables78Arguments: `$ARGUMENTS`9Configured active profile: `${user_config.active_profile}`1011## Purpose1213Bring a repository-owned briefing profile to a working state and, only when explicitly14requested, install the optional deterministic presentation build toolchain. The plugin is15repository- and organization-agnostic; consumers supply their own authorized sources,16audience lens, and branding.1718Check-centric per the uniform setup contract (`docs/PLUGIN-PHILOSOPHY.md`19"Setup is explicit and repeatable" in the marketplace repository): `check` inspects and20reports, `apply` scaffolds the profile, and the build-toolchain install is a distinct21opt-in subaction rather than fused behind a flag. Tracked profile configuration belongs in22the consuming repository, never in `${CLAUDE_PLUGIN_DATA}`, which is reserved for23machine-local state and generated artifacts.2425Action routing: no argument or `check` runs the check; `apply` runs the check first, then26scaffolds; `apply install-build-deps` additionally authorizes the build-toolchain install27below. `--profile <name>` selects the profile for either action and wins over the configured28active profile. All actions are non-interactive when the profile is unambiguous. Never29prompt when the action and profile are given.3031## Profile contents3233Files at `.claude/ai-briefing/` form the default profile. Each34`.claude/ai-briefing/<name>/` directory is a named profile. Selecting a named35profile is profile selection, not resolution of a `*.local.*` cascade layer.3637| Artifact | Purpose |38|---|---|39| `sources.md` | Approved RSS/Atom feeds, official release pages, GitHub repositories, and user-supplied URLs. |40| `brand.json` (optional) | Declarative organization name, tagline, local logo assets, and theme tokens. |41| `audience.md` (optional) | Stack/audience lens used for impact annotations. |4243## `check` (read-only)4445Resolve the profile, then probe its state and the build toolchain and report a46PASS/FAIL/INFO table with one remediation line per FAIL. Do not create, modify, or install47anything.48491. **Resolve the profile.** Parse `--profile <name>` from `$ARGUMENTS`; otherwise use the50 rendered `${user_config.active_profile}` value when non-empty, else the root `default`51 profile. A per-run `--profile` wins. Require a 1-63 character lowercase-kebab slug and52 reject reserved Windows device names. Report the resolved profile path, which of the three53 sources supplied it. When the resolved value came from `${user_config.active_profile}` or54 the configured value is wrong for this repository, also report the reconfiguration route:55 - **Interactive, any time:** `/plugin configure ai-briefing@<marketplace>`. The recommended56 route; this skill never writes `pluginConfigs`.57 - **Headless:** rerun the install with the new value, per the marketplace's58 plugin-reconfiguration convention59 (<https://github.com/melodic-software/claude-code-plugins/blob/main/docs/conventions/plugin-reconfiguration/README.md>,60 which owns the verified-version record): `claude plugin install ai-briefing@<marketplace>61 -s <scope> --config active_profile=<name>` (repeatable per key) — against an62 already-installed plugin it prints `already installed` **and still writes the value**. Do63 **not** uninstall to reconfigure: that drops this plugin's entire stored `pluginConfigs`64 entry, resetting every option in the README's Options reference to its manifest default.65 `-s` defaults to `user`; pass the scope `claude plugin list` reports for this plugin, and66 run from that project's directory for a `project`/`local` scope, or the write lands at a67 scope that does not load. Afterwards rerun `check` in a **fresh session** — the rendered68 `${user_config.*}` is injected at skill load, so a same-session `check` still reports the69 OLD value; report the observed effective value, never an unobserved change.70 - **Neither, for a one-off:** a per-run `--profile <name>` selects a different profile without71 touching stored config.722. **`sources.md`.** FAIL if the resolved profile has no `sources.md`: `/ai-briefing:generate`73 has no authorized sources to collect from. Remediation: `apply`.743. **Optional profile files.** INFO: report whether `audience.md` and declarative `brand.json`75 exist; their absence is expected and never a FAIL.764. **Build toolchain.** INFO unless the consumer intends `--format html`/`--format slides`.77 Report whether the locked runtime at `${CLAUDE_PLUGIN_DATA}/runtime/build` exists and its78 `.version` matches the plugin's `plugin.json` version (a mismatch means a rebuild is due).79 Read-only: never launch a browser here. Missing or stale is INFO with remediation80 `apply install-build-deps`, because the toolchain is opt-in. Markdown output needs none81 of it.825. **Build preflight.** INFO: report `node --version`, `npm --version`, and the OS family83 against Playwright's current supported environment matrix. The README's matrix is a dated84 snapshot (verified against85 [Playwright system requirements](https://playwright.dev/docs/intro#system-requirements));86 the linked page is authoritative. Re-check it before installing.8788## `apply` (idempotent)8990Run `check`, then scaffold the resolved profile. Re-running after everything passes changes91nothing and reports "already configured".92931. **Scaffold authorized sources.** Create the profile directory when absent. If `sources.md`94 does not exist, create it with short sections for official vendor feeds, GitHub95 repositories/releases, reputable secondary sources, and user-supplied URLs. Leave an96 existing file unchanged. Do not seed X handles, navigate X, scrape following graphs, or97 install an X API provider. Note the current X access restriction and link the98 authoritative terms: <https://x.com/en/tos>.992. **Offer optional profile files.** Offer `audience.md` and declarative `brand.json`, creating only100 the files the consumer requests. Keep local logo assets beside `brand.json`. These files are101 team-tracked in the selected profile directory. This surface has no gitignored `*.local.*`102 overlay.1033. **`apply install-build-deps` installs the optional build toolchain.** Parse the subaction104 before invoking a shell and never interpolate raw arguments into a command. Without it,105 skip this step and change no existing runtime. With it, build and validate a temporary106 locked runtime first, then replace the current runtime with same-filesystem renames. A107 dependency, browser-install, or launch failure must leave the working runtime untouched.108 The plugin cache is read-only, and Node ESM does not use `NODE_PATH` for bare-package109 resolution.110111 ```bash112 command -v node >/dev/null 2>&1 || {113 echo "ai-briefing setup requires Node.js" >&2114 exit 1115 }116 command -v npm >/dev/null 2>&1 || {117 echo "ai-briefing setup requires npm" >&2118 exit 1119 }120 NODE_MAJOR=$(node -p "Number(process.versions.node.split('.')[0])")121 case "$NODE_MAJOR" in122 22|24|26) ;;123 *) echo "ai-briefing setup requires the latest Node.js 22.x, 24.x, or 26.x" >&2; exit 1 ;;124 esac125 PLATFORM=$(uname -s)126 case "$PLATFORM" in127 Linux|Darwin|MINGW*|MSYS*|CYGWIN*) ;;128 *) echo "ai-briefing setup does not support platform: $PLATFORM" >&2; exit 1 ;;129 esac130131 VER=$(node -p "require('${CLAUDE_PLUGIN_ROOT}/.claude-plugin/plugin.json').version")132 RT="${CLAUDE_PLUGIN_DATA}/runtime"133 CURRENT="$RT/build"134135 if [ "$(cat "$CURRENT/.version" 2>/dev/null)" != "$VER" ]; then136 mkdir -p "$RT"137 STAGE=$(mktemp -d "$RT/.build-stage.XXXXXX")138 BACKUP="$RT/.build-backup.$$"139 cleanup() { rm -rf "$STAGE"; }140 trap cleanup EXIT INT TERM141142 cp -R "${CLAUDE_PLUGIN_ROOT}/skills/generate/output/build/." "$STAGE"143 if ! (144 cd "$STAGE" &&145 npm ci --no-fund --no-audit &&146 case "$(uname -s)" in147 Linux*) npx playwright install --with-deps --only-shell chromium ;;148 *) npx playwright install --only-shell chromium ;;149 esac &&150 node --input-type=module -e \151 "import { chromium } from 'playwright'; const b = await chromium.launch(); await b.close();" &&152 printf '%s' "$VER" > .version153 ); then154 echo "ai-briefing build setup failed; preserved the existing runtime" >&2155 exit 1156 fi157158 rm -rf "$BACKUP"159 if [ -d "$CURRENT" ] && ! mv "$CURRENT" "$BACKUP"; then160 echo "ai-briefing could not preserve the existing runtime; refusing to replace it" >&2161 exit 1162 fi163 if mv "$STAGE" "$CURRENT"; then164 STAGE=""165 rm -rf "$BACKUP"166 trap - EXIT INT TERM167 else168 if [ -d "$BACKUP" ]; then mv "$BACKUP" "$CURRENT"; fi169 exit 1170 fi171 fi172 ```173174 `npm ci` uses the committed lockfile and fails on dependency drift. Playwright is retained175 only to render and inspect generated local HTML/PDF artifacts; it must not be used as a176 collection browser. On Linux, Playwright's documented `--with-deps` path installs required177 operating-system packages. Other supported platforms install the browser shell and rely178 on their platform prerequisites. Supported OS and Node targets are whatever179 [Playwright's system requirements](https://playwright.dev/docs/intro#system-requirements)180 currently list (the README's matrix is a dated snapshot of that page. The link is181 authoritative). The launch probe runs before the runtime swap.182183 After the install, re-run the `check` build-toolchain probe and report its actual result.184 Never claim the toolchain is ready on the swap's exit code alone.1851864. **Confirm.** Report the profile path, whether `sources.md` was created or preserved, which187 optional profile files were created, and whether build dependencies were installed or188 intentionally skipped. Point the consumer to `/ai-briefing:generate`.189190## This skill does not191192- Run a briefing.193- Write curated configuration into `${CLAUDE_PLUGIN_DATA}`.194- Automate X/Twitter access or configure an X API provider.195- Install the optional build tree unless `apply install-build-deps` is invoked.196- Write the plugin cache, Claude Code user settings, or `pluginConfigs`.