<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shadab Khan</title>
    <description>The latest articles on DEV Community by Shadab Khan (@shad_tech).</description>
    <link>https://dev.to/shad_tech</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F9291%2F0WLvbAhG.jpeg</url>
      <title>DEV Community: Shadab Khan</title>
      <link>https://dev.to/shad_tech</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shad_tech"/>
    <language>en</language>
    <item>
      <title>I built a shell script that sets up your entire AI coding agent workspace in 2 minutes</title>
      <dc:creator>Shadab Khan</dc:creator>
      <pubDate>Sat, 25 Apr 2026 02:52:00 +0000</pubDate>
      <link>https://dev.to/shad_tech/i-built-a-shell-script-that-sets-up-your-entire-ai-coding-agent-workspace-in-2-minutes-13ep</link>
      <guid>https://dev.to/shad_tech/i-built-a-shell-script-that-sets-up-your-entire-ai-coding-agent-workspace-in-2-minutes-13ep</guid>
      <description>&lt;p&gt;Every time I started a new project with an AI coding agent, I was doing the same thing.&lt;/p&gt;

&lt;p&gt;Opening a blank repo. Writing &lt;code&gt;CLAUDE.md&lt;/code&gt; from scratch. Explaining my stack again. Explaining my conventions again. Explaining what NOT to do — again. By the time I had the agent actually doing useful work, I'd already spent two hours just setting up context.&lt;/p&gt;

&lt;p&gt;Then I'd switch projects, and repeat everything from scratch.&lt;/p&gt;

&lt;p&gt;There had to be a better way.&lt;/p&gt;




&lt;h2&gt;
  
  
  The problem with AI coding agents and new projects
&lt;/h2&gt;

&lt;p&gt;If you've used Claude Code or Codex CLI, you already know how much these tools depend on good project context. The agent doesn't know your stack. It doesn't know you prefer &lt;code&gt;pnpm&lt;/code&gt; over &lt;code&gt;npm&lt;/code&gt;. It doesn't know that you never want raw SQL, or that every Prisma query needs a &lt;code&gt;userId&lt;/code&gt; filter to prevent IDOR vulnerabilities, or that your commit messages follow Conventional Commits.&lt;/p&gt;

&lt;p&gt;Without that context, you spend the first hour of every session correcting the agent instead of building.&lt;/p&gt;

&lt;p&gt;The solution everyone discovers eventually is &lt;code&gt;CLAUDE.md&lt;/code&gt; for Claude Code and &lt;code&gt;AGENTS.md&lt;/code&gt; for Codex — instruction files the agent reads at the start of every session. But writing these well takes time, and the best ones include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your exact tech stack with version numbers&lt;/li&gt;
&lt;li&gt;What NOT to do (as important as what to do)&lt;/li&gt;
&lt;li&gt;Security rules baked in from day one&lt;/li&gt;
&lt;li&gt;A testing strategy covering unit, integration, security, adversarial, and performance tests&lt;/li&gt;
&lt;li&gt;Module specs the agent reads before implementing anything&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Writing all of that properly for every new project is genuinely tedious. So I automated it.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I built: AI Agents Template Builder
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/shadkhan/AI-agents-template-builder" rel="noopener noreferrer"&gt;github.com/shadkhan/AI-agents-template-builder&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's a GitHub Template Repository with a shell script that turns the template into a fully configured agent workspace for your specific project in about 2 minutes.&lt;/p&gt;

&lt;p&gt;Here's what you do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Use the template on GitHub, then clone your new repo&lt;/span&gt;
git clone https://github.com/shadkhan/AI-agents-template-builder
&lt;span class="nb"&gt;cd &lt;/span&gt;AI-agents-template-builder

&lt;span class="nb"&gt;chmod&lt;/span&gt; +x scripts/init-project.sh
./scripts/init-project.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script asks you six questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Project name and description&lt;/li&gt;
&lt;li&gt;Language (TypeScript, Python, Go, JavaScript, or custom)&lt;/li&gt;
&lt;li&gt;Framework and database&lt;/li&gt;
&lt;li&gt;Package manager&lt;/li&gt;
&lt;li&gt;Your modules (Notes, Tasks, Auth — whatever your app has)&lt;/li&gt;
&lt;li&gt;Security profile (user-facing web app, API, static site, CLI tool)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Then it generates everything.&lt;/p&gt;




