For Claude: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
Goal: Rename the achievement-report metric from 真题生词命中率 to 试卷掌握度命中率, and derive its displayed value from 试卷熟词提升 ÷ 词汇量提升, rounded to 1 decimal place as a percentage, with 0% when 词汇量提升 = 0.
Architecture: Keep the existing report DTO/placeholder shape intact and change only the application-layer mapping logic plus presentation text. Compute the percentage inside AchievementReportContentMapper from the existing delta fields so infrastructure rendering continues to consume the same unknownWordHitRateText placeholders without contract changes.
Tech Stack: Java, Maven, JUnit 5, AssertJ, HTML template rendering.
Files:
abilities/exam-sprint/application/src/main/java/cn/yunzhixue/ability/center/examsprint/application/report/AchievementReportContentMapper.javaabilities/exam-sprint/application/src/test/java/cn/yunzhixue/ability/center/examsprint/application/report/AchievementReportContentMapperTest.javaabilities/exam-sprint/application/src/test/java/cn/yunzhixue/ability/center/examsprint/application/report/ExamSprintReportApplicationServiceTest.javaStep 1: Write the failing tests
TestPaperImprovedWordCount ÷ StudentImproveWordCount instead of PaperMasteryHitRate.4 ÷ 19 = 21.1%.0% when StudentImproveWordCount = 0.PaperMasteryHitRate at a deliberately mismatched value so RED proves the old field is no longer the source.Step 2: Run tests to verify they fail
Run:
mvn -pl abilities/exam-sprint/application -am -Dtest=AchievementReportContentMapperTest,ExamSprintReportApplicationServiceTest test
Expected: FAIL because the mapper still uses PaperMasteryHitRate and formats 1.93% instead of 21.1% / 0%.
Step 3: Write the minimal implementation
AchievementReportContentMapper that:
payload.testPaperImprovedWordCount() as numeratorpayload.studentImproveWordCount() as denominator"0%" when denominator is zero(numerator / denominator) * 10020% becomes 20.0% while 21.1% stays 21.1%summaryMetrics.unknownWordHitRateText and examUnknownWordsHitStatus.unknownWordHitRateText.Step 4: Run tests to verify they pass
Run:
mvn -pl abilities/exam-sprint/application -am -Dtest=AchievementReportContentMapperTest,ExamSprintReportApplicationServiceTest test
Expected: PASS.
Step 5: Do not commit
Files:
abilities/exam-sprint/infrastructure/src/main/resources/templates/achievement-exam-sprint-report-template.htmlabilities/exam-sprint/infrastructure/src/test/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/rendering/achievement/ClasspathAchievementExamSprintReportRendererTest.javaabilities/exam-sprint/infrastructure/src/test/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/pdf/PlaywrightExamSprintReportPdfGeneratorTest.javaStep 1: Write the failing tests
真题生词命中率 to 试卷掌握度命中率.1.93% to 21.1% based on the shared sample payload.Step 2: Run tests to verify they fail
Run:
mvn -pl abilities/exam-sprint/infrastructure -am -Dtest=ClasspathAchievementExamSprintReportRendererTest,PlaywrightExamSprintReportPdfGeneratorTest test
Expected: FAIL because the template still shows the old label and existing fixture-derived values still render 1.93%.
Step 3: Write the minimal implementation
真题生词命中率 to 试卷掌握度命中率.Step 4: Run tests to verify they pass
Run:
mvn -pl abilities/exam-sprint/infrastructure -am -Dtest=ClasspathAchievementExamSprintReportRendererTest,PlaywrightExamSprintReportPdfGeneratorTest test
Expected: PASS.
Step 5: Do not commit
Files:
Step 1: Run the combined verification suite
Run:
mvn -pl abilities/exam-sprint/infrastructure,abilities/exam-sprint/application -am -Dtest=AchievementReportContentMapperTest,ExamSprintReportApplicationServiceTest,ClasspathAchievementExamSprintReportRendererTest,PlaywrightExamSprintReportPdfGeneratorTest test
Expected: PASS with zero failures.
Step 2: Inspect the final diff
Run:
git diff -- abilities/exam-sprint/application/src/main/java/cn/yunzhixue/ability/center/examsprint/application/report/AchievementReportContentMapper.java abilities/exam-sprint/application/src/test/java/cn/yunzhixue/ability/center/examsprint/application/report/AchievementReportContentMapperTest.java abilities/exam-sprint/application/src/test/java/cn/yunzhixue/ability/center/examsprint/application/report/ExamSprintReportApplicationServiceTest.java abilities/exam-sprint/infrastructure/src/main/resources/templates/achievement-exam-sprint-report-template.html abilities/exam-sprint/infrastructure/src/test/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/rendering/achievement/ClasspathAchievementExamSprintReportRendererTest.java abilities/exam-sprint/infrastructure/src/test/java/cn/yunzhixue/ability/center/examsprint/infrastructure/report/pdf/PlaywrightExamSprintReportPdfGeneratorTest.java
Expected: Only the derived-metric logic, renamed labels, and directly related test updates appear.
Step 3: Do not commit