Анализ требований

Идея в анализе требований. Вы пишете Вашу смутную идею в файлик INITIAL.md:
I want to develop a nodejs-python RPC library. So that nodejs can start a child process with a python getEvent style loop, and nodejs can pass request JSON objects and retrieve response JSON objects from Python while keeping the Python process alive between the "calls".
И пускаете тулзу. Она лепит длинный промпт:
async function constructPrompt() { const initial = await readFile('INITIAL.md'); const vision = await readFile('VISION.md'); return ` You are an AI assistant helping to refine a project vision by generating relevant questions. Use the following information about the project to generate insightful questions: Initial Project Description: ${initial} Current Project Vision: ${vision} Based on this information, generate 3 questions that will help clarify and expand the project vision. Each question should have 3-4 specific multiple choice options. Do not include an "Other" option, as it will be added automatically later. Ensure the options are distinct and cover a range of potential answers relevant to the question. `; }
В ответ на промпт LLM вызывает функцию и передает ей список вопросов с вариантами ответов. Который мы кормим библиотеке inquirer.
{тут будет скрин}
Тут логично конечно что ни один из вариантов не подошел, так что выбираем other, и идем дальше.
{тут тоже скрин}
Уже что-то более-менее осмысленное. В-общем после опросника из 3-4 вопросов (подготовленного 1 раз моделью, то есть все 3 вопроса известны заранее) мы скармливаем JSON с ответами ответы модели, но в этот раз через aider, вызывая его как шелл-скрипт:
aider -m "Update VISON.md given the stakeholder answers in tmp-Answers.md" VISION.md tmp-ANSWERS.md
Ну и получаем на выходе какой-никакой документик. А потом снова запускаем и генерим вопросы на основе улучшенного Vision и итерируемся. Пока оно все ужасное - gpt-4o-mini по-кругу спрашивает банальщину, и документ очень быстро перестает реально улучшаться. Но ничего, будем пробовать с более умными моделями и промптами.
|
</> |