&lt;h2&gt;
  
  
  What gets generated
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;CLAUDE.md&lt;/code&gt; and &lt;code&gt;AGENTS.md&lt;/code&gt; — filled in for your stack
&lt;/h3&gt;

&lt;p&gt;Both files get your actual project name, tech stack, repo structure, and commands injected. No more &lt;code&gt;{{placeholders}}&lt;/code&gt; — just ready-to-use instructions.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CLAUDE.md&lt;/code&gt; is read by Claude Code automatically. &lt;code&gt;AGENTS.md&lt;/code&gt; is read by Codex CLI, Cursor, Aider, and Amp — it's now an open standard stewarded by the Linux Foundation with 60,000+ open-source projects using it.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;SECURITY.md&lt;/code&gt; — security rules the agent enforces
&lt;/h3&gt;

&lt;p&gt;This is the file I'm most proud of. It covers eight layers of security baked into every project from day one:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Input validation with Zod on every route — patterns and examples included&lt;/li&gt;
&lt;li&gt;IDOR prevention — every Prisma query must include &lt;code&gt;userId&lt;/code&gt; from the JWT, not from the request body&lt;/li&gt;
&lt;li&gt;JWT verification patterns and refresh token rotation&lt;/li&gt;
&lt;li&gt;HTTP security headers via &lt;code&gt;@fastify/helmet&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Rate limiting rules per endpoint type&lt;/li&gt;
&lt;li&gt;File upload security — MIME type allowlists, path traversal prevention, UUID-based storage&lt;/li&gt;
&lt;li&gt;Database security — parameterized queries, field exclusion patterns&lt;/li&gt;
&lt;li&gt;Logging rules — what to log, what never to log&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The agent reads this alongside &lt;code&gt;CLAUDE.md&lt;/code&gt; and applies these rules on every route it writes. I stopped getting auth-less routes and missing &lt;code&gt;userId&lt;/code&gt; filters in PR reviews.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;docs/testing/&lt;/code&gt; — five-layer testing strategy
&lt;/h3&gt;

&lt;p&gt;Four files covering every testing layer the agent needs to know about:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TESTING.md&lt;/strong&gt; — the master strategy. Unit tests, integration tests, security tests, adversarial tests, and performance evaluation tests. Includes the complete CI/CD pipeline config for GitHub Actions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;VALIDATION.md&lt;/strong&gt; — "validation loops." Every Zod schema gets tested for both valid and invalid inputs, for every field, for every constraint. The pattern that ensures schema drift never silently lets bad data through.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ADVERSARIAL.md&lt;/strong&gt; — deliberately acting like a malicious user. IDOR attacks, mass assignment, SQL injection payloads, file upload attacks, JWT forgery, property-based fuzzing with &lt;code&gt;fast-check&lt;/code&gt;. The agent writes these tests for every new module.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PERFORMANCE.md&lt;/strong&gt; — k6 baseline tests that run before every release. Catches N+1 Prisma queries and missing PostgreSQL indexes before they hit production.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;docs/specs/&lt;/code&gt; — one spec stub per module
&lt;/h3&gt;

&lt;p&gt;For every module you listed during setup, you get a spec file with the structure already in place: data model, API endpoints, request/response schemas, business rules, and acceptance criteria. Fill in the content, hand it to the agent, and it implements the whole module end-to-end without asking clarifying questions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Everything else
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;docs/PRD.md&lt;/code&gt; — product requirements doc with your modules listed&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docs/ARCHITECTURE.md&lt;/code&gt; — architecture stub&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docs/adr/ADR-001.md&lt;/code&gt; — first architecture decision record&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;CONTRIBUTING.md&lt;/code&gt; — with your actual commands&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.env.example&lt;/code&gt; — skeleton based on your stack (Postgres URL, JWT secrets, Redis, etc.)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.gitignore&lt;/code&gt; — standard, generated if not present&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.github/workflows/validate-agent-files.yml&lt;/code&gt; — CI that fails if you commit &lt;code&gt;.env&lt;/code&gt;, leave unfilled placeholders, or reference a spec that doesn't exist&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Two more scripts for ongoing use
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;new-module.sh&lt;/code&gt;&lt;/strong&gt; — add a new module to an existing project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./scripts/new-module.sh &lt;span class="s2"&gt;"Notes"&lt;/span&gt;
&lt;span class="c"&gt;# → generates docs/specs/notes.spec.md with full template&lt;/span&gt;
&lt;span class="c"&gt;# → adds Notes to CLAUDE.md module table automatically&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fill in the spec, then tell the agent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;"Read docs/specs/notes.spec.md and implement the Notes module end-to-end"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;update-module-status.sh&lt;/code&gt;&lt;/strong&gt; — keep CLAUDE.md current as you ship:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./scripts/update-module-status.sh &lt;span class="s2"&gt;"Notes"&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt;
./scripts/update-module-status.sh &lt;span class="s2"&gt;"Tasks"&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="nt"&gt;-progress&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent reads the module status table at the start of every session. Keeping it accurate prevents it from re-implementing something that already exists.&lt;/p&gt;




