Loading...
Loading...
Create, validate, and work with Atlassian Document Format (ADF) for Jira. Use when creating rich content for Jira issues, epics, and comments. Helps with understanding ADF node structure, building documents programmatically, validating ADF against the specification, and troubleshooting validation errors.
npx skill4agent add dawiddutoit/custom-claude work-with-adffrom jira_tool.formatter import JiraDocumentBuilder
doc = JiraDocumentBuilder()
doc.add_paragraph(doc.add_text("Hello, Jira!"))
adf = doc.build()
print(adf){
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [{"type": "text", "text": "Hello, Jira!"}]
}
]
}docversiontype: "doc"content{
"version": 1,
"type": "doc",
"content": []
}JiraDocumentBuildersrc/jira_tool/formatter.pyEpicBuilderIssueBuilderdoc.add_heading("My Epic", level=1)
doc.add_heading("Problem Statement", level=2)doc.add_paragraph(
doc.bold("Priority: "),
doc.add_text("P0")
)doc.add_bullet_list(["Item 1", "Item 2", "Item 3"])
doc.add_ordered_list(["First step", "Second step"], start=1)doc.add_code_block(
'def hello():\n print("world")',
language="python"
)doc.add_panel("warning",
{"type": "paragraph", "content": [doc.add_text("Important!")]}
)doc.add_rule() # Horizontal rule
emoji = doc.add_emoji(":rocket:", "🚀")doc.bold("Bold text")
doc.italic("Italic text")
doc.code("inline_code")
doc.strikethrough("Strikethrough")
doc.link("Click here", "https://example.com")doc.add_paragraph(
doc.bold("Status: "),
doc.add_text("In Progress")
)adf_dict = doc.build()from jira_tool.client import JiraClient
client = JiraClient()
client.create_issue(
project="PROJ",
issue_type="Epic",
summary="My Epic",
description=adf_dict # Pass ADF directly
)from jira_tool.formatter import EpicBuilder
epic = EpicBuilder(
title="User Authentication System",
priority="P0",
dependencies="OAuth 2.0 library",
services="Auth Service, API Gateway"
)
epic.add_problem_statement(
"Current authentication is insecure and lacks OAuth support"
)
epic.add_description(
"Implement OAuth 2.0 integration with support for multiple providers"
)
epic.add_technical_details(
requirements=[
"Implement OAuth 2.0 flow",
"Support Google and GitHub providers",
"Add token refresh mechanism"
],
code_example="oauth = OAuth2Handler(provider='google')",
code_language="python"
)
epic.add_acceptance_criteria([
"Users can log in with Google",
"Users can log in with GitHub",
"Tokens refresh automatically"
])
epic.add_edge_cases([
"Handle provider outages gracefully",
"Support token expiration",
"Manage scope conflicts"
])
epic.add_testing_considerations([
"Mock OAuth provider responses",
"Test token refresh edge cases",
"Verify scope permissions"
])
adf = epic.build()from jira_tool.formatter import IssueBuilder
issue = IssueBuilder(
title="Implement OAuth Google Provider",
component="Auth Service",
story_points=13,
epic_key="PROJ-100"
)
issue.add_description(
"Add Google OAuth 2.0 provider support to the authentication system"
)
issue.add_implementation_details([
"Register application with Google Cloud Console",
"Implement OAuth callback endpoint",
"Add token validation and refresh logic",
"Update user profile with Google user ID"
])
issue.add_acceptance_criteria([
"Users can authenticate with Google account",
"Tokens are validated on each request",
"Token refresh works correctly",
"Tests pass with >90% coverage"
])
adf = issue.build()adf_document = {
"version": 1,
"type": "doc",
"content": [
{
"type": "heading",
"attrs": {"level": 1},
"content": [{"type": "text", "text": "Custom Report"}]
},
{
"type": "paragraph",
"content": [
{"type": "text", "text": "Data as of: "},
{"type": "text", "text": "2025-11-03", "marks": [{"type": "code"}]}
]
},
{
"type": "table",
"attrs": {"isNumberColumnEnabled": False, "layout": "default"},
"content": [
{
"type": "tableRow",
"content": [
{
"type": "tableHeader",
"content": [
{"type": "paragraph", "content": [{"type": "text", "text": "Metric"}]}
]
},
{
"type": "tableHeader",
"content": [
{"type": "paragraph", "content": [{"type": "text", "text": "Value"}]}
]
}
]
}
]
}
]
}from jira_tool.formatter import JiraDocumentBuilder
doc = JiraDocumentBuilder()
# Emoji in paragraph
doc.add_paragraph(
doc.add_emoji(":rocket:", "🚀"),
doc.add_text(" "),
doc.bold("Important Update")
)
# Emoji in heading
doc.add_heading(doc.add_emoji(":warning:", "⚠️") + " Critical Issue", 1)
adf = doc.build()# Validate using the skill's validation script
python .claude/skills/work-with-adf/scripts/validate_adf.py your-adf.json"content is required for block nodes"content"content": []"version is required""version": 1"Node type X is not allowed as child of Y""attrs is required for node type X"attrsimport json; print(json.dumps(adf, indent=2)).build()doc = JiraDocumentBuilder()
doc.add_heading("Report", 1)
if has_dependencies:
doc.add_heading("Dependencies", 2)
doc.add_bullet_list(dependencies)
if has_code_example:
doc.add_code_block(code, language)
adf = doc.build()def create_info_section(title: str, content: str) -> dict:
"""Create a titled info panel."""
from jira_tool.formatter import JiraDocumentBuilder
doc = JiraDocumentBuilder()
doc.add_heading(title, 2)
doc.add_panel("info",
{"type": "paragraph", "content": [doc.add_text(content)]}
)
return doc.content[0] # Return just the heading
return doc.content[1] # Return just the panel
# Use in larger document
epic = EpicBuilder("My Epic", "P0")
epic.content.extend(create_info_section("Background", "...").values())code = """
def calculate(a, b):
result = a + b
return result
"""
doc.add_code_block(code.strip(), language="python")jira-tooldocs/reference/adf_reference_guide.mdsrc/jira_tool/formatter.pydocs/guides/jira_formatting_guide.mdexamples/examples.mdreferences/reference.mdscripts/validate_adf.py