Back to Skills

rough-draft-pseudocode

verified

Phase 2 - Define the logic flow for each function

View on GitHub

Marketplace

mermaid-collab-dev

ben-mad-jlp/claude-mermaid-collab

Plugin

mermaid-collab

Repository

ben-mad-jlp/claude-mermaid-collab

skills/rough-draft-pseudocode/SKILL.md

Last Verified

January 25, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/ben-mad-jlp/claude-mermaid-collab/blob/main/skills/rough-draft-pseudocode/SKILL.md -a claude-code --skill rough-draft-pseudocode

Installation paths:

Claude
.claude/skills/rough-draft-pseudocode/
Powered by add-skill CLI

Instructions

## Step 0: Query Kodex

Query project knowledge for error handling and logic patterns.

### Topic Inference (Pseudocode Focus)

From work item context, build candidates:
- `{item-keyword}-error-handling`
- `{item-keyword}-logic`
- `error-patterns`
- `validation-patterns`

### Example

```
Tool: mcp__plugin_mermaid-collab_mermaid__kodex_query_topic
Args: { "project": "<cwd>", "name": "error-patterns" }
```

Display found topics as context before writing pseudocode.

# Phase 2: Pseudocode

Define the logic flow for each function.

## What to Produce

1. **Logic flow** - Step-by-step description of what each function does
2. **Error handling approach** - How errors are caught, propagated, reported
3. **Edge cases** - Boundary conditions and how they're handled
4. **Dependencies** - External services, databases, APIs called

## Process

For each function from the Interface phase:
1. Write plain-language pseudocode
2. Identify error conditions
3. List edge cases
4. Note any external calls

## Output Format

**Create per-item pseudocode documents** instead of adding to design.md:

For each work item N, create `pseudocode-item-N.md`:

```
Tool: mcp__plugin_mermaid-collab_mermaid__create_document
Args: {
  "project": "<cwd>",
  "session": "<session>",
  "name": "pseudocode-item-N",
  "content": "<pseudocode content for item N>"
}
```

**Document structure:**

```markdown
# Pseudocode: Item N - [Title]

### AuthService.authenticate(email, password)

```
1. Validate email format
   - If invalid: return { success: false, error: "Invalid email format" }

2. Look up user by email in database
   - If not found: return { success: false, error: "User not found" }

3. Verify password hash
   - If mismatch: return { success: false, error: "Invalid password" }
   - Rate limit: after 5 failures, lock account for 15 minutes

4. Generate JWT token
   - Include: user.id, user.role, expiry (1 hour)

5. Store token in Redis with TTL
   - Key: "token:{tokenId}", Value: user.id

6. Return { s

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
3238 chars