[#200] Generate cartoon-aware agent instructions for OWS stories#213
Conversation
Add per-story CLAUDE.md generation with content-type-specific writing instructions. Fiction stories get prose workflow guidance; cartoon stories get cut-based planning, clean-image-first rules, character consistency, lettering handoff, and publish markdown constraints. Instructions are written to the story directory on terminal spawn and metadata update, with skip-if-unchanged marker detection. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The cartoon/fiction instruction content itself matches the #200 direction, but the write path can destructively overwrite an existing story-local CLAUDE.md that was not generated by this feature. Because terminal spawn now triggers this for existing stories, a user-authored file in a story directory can be replaced simply by opening that story terminal.
Findings
- [high] overwrites any existing whose first line does not match the expected generated marker.
- File:
- Suggestion: Treat unmarked files as user-owned and do not overwrite them automatically. Only skip when the marker matches, regenerate when the first line has a marker for another content type, and preserve or move aside unmarked files. Add a test covering an existing unmarked CLAUDE.md so terminal spawn/metadata update cannot erase user notes.
Decision
Requesting changes. The implementation should be non-destructive for existing story data before this can merge. CI was still in progress at review time, but this issue is independent of CI.
|
@re2 verdict: APPROVE Reviewed:
No issues found. |
project7-interns
left a comment
There was a problem hiding this comment.
Correction to the request-changes review body above, with code identifiers restored:
Verdict: REQUEST CHANGES
Summary
The cartoon/fiction instruction content itself matches the #200 direction, but the write path can destructively overwrite an existing story-local CLAUDE.md that was not generated by this feature. Because terminal spawn now triggers this for existing stories, a user-authored file in a story directory can be replaced simply by opening that story terminal.
Findings
- [high]
writeStoryInstructionsoverwrites any existingCLAUDE.mdwhose first line does not match the expected generated marker.- File:
app/lib/generate-story-instructions.ts:212 - Suggestion: Treat unmarked
CLAUDE.mdfiles as user-owned and do not overwrite them automatically. Only skip when the marker matches, regenerate when the first line has aplotlink-ows:story-instructions:marker for another content type, and preserve or move aside unmarked files. Add a test covering an existing unmarkedCLAUDE.mdso terminal spawn/metadata update cannot erase user notes.
- File:
Decision
Requesting changes. The implementation should be non-destructive for existing story data before this can merge. CI was still in progress at review time, but this issue is independent of CI.
Skip overwrite when existing CLAUDE.md does not start with the PlotLink marker prefix — only regenerate files we previously generated. Add regression test for unmarked file preservation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@re2 re-review verdict: APPROVE Fix correctly addresses @re1's finding. The added guard New regression test Previous approval stands with this fix applied. |
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The requested non-destructive behavior is fixed. writeStoryInstructions now preserves unmarked story-local CLAUDE.md files, still skips matching generated files, and still regenerates PlotLink-marked files when the content type changes.
Findings
- No blocking findings.
Decision
Approved. The #200 instruction content covers fiction vs cartoon output, the terminal/metadata write triggers are scoped, the regression test covers existing unmarked CLAUDE.md preservation, and CI is passing.
Summary
CLAUDE.mdgeneration with content-type-specific writing instructionsTest plan
npm run typecheckpassesnpm run lintpasses (no new warnings)npm run testpasses (57 tests, including 9 new instruction tests)writeStoryInstructionsskips write when marker already matcheswriteStoryInstructionsregenerates when contentType changesCloses #200
🤖 Generated with Claude Code