
Agent Pseudocode
Translate an approved SPARC specification into structured pseudocode, complexity notes, and an implementation roadmap before coding.
Overview
Agent-pseudocode is an agent skill most often used in Validate (also Build) that runs the SPARC Pseudocode phase to turn specifications into algorithmic pseudocode and an implementation roadmap.
Install
npx skills add https://github.com/ruvnet/ruflo --skill agent-pseudocodeWhat is this skill?
- SPARC Pseudocode phase agent with algorithm_design and complexity_analysis capabilities
- Five-step phase flow: algorithms, data structures, complexity, patterns, implementation roadmap
- Pseudocode standards with structured ALGORITHM blocks, INPUT/OUTPUT, and control flow
- Pre/post hooks that store sparc_phase and pseudo_complete markers in memory
- High-priority architect-type specialist invoked as $agent-pseudocode
- Five pseudocode phase responsibilities listed (algorithms through implementation roadmap)
- SPARC pre-hook retrieves spec_complete from memory before pseudocode work
Adoption & trust: 643 installs on skills.sh; 58.5k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have a written spec but no shared algorithmic plan, so implementation agents guess control flow and complexity.
Who is it for?
Indie builders using SPARC or ruflo memory hooks who want explicit algorithms between spec sign-off and coding.
Skip if: Throwaway scripts with no spec, tasks that only need code review on existing files, or teams not following SPARC phase gates.
When should I use this skill?
Invoke with $agent-pseudocode when the SPARC Pseudocode phase should run after specification and before implementation coding.
What do I get? / Deliverables
You get SPARC-standard pseudocode, structure choices, and complexity notes stored for the next implementation phase in the SPARC chain.
- Structured pseudocode blocks
- Complexity and pattern notes
- Implementation roadmap for downstream coding agents
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Pseudocode sits immediately after specification in SPARC, so the canonical shelf is Validate/scope where builders lock algorithmic intent before Build. Scope and planning artifacts need explicit logic flow and data-structure choices so the agent does not jump straight from prose spec to code.
Where it fits
Convert auth and session rules from a finished spec into ALGORITHM blocks with error paths.
Sketch pagination and cache logic in pseudocode before a spike repo exists.
Hand implementation agents a roadmap keyed to pseudo_complete memory timestamps.
Lock data-structure choices for queue workers before writing production services.
Reconcile shipped code against stored pseudocode during a security-sensitive refactor review.
How it compares
SPARC phase workflow skill, not a general brainstorming or one-shot code generator.
Common Questions / FAQ
Who is agent-pseudocode for?
Builders orchestrating SPARC with ruflo agents who need a dedicated pseudocode architect between specification and implementation.
When should I use agent-pseudocode?
Use it in Validate/scope once spec_complete is in memory, in Build/pm when breaking a feature into algorithms before backend work, and in Ship/review when re-deriving logic for a refactor plan—always as the Pseudocode SPARC phase, not before spec exists.
Is agent-pseudocode safe to install?
Check the Security Audits panel on this page; the skill references memory_store hooks and shell echo in SPARC pre/post steps you should review in your agent runtime.
SKILL.md
READMESKILL.md - Agent Pseudocode
--- 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) // Pha