apply-algorithms
Skill7 starsChanged 15 days agoMITView on GitHub
Use when a problem shape maps to a classic family — dynamic programming, greedy, divide-and-conquer, graph search, or sort-first — and you must pick and justify the algorithm.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- VelimirMueller/claude-skillsword for word, first seen Nov 1, 2026
Other versions1 project uses a version of this.
Word for word · 1
- VelimirMueller/claude-skills★ 7100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository156 other files it gives its agents.
- skills/swift/swiftui-design-principles/AGENTS.mdAGENTS.md
- skills/swift/ios-code-audit/CLAUDE.mdCLAUDE.md
- skills/swift/swift-focusengine-pro/llms.txtllms.txt
- build-llm-seamSkill
- build-mcp-serverSkill
- build-rag-pipelineSkill
- secure-llm-featuresSkill
- set-up-llm-evalsSkill
- build-nextjs-backendSkill
- build-supabase-edge-functionSkill
- configure-backend-testsSkill
- design-http-apiSkill
- harden-backendSkill
- scaffold-fastapi-serviceSkill
- scaffold-go-serviceSkill
- scaffold-hono-serviceSkill
- secure-supabase-rlsSkill
- set-up-backend-authSkill
- set-up-background-jobsSkill
- set-up-databaseSkill
- set-up-nextjs-supabase-authSkill
- set-up-observabilitySkill
- set-up-supabaseSkill
- build-cliSkill
- release-cliSkill
- set-up-dev-toolchainSkill
- audit-securitySkill
- audit-toolchainSkill
- extend-skillsetSkill
- promote-releaseSkill
- set-up-stack-profileSkill
- write-commit-messagesSkill
- write-pull-requestsSkill
- analyze-complexitySkill
- apply-design-patternsSkill
- apply-design-principlesSkill
- apply-solidSkill
- choose-data-structureSkill
- debug-systematicallySkill
- enforce-dependency-ruleSkill
- refactor-safelySkill
- slice-and-estimateSkill
- write-clean-testsSkill
- write-readable-codeSkill
- clean-frontend-scaffoldingSkill
- configure-accessibilitySkill
- configure-analyticsSkill
- configure-ciSkill
- configure-error-trackingSkill
- configure-lintingSkill
- configure-test-stackSkill
- configure-typescriptSkill
- create-moduleSkill
- optimize-performanceSkill
- scaffold-frontend-projectSkill
- set-up-authSkill
- set-up-design-systemSkill
- set-up-document-headSkill
- set-up-error-boundariesSkill
- set-up-feature-flagsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
When a recursive solution recomputes the same subproblem, DP memoises it.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Apply Algorithms
Maps a problem's shape to the classic algorithm family that solves it (CLRS), with the complexity that justifies the choice. Data-structure half of the decision: choose-data-structure.
The families
- Divide and conquer — independent subproblems, combine the results (mergesort, binary search).
Solve the recurrence with the master theorem; often
O(n log n). - Dynamic programming — overlapping subproblems with optimal substructure: cache the repeated work.
When a recursive solution recomputes the same subproblem, DP memoises it.
O(n)–O(n²)typical. - Greedy — a locally optimal choice is globally optimal, only when a greedy-choice proof holds
(Huffman coding, Kruskal/Prim MST
O(E log V)). Never use greedily on a hunch; it is either proven or wrong. - Graph search — BFS/DFS
O(V + E)for reachability, connected components, topological sort; DijkstraO((V + E) log V)for non-negative shortest paths only (any negative edge breaks it); Bellman-FordO(VE)for negative edges, and it detects negative cycles; Floyd-WarshallO(V³)for all pairs. - Sort-first — sort then scan turns many pairwise problems into one pass (
O(n log n)+O(n)). - Bounded-integer tricks — counting/radix/bucket sort reach
O(n)when keys are small integers.
1. Audit (change nothing)
cat .claude/stack-profile.md 2>/dev/null | head -20
grep -rn "sort\|recur\|memo\|visited\|queue\|stack\|priority" --include="*.ts" --include="*.rs" --include="*.go" --include="*.py" . 2>/dev/null | head -30State the problem in one line, then name its shape: optimal substructure and overlapping subproblems → DP; independent subproblems → divide and conquer; a provable local optimum → greedy; nodes and edges or reachability → graph; "for each pair" → sort-first.
2. Pick and justify
- DP: identify the state, the recurrence, and the base case; memoise or bottom-up.
- Greedy: write the exchange/proof argument first; without it, fall back to DP.
- Graph: choose the traversal by the question (reachability, shortest path, cycles, ordering).
- Sort-first: sort by the key that makes the remaining question one linear pass.
3. State the complexity and the edge cases
Give the time and space order of the chosen algorithm, and the inputs it fails on: negatives (Dijkstra), already-sorted (quicksort), a cycle (topological sort), a graph with no path (shortest path).
Verify
The chosen family matches the named problem shape, the complexity is stated, and the edge case that breaks the algorithm is handled. A counterexample to a greedy choice fails the proof before it ships.
When to deviate
- The problem is small: the simplest correct algorithm beats the clever one.
- A well-tested standard-library or framework function already implements it — call it, do not re-implement.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

