devchat-ai / devchat

Automate your dev tasks with AI-powered scripts, from your IDE's chat panel.
https://www.devchat.ai
Apache License 2.0
342 stars 39 forks source link

Enhancements to workflow prompt.txt parsing: Path resolution and @file@ syntax support #276

Closed yangbobo2021 closed 6 months ago

yangbobo2021 commented 6 months ago

Issue Overview

We are encountering two primary issues with the current implementation of parsing the prompt.txt for our workflow processes. This issue aims to address these concerns by proposing enhancements that will improve the functionality and flexibility of handling prompt.txt files.

1. Path Resolution Issue

The current parser is unable to correctly locate the prompt.txt file. This seems to be a problem with how paths are being resolved within our system. An amendment to this path resolution logic is necessary to ensure that prompt.txt can be consistently and accurately found regardless of the environment it is run in.

2. Support for @file@ Syntax

We're looking to introduce new syntax support within the content of prompt.txt, specifically the incorporation of @file@ tags. This syntax will allow the direct referencing of files via relative paths to be included as part of the context within prompt.txt. If the file referenced by @file@ does not exist, the parser should leave the @file@ tag unchanged, maintaining the original text without alteration.

Proposed Solution

For Path Resolution:

For @file@ Syntax Support:

Desired Outcome

Additional Notes

Looking forward to the team's feedback and suggestions on how best to implement these improvements.