Personal Blogging Platform Generator
Defines requirements for a Python library that generates static blogs with content scheduling, social metadata, and image galleries.
What this file does
Defines requirements for a Python library that generates static blogs with content scheduling, social metadata, and image galleries.
When to use it
- Building a static site generator focused on blogging
- Implementing editorial planning features like drafts and scheduling
- Adding social sharing optimization to a static site
- Creating a testable Python library for content management
Assumes this stack
Personal Blogging Platform Generator
A specialized static site generator designed for independent bloggers to create, manage, and publish content-focused websites with editorial planning features, social optimization, and media galleries.
Overview
This project implements a Python library for generating blog-centric static websites that prioritize content presentation, reading experience, and social sharing. It focuses on the needs of independent bloggers who want full ownership of their platform while maintaining a professional online presence with minimal technical overhead.
Persona Description
Marcus writes a personal blog about urban gardening and sustainable living, sharing articles, tutorials, and photo galleries. He wants a simple way to publish his content with minimal technical overhead while maintaining full ownership of his platform.
Key Requirements
-
Content Calendar with Publishing Management: Implement a system for managing draft posts, scheduling future publications, and organizing content by status (draft, scheduled, published, archived).
- Critical for Marcus because it allows him to plan his editorial calendar, work on multiple posts simultaneously, and maintain a consistent publishing schedule without manual intervention.
- Must include metadata for publication dates, status tracking, and automated publishing pipeline.
-
Social Sharing Optimization: Generate appropriate metadata for optimal display when content is shared on social platforms, including Open Graph tags, Twitter Cards, and structured data.
- Essential for Marcus because social sharing drives significant traffic to his blog, and properly formatted previews with images and descriptions significantly increase click-through rates.
- Must generate platform-specific markup for major social networks with customizable templates.
-
Reading Time Estimation and Readability Analysis: Calculate estimated reading times for articles and provide readability metrics (like Flesch-Kincaid score) to help improve content structure.
- Important for Marcus because it helps readers set expectations for article length and helps him ensure his content remains accessible to his target audience.
- Should analyze text complexity, sentence structure, and word choice to provide actionable feedback.
-
Optimized Photo Gallery Templates: Create specialized templates for photo galleries with lazy loading, responsive images for different screen sizes, and proper image optimization.
- Valuable for Marcus because his gardening content relies heavily on visual elements, and a good gallery experience improves engagement while maintaining performance.
- Must handle image resizing, format conversion, and delivery optimization.
-
Comment System Integration: Support for adding comments to static pages through third-party systems or implementing a static site commenting solution.
- Critical for Marcus because community engagement and discussion are central to his blog's purpose, and comments must work without requiring server-side processing.
- Should support multiple commenting platforms with consistent styling and moderation capabilities.
Technical Requirements
Testability Requirements
- All components must be individually testable through well-defined interfaces
- Implement fixtures for testing with sample blog content and images
- Support snapshot testing for generated HTML output
- Test suites must validate the structure and correctness of generated social metadata
- Support mocking of time-dependent functions for testing scheduled publishing
Performance Expectations
- Generate a 100-post blog with images in under 30 seconds
- Image optimization pipelines should process 20+ images per second
- Incremental builds should complete in under 3 seconds for content-only changes
- Reading time and readability analysis should process 1000+ words in under 100ms
- Generated sites should achieve 90+ scores on Google PageSpeed Insights (to be simulated in tests)
Integration Points
- Social media platform metadata specifications
- Third-party commenting systems APIs
- Image optimization and transformation libraries
- Content delivery networks for optimized asset delivery
- Readability analysis algorithms and libraries
Key Constraints
- IMPORTANT: The implementation should have NO UI/UX components. All functionality must be implemented as testable Python modules and classes that can be thoroughly tested using pytest. Focus on creating well-defined APIs and interfaces rather than user interfaces.
- Must generate completely static HTML that works without any server-side processing
- Must optimize images for web delivery while maintaining quality
- Output must be fully accessible and SEO-optimized
- Content management must work efficiently with standard version control systems
- Site generation must be automatable for continuous deployment workflows
Core Functionality
The Personal Blogging Platform Generator should provide a comprehensive Python library with the following core capabilities:
-
Content Processing System
- Parse and process Markdown files with frontmatter for metadata
- Support for blog-specific formatting and shortcodes
- Handle draft status, publication dates, and scheduling
- Implement tagging, categorization, and content relationships
-
Content Analysis Tools
- Calculate estimated reading times based on content length and complexity
- Analyze readability using established metrics (Flesch-Kincaid, etc.)
- Suggest improvements for title formats, headings, and paragraph structure
- Identify potential SEO improvements for content
-
Media Management
- Process images for responsive delivery (multiple sizes, formats)
- Implement gallery templates with advanced features
- Optimize media files for web delivery
- Generate proper alt text and accessibility features
-
Social Integration
- Generate platform-specific social sharing metadata
- Create preview cards for various platforms
- Support custom social images with text overlays
- Enable structured data for rich search results
-
Site Structure and Features
- Build archive pages, tag pages, and category indexes
- Generate RSS/Atom feeds for subscription
- Implement related content suggestions
- Support for comments integration
- Create search indexes for client-side search
Testing Requirements
Key Functionalities to Verify
-
Content Processing and Publishing
- Test conversion of markdown to properly formatted HTML
- Verify correct handling of publication dates and draft status
- Test scheduled publishing mechanism
- Confirm generation of archives, category pages, and tag pages
-
Media Optimization and Galleries
- Test image resizing and format conversion
- Verify responsive image generation
- Test gallery templates with various image counts and orientations
- Confirm proper lazy loading implementation
- Verify accessibility compliance for media content
-
Metadata and Social Integration
- Test generation of Open Graph and Twitter Card metadata
- Verify structured data correctness
- Test custom social image generation
- Confirm proper handling of various content types
-
Content Analysis
- Test reading time calculations for various content lengths
- Verify readability scoring against established benchmarks
- Test content improvement suggestions
- Confirm correct operation with multilingual content
-
Comment System Integration
- Test integration with various commenting platforms
- Verify comment display templates
- Test comment counts and threading
- Confirm accessibility of comment sections
Critical User Scenarios
- Publishing a new blog post with images and seeing it properly displayed
- Scheduling multiple posts for future publication
- Creating and organizing photo galleries with many images
- Sharing content on social media with proper preview cards
- Analyzing content for readability and implementing improvements
Performance Benchmarks
- Full site build with 100 posts should complete in under 30 seconds
- Incremental builds should complete in under 3 seconds
- Image processing should handle 50+ images in under 10 seconds
- Search index generation should process content at 10+ posts/second
- Memory usage should not exceed 500MB for typical blog sizes
Edge Cases and Error Conditions
- Test handling of malformed markdown
- Verify proper error reporting for missing images
- Test behavior with extremely long posts or very short content
- Verify graceful handling of special characters and Unicode
- Test with missing metadata and incomplete front matter
- Validate behavior with uncommon media types (SVG, WebP, etc.)
Required Test Coverage Metrics
- Minimum 90% code coverage for core functionality
- 100% coverage for publishing and scheduling logic
- 100% coverage for social metadata generation
- Integration tests for entire build pipeline
- Performance tests for both small and large blogs
IMPORTANT:
- ALL functionality must be testable via pytest without any manual intervention
- Tests should verify behavior against requirements, not implementation details
- Tests should be designed to validate the WHAT (requirements) not the HOW (implementation)
- Tests should be comprehensive enough to verify all aspects of the requirements
- Tests should not assume or dictate specific implementation approaches
- REQUIRED: Tests must be run with pytest-json-report to generate a pytest_results.json file:
pip install pytest-json-report pytest --json-report --json-report-file=pytest_results.json - The pytest_results.json file must be included as proof that all tests pass
Success Criteria
The Personal Blogging Platform Generator will be considered successful if it:
- Correctly manages content with drafts, scheduling, and automatic publishing
- Produces optimized HTML with proper social sharing metadata for various platforms
- Accurately calculates reading times and readability scores
- Successfully processes images for responsive galleries with proper optimization
- Effectively integrates commenting solutions with the static site workflow
- Builds sites efficiently with proper incremental build support
- Generates accessible, SEO-friendly HTML output
- Creates all necessary site structure elements (archives, categories, tags, feeds)
REQUIRED FOR SUCCESS:
- All tests must pass when run with pytest
- A valid pytest_results.json file must be generated showing all tests passing
- The implementation must satisfy all key requirements specified for this persona
Development Environment Setup
To set up your development environment:
-
Create a virtual environment using UV:
uv venv -
Activate the virtual environment:
source .venv/bin/activate -
Install the project in development mode:
uv pip install -e . -
CRITICAL: When testing, you must generate the pytest_results.json file:
pip install pytest-json-report pytest --json-report --json-report-file=pytest_results.json
This file is MANDATORY proof that all tests pass and must be included with your implementation.
What's inside
8 sections covering persona, requirements, testing, and success criteria with 5 core functionality areas
Change this for your project
- Replace
justinchiu-test/librarybenchwith your own repository name - Replace
Marcusand his urban gardening persona with your target user - Replace
Personal Blogging Platform Generatorwith your project name
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Separating testability requirements from functional requirements to ensure test-first design
- Defining performance benchmarks as explicit testable targets (e.g., 100 posts in under 30 seconds)
- Requiring a JSON test report file as proof of passing tests
Related Documents
How you work
Defines personality, planning, task execution, and communication conventions for a coding agent in the Codex CLI environment.
How you work
Defines personality, planning, task execution, and communication guidelines for a coding agent in Codex CLI.
内置 Agent 提示词
Documents the system prompts, tool permissions, and model assignments for six built-in subagents in Claude Code.
perplexity-ai_20250112
Defines the system prompt for Perplexity AI, instructing the assistant on how to answer queries using search results with strict formatting, citation, and query-type rules.