Requirement Agent
This agent takes any requirement from the customer and builds the knowledge base through fragmneted sources like JIRA, CONFLUECE, github or pdfs . After undertsanding the customer requirements go aheads and writes functional and non functional requirements. Follows these steps: Authenticate and authorize the user. Retrieve the Jira story and authorized supporting context. Discover appropriate PRD/Confluence information. Generate structured functional and non-functional requirements. Generate acceptance criteria. Identify dependencies, assumptions, constraints, security/data needs and risks. Detect missing, ambiguous, and conflicting information. Link material AI outputs to supporting evidence or flag them for confirmation. Present clarification questions to a human. Capture human responses and reanalyze affected requirements. Calculate the requirement quality score. Version every material revision. Allow an authorized Product Owner to approve, reject, or request rework. Lock the approved version against silent modification. Maintain the complete AI/human audit trail.
Preview Mode
This is a preview with sample data. The template uses placeholders like
which will be replaced with actual agent data.
About This Template
Requirement Agent is a browser-executable AI agent template built on AgentOp. It runs entirely in the browser using Python (via Pyodide) and can be deployed without a server — just download the generated HTML file and open it locally or host it anywhere.
Template Metadata
- Slug
- Requirement-agent
- Created By
- sandeep9547
- Created
- Oct 02, 2026
- Usage Count
- 0
Tags
Code Statistics
- HTML Lines
- 0
- CSS Lines
- 0
- JS Lines
- 0
- Python Lines
- 105
Source Code
import json
import uuid
import datetime
class RequirementsAgent:
def __init__(self):
self.audit = []
self.versions = []
def log(self, action, user):
self.audit.append({
"timestamp": str(datetime.datetime.utcnow()),
"user": user,
"action": action
})
def authenticate(self, user):
role_map = {
"sandeep":"analyst",
"po":"product_owner"
}
return role_map.get(user)
def analyze_story(self, jira_story, context):
requirements = {
"functional": [
"System shall process ticket data",
"System shall validate user permissions"
],
"non_functional": [
"Response < 2 sec",
"Audit trail maintained"
]
}
return requirements
def generate_acceptance_criteria(self):
return [
"Given valid permissions user can access story",
"Given invalid permission access denied"
]
def detect_gaps(self, text):
gaps = []
if "security" not in text.lower():
gaps.append("Security requirements missing")
if "performance" not in text.lower():
gaps.append("Performance requirements missing")
return gaps
def generate_questions(self, gaps):
return [
f"Please clarify: {gap}"
for gap in gaps
]
def quality_score(self,
requirements,
gaps):
score = 100
score -= len(gaps) * 10
return max(score, 0)
def save_version(self,
requirements,
author):
version = {
"id": str(uuid.uuid4()),
"created_by": author,
"timestamp": str(datetime.datetime.utcnow()),
"requirements": requirements
}
self.versions.append(version)
return version
def approve(self,
version_id,
user_role):
if user_role != "product_owner":
raise Exception("Only Product Owner can approve")
return {
"version": version_id,
"status": "APPROVED"
}
Name your agent
Based on . You'll get your own private copy to try and customize.