[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EMWQ3YDAX4A97X0Z9BQ176":3,"skill-same:01M7EMWQ3YDAX4A97X0Z9BQ176":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7EMWQ3YDAX4A97X0Z9BQ176","dspy-programming",null,"Program language models instead of prompting them — DSPy signatures, modules, and optimizers that tune prompts automatically.","TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-dspy-programming\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: dspy-programming\ndescription: Program language models instead of prompting them — DSPy signatures, modules, and optimizers that tune prompts automatically.\ncategory: ai-research\n---\n\n## Overview\n\nDSPy replaces hand-written prompts with programs: you declare what each step\nshould do via signatures (input\u002Foutput field specs, e.g., `question -> answer`),\ncompose steps into modules (ChainOfThought, ReAct, multi-hop pipelines), and let\noptimizers (teleprompters) automatically find effective prompts and few-shot\nexamples using a metric you define. The core philosophy: prompting is an\noptimization problem, so treat it like one — write the objective and the\nstructure, and let the compiler search the prompt space.\n\nThis inverts the usual workflow. Instead of iterating on prompt wording by vibes,\nyou iterate on the metric and the module decomposition, then run an optimizer\n(like MIPRO or BootstrapFewShot) that generates, tests, and refines\ndemonstrations. The result is prompts that are found empirically rather than\ncrafted — often better, and reproducible from the metric and training set.\n\nDSPy is for teams tired of prompt folklore. It replaces \"we tried rewording it\nand it seemed better\" with an optimization run you can rerun, version, and\ndefend.\n\n## When to use\n\n- Any multi-step LLM pipeline where you're currently hand-tuning prompts and want\n  systematic improvement.\n- When you have a clear success metric and some labeled examples — the optimizer\n  needs both.\n- Building RAG, classification, extraction, or agent pipelines you expect to\n  maintain as models change (recompile for a new model instead of rewriting\n  prompts).\n- Teams where prompt changes need to be reviewable and reproducible rather than\n  tribal knowledge.\n- Research on prompt optimization itself.\n- Porting a pipeline to a new model: recompile instead of rewriting prompts by\n  hand.\n\n## Core concepts\n\n- **Signatures**: declarative specs of a step's behavior — `context, question ->\n  answer` plus a natural-language instruction. Signatures say what, not how; the\n  optimizer figures out the how.\n- **Modules**: composable building blocks — Predict (basic), ChainOfThought (adds\n  reasoning), ReAct (tool loop), and custom modules you write. Modules compose\n  into programs; programs are the unit of optimization.\n- **Teleprompters (optimizers)**: BootstrapFewShot (generate candidate\n  demonstrations from your training set, keep the ones that work), MIPRO (jointly\n  optimizes instructions and demonstrations, the strongest default), and others.\n  They need: a training set, a metric function, and a validation set.\n- **Metrics**: the objective function — exact match, F1, LLM-judge score,\n  task-specific checks. The optimizer will ruthlessly maximize whatever you give\n  it; a bad metric produces \"optimized\" prompts that game the metric.\n- **Assertions\u002Fsuggestions**: runtime constraints on module outputs (e.g., \"answer\n  must be valid JSON\") with automatic retry. Cheaper than hoping the prompt\n  holds.\n- **Compilation**: running the optimizer produces a compiled program — optimized\n  prompts + demonstrations baked in. Compile per model; a program optimized for\n  one model often underperforms on another without recompiling.\n- **Training\u002Fvalidation split**: the optimizer trains on one set and must be\n  validated on another. Optimized prompts overfit the training examples otherwise.\n- **Custom modules**: when built-ins don't fit, write your own module class with\n  a forward method. The optimizer still works — it optimizes whatever structure\n  you give it.\n\n## Practical workflow\n\n1. **Define the metric first.** Write the scoring function before any DSPy code.\n   Test it on sample outputs — if it doesn't match your judgment of quality, fix\n   it now.\n2. **Decompose into signatures.** Break the task into steps; write one signature\n   per step with clear field names and instructions. Start with the simplest\n   module per step (Predict, then ChainOfThought where reasoning helps).\n3. **Assemble a training set.** 50–200 labeled examples representative of the\n   task. Quality and coverage matter more than size — the optimizer learns\n   demonstrations from these.\n4. **Hold out validation data.** Split before optimizing. The validation set is\n   sacred — never let the optimizer see it.\n5. **Run a teleprompter.** Start with BootstrapFewShot for speed; move to MIPRO\n   for the final optimization. Validate on the held-out set — optimized prompts\n   can overfit the training examples.\n6. **Inspect what the optimizer found.** Read the generated demonstrations and\n   instructions. Sometimes they're insightful; sometimes they reveal metric\n   gaming. Either way, look.\n7. **Compile and version.** Save the compiled program; recompile when switching\n   models or when the task distribution shifts. Treat compilation as part of your\n   build, not a one-off.\n\nChecklist for a DSPy program:\n- Metric validated against human judgment on samples.\n- Held-out validation set separate from optimizer training data.\n- Compiled program inspected, not just scored.\n- Recompilation plan for model changes.\n- Module decomposition justified (no over-decomposition).\n\n## Common pitfalls\n\n- **Metric gaming.** The optimizer is an adversary against your metric. Vague\n  metrics (\"quality score 1-5 from an LLM judge\") get exploited. Make metrics\n  specific and check optimized outputs manually.\n- **Tiny training sets.** Optimizing on 10 examples finds prompts that memorize\n  those 10. Use enough examples to represent the task's variety.\n- **Skipping the held-out set.** Training-set scores after optimization are\n  meaningless. Always validate on unseen data.\n- **Over-decomposition.** Ten signatures where three would do gives the optimizer\n  ten places to overfit and you ten places to debug. Start coarse.\n- **Never inspecting compiled prompts.** The optimizer sometimes finds\n  bizarre-but-effective prompts. If you can't understand why it works, you can't\n  trust it in production — simplify or constrain.\n- **One compilation forever.** Models update, data drifts. Recompile on a schedule\n  or when metrics degrade, like retraining any model.\n- **Optimizing the wrong module.** Spending optimizer budget on a step that\n  contributes 5% of errors while the 80% step stays hand-written. Profile errors\n  per module first.\n- **Metric–judgment mismatch.** The metric says 95%, your eyes say the outputs\n  are bad. Trust your eyes; fix the metric; recompile.\n","## Overview\n\nDSPy replaces hand-written prompts with programs: you declare what each step\nshould do via signatures (input\u002Foutput field specs, e.g., `question -> answer`),\ncompose steps into modules (ChainOfThought, ReAct, multi-hop pipelines), and let\noptimizers (teleprompters) automatically find effective prompts and few-shot\nexamples using a metric you define. The core philosophy: prompting is an\noptimization problem, so treat it like one — write the objective and the\nstructure, and let the compiler search the prompt space.\n\nThis inverts the usual workflow. Instead of iterating on prompt wording by vibes,\nyou iterate on the metric and the module decomposition, then run an optimizer\n(like MIPRO or BootstrapFewShot) that generates, tests, and refines\ndemonstrations. The result is prompts that are found empirically rather than\ncrafted — often better, and reproducible from the metric and training set.\n\nDSPy is for teams tired of prompt folklore. It replaces \"we tried rewording it\nand it seemed better\" with an optimization run you can rerun, version, and\ndefend.\n\n## When to use\n\n- Any multi-step LLM pipeline where you're currently hand-tuning prompts and want\n  systematic improvement.\n- When you have a clear success metric and some labeled examples — the optimizer\n  needs both.\n- Building RAG, classification, extraction, or agent pipelines you expect to\n  maintain as models change (recompile for a new model instead of rewriting\n  prompts).\n- Teams where prompt changes need to be reviewable and reproducible rather than\n  tribal knowledge.\n- Research on prompt optimization itself.\n- Porting a pipeline to a new model: recompile instead of rewriting prompts by\n  hand.\n\n## Core concepts\n\n- **Signatures**: declarative specs of a step's behavior — `context, question ->\n  answer` plus a natural-language instruction. Signatures say what, not how; the\n  optimizer figures out the how.\n- **Modules**: composable building blocks — Predict (basic), ChainOfThought (adds\n  reasoning), ReAct (tool loop), and custom modules you write. Modules compose\n  into programs; programs are the unit of optimization.\n- **Teleprompters (optimizers)**: BootstrapFewShot (generate candidate\n  demonstrations from your training set, keep the ones that work), MIPRO (jointly\n  optimizes instructions and demonstrations, the strongest default), and others.\n  They need: a training set, a metric function, and a validation set.\n- **Metrics**: the objective function — exact match, F1, LLM-judge score,\n  task-specific checks. The optimizer will ruthlessly maximize whatever you give\n  it; a bad metric produces \"optimized\" prompts that game the metric.\n- **Assertions\u002Fsuggestions**: runtime constraints on module outputs (e.g., \"answer\n  must be valid JSON\") with automatic retry. Cheaper than hoping the prompt\n  holds.\n- **Compilation**: running the optimizer produces a compiled program — optimized\n  prompts + demonstrations baked in. Compile per model; a program optimized for\n  one model often underperforms on another without recompiling.\n- **Training\u002Fvalidation split**: the optimizer trains on one set and must be\n  validated on another. Optimized prompts overfit the training examples otherwise.\n- **Custom modules**: when built-ins don't fit, write your own module class with\n  a forward method. The optimizer still works — it optimizes whatever structure\n  you give it.\n\n## Practical workflow\n\n1. **Define the metric first.** Write the scoring function before any DSPy code.\n   Test it on sample outputs — if it doesn't match your judgment of quality, fix\n   it now.\n2. **Decompose into signatures.** Break the task into steps; write one signature\n   per step with clear field names and instructions. Start with the simplest\n   module per step (Predict, then ChainOfThought where reasoning helps).\n3. **Assemble a training set.** 50–200 labeled examples representative of the\n   task. Quality and coverage matter more than size — the optimizer learns\n   demonstrations from these.\n4. **Hold out validation data.** Split before optimizing. The validation set is\n   sacred — never let the optimizer see it.\n5. **Run a teleprompter.** Start with BootstrapFewShot for speed; move to MIPRO\n   for the final optimization. Validate on the held-out set — optimized prompts\n   can overfit the training examples.\n6. **Inspect what the optimizer found.** Read the generated demonstrations and\n   instructions. Sometimes they're insightful; sometimes they reveal metric\n   gaming. Either way, look.\n7. **Compile and version.** Save the compiled program; recompile when switching\n   models or when the task distribution shifts. Treat compilation as part of your\n   build, not a one-off.\n\nChecklist for a DSPy program:\n- Metric validated against human judgment on samples.\n- Held-out validation set separate from optimizer training data.\n- Compiled program inspected, not just scored.\n- Recompilation plan for model changes.\n- Module decomposition justified (no over-decomposition).\n\n## Common pitfalls\n\n- **Metric gaming.** The optimizer is an adversary against your metric. Vague\n  metrics (\"quality score 1-5 from an LLM judge\") get exploited. Make metrics\n  specific and check optimized outputs manually.\n- **Tiny training sets.** Optimizing on 10 examples finds prompts that memorize\n  those 10. Use enough examples to represent the task's variety.\n- **Skipping the held-out set.** Training-set scores after optimization are\n  meaningless. Always validate on unseen data.\n- **Over-decomposition.** Ten signatures where three would do gives the optimizer\n  ten places to overfit and you ten places to debug. Start coarse.\n- **Never inspecting compiled prompts.** The optimizer sometimes finds\n  bizarre-but-effective prompts. If you can't understand why it works, you can't\n  trust it in production — simplify or constrain.\n- **One compilation forever.** Models update, data drifts. Recompile on a schedule\n  or when metrics degrade, like retraining any model.\n- **Optimizing the wrong module.** Spending optimizer budget on a step that\n  contributes 5% of errors while the 80% step stays hand-written. Profile errors\n  per module first.\n- **Metric–judgment mismatch.** The metric says 95%, your eyes say the outputs\n  are bad. Trust your eyes; fix the metric; recompile.\n",{"name":5,"category":24,"description":7},"ai-research","main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-dspy-programming",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill dspy-programming",{"tool":39,"command":40},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill dspy-programming",{"tool":42,"command":43},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill dspy-programming","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-dspy-programming\u002FSKILL.md",true,[],[48,55,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":59,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]