portfolio-risk

portfolio-risk is a skill for Claude Code from awslabs/agentcore-samples. It costs 28 tokens per session (427 once invoked), scanned A, original, Apache-2.0.

A workflow for assessing the risk of a group of stocks or a sector allocation. It examines how concentrated the holdings are, how much exposure they have to volatile sectors, and assigns an overall risk level.

In plain words
What is it for?
Use it to review stock portfolios, sector diversification, concentration risk, volatility exposure, and fit with a risk tolerance.
Why use it?
It makes concentration and volatility risks easier to identify than looking at a holdings list alone. It also highlights the largest risk factor and suggests a defensive addition for aggressive portfolios.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

About the project

Amazon Bedrock AgentCore Samples is a collection of examples and tutorials for deploying and operating AI agents with Amazon Bedrock AgentCore. Developers use it to integrate agent applications built with different frameworks and language models while learning AgentCore features. The catalogue add-ons provide agent-oriented guidance for working with these samples and services.

awslabs/agentcore-samples · 3,336 stars · on GitHub · aws.amazon.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/awslabs/agentcore-samples/portfolio-risk
Any agent
npx skills add awslabs/agentcore-samples --skill portfolio-risk
Clone the repo
git clone --depth 1 https://github.com/awslabs/agentcore-samples

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for portfolio-risk

README.md
[![agentmods](https://agentmods.dev/badge/skills/awslabs/agentcore-samples/portfolio-risk.svg)](https://agentmods.dev/skills/awslabs/agentcore-samples/portfolio-risk)
Your own site
<a href="https://agentmods.dev/skills/awslabs/agentcore-samples/portfolio-risk"><img src="https://agentmods.dev/badge/skills/awslabs/agentcore-samples/portfolio-risk.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 427 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00028 $0.00427
Opus 5 $0.00014 $0.00214
Sonnet 5 $0.00006 $0.00085
Haiku 4.5 $0.00003 $0.00043

Measured 6d ago against content hash edaa620744f8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

portfolio-risk scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

02-use-cases/01-conversational-agents/market-trends-agent/skills/portfolio-risk/SKILL.md · 44 lines

What it actually says

Portfolio Risk Assessment Skill

Use this skill when a user asks about portfolio risk, how risky a set of holdings is, concentration risk, diversification, or whether a portfolio is suitable for a given risk tolerance.

Required workflow

  1. For each stock in the portfolio, retrieve data using get_stock_data.
  2. Retrieve sector data for each unique sector represented using get_sector_data.
  3. Compute concentration risk:
    • If any single sector > 50% of holdings → High Concentration Risk
    • If any single sector 30–50% → Moderate Concentration Risk
    • Otherwise → Diversified
  4. Assess volatility exposure:
    • High-beta sectors (Technology, Consumer Discretionary): count them
    • If > 50% of holdings in high-beta sectors → High Volatility Exposure
    • If 25–50% → Moderate; < 25% → Low
  5. Identify the single largest risk factor from sector risk lists.
  6. Score overall risk tier: Conservative, Moderate, Aggressive:
    • Conservative: Low volatility + Diversified
    • Aggressive: High volatility OR High Concentration
    • Moderate: all other combinations
  7. Suggest one defensive addition (from Consumer Staples or Healthcare sectors) if risk is Aggressive.

Output Format

Portfolio Risk Assessment
  Holdings analyzed : {symbols list}
  Sector breakdown  : {sector: count breakdown}
  Concentration     : {High | Moderate | Diversified}
  Volatility exposure: {High | Moderate | Low}
  Top risk factor   : {single biggest risk from sector data}
  Overall risk tier : {Conservative | Moderate | Aggressive}
  Recommendation    : {1-2 sentences on risk mitigation or confirmation}
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 44 lines · 28 tokens per session scan A edaa620744f8

Subscribe to this mod's changes

portfolio-risk is a skill published in the GitHub repository awslabs/agentcore-samples (3,336 stars, last pushed yesterday), licensed Apache-2.0. It adds 28 tokens to every session and 427 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

travel-expense-audit

Audit travel / 差旅报销 claims against uploaded policy handbooks and rate tables (lodging caps, transport, per diem). Use for 差旅费审核, travel expense review, or lodging over-limit checks.

vixues/LeAgent · 51 tokens

risk-scoring

Score how concentrated and risky a portfolio is on a 0-100 scale from its position weights. Use when the user asks how risky their portfolio is, whether it is too concentrated, or for a diversification check.

microsoft/agent-framework · 47 tokens

valuation

Estimate whether a stock looks cheap or expensive using a price-to-earnings (P/E) based fair-value method. Use when the user asks if a stock is over- or under-valued, or for a fair-value / target price.

microsoft/agent-framework · 51 tokens

babysit

Same-session monitoring loop for PRs, CI runs, tickets, and deployments using the monitorstart / monitorupdate / autonudgestop MCP tools. The loop re-injects your check instructions into THIS session on an idle interval — same context, same tools — and works from dashboard chat, Slack threads, and Discord DMs. Use…

kirodotdev/KiroCrew · 137 tokens

computer-use

Read and drive native desktop applications through the accessibility layer — list on-screen apps, snapshot one window as a numbered element tree, then click / type / set a value / scroll / drag / run a named action, by element index or by screen coordinates. Use for work in a desktop app rather than a web page. Full…

kirodotdev/KiroCrew · 105 tokens

goal-conductor

Own a long-horizon goal end to end - decompose it into work items, stand up one top-level session per item, patrol their state on a nudge loop, and decide each next round until the goal is met or a stop condition fires. Use when the user hands over a goal too large for one session ("clear the flaky-test backlog"…

kirodotdev/KiroCrew · 105 tokens