Skip to content

updating poem to content use case#5286

Merged
lorenzejay merged 2 commits intomainfrom
lorenze/imp/getting-started
Apr 6, 2026
Merged

updating poem to content use case#5286
lorenzejay merged 2 commits intomainfrom
lorenze/imp/getting-started

Conversation

@lorenzejay
Copy link
Copy Markdown
Collaborator

@lorenzejay lorenzejay commented Apr 5, 2026

Note

Low Risk
Low risk template/scaffolding change that mainly affects newly generated flow projects; existing user projects are unaffected unless they regenerate from templates.

Overview
Updates the crewai create flow scaffolding to generate a content creation example instead of the previous poem example.

The flow template now wires a ContentCrew (planner/writer/editor) with new agents.yaml and tasks.yaml, accepts a topic trigger payload, and writes the final output to output/post.md. Related template docs (AGENTS.md, flow README.md) and the copied crew folder list are updated accordingly, and the old poem_crew template is removed.

Reviewed by Cursor Bugbot for commit 824586e. Bugbot is set up for automated code reviews on this repo. Configure here.

from crewai.flow import Flow, listen, start

from {{folder_name}}.crews.poem_crew.poem_crew import PoemCrew
from {{folder_name}}.crews.content_crew.content_crew import ContentCrew
@crew
def crew(self) -> Crew:
"""Creates the Research Crew"""
"""Creates the Content Crew"""
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing __init__.py for content_crew package

Medium Severity

The old poem_crew/__init__.py was deleted but no corresponding content_crew/__init__.py was created. The create_flow.py copies crew folders using rglob("*"), so the generated project's content_crew directory will lack an __init__.py. The flow's main.py imports from {{folder_name}}.crews.content_crew.content_crew import ContentCrew, which may fail or behave unexpectedly without a proper package marker depending on the Python/packaging setup.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit cf49b3f. Configure here.

class ContentState(BaseModel):
topic: str = ""
outline: str = ""
draft: str = ""
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused outline and draft state fields

Low Severity

ContentState defines outline and draft fields that are never read or written anywhere in the flow. Only topic and final_post are used. Since this is a template that new users will scaffold from, these dead fields add confusion about the intended flow architecture without providing value.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit cf49b3f. Configure here.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 3 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 824586e. Configure here.

def save_content(self):
print("Saving content")
with open("output/post.md", "w") as f:
f.write(self.state.final_post)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Writing to subdirectory without ensuring it exists

Medium Severity

save_content writes to output/post.md without ensuring the output/ directory exists. The old template wrote to poem.txt in the current directory, which always works. The new code will raise a FileNotFoundError if the output/ directory hasn't been created. It currently relies on the crew's editing_task output_file setting to implicitly create the directory first — a fragile coupling that breaks if someone modifies the task config.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 824586e. Configure here.

@lorenzejay lorenzejay merged commit d2e57e3 into main Apr 6, 2026
48 of 49 checks passed
@lorenzejay lorenzejay deleted the lorenze/imp/getting-started branch April 6, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants