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
21 changes: 21 additions & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "expert-system",
"owner": {
"name": "STAR MODE",
"url": "https://github.com/starmode-base"
},
"plugins": [
{
"name": "expert-system",
"source": {
"source": "github",
"repo": "starmode-base/expert-system-plugin"
},
"version": "2.0.0",
"description": "Curated research, FRED macroeconomic data, and SEC company financials with source provenance."
}
],
"metadata": {
"description": "Expert System research, macroeconomic data, and financials plugins."
}
}
21 changes: 8 additions & 13 deletions .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
{
"name": "expert-system",
"description": "Search curated research and query real-time macroeconomic data and normalized SEC company financials.",
"version": "1.0.0",
"version": "2.0.0",
"description": "Curated research, FRED macroeconomic data, and SEC company financials with source provenance.",
"author": {
"name": "Starmode"
"name": "STAR MODE",
"url": "https://github.com/starmode-base"
},
"repository": {
"type": "git",
"url": "https://github.com/starmode-base/expert-system-plugin"
},
"userConfig": {
"api_key": {
"description": "Expert System API key (get one at https://expert-system.starmode.dev/account/api-keys)",
"sensitive": true
}
}
"homepage": "https://expert-system.starmode.dev",
"repository": "https://github.com/starmode-base/expert-system-plugin",
"keywords": ["research", "macroeconomics", "financials", "fred", "sec"],
"skills": "./skills/"
}
30 changes: 30 additions & 0 deletions .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "expert-system",
"version": "2.0.0",
"description": "Curated research, FRED macroeconomic data, and SEC company financials with source provenance.",
"author": {
"name": "STAR MODE",
"url": "https://github.com/starmode-base"
},
"homepage": "https://expert-system.starmode.dev",
"repository": "https://github.com/starmode-base/expert-system-plugin",
"keywords": ["research", "macroeconomics", "financials", "fred", "sec"],
"skills": "./skills/",
"mcpServers": "./.mcp.json",
"interface": {
"displayName": "Expert System",
"shortDescription": "Research, macro data, and company financials",
"longDescription": "Curated research, FRED macroeconomic data, and SEC company financials with source provenance.",
"developerName": "STAR MODE",
"category": "Productivity",
"websiteURL": "https://expert-system.starmode.dev",
"defaultPrompt": [
"Find recent research about AI infrastructure.",
"Show the latest US inflation observations.",
"Compare Apple revenue and operating cash flow."
],
"capabilities": ["Read"],
"privacyPolicyURL": "https://expert-system.starmode.dev/privacy.html",
"termsOfServiceURL": "https://expert-system.starmode.dev/terms.html"
}
}
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
pull_request:
push:
branches: [main]
# The server repository does not run this check, so drift originating there
# would otherwise go unnoticed until the next plugin change or release.
schedule:
- cron: "17 11 * * *"
workflow_dispatch:

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Check out plugin
uses: actions/checkout@v4
with:
path: expert-system-plugin

# The cross-repository contract test reads the server's tool registry,
# hosted marketplace copy, and policy pages. Both repositories are public,
# so the default token is sufficient.
- name: Check out server
uses: actions/checkout@v4
with:
repository: starmode-base/expert-system
path: expert-system

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- run: bun install --frozen-lockfile
working-directory: expert-system-plugin

- run: bun run typecheck
working-directory: expert-system-plugin

- run: bun run lint
working-directory: expert-system-plugin

- run: bun run format:check
working-directory: expert-system-plugin

# Without EXPERT_SYSTEM_SERVER_ROOT the cross-repository test is silently
# skipped, so a green run here would not prove synchronization.
- run: bun run plugin:check
working-directory: expert-system-plugin
env:
EXPERT_SYSTEM_SERVER_ROOT: ${{ github.workspace }}/expert-system
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
*.tsbuildinfo
__pycache__/
dist/
8 changes: 8 additions & 0 deletions .mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mcpServers": {
"expert-system": {
"type": "http",
"url": "https://expert-system.starmode.dev/api/mcp"
}
}
}
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bun.lock
dist/
22 changes: 22 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Agent guidelines

## Server–plugin synchronization

Expert System is maintained in two repositories, normally checked out as siblings:

- `expert-system` owns the MCP server, OAuth, tool schemas and response semantics, website, and public privacy/terms pages.
- `expert-system-plugin` owns the plugin manifests, shared skills, installation documentation, packaging tests, and plugin releases. Do not duplicate the plugin package in the server repository.

