About ds-lessons
ds-lessons is a skill for coding agents that turns recurring mistakes into safeguards, choosing among structural changes, types, checks, tests, and documentation. It requires validating checks against real past mistakes and recording how each rule is enforced.
Key features
- 01Group recurring errors from sessions and reviews
- 02Choose safeguards across structure, types, checks, tests, and docs
- 03Validate checks against real past mistakes
- 04Record rules and enforcement in agent instructions
- 05Use session reflection to address recurring issues
Use cases
- 01Turn repeated coding errors into automated checks
- 02Document judgment calls that cannot be checked automatically
- 03Verify new safeguards catch real historical mistakes
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ aicodeking/ deepseek-stack --skill ds-lessonsAfter installing, type/ds-lessonsin Claude Code to confirm it loaded.
Details
From the project READMEds-lessons
An instruction an agent can skip is a wish. Make repeated mistakes fail loudly instead.
Steps
- 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.
- For each class, pick the highest level that works:
- Structure: one owner per piece of state, one supported way per task, hidden internals, delete old patterns an agent would copy.
- Types: make the bad state impossible to write.
- 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.
- Test: checks behavior, not internals.
- Docs or agent rules: only for judgment calls that cannot be checked. Add a short example of the failure.
- Fix the most frequent classes now, one commit each.
- Prove each new check. Re-introduce a real past mistake, run the check, and show it fails. Then remove it and show it passes.
- 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.
- 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.
Comments
Markdown supported