Skip to content
Back to skills

3 Chain Of Thought Prompting

ASecurity

Sub-skill of prompt-engineering: 3. Chain-of-Thought Prompting.

  • 17 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 9, 2026
ai-agentspythongoapi

Works with

  • api

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add vamseeachanta/workspace-hub --skill 3-chain-of-thought-prompting --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 3 Chain Of Thought Prompting?

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

Security grade badge for 3 Chain Of Thought Prompting
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vamseeachanta-3-chain-of-thought-prompting/badge)](https://www.skillsdirectory.com/skills/vamseeachanta-3-chain-of-thought-prompting)

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: prompt-engineering-3-chain-of-thought-prompting
description: 'Sub-skill of prompt-engineering: 3. Chain-of-Thought Prompting.'
version: 1.0.0
category: ai-prompting
type: reference
scripts_exempt: true
---

# 3. Chain-of-Thought Prompting

## 3. Chain-of-Thought Prompting


**Basic Chain-of-Thought:**
```python
COT_TEMPLATE = """
Solve this problem step by step.

Problem: {problem}

Let me think through this carefully:

Step 1: First, I'll identify the key information...
Step 2: Next, I'll determine the approach...
Step 3: Then, I'll perform the calculations...
Step 4: Finally, I'll verify and state the answer...

Solution:
"""

def chain_of_thought_prompt(problem: str) -> str:
    return COT_TEMPLATE.format(problem=problem)

# Usage
prompt = chain_of_thought_prompt(
    problem="""
    A mooring line has a breaking load of 5000 kN.
    The maximum tension is 2800 kN.
    What is the safety factor, and does it meet the API RP 2SK
    requirement of 1.67 for intact conditions?
    """
)
```

**Zero-Shot Chain-of-Thought:**
```python
def zero_shot_cot(question: str) -> str:
    """
    Zero-shot CoT: Simply append "Let's think step by step"
    Surprisingly effective for many reasoning tasks.
    """
    return f"{question}\n\nLet's think step by step."

# Usage
prompt = zero_shot_cot(
    "If a vessel offsets 50m from its mean position, and the "
    "mooring stiffness is 100 kN/m, what is the restoring force?"
)
```

**Structured Chain-of-Thought:**
```python
STRUCTURED_COT_TEMPLATE = """
Analyze this engineering problem using structured reasoning.

Problem: {problem}

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.