Skip to content

spec-ops-method/spec-ops-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpecOps Demo: IRS Direct File

A demonstration of the SpecOps methodology applied to the IRS Direct File project, showing how AI agent instruction sets can be used to extract and document institutional knowledge from government tax systems.

Demo Results

We've completed an initial demonstration of the SpecOps methodology using three different AI models (GPT-5, Gemini 2.5 Pro, and Claude Sonnet 4.5) to generate specifications from IRS Direct File code samples.

View the full evaluation findings →

Summary

Specification Model Grade
Standard Deduction GPT-5 A
Dependent Qualification Gemini 2.5 Pro B
Tax Bracket Calculation Claude Sonnet 4.5 A-

All three specifications successfully extracted business logic in plain language suitable for domain expert review. See the FINDINGS.md for detailed analysis against success criteria.

Try It Yourself

This repository is designed for you to replicate and extend the demonstration. Use the skills and examples provided to test the SpecOps methodology with your own AI models and evaluate the results.

About This Demo

This repository demonstrates how to create reusable AI agent instruction sets (skills) for analyzing tax system code and generating human-verifiable specifications. Rather than directly transpiling code, SpecOps focuses on preserving institutional knowledge in specifications that domain experts can review.

Why IRS Direct File?

The IRS Direct File project is an excellent demonstration case because:

  • Complex business logic: Interprets the Internal Revenue Code (26 USC)
  • Domain expert verification: Tax policy experts can verify specifications
  • Multi-technology stack: TypeScript, Scala, Java, JavaScript
  • Public visibility: Well-known government project (4.5k+ GitHub stars)
  • Institutional knowledge: Tax calculation rules that need preservation

Repository Structure

spec-ops-demo/
├── FINDINGS.md                       # Evaluation of generated specifications
├── skills/                           # AI agent instruction sets
│   ├── tax-logic-comprehension.md    # Understanding tax code patterns
│   ├── scala-fact-graph-comprehension.md  # Analyzing Fact Graph logic
│   ├── standard-deduction-calculation.md  # Standard deduction skill
│   └── dependent-qualification-comprehension.md  # Dependent rules skill
│
├── examples/                         # Code samples from Direct File
│   ├── standard-deduction/           # Standard deduction logic
│   ├── dependent-qualification/      # Dependent rules
│   └── fact-graph-sample/            # Knowledge graph examples
│
├── specifications/                   # Generated specifications
│   ├── standard-deduction-spec.md    # Generated by GPT-5
│   ├── qualifying-dependent.md       # Generated by Gemini 2.5 Pro
│   └── fact-graph-tax-bracket-spec.md # Generated by Claude Sonnet 4.5
│
└── README.md                         # This file

How to Use This Demo

1. Understand the Skills

Review the instruction sets in skills/ to see how AI agents are guided to:

  • Analyze tax system code
  • Extract business logic
  • Generate plain-language specifications
  • Document institutional knowledge

Start with tax-logic-comprehension.md - this is the foundation skill that other specialized skills extend.

2. Examine the Examples

Look at the code samples in examples/ - these are real excerpts from IRS Direct File showing:

  • Tax calculation logic
  • Fact Graph reasoning patterns
  • Test-driven business rules

3. Review Generated Specifications

See the specifications/ directory for examples of specifications generated using the skills, showing how complex tax logic is translated into human-readable documentation.

4. Generate Your Own Specifications

To replicate this demonstration:

  1. Load the parent skill (skills/tax-logic-comprehension.md) into your AI agent
  2. Load the specialized skill for your target domain
  3. Point the agent at the example code in examples/
  4. Generate a specification following the skill templates
  5. Evaluate against the success criteria

5. Compare Results

Use the evaluation framework in FINDINGS.md to assess your generated specifications against the same criteria.

The SpecOps Process

This demo illustrates key SpecOps phases:

Phase 1: Discovery - Identify target system components (e.g., standard deduction logic)

Phase 2: Specification Generation - Use AI with custom instruction sets to analyze code and generate initial specifications

Phase 3: Verification - Domain experts (tax policy professionals) review and validate specifications

Phase 4: Implementation - Use verified specifications to guide modern implementations

Key Principles Demonstrated

  1. The Specification is the Source of Truth - Specifications capture what the system does, independent of implementation
  2. Domain Experts Are the Arbiters - Tax experts verify specs, not code
  3. AI Assists, Humans Verify - AI analyzes code; humans validate accuracy
  4. Reusable Skills - Instruction sets work across different tax systems

Skills Being Developed

  • Tax Logic Comprehension: Understanding IRC references, tax calculations, and form dependencies
  • Standard Deduction Calculation: Documenting standard vs. itemized deduction logic
  • Scala Fact Graph Analysis: Analyzing declarative knowledge graph structures and XML-based business rules
  • Dependent Qualification Rules: Capturing the five tests for qualifying child and four tests for qualifying relative

Related Projects

Contributing

This is a demonstration repository showing how SpecOps can be applied. The skills developed here are intended to be:

  • Portable: Usable across different tax systems
  • Shareable: Applicable to state and federal tax modernization
  • Extensible: Templates for developing additional skills

Ways to Contribute

  • Run your own evaluation: Use different AI models and compare results
  • Improve the skills: Suggest enhancements to instruction sets based on your findings
  • Add new examples: Extract additional code samples from IRS Direct File
  • Develop new skills: Create instruction sets for other tax domains (credits, schedules, etc.)

Contact

For questions about the SpecOps methodology, see:

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A demonstration of core SpecOps principles

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published