Skip to content
Back to skills

Cot Answer Extraction

ASecurity

Extract and normalize final answers from chain-of-thought outputs without scoring intermediate reasoning text.

  • 247 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 9, 2026
testingpythonbash

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill cot_answer_extraction --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cot Answer Extraction?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cot Answer Extraction
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-cot-answer-extraction/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-cot-answer-extraction)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cot_answer_extraction
description: Extract and normalize final answers from chain-of-thought outputs without scoring intermediate reasoning text.
---

# Chain-of-Thought Answer Extraction

Use this skill when a model or recovery harness emits reasoning followed by a final answer and you need the shortest canonical answer span for scoring. Do not use it to build prompts, judge rationale quality, or run an external calculator.

## Inputs

- Raw output text.
- Task type: `numeric`, `multiple_choice`, `yes_no`, `date`, `symbolic`, or `plan`.
- Optional final-answer markers and numeric tolerance settings.

## Outputs

- Raw text.
- Extracted final answer.
- Normalized answer.
- Diagnostics with marker and fallback information.

## Workflow

1. Search from the end of the output for markers such as `The answer is`, `So the answer is`, or `Answer:`.
2. Extract the following short span and ignore earlier intermediate numbers.
3. If no marker appears, fall back to a task-specific extraction from the end of the text.
4. Normalize according to task type.
5. Preserve diagnostics so recovery can distinguish explicit marker extraction from fallback behavior.

## Validation

Run:

```bash
python scripts/cot_answer_extraction.py --self-test
python -m unittest discover -s tests
```

Tests cover numeric traces, multiple-choice letters, yes/no outputs, dates, and symbolic answers.

## Limitations

The extractor intentionally keeps normalization conservative. It does not infer answers from unsupported world knowledge and it does not decide whether the reasoning path is faithful.

Files in this skill

  • SKILL.md1.6 KB
  • scripts/cot_answer_extraction.py4.3 KB
  • tests/test_cot_answer_extraction.py1.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.