Thanks for your interest in contributing! Here's how to get started.
git clone https://github.com/yashksaini-coder/DevNotion.git
cd DevNotion
pnpm install
cp .env.example .env.local # or create manually (see README)GITHUB_TOKEN=ghp_...
GITHUB_USERNAME=your_username
GOOGLE_GENERATIVE_AI_API_KEY=...
NOTION_TOKEN=ntn_...
NOTION_PARENT_PAGE_ID=...src/
agents/ # Mastra agent definitions (harvest, narrator, publisher)
tools/ # Mastra tools (GitHub GraphQL, Notion REST)
types/ # Zod schemas (github.types.ts, blog.types.ts)
workflows/ # Pipeline definition (weekly-dispatch.workflow.ts)
config/ # Environment validation (env.ts)
utils/ # Helpers (parse-llm-json.ts, dates.ts)
mastra/ # Mastra runtime entry (index.ts)
__tests__/ # Vitest test files
# Run the full pipeline once
pnpm dev
# Open the Mastra playground for testing agents individually
pnpm playground
# Run tests
pnpm test
# Type check
npx tsc --noEmit
# Lint and format
pnpm lint
pnpm format- Harvest and publish agents use direct function calls (no LLM needed for deterministic work)
- Narrator agent uses Gemini with structured output + text parsing + deterministic fallback
- Agent instructions are template literals that interpolate runtime config (e.g.,
BLOG_TONE)
- Mastra tools use
createToolwith Zod input/output schemas - Tool execute functions receive
inputDatadirectly (not{ context }) - Notion tools use rate limiting via
p-queue+ retry viap-retry
- Workflows use
createWorkflow→.then(step).commit()pattern - Each step has explicit
inputSchema/outputSchemafor type safety - Steps access agents via
mastra.getAgent('agent-id')
- All data flows through Zod schemas — no untyped data crossing step boundaries
- GitHub data:
WeeklyDataSchemainsrc/types/github.types.ts - Blog output:
NarratorOutputSchemainsrc/types/blog.types.ts
- Single provider: Gemini via
@ai-sdk/google - Model format:
google/model-id(Mastra'sparseModelStringsplits on first/) - Structured output:
agent.generate(prompt, { structuredOutput: { schema } })→result.object
- Create
src/agents/your-agent.tswithnew Agent({ id, name, model, instructions }) - Register in
src/mastra/index.tsagents map - Add a workflow step in
src/workflows/if needed - Add tests in
src/__tests__/
- Create
src/tools/your-tool.tswithcreateTool({ id, inputSchema, outputSchema, execute }) - Assign to an agent's
toolsmap or use directly in a workflow step - Add tests
Tests use Vitest. Mock external APIs with vi.fn() and vi.mock().
pnpm test # Run once
pnpm test:watch # Watch mode- Create a feature branch from
main - Make your changes with clear, focused commits
- Ensure
npx tsc --noEmitandpnpm testpass - Open a PR with a description of what changed and why
Open an issue on GitHub with:
- What you expected vs. what happened
- Steps to reproduce
- Relevant logs or error output