When changing MCP tool names, arguments, responses, errors, limits, pagination, units, fiscal-period semantics, endpoint URLs, or OAuth requirements, inspect the corresponding code and instructions in **both** repositories. Update affected plugin skills, `agents/openai.yaml` dependencies, manifests, tests, and documentation together with server changes. The server contract is defined by `src/server/mcp/tools.ts` and its referenced schemas/operations; do not infer it from stale skill text.

The plugin's `.claude-plugin/marketplace.json` is canonical. Keep the server's `public/marketplace.json` identical whenever plugin versions, descriptions, or source references change. Keep identity and version metadata synchronized across the plugin's portable, Claude, and Codex manifests; transport declarations must point to the same MCP endpoint. Policy URLs in plugin metadata must correspond to pages hosted by the server.

For changes affecting this shared contract or a plugin release, run this command **from the plugin repository**, in addition to each repository's relevant checks:

```bash
EXPERT_SYSTEM_SERVER_ROOT=../expert-system bun run plugin:check
```

Use the actual server checkout path if the repositories are not siblings. The cross-repository test is skipped when `EXPERT_SYSTEM_SERVER_ROOT` is unset; a standalone green run is not synchronization validation. The check verifies tool names, marketplace parity, and policy files, but does not validate argument/response semantics or live OAuth behavior. Review affected schemas and workflows and run relevant server tests; perform client smoke tests when connection or packaging behavior changes. Update contract assertions only for intentional changes, never merely to make drift checks pass.

Preserve compatibility with already-installed plugin versions where possible. For breaking changes, document the required plugin version and rollout order in `documents/plugin-release.md` in the plugin repository. If work spans both repositories, link the companion PRs and report checks for each. If a companion checkout is unavailable, report the synchronization work and checks still needed; do not claim the change is release-ready.
103 changes: 79 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,98 @@
# Expert System Plugin for Claude Code
# Expert System

A Claude Code plugin that gives Claude access to real-time research intelligence, macroeconomic indicators, and normalized SEC company financials.
Research intelligence, FRED macroeconomic observations, and normalized SEC company financials for Claude Code and Codex. Version **2.0.0** uses OAuth and one shared set of skills.

