Skip to main content
skill CX Codex

ds-lessons — Claude Code skill: what it does, how to install

ds-lessons is a Claude Code skill that turns recurring agent mistakes in a repository into hard checks, from types to linters. It runs after user corrections, repeated bugs, or long sessions.

MIT 544 installs ★ 320 updated 2026-10-28

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add aicodeking/deepseek-stack --skill ds-lessons -a claude-code
Open on GitHub

What ds-lessons does

The skill gathers mistakes from sessions, commits, reviews, and instruction files, grouping them into classes once a failure happens twice. For each error class, it selects the strongest enforcement level, preferring structural code changes and types over linters, tests, and documentation. The agent fixes top issues with individual commits, proves each new check by re-introducing the past mistake, and maintains a rule enforcement table.

At the end of the session, a reflection step lists what went wrong, routes items to checks or rule edits, and drops one-off issues. If a fix is structural, prose explanations are skipped. Every report includes evidence, the chosen protection level, and the reasoning for skipping weaker levels.

The process stops when every chosen class has a proven failing check or the top three session classes are handled. Single occurrences are ignored to focus exclusively on recurring patterns.

What it helps with

  • gather repeating agent mistakes from history
  • turn recurring errors into type or linter checks
  • prove new checks against past bugs
  • maintain a rule enforcement table in instructions
  • run an end-of-session reflection on agent failures

Example prompts for the agent

  • Analyze session mistakes and turn repeats into checks using ds-lessons
  • Run end-of-session reflection via ds-lessons
  • Collect agent errors and set up enforcement with ds-lessons

How to install ds-lessons

1Skills CLI (Vercel)

npx skills add aicodeking/deepseek-stack --skill ds-lessons -a claude-code

2Manually: put the files in place

~/.claude/skills/ds-lessons/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/ds-lessons/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about ds-lessons

How to install ds-lessons in Claude Code?

Run npx skills add aicodeking/deepseek-stack --skill ds-lessons -a claude-code and reference ~/.claude/skills/ds-lessons/SKILL.md.

What does ds-lessons do?

It detects recurring agent mistakes in the repository and replaces soft instructions with strict type checks, linters, and tests.

When is ds-lessons used?

Use it after a user correction, when a fix repeats twice, at the end of a long session, or via direct command.

Source text

SKILL.md · MIT
---
name: ds-lessons
description: "Find mistakes agents keep repeating in this repo and turn each into structure that blocks it, preferring types over lint over tests over docs, plus an end-of-session reflection. Use after a user correction, when the same fix comes up twice, at the end of a long session, or for /ds-lessons."
---

# ds-lessons

An instruction an agent can skip is a wish. Make repeated mistakes fail loudly instead.

## Steps

1. Gather mistakes. Read the current session, recent commits, reverts, review comments, agent instruction files and workaround comments. Group them into classes. A class counts once it happened twice.
2. For each class, pick the highest level that works:
   1. Structure: one owner per piece of state, one supported way per task, hidden internals, delete old patterns an agent would copy.
   2. Types: make the bad state impossible to write.
   3. Lint or CI check: the error message names the right file, type or function to use. If the bad pattern is already common, fail only on new additions.
   4. Test: checks behavior, not internals.
   5. Docs or agent rules: only for judgment calls that cannot be checked. Add a short example of the failure.
3. Fix the most frequent classes now, one commit each.
4. Prove each new check. Re-introduce a real past mistake, run the check, and show it fails. Then remove it and show it passes.
5. Keep a table in the agent instruction file: rule, and what enforces it. If a rule already existed but nothing enforced it, treat it as a repeat and enforce it now.
6. End-of-session reflection: list what went wrong, what took extra loops and what the user corrected. Route each item to a check, a skill edit or a rule. Drop one-off issues.

## Stop when

- Each chosen class has an enforcement that you showed failing on a real mistake.
- Or you have handled the top three classes this session. Note the rest.

## Rules

- If the fix is structural, do not also add prose. The prose was the symptom.
- Report each class with evidence, the level chosen, and why a higher level did not work.

© aicodeking · MIT · aicodeking/deepseek-stack

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set29

The whole set →
ds-unslop This Claude Code skill rewrites prose and code comments in plain, specific English. It activates while editing replies, docs, READMEs, PR descriptions or commit messages, and on /ds-unslop. CX Codex +1 547installs ds-blueprint Defines types, signatures, and module boundaries before writing code bodies. It triggers on /ds-blueprint or when asked to design the structure first. CX Codex +1 546installs ds-ledger This Claude Code skill logs decisions during long or unattended work. It is triggered for multi-phase tasks, work that a person will review later, or with /ds-ledger. CX Codex +1 545installs ds-explain Skill explains code logic and architectural reasons in plain language for Claude Code, Codex, and Cursor. Runs during subsystem onboarding or via /ds-explain. CX Codex +1 545installs ds-sharpen The ds-sharpen Claude Code skill refines your prompts, deepens tasks, and stress-tests plans for AI agents. It runs before starting vague or high-stakes work to identify potential weaknesses. CX Codex +1 542installs ds-tdd The ds-tdd Claude Code skill guides bug fixes through a failing test, then a minimal code change. It activates for TDD or regression-test requests and bugs with a simple local test target. CX Codex +1 542installs ds-catchup ds-catchup — a skill for Claude Code summarizes changes since the last message and lists decisions awaiting the user's input. It runs when someone returns after a long pause or asks what happened. CX Codex +1 540installs ds-jury The ds-jury Claude Code skill gathers independent reviews of a code change from several models. The agent works through accepted findings and runs another review round until the reviewers agree. CX Codex +1 539installs

Project sponsors

Companies that keep this analytics open