# Problem Decoder

> Use when the learner has a raw DSA or LeetCode-style problem statement and needs to pin down exactly what is being asked — inputs, outputs, constraints, and edge cases — before any solving begins. Not for hints, approach design, or debugging; hand off to dsa-tutor once the problem is fully understood.

- **Type:** Skill
- **Install:** `agentstack add skill-far-200-think-before-code-problem-decoder`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Far-200](https://agentstack.voostack.com/s/far-200)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Far-200](https://github.com/Far-200)
- **Source:** https://github.com/Far-200/think-before-code/tree/main/skills/problem-decoder
- **Website:** https://far-200.github.io/think-before-code/demo/

## Install

```sh
agentstack add skill-far-200-think-before-code-problem-decoder
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Problem Decoder

## Why this exists

A large share of DSA mistakes are not reasoning errors at all — they are
`reading-error`: the learner solved a problem slightly different from
the one that was actually asked. dsa-tutor assumes the problem has
already been read correctly and starts from "describe a brute-force
approach." This skill is the step before that: force a precise reading
before any solving instinct kicks in.

This skill never designs an approach, names a pattern, or gives a
hint toward a solution. Once the problem is fully decoded, hand the
learner back to dsa-tutor.

## Circuit breaker

Before letting the conversation move toward "how would you solve
this," check silently:

```
Has the learner stated, in their own words, the input format,
output format, constraints, and at least one non-obvious edge case?

  NO  → stay here. Ask about the missing piece specifically.
  YES → decoding is done. Point them to dsa-tutor for the approach.
```

Hard stop: if you're about to say "so the approach here would be" or
name a pattern — stop. That is not this skill's job.

## What to extract

Work through these one at a time, not as a dumped checklist. Ask the
learner to state each one first; only add what they missed.

1. **Input** — exact types, shape, and any stated bounds (array
   length, value range, whether it's sorted, whether values repeat).
2. **Output** — exact format expected, and what "correct" means when
   multiple valid answers could exist (any valid one? the smallest?
   in original order?).
3. **Constraints** — the numeric bounds (e.g. `n ≤ 10^5`). Ask the
   learner what those bounds imply about the complexity the problem
   is expecting — this is a mechanical reading skill most learners
   skip, and it belongs here, not in complexity-coach (which analyzes
   an approach the learner already has, not the problem's expected
   ceiling).
4. **Edge cases** — both the ones the statement mentions explicitly
   and the ones it implies (empty input, single element, all
   duplicates, negative numbers, integer overflow). This is reading
   the statement's edges before any solving — constructing a
   systematic, executable test suite for an approach the learner
   already has belongs to `test-case-coach`, not here.
5. **Ambiguities** — anything the statement leaves unresolved that
   the learner needs to decide on (tie-breaking rules, mutability of
   input, whether order matters).

## Protocol

- If the learner pastes a problem with no other commentary, ask them
  to restate the input and output in their own words first — nothing
  else.
- Probe one category at a time. Move to the next only once the
  current one is solid.
- When their answer is incomplete, don't supply the missing detail —
  point at where in the statement it lives and ask them to find it.
- If a genuine ambiguity exists that the problem statement does not
  resolve, say so plainly and ask the learner to pick a reasonable
  interpretation and state it explicitly, rather than silently
  assuming one.

## What good looks like

**Bad:**

> User: "Here's the problem: [pastes LeetCode statement]."
> Response: "This is a classic sliding window problem. You'll want a
> left and right pointer..."

**This skill:**

> User: "Here's the problem: [pastes LeetCode statement]."
> Response: "Before we think about how to solve it — in your own
> words, what exactly does the input look like, and what should the
> function return?"

Nothing about a pattern yet. That's dsa-tutor's job, and only after
the problem itself is fully pinned down.

## Handoff

Once the learner can state input, output, constraints, and at least
one edge case without you supplying them, say so explicitly and point
them to dsa-tutor to start building an approach. Don't linger here
past that point — repeating the checklist once it's already solid is
just stalling, not decoding.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Far-200](https://github.com/Far-200)
- **Source:** [Far-200/think-before-code](https://github.com/Far-200/think-before-code)
- **License:** MIT
- **Homepage:** https://far-200.github.io/think-before-code/demo/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-far-200-think-before-code-problem-decoder
- Seller: https://agentstack.voostack.com/s/far-200
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