## Skills
Service: [expert-system.starmode.dev](https://expert-system.starmode.dev) · [Support](https://github.com/starmode-base/expert-system-plugin/issues) · [Privacy](https://expert-system.starmode.dev/privacy.html) · [Terms](https://expert-system.starmode.dev/terms.html)

| Skill | Command | What it does |
|-------|---------|-------------|
| **Research** | `/expert-system:research` | Search recent news, analysis, and insights from tech blogs, X posts, podcast transcripts, earnings calls, and expert commentary |
| **Macro** | `/expert-system:macro` | Query macroeconomic indicators — GDP, unemployment, inflation, interest rates, housing, consumer sentiment |
| **Financials** | `/expert-system:financials` | Query deterministic, normalized SEC company financial metrics by ticker or CIK |
## Capabilities

All three skills also trigger automatically based on context — you don't need to invoke them by name.
| Skill | Example | Workflow |
| ---------- | -------------------------------------------------- | ------------------------------------------------------------------ |
| Research | “What are experts saying about AI infrastructure?” | Search previews → selected takeaways → bounded source verification |
| Macro | “Show recent US inflation and unemployment.” | Resolve supported FRED series → retrieve dated observations |
| Financials | “Compare Apple's revenue and operating cash flow.” | Discover metrics → retrieve company series with filing provenance |

## Install
Results preserve source links, observation dates, units, and fiscal-period semantics. These capabilities do not provide live stock prices, forecasts, or trading. There are 11 data tools; the server also offers a free `get_profile` identity utility. Data calls share the account's REST quota, including valid calls that return empty or partial results.

```
/plugin install github://starmode-base/expert-system-plugin
## Claude Code installation

Once v2 is available on the repository's default branch, run:

```text
/plugin marketplace add starmode-base/expert-system-plugin
/plugin install expert-system@expert-system
```

## Setup
Restart Claude Code, open `/mcp`, and follow the Expert System sign-in flow. Approve the OAuth read access and any client tool-permission prompts you intend to allow. No API key is required. Use natural-language requests or `/expert-system:research`, `/expert-system:macro`, and `/expert-system:financials`.

1. Get your API key at [expert-system.starmode.dev/account/api-keys](https://expert-system.starmode.dev/account/api-keys)
For local development before publication: `claude --plugin-dir /absolute/path/to/expert-system-plugin`. For isolated install testing and GitHub branch validation, see [the release checklist](documents/plugin-release.md).

2. Add your key to `~/.claude/plugins/expert-system/env.json`:
Update with `/plugin marketplace update expert-system` then `/plugin update expert-system@expert-system`. Remove with `/plugin uninstall expert-system@expert-system`. Manage sign-in separately in `/mcp`; uninstalling a plugin does not delete your service account or billing subscription.

## Codex installation

Clone the desired release of this repository. Register a local marketplace pointing at that checkout using the bundled plugin-creator skill, or create this temporary marketplace layout:

```text
expert-system-marketplace/
.agents/plugins/marketplace.json
plugins/expert-system/ # plugin files from the release archive
```

Use this catalog in `.agents/plugins/marketplace.json`:

```json
{
"EXPERT_SYSTEM_API_KEY": "esak_..."
"name": "expert-system-local",
"interface": { "displayName": "Expert System" },
"plugins": [
{
"name": "expert-system",
"source": { "source": "local", "path": "./plugins/expert-system" },
"policy": { "installation": "AVAILABLE", "authentication": "ON_INSTALL" },
"category": "Productivity"
}
]
}
```

## Examples
Register and install it using a Codex CLI with plugin support:

```sh
codex plugin marketplace add /absolute/path/to/expert-system-marketplace
codex plugin add expert-system@expert-system-local
```

Alternatively, select that marketplace in the Codex Plugins UI and install Expert System. Complete its OAuth sign-in prompt, then start a new task so the skills and connection are loaded. Ask naturally or select the research, macro, or financials skill. The three summaries support routing; the host discovers tool schemas as needed rather than this plugin eagerly loading them.

- "What's happening with Nvidia?"
- "Give me a news briefing on AI development"
- "What's the current unemployment rate and how has it trended?"
- "Compare Apple's quarterly revenue and net income with SEC provenance"
To update, replace the plugin directory with the new release, refresh the marketplace with `codex plugin marketplace upgrade expert-system-local`, and reinstall from the Plugins UI (or remove/add using the CLI). Start a new task. Remove with `codex plugin remove expert-system@expert-system-local`; remove an unused marketplace with `codex plugin marketplace remove expert-system-local`.

## Links
## Sign-in and troubleshooting

- [Expert System](https://expert-system.starmode.dev)
- [API Key Management](https://expert-system.starmode.dev/account/api-keys)
The shared MCP endpoint is `https://expert-system.starmode.dev/api/mcp`. Sign in through the client's connection controls; credentials belong to the client, never plugin files or prompts. The server requests `expert-system:read`. Cancelling sign-in leaves the connection unavailable; retry when ready. An expired or revoked session may require reconnecting. For access denied, verify your account and authorization rather than repeatedly retrying tools.

In Claude Code use `/mcp`; in Codex inspect `/mcp` and the plugin's connection settings. If tools are missing, confirm installation, enable the plugin, reconnect, and start a fresh task. Remove duplicate manually configured Expert System connections if they cause duplicate tools. A quota error requires waiting for renewal or managing your plan, not reinstalling. Report client version and redacted error details through Support; never post tokens or personal data.

For a v1 upgrade, uninstall the old plugin, remove its saved plugin API-key configuration, then install v2 and sign in. Existing REST `/api/v1` integrations continue to use their API keys; revoke an old key only if it is no longer used elsewhere.

## Plugin development and release

The root `plugin.json` and `mcp.json` follow the [portable Agent Plugins format](https://developers.openai.com/plugins/build/plugins). `.claude-plugin/` and `.codex-plugin/` provide client compatibility; both use the same `skills/`. Skill MCP dependencies follow [OpenAI's skill guidance](https://developers.openai.com/plugins/build/skills). The server repository hosts `public/marketplace.json` as a compatibility copy of this repository’s canonical Claude marketplace. Privacy and terms pages are also hosted by the server.

```sh
bun install --frozen-lockfile
bun run plugin:check
claude plugin validate .claude-plugin/plugin.json
claude plugin validate .
python3 scripts/package-plugin.py /tmp/expert-system-2.0.0.zip
bun run typecheck && bun run lint && bun run format
```

The archive includes only the plugin manifests, README, release checklist, and skills. It excludes application code, environment files, local config, and dependencies. Installation from GitHub still checks out the repository; never commit credentials. Release, clean-profile validation, routing scenarios, monitoring, and rollback are documented in [the release checklist](documents/plugin-release.md).

The plugin checks run without a server checkout. Before release, additionally verify
the 11-tool contract, hosted marketplace copy, and policy files against the server:

```sh
EXPERT_SYSTEM_SERVER_ROOT=/absolute/path/to/expert-system bun run plugin:check
```
Loading
Loading