dynamic-programming-analysis ยท diff
v1.0.0 to v1.1.0
30 added, 180 removed. Audit A to A.
What this update changes in the checks
No check changed: every fixed check gives the same answer before and after this update.
A tripped check is a label, not a verdict: read the matched text and the lines below. This week's updates that newly trip a check.
---
name: dynamic-programming-analysis
description: >
Use this skill whenever the user presents a problem, challenge, decision, or complex question
that needs to be broken down into smaller, manageable sub-problems, just like dynamic programming
in computer science. Triggers include: any problem that feels too big or overwhelming, strategic
planning questions, optimization challenges (what is the best way to...), multi-step processes,
decision trees, architectural designs, research questions, business or personal dilemmas, or any
situation where the user says they do not know where to start. Always use this skill when
decomposition, step-by-step reasoning, or structured problem-solving would help, even if the user
does not mention dynamic programming explicitly. The goal is to model the DP mindset: identify
base cases, define sub-problems, find overlapping structure, and build toward the solution
bottom-up.
metadata:
author: Ronnasayd Machado - github.com/Ronnasayd
- version: "1.0.0"
+ version: "1.1.0"
---
# Dynamic Programming Analysis
- This skill transforms any complex problem into a structured analysis inspired by **dynamic programming**: break the larger problem into smaller sub-problems, identify dependencies, solve from the bottom up, and avoid redundant work.
-
- ---
-
- ## Core Philosophy
-
- Dynamic Programming (DP) solves complex problems using two fundamental principles:
-
- 1. **Optimal Substructure** โ the solution to the larger problem depends on the solutions to smaller sub-problems.
- 2. **Overlapping Sub-problems** โ sub-problems recur; by identifying them, we avoid repeated work (memoization).
-
- Apply this logic to _any_ domain: business, personal decisions, software architecture, research, learning, and projects.
-
- ---
-
- ## Analysis Protocol
-
- When presented with a problem, always follow this pipeline:
-
- ### 1. ๐ฏ Define the Main Problem
-
- - Restate the problem precisely: what exactly needs to be solved?
- - Identify the desired **final state** (what does "solved" look like?)
- - Identify explicit and implicit **constraints**
-
- ### 2. ๐งฉ Decompose into Sub-problems
-
- - Break the problem into smaller, independent (or nearly independent) parts
- - For each sub-problem, ask: "Can this problem be broken down further?"
- - Continue until reaching the **base cases** โ simple problems with direct solutions
-
- **Output Format:**
-
- ```text
- Main Problem
- โโโ Sub-problem A
- โ โโโ Sub-problem A.1 (base case)
- โ โโโ Sub-problem A.2
- โ โโโ Sub-problem A.2.1 (base case)
- โ โโโ Sub-problem A.2.2 (base case)
- โโโ Sub-problem B
- โโโ Sub-problem B.1 (base case)
- โโโ Sub-problem B.2 (base case)
- ```
-
- ### 3. ๐ Identify Overlaps (Memoization)
-
- - Which sub-problems appear in multiple branches?
- - Which partial solutions can be **reused**?
- - Which insights, once discovered, eliminate repeated effort?
-
- Mark these explicitly โ they represent the greatest efficiency gains.
-
- ### 4. โฌ๏ธ Resolution Order (Bottom-Up)
-
- - List the base cases first (lowest dependency)
- - Order sub-problems by dependency: solve prerequisites before dependents
- - Create a clear **execution sequence**
-
- ### 5. ๐ ๏ธ Solve Each Sub-problem
-
- For each sub-problem (from smallest to largest):
-
- - Present the direct solution or required reasoning
- - If multiple options exist, compare them briefly
- - Indicate which higher-level problem this solution supports
-
- ### 6. ๐ Compose the Final Solution
-
- - Combine the sub-problem solutions back into the original problem
- - Show how the pieces fit together
- - Validate: does the composed solution solve the original problem?
-
- ### 7. โ
Verification and Edge Cases
-
- - What could fail? (extreme cases, incorrect assumptions)
- - Are there external dependencies outside your control?
- - Is the solution optimal, or simply good enough?
-
- ---
-
- ## Standard Response Format
-
- Use this template when responding:
-
- ```markdown
- ## ๐ง Dynamic Programming Analysis
-
- ### Main Problem
-
- [precise definition]
-
- ### Sub-problem Tree
-
- [hierarchical text/tree structure]
-
- ### Base Cases
-
- [list of the simplest sub-problems and their direct solutions]
-
- ### Identified Overlaps
-
- [repeated sub-problems and reusable solutions]
-
- ### Resolution Sequence (Bottom-Up)
-
- [recommended order of execution]
-
- ### Composed Solution
-
- [how the solutions combine to solve the original problem]
-
- ### Risks and Edge Cases
-
- [what to watch for]
- ```
-
- ---
-
- ## Adaptations by Problem Type
-
- ### Decision Problems
-
- - Sub-problem = each decision criterion
- - Base case = verifiable facts, not opinions
- - Overlap = criteria affecting multiple options
- - Composition = decision table or matrix
-
- ### Planning / Project Problems
-
- - Sub-problem = each deliverable or milestone
- - Base case = atomic tasks (1 person, 1 day)
- - Overlap = shared dependencies between phases
- - Composition = schedule / roadmap
-
- ### Technical / Architecture Problems
-
- - Sub-problem = each component or module
- - Base case = primitive functions / services
- - Overlap = utilities, libraries, reusable patterns
- - Composition = integration diagram
-
- ### Learning Problems
-
- - Sub-problem = each prerequisite concept
- - Base case = knowledge requiring no prerequisites
- - Overlap = fundamentals that unlock multiple topics
- - Composition = ordered learning path
-
- ### Business / Strategy Problems
+ Breaks any complex problem into DP-style sub-problems: **optimal substructure** (solution depends on smaller solutions) + **overlapping sub-problems** (recurring parts, solve once, reuse). Applies to business, personal decisions, architecture, research, learning, projects.
- - Sub-problem = each strategic lever
- - Base case = observable metrics and concrete actions
- - Overlap = capabilities that support multiple strategies
- - Composition = integrated strategic plan
+ ## Protocol
- ---
+ | # | Step | Action | Gate |
+ | --- | ------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------- |
+ | 1 | Define main problem | Restate precisely, final state, explicit/implicit constraints | โ |
+ | 2 | Decompose | Break into smaller parts; recurse until **base cases** (directly solvable) | tree structure, see `references/response-template.md` |
+ | 3 | Identify overlaps | Which sub-problems recur across branches? Which partial solutions reuse? | mark explicitly โ biggest efficiency win |
+ | 4 | Resolution order | Base cases first, then by dependency (prereq before dependent) | execution sequence |
+ | 5 | Solve each | Smallest โ largest; compare options if multiple; note which parent problem it feeds | โ |
+ | 6 | Compose | Combine sub-solutions into original problem; validate fit | โ |
+ | 7 | Verify | Edge cases, external dependencies, optimal vs. good-enough | โ |
- ## Quality Principles
+ Respond using the template in `references/response-template.md`.
- - **Be granular enough**: a well-defined sub-problem has a clear answer.
- - **Avoid pseudo-decomposition**: do not merely rename the original problem โ break it down genuinely.
- - **Name dependencies**: always make clear which sub-problem depends on which.
- - **Prioritize bottom-up resolution**: solving larger problems before smaller ones leads to rework.
- - **Highlight reuse**: when one partial solution supports another, state it explicitly.
+ ## Adaptations by problem type
- ---
+ | Type | Sub-problem | Base case | Overlap | Composition |
+ | ---------------------- | -------------------------- | ------------------------------------ | ------------------------------------------- | ------------------------- |
+ | Decision | each criterion | verifiable facts, not opinions | criteria affecting multiple options | decision table/matrix |
+ | Planning/Project | each deliverable/milestone | atomic task (1 person, 1 day) | shared deps between phases | schedule/roadmap |
+ | Technical/Architecture | each component/module | primitive functions/services | reusable utilities/patterns | integration diagram |
+ | Learning | each prerequisite concept | needs-no-prerequisite knowledge | fundamentals unlocking multiple topics | ordered learning path |
+ | Business/Strategy | each strategic lever | observable metrics, concrete actions | capabilities supporting multiple strategies | integrated strategic plan |
- ## Quick Example
+ ## Quality principles
- **Problem**: "How should I structure my career to transition into AI within 18 months?"
+ - Granular: each sub-problem has a clear, direct answer.
+ - No pseudo-decomposition: genuinely break down, don't just rename the problem.
+ - Name dependencies explicitly (what depends on what).
+ - Bottom-up only โ solving big before small causes rework.
+ - State reuse explicitly when one solution supports another.
- ```text
- Main Problem: Transition into AI within 18 months
- โโโ Sub-problem A: What does the AI industry require?
- โ โโโ A.1: In-demand technical skills (base case)
- โ โโโ A.2: In-demand non-technical skills (base case)
- โโโ Sub-problem B: Where am I today?
- โ โโโ B.1: Inventory of current skills (base case)
- โ โโโ B.2: Gap analysis vs. A (depends on A + B.1)
- โโโ Sub-problem C: How do I close the gap in 18 months?
- โโโ C.1: Available resources (time, money) (base case)
- โโโ C.2: Study and practice plan (depends on B.2 + C.1)
- โโโ C.3: Networking and portfolio strategy (depends on C.2)
+ ## Reference files
- Overlap: Python fundamentals appear in A.1, B.1, and C.2 โ solve once and reuse.
- Bottom-Up Order: A.1 โ A.2 โ B.1 โ B.2 โ C.1 โ C.2 โ C.3
- ```
+ - `references/response-template.md` โ verbatim markdown response template + sub-problem tree text format.
+ - `references/example.md` โ worked example (career transition into AI).