From dsa-coach
Verify and add a newly-solved DSA problem to the configured metadata file. Looks up official metadata (title, difficulty, topic tags) from the source platform and pulls LeetCode company frequencies from a public aggregator. Use after the user solves a new problem.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dsa-coach:add-problem <file-path> (e.g. leetcode/704_binary_search.ts)<file-path> (e.g. leetcode/704_binary_search.ts)The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Add metadata for a newly-solved problem to the configured metadata file. Skip the manual research grind.
Add metadata for a newly-solved problem to the configured metadata file. Skip the manual research grind.
Look for dsa-coach.config.json in the current working directory. If present, parse it and use its values. For any missing key, fall back to the documented default below. If the file is absent entirely, use all defaults.
Config keys + defaults:
language (default "ts") — solution file extension.solutionDirs (default { "leetcode": "leetcode", "geeksforgeeks": "geeksforgeeks", "hackerrank": "hackerrank", "interviewbit": "interviewbit" }) — platform key → folder name.metaFile (default "data/problems-meta.json") — metadata file to read/write.statsCommand (default "npm run stats") — optional stats regen command; skip gracefully if null/absent.Throughout this skill, metaFile means the configured metadata path and the solutionDirs values are the folder names to match against.
$ARGUMENTS is the repo-relative path to the newly-added solution file (e.g. leetcode/704_binary_search.ts).
If empty: run git status --short scoped to the directory holding metaFile plus every solutionDirs value (e.g. git status --short data/ leetcode/ geeksforgeeks/ hackerrank/ interviewbit/, using the configured folders) to find new untracked solution files with the configured language extension. If multiple, ask which one. If one, use it.
If the file already has an entry in metaFile under problems: warn, ask whether to refresh metadata or abort.
From the path, match the leading folder against the solutionDirs values (the examples below use the defaults; substitute the configured folder names and language extension):
<leetcode-dir>/<NNN>_<slug>.<language> → LeetCode, problem ID = <NNN><geeksforgeeks-dir>/<topic>/<slug>.<language> → GFG, slug = filename<hackerrank-dir>/<slug>.<language> → HackerRank, slug = filename<interviewbit-dir>/<slug>.<language> → InterviewBitRead the file's first ~20 lines. If a // Problem link - <url> comment exists, it's authoritative — use that URL.
LeetCode <NNN> "<inferred title>" difficulty topics tagshttps://github.com/doocs/leetcode/blob/main/solution/<padded-range>/<NNN>...README_EN.md for tags.GeeksforGeeks "<problem name>" practice difficulty topic tagshttps://www.geeksforgeeks.org/problems/<slug>/1 URL when available./challenges/<slug>/problem page directly — usually returns difficulty + subdomain.Run via Bash:
tmp=$(mktemp -d)
ID=<problem-id>
COMPANIES="amazon google microsoft meta apple bloomberg uber adobe netflix tiktok oracle goldman-sachs nvidia salesforce linkedin atlassian airbnb"
for co in $COMPANIES; do
curl -sL "https://raw.githubusercontent.com/snehasishroy/leetcode-companywise-interview-questions/master/$co/all.csv" \
-o "$tmp/$co.csv"
done
for co in $COMPANIES; do
freq=$(awk -F',' -v id="$ID" 'NR>1 && $1==id{print $NF}' "$tmp/$co.csv" 2>/dev/null)
if [ -n "$freq" ]; then echo "$co $freq"; fi
done
Selection rule: companies with frequency ≥ 50%. If more than 5 qualify, take top 5 by frequency. If fewer than 5 qualify but problem has any, include all.
Capitalize properly when writing to JSON: meta → Meta, tiktok → TikTok, nvidia → NVIDIA, goldman-sachs → Goldman Sachs, linkedin → LinkedIn, otherwise Title Case.
For GFG / HackerRank / InterviewBit: leave companies: []. The aggregator above is LC-only and GFG company tags are gated behind their JS-rendered SPA — don't guess.
category and patternscategory = single primary topic. Heuristics: Array, String, Sorting, Linked List, Tree, Graph, Dynamic Programming. Pick the dominant one — usually matches the source folder for GFG.patterns = the official topic tags array from Step 3, verbatim. Don't invent tags. If source uses a famous algorithm name not in LC tags (e.g. "Boyer-Moore"), do NOT include it — stick to platform-official tags only.If a new pattern appears that's not in the existing corePatterns array in metaFile, add it there too.
Read metaFile. If it does not exist, self-heal: create it with the skeleton { "corePatterns": [], "problems": {} } before inserting. Use Edit to insert the new entry into problems (keep the file path key as <platform>/<file> matching $ARGUMENTS exactly).
Entry shape:
"<file-path>": {
"title": "<official title with exact casing>",
"difficulty": "<Easy|Medium|Hard>",
"category": "<primary topic>",
"patterns": ["<official tag>", ...],
"companies": ["<Company>", ...]
}
After write, validate JSON. Use the configured metaFile path:
python3 -c "import json; json.load(open('<metaFile>'))" && echo OK
If statsCommand is configured (non-null), run it:
<statsCommand>
Confirm the script prints the updated problem count.
If statsCommand is null or absent, print "stats command not configured — skipping" and continue.
Print a 5-line summary:
$ARGUMENTS
Searches MemPalace before answering questions about past work, people, projects, or prior decisions. Returns verbatim stored content instead of guessing from model memory.
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
Implements vector databases with Pinecone, Weaviate, Qdrant, Milvus, pgvector for semantic search, RAG, recommendations, and similarity systems. Optimizes embeddings, indexing, and hybrid search.
npx claudepluginhub arkajyotiadhikary/dsa-coach --plugin dsa-coach