Skip to content

feat(init): generate AGENTS.md with plugin development conventions#109

Merged
mackenziemcclaskey merged 2 commits into
mainfrom
feat/18035-init-agents-md
May 28, 2026
Merged

feat(init): generate AGENTS.md with plugin development conventions#109
mackenziemcclaskey merged 2 commits into
mainfrom
feat/18035-init-agents-md

Conversation

@mackenziemcclaskey
Copy link
Copy Markdown
Collaborator

Summary

  • Adds renderAgentsMd() to init-template.ts — produces an AGENTS.md guide for agentic coding assistants (Cursor, Claude Code, etc.) working in a WE plugin project
  • Adds writeAgentsMdIfAbsent(pluginDir) to init.ts — writes AGENTS.md during init, skips gracefully if one already exists
  • Wires writeAgentsMdIfAbsent into InitCommand.run() after plugin.tsx is written

AGENTS.md covers:

  • What the project is and where the entry point lives (plugin.tsx)
  • Routes and type-safe navigation (route(), useNavigate(), useParams())
  • Data provider context — DataResolver, DataProvider, GraphQLResolver, generated hooks from everywhere bind
  • Peer dependency constraints (react, react-dom ≥18 must not be bundled)
  • Import conventions (.js extensions required on all local imports)
  • CLI reference (everywhere dev, everywhere build, everywhere bind)

Test plan

  • just test passes (373 tests, all green)
  • just check passes (typecheck + lint + prettier)
  • 14 new tests added: 8 for renderAgentsMd() in init-template.test.ts, 5 for writeAgentsMdIfAbsent in init.test.ts
  • Manually run we init in a fresh directory and confirm AGENTS.md is generated with correct content
  • Re-run we init in a directory that already has AGENTS.md and confirm it is not overwritten

🤖 Generated with Claude Code

@mackenziemcclaskey mackenziemcclaskey changed the title NW-18035 feat(init): generate AGENTS.md with plugin development conventions feat(init): generate AGENTS.md with plugin development conventions May 27, 2026
Copy link
Copy Markdown
Collaborator

@mpfilbin mpfilbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good as is. I made a couple of suggestions that might be worth considering.

Comment thread cli/src/init-template.ts Outdated
- \`npx everywhere dev\` — start the dev server with hot reload
- \`npx everywhere build\` — build the plugin bundle
- \`npx everywhere bind <bundle>\` — generate typed data hooks from a business object bundle
`;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might consider adding references (URLs) to our example applications to this file so the agent can go an reference implementations to help improve the changes of producing a viable plugin with zero-shot prompting.

Comment thread cli/src/init-template.ts Outdated
@@ -1,3 +1,83 @@
export function renderAgentsMd(): string {
return `# Workday Everywhere Plugin — Agent Guide
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might also consider having this be a standalone .md file in the repository calling it something like agents.template.md. It might be easier to work with it as a markdown document rather than a large string value in a TypeScript file. The init command can just copy the file over to the target location in the file system.

Comment thread cli/src/commands/everywhere/init.ts Outdated
if (fs.existsSync(agentsPath)) {
return false;
}
fs.writeFileSync(agentsPath, renderAgentsMd());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we opt to extract the markdown content as a standalone file, we could use Node streams to efficiently copy the file contents doing something like:

import { createReadStream, createWriteStream } from 'fs'

const templateFile = createReadStream('agents.template.md');
const agentsFile = createWriteStream('path/to/plugin/Agents.md');

templateFile.pipe(agentsFile);

templateFile.on('error', (err) => {
    this.log(chalk.red(`Unable to copy Agents.md file, ${String(err)}`));
});

Mackenzie Fernandez and others added 2 commits May 28, 2026 11:56
Adds renderAgentsMd() to produce an AGENTS.md guide for agentic coding
assistants working in a WE plugin project. The file covers the plugin
entry point, routes, data provider setup, peer dependency constraints,
and import conventions. writeAgentsMdIfAbsent() writes the file during
init, skipping gracefully if one already exists.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the inline renderAgentsMd() string with agents.template.md, a
standalone markdown file that is copied into the plugin directory at
init time. Adds reference links to the hello and directory example apps.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mackenziemcclaskey mackenziemcclaskey force-pushed the feat/18035-init-agents-md branch from 00750a5 to d5cc84e Compare May 28, 2026 18:04
@mackenziemcclaskey mackenziemcclaskey merged commit 6d968ea into main May 28, 2026
2 checks passed
@mackenziemcclaskey mackenziemcclaskey deleted the feat/18035-init-agents-md branch May 28, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants