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.
npx skills add sequenzia/agent-alchemy --skill dp-patternsgit clone --depth 1 https://github.com/sequenzia/agent-alchemyWrote 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.
[](https://agentmods.dev/skills/sequenzia/agent-alchemy/dp-patterns)<a href="https://agentmods.dev/skills/sequenzia/agent-alchemy/dp-patterns"><img src="https://agentmods.dev/badge/skills/sequenzia/agent-alchemy/dp-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/sequenzia/agent-alchemy/dp-patterns"><img src="https://agentmods.dev/badge/skills/sequenzia/agent-alchemy/dp-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00031 | $0.05396 |
| Opus 5.5 | $0.00012 | $0.02158 |
| Sonnet 5.5 | $0.00006 | $0.01079 |
| Haiku 4.5 | $0.00003 | $0.00540 |
Grade A, and why
dp-patterns 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 429 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Dynamic Programming Patterns
This reference covers eight foundational dynamic programming patterns commonly encountered in algorithmic problem solving. Each pattern includes recognition signals to identify when a problem maps to the technique, a working Python template, and specific edge cases and mistakes to watch for. Load this skill when solving optimization, counting, or subsequence problems that exhibit optimal substructure and overlapping subproblems.
General DP Approach
Before selecting a specific pattern, apply this checklist:
- Identify the state: What information do you need to uniquely describe a subproblem? (index, remaining capacity, bitmask of visited nodes)
- Define the recurrence: How does the answer for the current state relate to answers for smaller states?
- Establish base cases: What are the trivial subproblems with known answers?
- Determine iteration order: Ensure every state is computed before it is needed (bottom-up) or use memoization (top-down)
- Optimize space: If dp[i] depends only on dp[i-1] (or a small window), use rolling arrays instead of the full table
Pattern Recognition Table
| Trigger Signals | Technique | Typical Complexity |
|---|---|---|
| "count the number of ways", "how many distinct paths" | Fibonacci / Climbing Stairs | O(N) time, O(1) space |
| "maximize value with weight limit", "partition into two equal subsets" | 0/1 Knapsack | O(N * W) time, O(W) space |
| "longest common subsequence", "minimum edit operations" | LCS / Edit Distance | O(N * M) time, O(min(N, M)) space |
| "longest increasing subsequence", "minimum number of envelopes" | LIS | O(N log N) time, O(N) space |
| "unique paths in grid", "minimum cost to reach bottom-right" | Grid DP | O(R * C) time, O(C) space |
| "maximum subarray sum", "best contiguous segment" | Kadane's Algorithm | O(N) time, O(1) space |
| "fewest coins to make amount", "ways to combine denominations" | Coin Change / Unbounded Knapsack | O(N * amount) time, O(amount) space |
| "visit all nodes exactly once", "assign N items optimally", N <= 20 | Bitmask DP | O(2^N * N) time, O(2^N) space |
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.
- 1mo ago First seen · 429 lines · 31 tokens per session scan A e5de460a128f
dp-patterns is a skill published in the GitHub repository sequenzia/agent-alchemy (45 stars, last pushed 4mo ago), licensed MIT. It adds 31 tokens to every session and 5,396 once invoked, about $0.0001 per session on Opus 5.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.
Other skills, from other repositories
ccc-research
Research before you build: cited multi-source research, spec interviews, cross-model review, literature reviews, competitive and trend analysis, and large-document or large-codebase ingestion. Use when the user wants options compared, prior art found, a spec defined, or something too big summarized.
add-didactic-comments
Comment tagged files so the user learns the APIs they are studying, with a doc link in every comment.
gan-zhong-xue
A learning workflow that makes an AI explain code changes through questions, evidence, and underlying principles. It is designed to help developers understand work they asked an AI to do, rather than merely accept the result.
bro
Use when the user says an explanation was unclear, too technical, or full of jargon, or asks for plain language.
formal-methods-guide
A reference guide to formal methods, which use mathematics to describe and check how software should behave, with a focus on the VDM-SL specification language. It explains VDM-SL types, conditions, invariants, and proof obligations in developer-friendly terms.
quiz-me
Use right after writing or editing code or files for the user — before ending your turn — to quiz them on what was just built and confirm they actually understand it. Also triggers on "quiz me", "test my understanding", "check what I learned", "comprehension check", or recovering the understanding that vaporizes when…