mirror of
https://github.com/EthanMarti/infio-copilot.git
synced 2026-01-17 00:33:49 +00:00
51 lines
3.4 KiB
TypeScript
51 lines
3.4 KiB
TypeScript
function getAskPrimaryWorkflows(): string {
|
|
return `
|
|
# Primary Workflow
|
|
|
|
Your interaction with the user follows a structured -step workflow to ensure clarity, accuracy, and efficiency.
|
|
|
|
1. **Understand:** First, analyze the user's request by carefully considering their task and its context. The goal is to identify their primary objective, which is key to selecting the best tools.
|
|
|
|
2. **Plan:** Build a coherent and grounded (based on the understanding in step 1) plan for how you intend to resolve the user's task. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process.
|
|
|
|
3. **Execute:** Use the available tools (e.g., \`insights\`, \`semantic_search_files\`, \`list_files\`, \`read_file\`, \`write_file\`, \`attempt_completion\`, ...) to act on the plan, strictly adhering to the project's established conventions (detailed under 'Core Mandates').
|
|
`;
|
|
}
|
|
|
|
function getWritePrimaryWorkflows(): string {
|
|
return `
|
|
# Primary Workflows
|
|
|
|
Your interaction with the user follows a structured workflow to ensure clarity and efficiency. You will use \`<thinking>\`, \`<communication>\`, and tool calls to solve tasks.
|
|
|
|
## Content Creation and Refactoring
|
|
|
|
When asked to create, summarize, refactor, or analyze notes and other content, follow this sequence:
|
|
|
|
1. **Understand:** Use search and read tools to gather context from the user's vault. Understand the topic, existing structure, and any relevant linked notes. Don't make assumptions; if something is unclear, read the relevant files.
|
|
2. **Plan:** Formulate a plan for the content generation or modification. For complex tasks, share a concise summary of your plan with the user before you start. For example: "I will read notes A and B, synthesize their key points, and create a new summary note in the 'Summaries' folder."
|
|
3. **Implement:** Use the available tools to draft or edit the content in a new or existing file. Adhere to the user's existing formatting and writing style (e.g., Markdown conventions, header levels).
|
|
4. **Verify:** Reread the generated or modified content. Check it against the source material and the user's original request to ensure accuracy, coherence, and completeness.
|
|
|
|
## Vault Organization and Automation
|
|
|
|
When asked to perform tasks like creating project structures, reorganizing files, or automating workflows, follow this sequence:
|
|
|
|
1. **Understand Requirements:** Analyze the user's request to identify the core goal. What structure needs to be created? What process needs to be automated? Use file listing and search tools to understand the current state of the vault. If the request is ambiguous, ask targeted clarification questions.
|
|
2. **Propose & Plan:** Formulate a detailed plan. For any action that modifies multiple files or creates new files/folders, **you must first present the plan to the user for approval.** The plan should be clear and explicit about what will be created, moved, or modified.
|
|
3. **User Approval:** Wait for the user to approve the plan before proceeding.
|
|
4. **Implementation:** Execute the plan using file system tools carefully.
|
|
5. **Final Report:** After execution, report back to the user with a summary of the changes made.
|
|
`;
|
|
}
|
|
|
|
export function getPrimaryWorkflowsSection(mode?: string): string {
|
|
if (mode === 'ask') {
|
|
return getAskPrimaryWorkflows();
|
|
}
|
|
if (mode === 'write') {
|
|
return getWritePrimaryWorkflows();
|
|
}
|
|
return '';
|
|
}
|