Contract
- Input: problem description and inputs defined by the skill body.
- Output: Markdown artifact with completed process steps.
- Side effects: none.
- Dependencies: none.
- Stop condition: all process steps executed; artifact saved with required sections.
- Risk: low.
- Boundary: produces reasoning artifact only; no system changes.
CS Algorithms
Design, analyse, and verify an algorithm — its correctness, complexity, stability, and invariants — with an explicit proof structure.
When to use
- The user needs an algorithm designed or analysed.
- A data structure choice needs justification.
- Performance or correctness requires proof.
Process
- Problem statement — input, output, pre/post conditions.
- Algorithm design — strategy (divide and conquer, greedy, dynamic programming, backtracking, etc.); justify why it fits.
- Pseudocode / code — clean, with clear variable names.
- Correctness proof — loop invariant; termination; initialisation, maintenance, termination. Or proof by contradiction / induction for non-loop structures.
- Complexity analysis — time (best/average/worst), space; use Big-O with justification (count operations, recursion depth).
- Stability — if numerical, numerical stability; if combinatorial, output stability.
- Deliver — artifact: problem, design, code/pseudocode, correctness proof, complexity, stability note.