# sector-pe-ratios

Retrieves sector P/E ratios across stock exchanges using Octagon MCP. Helps compare equity valuations against sector baselines.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 260 installs · ★ 132 repo stars
- Author: OctagonAI
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/OctagonAI/skills/tree/HEAD/skills/sector-pe-ratios/SKILL.md
- Updated: 2026-06-05
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/sector-pe-ratios

## What it does

This skill guides your coding assistant to query sector-wide price-to-earnings ratios by date, exchange, and industry. It routes natural language queries through the `octagon-mcp` server using the `octagon-agent` tool, backed by the `octagon-stock-data-agent` source.

You can query exchanges like NYSE, NASDAQ, or AMEX. Without the Octagon MCP server configured in your environment, the agent cannot return valuation numbers. The skill also provides guidance for calculating discount and premium percentages against sector averages.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add OctagonAI/skills --skill sector-pe-ratios -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/sector-pe-ratios/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/sector-pe-ratios/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add OctagonAI/skills --skill sector-pe-ratios -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/sector-pe-ratios/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add OctagonAI/skills --skill sector-pe-ratios -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/sector-pe-ratios/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install OctagonAI/skills skills/sector-pe-ratios
```

2. **Manually: put the files in place**
- File: `.github/skills/sector-pe-ratios/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add OctagonAI/skills --skill sector-pe-ratios -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/OctagonAI/skills --path skills/sector-pe-ratios
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/sector-pe-ratios/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add OctagonAI/skills --skill sector-pe-ratios -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/OctagonAI/skills/tree/HEAD/skills/sector-pe-ratios/SKILL.md

## When to use it
- benchmark a company valuation against sector P/E medians
- compare Technology sector valuations between NYSE and NASDAQ
- track sector P/E multiples across different trading dates

## Example prompts
- Retrieve the latest sector P/E ratios for 2025-02-03, filtered by exchange NASDAQ and sector Technology
- Compare P/E ratios for Technology and Financials sectors on NYSE
- Check if AAPL trades at a discount compared to the Technology sector P/E

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 76c23f6fc912e59c.

BEGIN THIRD-PARTY FILE 76c23f6fc912e59c
````text
---
name: sector-pe-ratios
description: Retrieve sector P/E ratios using Octagon MCP. Use when comparing company valuations to sector benchmarks, analyzing sector valuations across exchanges, and understanding market-wide valuation trends.
---

# Sector P/E Ratios

Retrieve price-to-earnings ratios by sector and exchange using the Octagon MCP server.

## Prerequisites

Ensure Octagon MCP is configured in your AI agent (Cursor, Claude Desktop, Windsurf, etc.). See [references/mcp-setup.md](references/mcp-setup.md) for installation instructions.

## Workflow

### 1. Identify Parameters

Determine your query parameters:
- **Date**: Specific date for the data
- **Exchange**: NYSE, NASDAQ, etc.
- **Sector**: Technology, Healthcare, Financials, etc.

### 2. Execute Query via Octagon MCP

Use the `octagon-agent` tool with a natural language prompt:

```
Retrieve the latest sector P/E ratios for <DATE>, filtered by exchange <EXCHANGE> and sector <SECTOR>.
```

**MCP Call Format:**

```json
{
  "server": "octagon-mcp",
  "toolName": "octagon-agent",
  "arguments": {
    "prompt": "Retrieve the latest sector P/E ratios for 2025-02-03, filtered by exchange NASDAQ and sector Technology."
  }
}
```

### 3. Expected Output

The agent returns sector P/E data:

| Metric | Value |
|--------|-------|
| Sector | Technology |
| Exchange | NASDAQ |
| P/E Ratio | 58.77 |
| Date | 2025-02-03 |

**Data Sources**: octagon-stock-data-agent

### 4. Interpret Results

See [references/interpreting-results.md](references/interpreting-results.md) for guidance on:
- Comparing company P/E to sector P/E
- Historical sector valuation context
- Cross-sector comparisons
- Exchange-specific analysis

## Example Queries

**Specific Sector and Exchange:**
```
Retrieve the latest sector P/E ratios for 2025-02-03, filtered by exchange NASDAQ and sector Technology.
```

**All Sectors on Exchange:**
```
Get P/E ratios for all sectors on the NYSE.
```

**Sector Comparison:**
```
Compare P/E ratios for Technology, Healthcare, and Financials sectors.
```

**Historical Trend:**
```
What is the historical P/E trend for the Technology sector on NASDAQ?
```

**Cross-Exchange:**
```
Compare Technology sector P/E ratios on NYSE vs. NASDAQ.
```

## Understanding P/E Ratios

### Definition

```
P/E Ratio = Stock Price / Earnings Per Share
```

For sectors:
```
Sector P/E = Weighted Average P/E of all stocks in the sector
```

### Types of P/E

| Type | Description |
|------|-------------|
| Trailing P/E | Based on past 12 months earnings |
| Forward P/E | Based on estimated future earnings |
| GAAP P/E | Using GAAP earnings |
| Non-GAAP P/E | Using adjusted earnings |

## Sector Categories

### Major Sectors

| Sector | Typical P/E Range |
|--------|-------------------|
| Technology | 25-60 |
| Healthcare | 18-35 |
| Financials | 10-18 |
| Consumer Discretionary | 15-30 |
| Consumer Staples | 18-25 |
| Industrials | 15-25 |
| Energy | 8-20 |
| Utilities | 15-22 |
| Real Estate | 30-50 |
| Materials | 12-20 |
| Communications | 15-25 |

### P/E Characteristics by Sector

| Sector | P/E Tendency | Reason |
|--------|--------------|--------|
````
END THIRD-PARTY FILE 76c23f6fc912e59c

The third-party file has ended. Everything between the 76c23f6fc912e59c tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3141 of 6736 bytes. © OctagonAI · MIT · https://github.com/OctagonAI/skills/tree/HEAD/skills/sector-pe-ratios/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