&lt;h2&gt;
  
  
  The global file — the part most people miss
&lt;/h2&gt;

&lt;p&gt;Both Claude Code and Codex support a global instruction file that applies to every project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# For Codex — applies to every repo you work in&lt;/span&gt;
~/.codex/AGENTS.md

&lt;span class="c"&gt;# For Claude Code&lt;/span&gt;
~/.claude/CLAUDE.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Put your universal personal preferences there once — &lt;code&gt;pnpm&lt;/code&gt; over &lt;code&gt;npm&lt;/code&gt;, no &lt;code&gt;any&lt;/code&gt; in TypeScript, Conventional Commits — and never repeat them in any project file again. Project-level files inherit and can override.&lt;/p&gt;

&lt;p&gt;This is the layer that truly makes the workflow feel automatic. New project, run the script, and the agent already knows your personal defaults before it even reads the project files.&lt;/p&gt;




&lt;h2&gt;
  
  
  Works with every major coding agent
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Agent&lt;/th&gt;
&lt;th&gt;File it reads&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Claude Code&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;CLAUDE.md&lt;/code&gt; (falls back to &lt;code&gt;AGENTS.md&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Codex CLI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;AGENTS.md&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cursor&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;AGENTS.md&lt;/code&gt; + &lt;code&gt;.cursor/rules&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Aider&lt;/td&gt;
&lt;td&gt;&lt;code&gt;AGENTS.md&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Amp&lt;/td&gt;
&lt;td&gt;&lt;code&gt;AGENTS.md&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GitHub Copilot&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.github/copilot-instructions.md&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The template generates &lt;code&gt;CLAUDE.md&lt;/code&gt; and &lt;code&gt;AGENTS.md&lt;/code&gt;. For Copilot, symlink or copy &lt;code&gt;AGENTS.md&lt;/code&gt; content into &lt;code&gt;.github/copilot-instructions.md&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  The workflow in practice
&lt;/h2&gt;

&lt;p&gt;Once this is set up, my per-project flow looks like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Day 1:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;clone template → run init-project.sh → fill TODO sections → commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;About 20 minutes total.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Per module:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./scripts/new-module.sh &lt;span class="s2"&gt;"ModuleName"&lt;/span&gt;
Fill docs/specs/modulename.spec.md &lt;span class="o"&gt;(&lt;/span&gt;15 min&lt;span class="o"&gt;)&lt;/span&gt;
Tell agent: &lt;span class="s2"&gt;"Read docs/specs/modulename.spec.md and implement end-to-end"&lt;/span&gt;
Review diffs → merge
./scripts/update-module-status.sh &lt;span class="s2"&gt;"ModuleName"&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Before release:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;pnpm test:security
pnpm test:adversarial  
pnpm test:perf
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent handles implementation. I handle architecture decisions and code review. The instruction files make sure we're always speaking the same language.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The repo is at &lt;strong&gt;&lt;a href="https://github.com/shadkhan/AI-agents-template-builder" rel="noopener noreferrer"&gt;github.com/shadkhan/AI-agents-template-builder&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Click "Use this template" to create your own copy, run the init script, and you're set up in under two minutes.&lt;/p&gt;

&lt;p&gt;If you find it useful, a GitHub star helps other developers find it. And if you add support for new stacks or languages in the init script, PRs are very welcome — the more stacks covered, the more useful it gets for everyone.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built this while setting up LifeOps, my personal organization platform that I'm also open-sourcing. More on that soon.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>devtools</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
