Skip to content

Commit ea6dbd6

Browse files
authored
Merge pull request #21 from plotday/change/generate-agent-guide
Generate agent guide
2 parents 178d32d + 8f50618 commit ea6dbd6

5 files changed

Lines changed: 32 additions & 438 deletions

File tree

.changeset/tall-rules-tap.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@plotday/sdk": patch
3+
---
4+
5+
Changed: Generate agent-guide.ts from AGENT.template.md

sdk/cli/templates/AGENTS.template.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,8 @@ try {
382382
6. **Clean up callbacks and stored state** - Delete callbacks and Store entries when no longer needed.
383383
7. **Handle missing auth gracefully** - Check for stored auth before operations.
384384
8. **Batch size matters** - Process enough items per batch to be efficient, but few enough to stay under time limits.
385+
9. **Processing self-created activities** - Other users may change an Activity created by the agent, resulting in an \`activity\` call. Be sure to check the \`changes === null\` and/or \`activity.author.id !== this.id\` to avoid re-processing.
386+
10. Activity with type ActivityType.Note typically do not have a start or end set, unless they're a note about a specific day or time that shouldn't be shown until then.
385387

386388
## Type Patterns
387389

sdk/prebuild.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,24 @@ export default llmDocs;
153153
const indexPath = join(llmDocsDir, "index.ts");
154154
writeFileSync(indexPath, indexContent, "utf-8");
155155

156+
// Generate agents-guide-template.ts from AGENTS.template.md
157+
const agentsTemplatePath = join(__dirname, "cli", "templates", "AGENTS.template.md");
158+
if (existsSync(agentsTemplatePath)) {
159+
const agentsTemplateContent = readFileSync(agentsTemplatePath, "utf-8");
160+
const agentsGuideContent = `/**
161+
* Generated agents guide template
162+
*
163+
* This file is auto-generated during build. Do not edit manually.
164+
* Generated from: cli/templates/AGENTS.template.md
165+
*/
166+
167+
export default ${JSON.stringify(agentsTemplateContent)};
168+
`;
169+
const agentsGuideOutputPath = join(llmDocsDir, "agents-guide-template.ts");
170+
writeFileSync(agentsGuideOutputPath, agentsGuideContent, "utf-8");
171+
console.log(`✓ Generated agents-guide-template.ts from AGENTS.template.md`);
172+
} else {
173+
console.warn(`Warning: AGENTS.template.md not found at ${agentsTemplatePath}`);
174+
}
175+
156176
console.log(`✓ Generated ${typeFiles.length} LLM documentation files in src/llm-docs/`);

0 commit comments

Comments
 (0)