用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cxcscmu/SkillLearnBench --skill run2-cross-fund-analysis命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Handles reading, populating, and saving .docx files using the python-docx library. Use this skill for any tasks involving template filling or modifying Word documents.
Perform various data analysis on SEC 13-F and obtain some insights of fund activities such as number of holdings, AUM, and change of holdings between two quarters.
This skill includes search capability in 13F, such as fuzzy search a fund information using possibly inaccurate name, or fuzzy search a stock cusip info using its name.
基于 SOC 职业分类
正在显示 SKILL.md
| name | run2_cross_fund_analysis |
| description | Find which funds hold a specific stock and rank them by holding value |
Analyze which funds hold a specific security (identified by CUSIP) and rank them by the size of their investment. This is useful for understanding which asset managers have the largest positions in a given stock.
import pandas as pd
# You already know the CUSIP
palantir_cusip = "69608A108"
# Use the fuzzy-name-search skill
# Command: python3 scripts/search_stock_cusip.py --keywords palantir --topk 10
# Returns: CUSIP: 69608A108
# Search NAMEOFISSUER in INFOTABLE
infotable = pd.read_csv('/root/2025-q3/INFOTABLE.tsv', sep='\t', low_memory=False)
palantir_rows = infotable[infotable['NAMEOFISSUER'].str.contains('Palantir', case=False, na=False)]
cusip = palantir_rows['CUSIP'].unique()[0]
print(f"Palantir CUSIP: {cusip}")
import pandas as pd
palantir_cusip = "69608A108"
# Load INFOTABLE for the target quarter
infotable = pd.read_csv('/root/2025-q3/INFOTABLE.tsv', sep='\t', low_memory=False)
# Find all fund holdings of this stock
stock_holdings = infotable[infotable['CUSIP'] == palantir_cusip]
print(f"Number of funds holding this stock: {stock_holdings['ACCESSION_NUMBER'].nunique()}")
print(f"Total holdings records: {len(stock_holdings)}")
# Load COVERPAGE to get fund names
coverpage = pd.read_csv('/root/2025-q3/COVERPAGE.tsv', sep='\t')
# Merge holdings with fund information
holdings_with_funds = pd.merge(
stock_holdings,
coverpage[['ACCESSION_NUMBER', 'FILINGMANAGER_NAME']],
on='ACCESSION_NUMBER'
)
print(f"Unique funds: {holdings_with_funds['FILINGMANAGER_NAME'].nunique()}")
# Group by fund manager and sum the value
fund_holdings = holdings_with_funds.groupby('FILINGMANAGER_NAME').agg({
'VALUE': 'sum',
'SSHPRNAMT': 'sum', # Share count
'ACCESSION_NUMBER': 'first'
}).reset_index()
# Rename for clarity
fund_holdings.columns = ['FUND_NAME', 'TOTAL_VALUE', 'TOTAL_SHARES', 'ACCESSION_NUMBER']
# Sort by value (descending) to get largest holders
fund_holdings = fund_holdings.sort_values('TOTAL_VALUE', ascending=False)
print(fund_holdings.head(10))
# Extract top 3 fund names
top_3_funds = fund_holdings.nlargest(3, 'TOTAL_VALUE')
top_3_names = top_3_funds['FUND_NAME'].tolist()
print("Top 3 funds holding Palantir (by value):")
for i, (name, value) in enumerate(zip(top_3_names, top_3_funds['TOTAL_VALUE']), 1):
print(f"{i}. {name}: ${value:,.0f}")
import pandas as pd
# Stock CUSIP
palantir_cusip = "69608A108"
# Load files
infotable = pd.read_csv('/root/2025-q3/INFOTABLE.tsv', sep='\t', low_memory=False)
coverpage = pd.read_csv('/root/2025-q3/COVERPAGE.tsv', sep='\t')
# Find all holdings
palantir_holdings = infotable[infotable['CUSIP'] == palantir_cusip]
# Merge with fund names
holdings_with_names = pd.merge(
palantir_holdings,
coverpage[['ACCESSION_NUMBER', 'FILINGMANAGER_NAME']],
on='ACCESSION_NUMBER'
)
# Aggregate by fund
fund_summary = holdings_with_names.groupby('FILINGMANAGER_NAME').agg({
'VALUE': 'sum'
}).reset_index()
# Sort and get top 3
top_3 = fund_summary.nlargest(3, 'VALUE')
fund_names = top_3['FILINGMANAGER_NAME'].tolist()
print(fund_names)
# Output: ['VANGUARD GROUP INC', 'BlackRock, Inc.', 'STATE STREET CORP']
For a given CUSIP:
stock_holdings['ACCESSION_NUMBER'].nunique()stock_holdings['SSHPRNAMT'].sum()stock_holdings['VALUE'].sum()nlargest(3, 'VALUE')# Some funds may have Palantir in multiple rows (different options, derivatives, etc.)
# The groupby().sum() handles this correctly by aggregating all values
# Example: Fund A might have:
# Row 1: 100M (common stock)
# Row 2: 50M (call options)
# Total: 150M (correctly summed by groupby)
# Ensure CUSIP is treated as string
infotable = pd.read_csv(
'INFOTABLE.tsv',
sep='\t',
low_memory=False,
dtype={'CUSIP': 'str', 'ACCESSION_NUMBER': 'str', 'VALUE': 'int64'}
)
# Option 1: Exact CUSIP match
stock_holdings = infotable[infotable['CUSIP'] == cusip]
# Option 2: CUSIP contains (for potential variations)
stock_holdings = infotable[infotable['CUSIP'].str.contains(cusip_partial, na=False)]
# Option 3: NAMEOFISSUER contains (good for verification)
stock_holdings = infotable[infotable['NAMEOFISSUER'].str.contains('Palantir', case=False, na=False)]
{
"stock_cusip": "69608A108",
"stock_name": "PALANTIR TECHNOLOGIES INC",
"number_of_funds": 4531,
"total_value": 123456789,
"top_3_funds": [
{
"rank": 1,
"name": "VANGUARD GROUP INC",
"value": 39017133374,
"shares": 213886270
},
{
"rank": 2,
"name": "BlackRock, Inc.",
"value": 34409511965,
"shares": 188627957
},