Skip to content
This repository was archived by the owner on Mar 28, 2025. It is now read-only.
This repository was archived by the owner on Mar 28, 2025. It is now read-only.

Implement files-to-prompt using org-mode and detangle #9

@jwalsh

Description

@jwalsh

Overview

We need a way to convert a set of files into an org-mode document that can be used for generating prompts with code context. This would enable:

  1. Converting existing code into org files for literate programming
  2. Creating prompts that include multiple files with proper formatting
  3. Using org-mode as an intermediate format for file-to-prompt workflows

Requirements

  • Create a tool that takes a list of files and generates an org-mode file
  • Each file should be in its own source block with proper language detection
  • Directory structure should be preserved with proper headers
  • Support for handling different file types (scripts, code, configs)
  • Implement bidirectional workflow (files → org → files)

Test Case

Create a test directory with:

  • A test Makefile for the workflow
  • Mock prompt system with markdown files
  • Mock message prompt indicating code review request
  • Three sample files (.py, .sh, .gitignore) in different directories

Implementation Approach

  1. Create a script that generates org-mode code blocks from files
  2. Use :tangle and :mkdirp yes to preserve directory structure
  3. Ensure :comments link is used for bidirectional editing
  4. Add headers to indicate file paths and types
  5. Demonstrate conversion from files to prompt and back

Success Criteria

  • Ability to generate an org file from a list of files
  • Proper language detection and syntax highlighting
  • Ability to tangle back to the original files
  • Support for various file types and structures
  • Working example in test directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions