Skip to content

Add write_essay_by_author and update Pattern metadata #1542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ksylvan
Copy link
Collaborator

@ksylvan ksylvan commented Jun 24, 2025

Add write_essay_by_author and update Pattern metadata

Summary

This PR updates the pattern descriptions and related files in the Fabric project. The main changes involve consolidating pattern metadata, adding new patterns, and renaming the write_essay pattern to write_essay_pg while creating a new parameterized write_essay pattern.

Files Changed

Pattern_Descriptions/pattern_descriptions.json

  • Reformatted JSON: Changed multi-line array formatting to single-line for all tag arrays
  • Added 5 new patterns:
    • analyze_paper_simple: Analyze research papers for findings and scientific rigor
    • analyze_terraform_plan: Analyze Terraform plans for infrastructure changes and security
    • create_mnemonic_phrases: Create memorable mnemonic sentences from given words
    • summarize_board_meeting: Convert board meeting transcripts to formal notes
    • write_essay: New parameterized essay writer using {{author_name}} variable
  • Updated pattern description: Fixed description for create_coding_feature pattern
  • Renamed pattern: write_essaywrite_essay_pg (Paul Graham style)

Pattern_Descriptions/pattern_extracts.json

  • Added pattern extracts for the 5 new patterns with their system prompts
  • Updated extract for renamed write_essay_pg pattern

patterns/pattern_explanations.md

  • Added explanations for all 5 new patterns
  • Updated explanation for write_essay to reflect it now uses an author_name variable
  • Updated explanation for write_essay_pg to clarify it's specifically Paul Graham style

patterns/suggest_pattern/user.md

  • Added pattern descriptions for all 5 new patterns in the documentation
  • Updated descriptions to reflect the write_essaywrite_essay_pg rename

patterns/write_essay/system.md

  • Complete rewrite: Transformed from Paul Graham-specific to a parameterized pattern
  • Uses {{author_name}} variable: Allows writing in any author's style
  • Includes web search instruction: Can look up example essays if tool available
  • More flexible approach: Adapts vocabulary, style, and structure to match specified author

patterns/write_essay_pg/system.md

  • New file: Contains the original Paul Graham-specific essay writing pattern
  • Preserved original content: Maintains all Paul Graham examples and specific instructions

web/static/data/pattern_descriptions.json

  • Identical changes to Pattern_Descriptions/pattern_descriptions.json (duplicate file)

Code Changes

The most significant code change is the transformation of the write_essay pattern from a hardcoded Paul Graham style to a flexible, parameterized pattern:

# Old (now write_essay_pg)
- Write the essay in the style of Paul Graham, who is known for this concise, clear, and simple style of writing.

# New (write_essay)
- Write the essay in the style of {{author_name}}, embodying all the qualities that they are known for.
- Look up some example Essays by {{author_name}} (Use web search if the tool is available)

Reason for Changes

  1. Pattern flexibility: The new write_essay pattern allows users to write in any author's style, not just Paul Graham's
  2. Backward compatibility: The original functionality is preserved in write_essay_pg
  3. New capabilities: Added patterns for analyzing Terraform plans, creating mnemonics, and formal meeting documentation
  4. Improved organization: Consistent JSON formatting makes the files easier to read and maintain

Impact of Changes

  • Enhanced functionality: Users can now write essays in multiple styles using a single pattern
  • More analysis options: New patterns provide capabilities for infrastructure, research, and business documentation
  • Better user experience: The parameterized approach reduces the need for multiple similar patterns
  • Maintained compatibility: Existing users of the Paul Graham essay pattern can use write_essay_pg

Test Plan

  1. Test the new write_essay pattern with various author names
  2. Verify write_essay_pg still produces Paul Graham-style essays
  3. Test each new pattern with appropriate input
  4. Ensure pattern discovery/suggestion still works with updated descriptions
  5. Verify JSON files are valid and properly formatted

Additional Notes

  • The duplicate pattern_descriptions.json files (in Pattern_Descriptions/ and web/static/data/) should be kept in sync or consolidated
  • The new patterns expand Fabric's capabilities into DevOps (Terraform), memory techniques (mnemonics), and corporate documentation (board meetings)

ksylvan and others added 3 commits June 23, 2025 12:35
# CHANGES

- Add `os` and `strings` packages to imports
- Implement dynamic URL handling with environment variables
- Refactor provider configuration to support URL templates
- Reorder providers for consistent key order in ProviderMap
- Extract and parse template variables from BaseURL
- Use environment variables or default values for templates
- Replace template with actual values in BaseURL
### CHANGES

- Add tags and descriptions for five new creative and analytical patterns.
- Introduce `analyze_terraform_plan` for infrastructure review.
- Add `write_essay_by_author` for stylistic writing.
- Include `summarize_board_meeting` for corporate notes.
- Introduce `create_mnemonic_phrases` for memory aids.
- Update and clean pattern description data files.
- Sort the pattern explanations list alphabetically.
@ksylvan ksylvan changed the title 0624 write essay by author and updates Add write_essay_by_author and update Pattern metadata Jun 24, 2025
…variable usage

## CHANGES

- Rename `write_essay` to `write_essay_pg` for Paul Graham style
- Rename `write_essay_by_author` to `write_essay` with author variable
- Update pattern descriptions to reflect naming changes
- Fix duplicate `write_essay_pg` entry in pattern descriptions
Copilot

This comment was marked as resolved.

@ksylvan ksylvan requested a review from Copilot June 25, 2025 06:16
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR streamlines pattern metadata formatting while introducing five new patterns and refactoring the essay-writing patterns for improved flexibility and backward compatibility.

  • Consolidates JSON arrays to single-line formatting and renames the classic essay pattern from "write_essay" to "write_essay_pg".
  • Introduces a new parameterized "write_essay" pattern using the {{author_name}} variable and updates related system prompt documentation for both essay patterns.

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.

File Description
web/static/data/pattern_descriptions.json Reformats tag arrays, renames "write_essay" to "write_essay_pg", and adds new pattern entries.
patterns/write_essay_pg/system.md Adds a complete system prompt for the Paul Graham–style essay writing pattern.
patterns/write_essay/system.md Transforms the essay pattern to be parameterized via {{author_name}} and updates instructions.
patterns/suggest_pattern/user_updated.md Updates documentation for Fabric usage and details many pattern options, including the new ones.
Comments suppressed due to low confidence (2)

web/static/data/pattern_descriptions.json:989

  • The renaming of 'write_essay' to 'write_essay_pg' alongside the addition of a new 'write_essay' pattern could be confusing. Consider updating the documentation to clearly differentiate their intended use cases.
      "patternName": "write_essay_pg",

web/static/data/pattern_descriptions.json:3

  • Since identical changes are applied in both 'web/static/data/pattern_descriptions.json' and 'Pattern_Descriptions/pattern_descriptions.json', consider consolidating these duplicate files to ease maintenance.
    {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant