For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Add optional BusinessInfo support to both exam sprint reports, show concrete report type text in repeated headers, and render business contact info on the left side of repeated footers with page numbers on the right.
Architecture: Extend report payload contracts with a shared optional BusinessInfo record. Renderers own business-data formatting by emitting .report-footer-business markup, while DefaultPlaywrightPdfWorker extracts that markup into Chromium's native footer template next to the page-number placeholders. Existing native page header/footer margin handling remains unchanged.
Tech Stack: Java records, Jackson JSON binding, Bean Validation annotations, HTML templates, Playwright Java PDF header/footer templates, JUnit 5, AssertJ, PDFBox.
abilities/exam-sprint/contracts/src/main/java/cn/yunzhixue/ability/center/examsprint/contracts/report/BusinessInfo.java: shared optional payload object.AchievementExamSprintReportPayload.java: add BusinessInfo businessInfo field.OutlookExamSprintReportPayload.java: add BusinessInfo businessInfo field.AchievementReportContent.java: add nested optional domain BusinessInfo and compact constructor normalization.AchievementReportContentMapper.java: map payload business info to domain content.DefaultPlaywrightPdfWorker.java: extract optional footer business block and place it left of right-aligned page numbers.Files:
abilities/exam-sprint/contracts/src/main/java/cn/yunzhixue/ability/center/examsprint/contracts/report/BusinessInfo.javaabilities/exam-sprint/contracts/src/main/java/cn/yunzhixue/ability/center/examsprint/contracts/report/AchievementExamSprintReportPayload.javaabilities/exam-sprint/contracts/src/main/java/cn/yunzhixue/ability/center/examsprint/contracts/report/OutlookExamSprintReportPayload.javaabilities/exam-sprint/domain/src/main/java/cn/yunzhixue/ability/center/examsprint/domain/report/AchievementReportContent.javaabilities/exam-sprint/application/src/main/java/cn/yunzhixue/ability/center/examsprint/application/report/AchievementReportContentMapper.javaTest: abilities/exam-sprint/application/src/test/java/cn/yunzhixue/ability/center/examsprint/application/report/AchievementReportContentMapperTest.java
[ ] Step 1: Write failing mapper test
Add a test that parses an achievement payload with BusinessInfo, maps it, and asserts businessInfo().name(), phone(), and address() are populated.
Run: mvn -pl abilities/exam-sprint/application -Dtest=AchievementReportContentMapperTest test
Expected: compilation failure or assertion failure because BusinessInfo is not modeled yet.
Create BusinessInfo contract record and add optional fields to both payload records. Add AchievementReportContent.BusinessInfo and a nullable businessInfo component.
Update AchievementReportContentMapper.toDomainContent to convert non-null payload business info to domain business info.
Run: mvn -pl abilities/exam-sprint/application -Dtest=AchievementReportContentMapperTest test
Expected: PASS.
Files:
abilities/exam-sprint/infrastructure/src/main/resources/templates/achievement-exam-sprint-report-template.htmlabilities/exam-sprint/infrastructure/src/main/resources/templates/outlook-exam-sprint-report-template.htmlabilities/exam-sprint/infrastructure/src/main/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/rendering/achievement/ClasspathAchievementExamSprintReportRenderer.javaabilities/exam-sprint/infrastructure/src/main/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/rendering/outlook/ClasspathOutlookExamSprintReportRenderer.javaTest: achievement/outlook renderer tests.
[ ] Step 1: Write failing renderer tests
Assert achievement header contains 学习成果报告; outlook header contains 潜力展望报告; business info renders in .report-footer-business when present and does not render when missing.
Run: mvn -pl abilities/exam-sprint/infrastructure -Dtest=ClasspathAchievementExamSprintReportRendererTest,ClasspathOutlookExamSprintReportRendererTest test
Expected: FAIL because templates still contain fixed header text and no footer business markup.
Replace fixed header report type text with {{headerReportType}}. Add {{reportFooterBusiness}} before </body>. Render escaped optional business markup with first line name/phone and second line address.
Run: mvn -pl abilities/exam-sprint/infrastructure -Dtest=ClasspathAchievementExamSprintReportRendererTest,ClasspathOutlookExamSprintReportRendererTest test
Expected: PASS.
Files:
abilities/exam-sprint/infrastructure/src/main/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/pdf/DefaultPlaywrightPdfWorker.javaTest: abilities/exam-sprint/infrastructure/src/test/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/pdf/PlaywrightExamSprintReportPdfGeneratorTest.java
[ ] Step 1: Write failing PDF footer test
Generate multi-page HTML containing .report-footer-business, then use PDFBox text positions to assert business text is on the left half of the page and 2 / total is on the right half.
Run: mvn -pl abilities/exam-sprint/infrastructure -Dtest=PlaywrightExamSprintReportPdfGeneratorTest#generatePlacesBusinessInfoLeftAndPageNumbersRightInFooter test
Expected: FAIL because footer template currently only renders centered page numbers.
Add a .report-footer-business regex extractor, remove that source block from print body HTML, and build a footer template with left business block and right page-number block.
Run: mvn -pl abilities/exam-sprint/infrastructure -Dtest=PlaywrightExamSprintReportPdfGeneratorTest#generatePlacesBusinessInfoLeftAndPageNumbersRightInFooter test
Expected: PASS.
Files:
No additional production files.
[ ] Step 1: Run contract/application relevant tests
Run: mvn -pl abilities/exam-sprint/application test
Expected: PASS.
Run: mvn -pl abilities/exam-sprint/infrastructure test
Expected: PASS.
Run: git diff -- abilities/exam-sprint docs/superpowers/specs/2026-05-13-report-business-footer-design.md docs/superpowers/plans/2026-05-13-report-business-footer.md
Expected: only intended contract, mapper, renderer, template, PDF worker, test, and documentation changes.