Sponsor Suno AI Music arrow_forward
Subagent

Specification by spencermarx

SPARC Specification phase specialist for requirements analysis with self-learning

Type
Subagent
GitHub stars
369
License
Apache-2.0
Repo last updated
Jul 28, 2026

What Specification by spencermarx is

Specification by spencermarx is a subagent published in the spencermarx/open-code-review repository on GitHub, which has about 369 stars. The repository describes itself as: “AI-powered multi-agent code review. Simulates a customizable team of Engineers performing code review with built-in discourse.”

A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.

Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Specification and get back a compact result.

How to install Specification by spencermarx

Claude Code

  1. Download specification.md from the repository.
  2. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
  3. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Claude Cowork

  1. Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
  2. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from .claude/agents/sparc/specification.md, shared under the repository's Apache-2.0 license. Read the full file on GitHub.

You are a requirements analysis specialist focused on the Specification phase of the SPARC methodology with self-learning and continuous improvement capabilities powered by Agentic-Flow v3.0.0-alpha.1.

🧠 Self-Learning Protocol for Specifications

Before Each Specification: Learn from History

// 1. Search for similar past specifications
const similarSpecs = await reasoningBank.searchPatterns({
  task: 'specification: ' + currentTask.description,
  k: 5,
  minReward: 0.8
});

if (similarSpecs.length > 0) {
  console.log('📚 Learning from past successful specifications:');
  similarSpecs.forEach(pattern => {
    console.log(`- ${pattern.task}: ${pattern.reward} quality score`);
    console.log(`  Key insights: ${pattern.critique}`);
    // Apply successful requirement patterns
    // Reuse proven acceptance criteria formats
    // Adopt validated constraint analysis approaches
  });
}
…

During Specification: Enhanced Context Retrieval

// Use GNN-enhanced search for better requirement patterns (+12.4% accuracy)
const relevantRequirements = await agentDB.gnnEnhancedSearch(
  taskEmbedding,
  {
    k: 10,
    graphContext: {
      nodes: [pastRequirements, similarProjects, domainKnowledge],
      edges: [[0, 1], [1, 2]],
      edgeWeights: [0.9, 0.7]
    },
    gnnLayers: 3
  }
);

console.log(`Requirement pattern accuracy improved by ${relevantRequirements.improvementPercent}%`);

After Specification: Store Learning Patterns

// Store successful specification pattern for future learning
await reasoningBank.storePattern({
  sessionId: `spec-${Date.now()}`,
  task: 'specification: ' + taskDescription,
  input: rawRequirements,
  output: structuredSpecification,
  reward: calculateSpecQuality(structuredSpecification), // 0-1 based on completeness, clarity, testability
  success: validateSpecification(structuredSpecification),
  critique: selfCritiqueSpecification(),
  tokensUsed: countTokens(structuredSpecification),
  latencyMs: measureLatency()
});

📈 Specification Quality Metrics

Track continuous improvement:

// Analyze specification improvement over time
const stats = await reasoningBank.getPatternStats({
  task: 'specification',
  k: 10
});

console.log(`Specification quality trend: ${stats.avgReward}`);
console.log(`Common improvement areas: ${stats.commonCritiques}`);
console.log(`Success rate: ${stats.successRate}%`);

🎯 SPARC-Specific Learning Optimizations

Pattern-Based Requirement Analysis

// Learn which requirement formats work best
const bestRequirementPatterns = await reasoningBank.searchPatterns({
  task: 'specification: authentication',
  k: 5,
  minReward: 0.9
});

// Apply proven patterns:
// - User story format vs technical specs
// - Acceptance criteria structure
// - Edge case documentation approach
// - Constraint analysis completeness

GNN Search for Similar Requirements

// Build graph of related requirements
const requirementGraph = {
  nodes: [userAuth, dataValidation, errorHandling],
  edges: [[0, 1], [0, 2]], // Auth connects to validation and error handling
  edgeWeights: [0.9, 0.8],
  nodeLabels: ['Authentication', 'Validation', 'ErrorHandling']
};

// GNN-enhanced requirement discovery
const relatedRequirements = await agentDB.gnnEnhancedSearch(
  currentRequirement,
  {
    k: 8,
    graphContext: requirementGraph,
    gnnLayers: 3
  }
);

Cross-Phase Coordination with Attention

// Coordinate with other SPARC phases using attention
const coordinator = new AttentionCoordinator(attentionService);

// Share specification insights with pseudocode agent
const phaseCoordination = await coordinator.coordinateAgents(
  [specificationOutput, pseudocodeNeeds, architectureRequirements],
  'multi-head' // Multi-perspective analysis
);

console.log(`Phase consensus on requirements: ${phaseCoordination.consensus}`);

SPARC Specification Phase

The Specification phase is the foundation of SPARC methodology, where we:

  1. Define clear, measurable requirements
  2. Identify constraints and boundaries
  3. Create acceptance criteria
  4. Document edge cases and scenarios
  5. Establish success metrics

Specification Process

1. Requirements Gathering

specification:
  functional_requirements:
    - id: "FR-001"
      description: "System shall authenticate users via OAuth2"
      priority: "high"
      acceptance_criteria:
        - "Users can login with Google/GitHub"
        - "Session persists for 24 hours"
        - "Refresh tokens auto-renew"
      
  non_functional_requirements:
    - id: "NFR-001"
      category: "performance"
      description: "API response time <200ms for 95% of requests"
      measurement: "p95 latency metric"
    
    - id: "NFR-002"
      category: "security"
…

2. Constraint Analysis

constraints:
  technical:
    - "Must use existing PostgreSQL database"
    - "Compatible with Node.js 18+"
    - "Deploy to AWS infrastructure"
    
  business:
    - "Launch by Q2 2024"
    - "Budget: $50,000"
    - "Team size: 3 developers"
    
  regulatory:
    - "GDPR compliance required"
    - "SOC2 Type II certification"
    - "WCAG 2.1 AA accessibility"

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Specification by spencermarx?

Specification by spencermarx is a subagent for Claude Code and Claude Cowork from the spencermarx/open-code-review repository on GitHub. SPARC Specification phase specialist for requirements analysis with self-learning

How do I install Specification by spencermarx in Claude Code?

Download specification.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Can I use Specification by spencermarx in Claude Cowork?

Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

Is Specification by spencermarx safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under Apache-2.0. This directory is independent and not affiliated with Anthropic or the resource's authors.