Skip to content

Agentic workflows: Add mandatory article quality gate with disqualifying patterns #466

@pethers

Description

@pethers

📋 Issue Type

Feature / Agentic Workflow Improvement

🎯 Objective

Enhance all agentic workflow definition files to explicitly require Economist-style deep analysis in the article generation prompts. Currently, while the workflows mention "The Economist-style standards", the actual instructions allow the TypeScript pipeline to generate list-style articles without being flagged as insufficient quality.

📊 Current State

The workflow prompts (.github/workflows/news-*.md) include:

  • Reference to editorial-standards skill
  • "Each article MUST contain real analysis, not just a list of translated links"
  • Step 4 says "If the generated article lacks these analytical sections, manually add contextual analysis before committing"

Problem: The agent runs npx tsx scripts/generate-news-enhanced.ts which produces list-style output, and the agent doesn't always enhance it. The prompt needs to be MORE explicit about:

  1. What "real analysis" means (specific sections required)
  2. Quality validation criteria (minimum standards before committing)
  3. How to transform list output into analysis

🚀 Desired State

Each workflow .md file should include:

Enhanced Quality Gate in Step 4:

## MANDATORY Quality Validation

After article generation, verify EACH article meets these minimum standards:

### Required Sections (at least 3 of 5):
1. **Analytical Lede** (paragraph, not just document count)
2. **Thematic Analysis** (documents grouped by policy theme)
3. **Strategic Context** (why these documents matter politically)
4. **Stakeholder Impact** (who benefits, who loses)
5. **What Happens Next** (expected timeline and outcomes)

### Disqualifying Patterns:
- ❌ "Filed by: Unknown (Unknown)" — FIX before committing
-`data-translate="true"` spans in non-Swedish articles — TRANSLATE before committing
- ❌ Identical "Why It Matters" text for all entries — DIFFERENTIATE analysis
- ❌ Flat list of documents without grouping — GROUP by theme
- ❌ Article under 500 words — EXPAND with analysis

### If article fails quality check:
1. Use bash to enhance the HTML with analytical sections
2. Replace generic "Why It Matters" with document-specific analysis
3. Add thematic grouping headers
4. Translate any remaining Swedish content

🔧 Implementation Approach

Target files: .github/workflows/news-motions.md, news-propositions.md, news-committee-reports.md (the 3 document-type workflows)

  1. Add "MANDATORY Quality Validation" section after Step 4
  2. Include specific disqualifying patterns to check for
  3. Add explicit fix instructions for each pattern
  4. Include word count minimum (500 words for analysis articles)
  5. Add validation bash commands to check for issues

✅ Acceptance Criteria

  • All 3 document-type workflow .md files include quality validation section
  • Disqualifying patterns explicitly listed
  • Fix instructions provided for each pattern
  • Quality gate prevents list-only articles from being committed
  • Consistent wording across all 3 workflows

📚 References

  • .github/workflows/news-motions.md (Step 4: Translate, Validate & Verify Analysis Quality)
  • .github/workflows/news-propositions.md
  • .github/workflows/news-committee-reports.md
  • .github/skills/editorial-standards/SKILL.md — The Economist-style standards
  • Bad example: news/2026-02-22-opposition-motions-en.html (list-only)
  • Good example: news/2026-02-opposition-motions-en.html (deep analysis)

🤖 Recommended Agent

Copilot coding agent — enhance workflow prompts for quality enforcement

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions