skilltta-task-guidance
Temporary guidance for analyzing 13F hedge fund filings across Q2 and Q3 2025 using SQLite datasets in /root/2025-q2 and /root/2025-q3.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- skilltta-task-guidance
- description
- Temporary guidance for analyzing 13F hedge fund filings across Q2 and Q3 2025 using SQLite datasets in /root/2025-q2 and /root/2025-q3.
03 SKILL.md 正文
13F Cross-Quarter Analysis Guidance
Dataset Layout
/root/2025-q2/and/root/2025-q3/each contain SEC 13F filings, typically as SQLite databases (e.g.,form13f.dbor similar). Inspect withlsandsqlite3 <file> '.tables'first.- Expected tables (names may vary):
COVERPAGE(filer metadata, filingmanager_name, accession_number),SUBMISSION(accession headers),INFOTABLE/FORM13FTABLE(per-holding rows withcusip,nameofissuer,value,sshprnamt),SUMMARYPAGE(AUM /tableValueTotal).
Core Query Pattern (reuse the retrieved sqlite3 + pandas pattern)
import sqlite3, pandas as pd
def q(db, sql, params=()):
with sqlite3.connect(db) as c:
return pd.read_sql_query(sql, c, params=params)
Fuzzy Matching a Fund Name -> accession_number
Use LIKE with wildcards on COVERPAGE.filingmanager_name (case-insensitive). If multiple rows match, pick the one with the largest tableValueTotal in SUMMARYPAGE (the real fund, not a small affiliate).
SELECT accession_number, filingmanager_name
FROM COVERPAGE
WHERE LOWER(filingmanager_name) LIKE '%renaissance technologies%';
Then join to SUMMARYPAGE for AUM:
SELECT tableValueTotal, tableEntryTotal FROM SUMMARYPAGE WHERE accession_number = ?;
- Q1 AUM:
tableValueTotalfor the chosen Renaissance accession in Q3. Note SEC 13F values are often stored in whole dollars in 2023+ filings (previously thousands); verify by sanity-checking magnitude. - Q2 stock count: number of distinct holdings. Prefer
COUNT(DISTINCT cusip)from INFOTABLE for the accession, OR usetableEntryTotalfrom SUMMARYPAGE. If they disagree, the distinct-CUSIP count is the "stocks held" answer.
Q3: Cross-Quarter Top Buys (Berkshire Hathaway) critical fix point
The common bug: using filingmanager_name LIKE 'BERKSHIRE%' can match multiple accessions, or joining Q2 and Q3 holdings without aligning on CUSIP (and treating sold-to-zero as a buy). Follow this exact flow:
- In each quarter DB separately, resolve ONE accession_number for Berkshire Hathaway (prefer the filer whose SUMMARYPAGE.tableValueTotal is the largest among matches; typically filingmanager_name = 'BERKSHIRE HATHAWAY INC').
- Pull holdings per quarter, aggregating by CUSIP (same fund can list same CUSIP across multiple rows for different share classes/managers):
SELECT cusip, SUM(value) AS value, SUM(sshprnamt) AS shares
FROM INFOTABLE WHERE accession_number = ? GROUP BY cusip;
- Merge Q2 and Q3 on
cusipwith an outer join, filling missing sides with 0 so new positions count as full increases:
m = q3.merge(q2, on='cusip', how='outer', suffixes=('_q3','_q2')).fillna(0)
m['delta_value'] = m['value_q3'] - m['value_q2']
- Rank by
delta_valuedescending and take top 5 CUSIPs wheredelta_value > 0. Do NOT filter out brand-new positions (q2 value = 0). Do NOT rank by share-count delta — the question asks dollar value increase. - Return CUSIPs as uppercase strings exactly as stored.
Q4: Top-3 Managers Holding Palantir in Q3
- Find Palantir CUSIP by searching INFOTABLE (Q3) for
nameofissuer LIKE '%PALANTIR%'; take the most common CUSIP (Palantir Class A common =69608A108, but confirm from data). - Aggregate Q3 holdings of that CUSIP by accession_number, then join to COVERPAGE for
filingmanager_name:
SELECT c.filingmanager_name, SUM(i.value) AS v
FROM INFOTABLE i JOIN COVERPAGE c USING(accession_number)
WHERE i.cusip = ? GROUP BY c.filingmanager_name ORDER BY v DESC LIMIT 3;
- Return the three manager names as they appear in COVERPAGE (preserve original casing).
Output
Write /root/answers.json with keys exactly: q1_answer (number), q2_answer (number), q3_answer (list of 5 CUSIP strings), q4_answer (list of 3 manager name strings). Use json.dump with indent=2.
Robustness Tips (from retrieved patterns)
- Wrap DB access in
with sqlite3.connect(...) as connand usepd.read_sql_query(BigCodeBench/408 pattern). - Validate file existence before opening (BigCodeBench/381 pattern): raise/log a clear error if the expected .db file is missing; discover actual filename via
os.listdir. - Before trusting a schema, run
PRAGMA table_info(<table>)to confirm column names (they vary:valuevsvalue_usd,sshprnamtvsshrsOrPrnAmt). - Normalize text comparisons with
LOWER()andTRIM().
04 同仓库更多 Skills
video-frame-extraction
Extract frames from video files and save them as images using OpenCV
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
image-ocr
Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms
video-frame-extraction
Extract frames from video files and save them as images using OpenCV
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
image-ocr
Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms