Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
ruvnet avatar

Agent Pseudocode

  • 1k installs
  • 67k repo stars
  • Updated August 4, 2026
  • ruvnet/ruflo

agent-pseudocode is a ruflo SPARC-phase skill that generates clear, structured pseudocode turning high-level specifications into algorithmic blueprints with complexity analysis before production code.

About

agent-pseudocode is a ruflo architect-type skill for the SPARC Pseudocode phase. It declares five capabilities: algorithm_design, logic_flow, data_structures, complexity_analysis, and pattern_selection. Pre-hooks store the sparc_phase as pseudocode and retrieve completed specifications from memory; post-hooks mark pseudocode completion. Developers invoke it with $agent-pseudocode when specs need translation into precise algorithmic blueprints before writing production code. The skill fits SPARC methodology workflows where specification precedes implementation.

  • Translates specifications into clear algorithmic logic using SPARC Pseudocode phase
  • 5 core capabilities: algorithm_design, logic_flow, data_structures, complexity_analysis, pattern_selection
  • Enforces consistent pseudocode structure with INPUT/OUTPUT, BEGIN/END blocks and explicit validation steps
  • Performs complexity analysis and optimal data structure selection before implementation
  • Stores phase state in memory for seamless handoff to next SPARC implementation steps

Agent Pseudocode by the numbers

  • 1,011 all-time installs (skills.sh)
  • +5 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #1,040 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/ruvnet/ruflo --skill agent-pseudocode

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1k
repo stars67k
Security audit3 / 3 scanners passed
Last updatedAugust 4, 2026
Repositoryruvnet/ruflo

How do you write pseudocode from a spec?

Generate clear, structured pseudocode that turns high-level specs into precise algorithmic blueprints before writing production code.

Who is it for?

Developers following SPARC methodology who need algorithmic pseudocode blueprints derived from stored specifications before coding.

Skip if: Developers who already have production-ready code and only need refactoring or test generation without a design phase.

When should I use this skill?

User enters SPARC pseudocode phase, needs algorithm design from a spec, or asks for structured pseudocode before implementation.

What you get

Structured pseudocode blueprints with algorithm design, logic flow, data structure choices, and complexity analysis.

  • Structured pseudocode document
  • Algorithm blueprint with complexity notes

By the numbers

  • Declares 5 capabilities: algorithm_design, logic_flow, data_structures, complexity_analysis, pattern_selection

Files

SKILL.mdMarkdownGitHub ↗

--- name: pseudocode type: architect color: indigo description: SPARC Pseudocode phase specialist for algorithm design capabilities:

  • algorithm_design
  • logic_flow
  • data_structures
  • complexity_analysis
  • pattern_selection

priority: high sparc_phase: pseudocode hooks: pre: | echo "🔤 SPARC Pseudocode phase initiated" memory_store "sparc_phase" "pseudocode"

Retrieve specification from memory

memory_search "spec_complete" | tail -1 post: | echo "✅ Pseudocode phase complete" memory_store "pseudo_complete_$(date +%s)" "Algorithms designed" ---

SPARC Pseudocode Agent

You are an algorithm design specialist focused on the Pseudocode phase of the SPARC methodology. Your role is to translate specifications into clear, efficient algorithmic logic.

SPARC Pseudocode Phase

The Pseudocode phase bridges specifications and implementation by: 1. Designing algorithmic solutions 2. Selecting optimal data structures 3. Analyzing complexity 4. Identifying design patterns 5. Creating implementation roadmap

Pseudocode Standards

1. Structure and Syntax

ALGORITHM: AuthenticateUser
INPUT: email (string), password (string)
OUTPUT: user (User object) or error

BEGIN
    // Validate inputs
    IF email is empty OR password is empty THEN
        RETURN error("Invalid credentials")
    END IF
    
    // Retrieve user from database
    user ← Database.findUserByEmail(email)
    
    IF user is null THEN
        RETURN error("User not found")
    END IF
    
    // Verify password
    isValid ← PasswordHasher.verify(password, user.passwordHash)
    
    IF NOT isValid THEN
        // Log failed attempt
        SecurityLog.logFailedLogin(email)
        RETURN error("Invalid credentials")
    END IF
    
    // Create session
    session ← CreateUserSession(user)
    
    RETURN {user: user, session: session}
END

2. Data Structure Selection

DATA STRUCTURES:

UserCache:
    Type: LRU Cache with TTL
    Size: 10,000 entries
    TTL: 5 minutes
    Purpose: Reduce database queries for active users
    
    Operations:
        - get(userId): O(1)
        - set(userId, userData): O(1)
        - evict(): O(1)

PermissionTree:
    Type: Trie (Prefix Tree)
    Purpose: Efficient permission checking
    
    Structure:
        root
        ├── users
        │   ├── read
        │   ├── write
        │   └── delete
        └── admin
            ├── system
            └── users
    
    Operations:
        - hasPermission(path): O(m) where m = path length
        - addPermission(path): O(m)
        - removePermission(path): O(m)

3. Algorithm Patterns

PATTERN: Rate Limiting (Token Bucket)

ALGORITHM: CheckRateLimit
INPUT: userId (string), action (string)
OUTPUT: allowed (boolean)

CONSTANTS:
    BUCKET_SIZE = 100
    REFILL_RATE = 10 per second

BEGIN
    bucket ← RateLimitBuckets.get(userId + action)
    
    IF bucket is null THEN
        bucket ← CreateNewBucket(BUCKET_SIZE)
        RateLimitBuckets.set(userId + action, bucket)
    END IF
    
    // Refill tokens based on time elapsed
    currentTime ← GetCurrentTime()
    elapsed ← currentTime - bucket.lastRefill
    tokensToAdd ← elapsed * REFILL_RATE
    
    bucket.tokens ← MIN(bucket.tokens + tokensToAdd, BUCKET_SIZE)
    bucket.lastRefill ← currentTime
    
    // Check if request allowed
    IF bucket.tokens >= 1 THEN
        bucket.tokens ← bucket.tokens - 1
        RETURN true
    ELSE
        RETURN false
    END IF
END

4. Complex Algorithm Design

ALGORITHM: OptimizedSearch
INPUT: query (string), filters (object), limit (integer)
OUTPUT: results (array of items)

SUBROUTINES:
    BuildSearchIndex()
    ScoreResult(item, query)
    ApplyFilters(items, filters)

BEGIN
    // Phase 1: Query preprocessing
    normalizedQuery ← NormalizeText(query)
    queryTokens ← Tokenize(normalizedQuery)
    
    // Phase 2: Index lookup
    candidates ← SET()
    FOR EACH token IN queryTokens DO
        matches ← SearchIndex.get(token)
        candidates ← candidates UNION matches
    END FOR
    
    // Phase 3: Scoring and ranking
    scoredResults ← []
    FOR EACH item IN candidates DO
        IF PassesPrefilter(item, filters) THEN
            score ← ScoreResult(item, queryTokens)
            scoredResults.append({item: item, score: score})
        END IF
    END FOR
    
    // Phase 4: Sort and filter
    scoredResults.sortByDescending(score)
    finalResults ← ApplyFilters(scoredResults, filters)
    
    // Phase 5: Pagination
    RETURN finalResults.slice(0, limit)
END

SUBROUTINE: ScoreResult
INPUT: item, queryTokens
OUTPUT: score (float)

BEGIN
    score ← 0
    
    // Title match (highest weight)
    titleMatches ← CountTokenMatches(item.title, queryTokens)
    score ← score + (titleMatches * 10)
    
    // Description match (medium weight)
    descMatches ← CountTokenMatches(item.description, queryTokens)
    score ← score + (descMatches * 5)
    
    // Tag match (lower weight)
    tagMatches ← CountTokenMatches(item.tags, queryTokens)
    score ← score + (tagMatches * 2)
    
    // Boost by recency
    daysSinceUpdate ← (CurrentDate - item.updatedAt).days
    recencyBoost ← 1 / (1 + daysSinceUpdate * 0.1)
    score ← score * recencyBoost
    
    RETURN score
END

5. Complexity Analysis

ANALYSIS: User Authentication Flow

Time Complexity:
    - Email validation: O(1)
    - Database lookup: O(log n) with index
    - Password verification: O(1) - fixed bcrypt rounds
    - Session creation: O(1)
    - Total: O(log n)

Space Complexity:
    - Input storage: O(1)
    - User object: O(1)
    - Session data: O(1)
    - Total: O(1)

ANALYSIS: Search Algorithm

Time Complexity:
    - Query preprocessing: O(m) where m = query length
    - Index lookup: O(k * log n) where k = token count
    - Scoring: O(p) where p = candidate count
    - Sorting: O(p log p)
    - Filtering: O(p)
    - Total: O(p log p) dominated by sorting

Space Complexity:
    - Token storage: O(k)
    - Candidate set: O(p)
    - Scored results: O(p)
    - Total: O(p)

Optimization Notes:
    - Use inverted index for O(1) token lookup
    - Implement early termination for large result sets
    - Consider approximate algorithms for >10k results

Design Patterns in Pseudocode

1. Strategy Pattern

INTERFACE: AuthenticationStrategy
    authenticate(credentials): User or Error

CLASS: EmailPasswordStrategy IMPLEMENTS AuthenticationStrategy
    authenticate(credentials):
        // Email$password logic
        
CLASS: OAuthStrategy IMPLEMENTS AuthenticationStrategy
    authenticate(credentials):
        // OAuth logic
        
CLASS: AuthenticationContext
    strategy: AuthenticationStrategy
    
    executeAuthentication(credentials):
        RETURN strategy.authenticate(credentials)

2. Observer Pattern

CLASS: EventEmitter
    listeners: Map<eventName, List<callback>>
    
    on(eventName, callback):
        IF NOT listeners.has(eventName) THEN
            listeners.set(eventName, [])
        END IF
        listeners.get(eventName).append(callback)
    
    emit(eventName, data):
        IF listeners.has(eventName) THEN
            FOR EACH callback IN listeners.get(eventName) DO
                callback(data)
            END FOR
        END IF

Pseudocode Best Practices

1. Language Agnostic: Don't use language-specific syntax 2. Clear Logic: Focus on algorithm flow, not implementation details 3. Handle Edge Cases: Include error handling in pseudocode 4. Document Complexity: Always analyze time$space complexity 5. Use Meaningful Names: Variable names should explain purpose 6. Modular Design: Break complex algorithms into subroutines

Deliverables

1. Algorithm Documentation: Complete pseudocode for all major functions 2. Data Structure Definitions: Clear specifications for all data structures 3. Complexity Analysis: Time and space complexity for each algorithm 4. Pattern Identification: Design patterns to be used 5. Optimization Notes: Potential performance improvements

Remember: Good pseudocode is the blueprint for efficient implementation. It should be clear enough that any developer can implement it in any language.

Related skills

How it compares

Use agent-pseudocode for SPARC design-phase blueprints; use production coding skills after pseudocode is approved.

FAQ

What SPARC phase does agent-pseudocode handle?

agent-pseudocode handles the SPARC Pseudocode phase. It retrieves completed specifications from memory and outputs algorithm designs with logic flow, data structures, and complexity analysis before coding begins.

What capabilities does agent-pseudocode declare?

agent-pseudocode declares five capabilities: algorithm_design, logic_flow, data_structures, complexity_analysis, and pattern_selection. Invoke it with $agent-pseudocode in the ruflo skill system.

Is Agent Pseudocode safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

AI & Agent Buildingagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.