<?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: Reymond</title>
    <description>The latest articles on DEV Community by Reymond (@reymondyncierto).</description>
    <link>https://dev.to/reymondyncierto</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%2F3914135%2F15612b2a-34a0-46eb-bc1f-02bc4b08e216.png</url>
      <title>DEV Community: Reymond</title>
      <link>https://dev.to/reymondyncierto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/reymondyncierto"/>
    <language>en</language>
    <item>
      <title>How I Set Up Codex for Spec-Driven Development</title>
      <dc:creator>Reymond</dc:creator>
      <pubDate>Wed, 06 May 2026 08:07:17 +0000</pubDate>
      <link>https://dev.to/reymondyncierto/how-i-set-up-codex-for-spec-driven-development-1nmh</link>
      <guid>https://dev.to/reymondyncierto/how-i-set-up-codex-for-spec-driven-development-1nmh</guid>
      <description>&lt;p&gt;I wanted Codex to feel like a reliable teammate, not a fast autocomplete that occasionally rewrites half my repo.&lt;/p&gt;

&lt;p&gt;The shift that worked for me was simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;No approved spec, no code changes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This post is my real setup flow based on my &lt;code&gt;init.md&lt;/code&gt; blueprint in &lt;code&gt;spec-driven-template-codex&lt;/code&gt;, plus how I actually use it day to day when building features.&lt;/p&gt;

&lt;h2&gt;
  
  
  The System in One Flow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User request
   |
   v
spec-architect drafts task spec
   |
   v
human approval gate
   |
   v
agent-router picks specialist
   |
   v
specialist implements inside scope_in only
   |
   v
validation (npm run verify)
   |
   v
commit with spec deletion + evidence
   |
   v
full-branch PR review
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ordering matters more than any individual prompt trick.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Build First in a New Repo
&lt;/h2&gt;

&lt;p&gt;My &lt;code&gt;init.md&lt;/code&gt; breaks setup into explicit tasks. In practice, I treat them as six foundation layers.&lt;/p&gt;

&lt;h3&gt;
  
  
  1) Project Standard Files (&lt;code&gt;CODEX.md&lt;/code&gt; + &lt;code&gt;AGENTS.md&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;I keep two top-level files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;CODEX.md&lt;/code&gt; is the canonical contract.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;AGENTS.md&lt;/code&gt; is the loader that tells Codex to follow that contract.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;CODEX.md&lt;/code&gt; carries the rules that I do not want to renegotiate per session:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;command list (&lt;code&gt;dev&lt;/code&gt;, &lt;code&gt;build&lt;/code&gt;, &lt;code&gt;lint&lt;/code&gt;, &lt;code&gt;verify&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;architecture boundaries&lt;/li&gt;
&lt;li&gt;domain routing table&lt;/li&gt;
&lt;li&gt;commit policy&lt;/li&gt;
&lt;li&gt;the hard workflow gates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I keep this file direct and non-negotiable. If a rule is optional, I remove it.&lt;/p&gt;

&lt;h3&gt;
  
  
  2) Behavioral Blueprint in &lt;code&gt;.codex/WORKFLOW.md&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This file is where behavior is encoded, not implied.&lt;/p&gt;

&lt;p&gt;My key block is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;first principle: never implement without an approved spec&lt;/li&gt;
&lt;li&gt;spec-first gate on every request&lt;/li&gt;
&lt;li&gt;architect mode when no spec exists&lt;/li&gt;
&lt;li&gt;mandatory subagent chain (&lt;code&gt;spec-architect -&amp;gt; agent-router -&amp;gt; specialist&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;model enforcement (&lt;code&gt;model&lt;/code&gt; + &lt;code&gt;model_reasoning_effort&lt;/code&gt; on every agent)&lt;/li&gt;
&lt;li&gt;evidence gate tied to deleted specs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I use &lt;code&gt;.codex/STRATEGY.md&lt;/code&gt; as the stable "why" and &lt;code&gt;.codex/WORKFLOW.md&lt;/code&gt; as the executable "how".&lt;/p&gt;

&lt;h3&gt;
  
  
  3) Agent Topology in &lt;code&gt;.codex/agents/*.toml&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;I split responsibilities so one agent is not making every decision end-to-end.&lt;/p&gt;

&lt;p&gt;Core agents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;spec-architect&lt;/code&gt;: plans and drafts specs only&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;agent-router&lt;/code&gt;: reads approved specs and dispatches&lt;/li&gt;
&lt;li&gt;domain specialists: implement only in &lt;code&gt;scope_in&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pr-reviewer&lt;/code&gt;: branch-level quality gate&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A detail that made my setup much more predictable: every agent file pins both &lt;code&gt;model&lt;/code&gt; and &lt;code&gt;model_reasoning_effort&lt;/code&gt;. I do not allow inheritance.&lt;/p&gt;

&lt;p&gt;My usual pattern:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;strongest reasoning for architecture and review&lt;/li&gt;
&lt;li&gt;medium reasoning for implementation specialists&lt;/li&gt;
&lt;li&gt;lower-cost, fast routing for dispatch-only work&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4) Spec Template as the Unit of Work
&lt;/h3&gt;

&lt;p&gt;Each task is a &lt;code&gt;TASK-YYYY-MM-DD-###.spec.md&lt;/code&gt; with strict front matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;goal&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;scope_in&lt;/code&gt; and &lt;code&gt;scope_out&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;constraints&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;validation&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;status&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;collaborators and design flags when needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The point is not bureaucracy. The point is forcing clarity before edits begin.&lt;/p&gt;

&lt;p&gt;I keep tasks small enough to finish in around 30 minutes. If I cannot describe it that tightly, it usually means I am hiding complexity.&lt;/p&gt;

&lt;h3&gt;
  
  
  5) Hard Guardrails with Hooks
&lt;/h3&gt;

&lt;p&gt;This is where workflow stops being "best effort."&lt;/p&gt;

&lt;p&gt;I add &lt;code&gt;.codex/hooks/workflow-guard.sh&lt;/code&gt; and wire it through &lt;code&gt;.codex/hooks.json&lt;/code&gt; (or inline in &lt;code&gt;.codex/config.toml&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;The guard blocks patterns that silently damage quality:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;git commit --no-verify&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;broad staging like &lt;code&gt;git add .&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;commit attempts without staged spec deletion&lt;/li&gt;
&lt;li&gt;missing required agent files&lt;/li&gt;
&lt;li&gt;missing &lt;code&gt;model&lt;/code&gt; or &lt;code&gt;model_reasoning_effort&lt;/code&gt; fields&lt;/li&gt;
&lt;li&gt;missing or invalid evidence JSON for deleted specs&lt;/li&gt;
&lt;li&gt;mismatch between evidence model values and pinned agent models&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The important behavior is that policy is enforced at command time, not remembered manually.&lt;/p&gt;

&lt;h3&gt;
  
  
  6) Evidence + Memory
&lt;/h3&gt;

&lt;p&gt;For every completed spec, I track chain evidence in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.codex/evidence/agent-chain/&amp;lt;spec-id&amp;gt;.json&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I record:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;agent name&lt;/li&gt;
&lt;li&gt;model used&lt;/li&gt;
&lt;li&gt;chain step (&lt;code&gt;architect&lt;/code&gt;, &lt;code&gt;router&lt;/code&gt;, &lt;code&gt;specialist&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;timestamp&lt;/li&gt;
&lt;li&gt;success status&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I also initialize &lt;code&gt;.codex/memory/&lt;/code&gt; for persistent preferences and constraints so sessions start with context instead of re-discovery.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Day-to-Day Execution Pattern
&lt;/h2&gt;

&lt;p&gt;Once the repo is bootstrapped, feature work becomes very repeatable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Request -&amp;gt; Draft Spec
&lt;/h3&gt;

&lt;p&gt;I start by spawning &lt;code&gt;spec-architect&lt;/code&gt; and asking it to create or update a spec.&lt;/p&gt;

&lt;p&gt;If there is no approved spec, no implementation is allowed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Approve Before Code
&lt;/h3&gt;

&lt;p&gt;I keep status flow explicit:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;draft -&amp;gt; approved -&amp;gt; in_progress -&amp;gt; done|blocked&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Approval is where I catch wrong assumptions early, before diff churn begins.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Route by Domain
&lt;/h3&gt;

&lt;p&gt;I spawn &lt;code&gt;agent-router&lt;/code&gt; on the approved spec.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If domain is clear, route to one specialist.&lt;/li&gt;
&lt;li&gt;If domain is mixed, split specs first.&lt;/li&gt;
&lt;li&gt;Parallel only for truly non-overlapping owned paths.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 4: Implement Only Inside Scope
&lt;/h3&gt;

&lt;p&gt;Specialists are constrained by spec boundaries.&lt;/p&gt;

&lt;p&gt;No "while I'm here" changes.&lt;br&gt;
No opportunistic refactors outside scope.&lt;/p&gt;

&lt;p&gt;This keeps diffs reviewable and rollback-friendly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Validate and Commit Under Policy
&lt;/h3&gt;

&lt;p&gt;I run &lt;code&gt;npm run verify&lt;/code&gt;, then commit with strict formatting.&lt;/p&gt;

&lt;p&gt;My commit gate expects spec lifecycle completion behavior, including spec deletion and matching evidence when required by workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6: Run PR-Level Review
&lt;/h3&gt;

&lt;p&gt;After feature specs are done, I run a full-branch review.&lt;/p&gt;

&lt;p&gt;That catches regressions that are invisible when you only inspect one task at a time.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Changed After I Adopted This
&lt;/h2&gt;

&lt;p&gt;Three practical improvements stood out.&lt;/p&gt;

&lt;h3&gt;
  
  
  1) Fewer accidental repo-wide edits
&lt;/h3&gt;

&lt;p&gt;Explicit &lt;code&gt;scope_in&lt;/code&gt; stopped many "small change" cascades.&lt;/p&gt;

&lt;h3&gt;
  
  
  2) Faster reviews
&lt;/h3&gt;

&lt;p&gt;Review conversation shifted from "what happened?" to "is this the right behavior?" because intent was already encoded in specs.&lt;/p&gt;

&lt;h3&gt;
  
  
  3) Better handoffs across days
&lt;/h3&gt;

&lt;p&gt;When I pause and resume later, I continue from spec status and evidence instead of reconstructing context from raw diffs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Failure Modes I Guard Against
&lt;/h2&gt;

&lt;h3&gt;
  
  
  "This is too small for a spec"
&lt;/h3&gt;

&lt;p&gt;Small tasks are where process drift starts. I still create a tiny spec.&lt;/p&gt;

&lt;h3&gt;
  
  
  "Let's skip verify once"
&lt;/h3&gt;

&lt;p&gt;If verify is painful, optimize verify. Skipping it just moves failure later.&lt;/p&gt;

&lt;h3&gt;
  
  
  "Agent touched unrelated files"
&lt;/h3&gt;

&lt;p&gt;I treat that as workflow failure, not a harmless side effect. I re-scope and rerun.&lt;/p&gt;

&lt;h3&gt;
  
  
  "We can commit now and clean evidence later"
&lt;/h3&gt;

&lt;p&gt;I avoid deferred compliance. Evidence exists to prove the actual chain that happened.&lt;/p&gt;

&lt;h2&gt;
  
  
  Minimal Setup Order If You Want to Copy This
&lt;/h2&gt;

&lt;p&gt;If you are starting fresh, this is the shortest safe sequence:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;CODEX.md&lt;/code&gt; and &lt;code&gt;AGENTS.md&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add &lt;code&gt;specs/templates/TASK.spec.template.md&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add &lt;code&gt;.codex/WORKFLOW.md&lt;/code&gt; and &lt;code&gt;.codex/STRATEGY.md&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create core agents in &lt;code&gt;.codex/agents/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Enable hooks in &lt;code&gt;.codex/config.toml&lt;/code&gt; and wire &lt;code&gt;workflow-guard.sh&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add evidence schema path under &lt;code&gt;.codex/evidence/agent-chain/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Test blocked and allowed commit scenarios&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If step 7 is skipped, your rules are probably not real yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Takeaway
&lt;/h2&gt;

&lt;p&gt;My Codex setup works because it converts process from documentation into enforcement:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;specs define intent&lt;/li&gt;
&lt;li&gt;agents separate responsibilities&lt;/li&gt;
&lt;li&gt;hooks enforce non-negotiable policies&lt;/li&gt;
&lt;li&gt;evidence proves what actually ran&lt;/li&gt;
&lt;li&gt;PR review validates system-level safety&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I still iterate prompts, but prompts are now the smallest part of the system.&lt;/p&gt;

&lt;p&gt;The bigger win is having a workflow that stays stable even when tasks, tools, or models change.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>automation</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>How I Set Up My Claude Workflow (Spec-Driven and Easy to Follow)</title>
      <dc:creator>Reymond</dc:creator>
      <pubDate>Tue, 05 May 2026 14:31:38 +0000</pubDate>
      <link>https://dev.to/reymondyncierto/how-i-set-up-my-claude-workflow-spec-driven-and-easy-to-follow-58d7</link>
      <guid>https://dev.to/reymondyncierto/how-i-set-up-my-claude-workflow-spec-driven-and-easy-to-follow-58d7</guid>
      <description>&lt;p&gt;I used to jump straight into code with Claude. It felt fast, but I kept paying for it later: missed edge cases, messy commits, and "what changed?" moments during review.&lt;/p&gt;

&lt;p&gt;So I rebuilt my setup around one idea:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Slow down before coding, so coding goes faster.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This post explains exactly how I set up my workflow from my &lt;code&gt;init.md&lt;/code&gt; template, why each part exists, and what alternatives I might try later.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Workflow in One Picture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User request
   |
   v
spec-architect (creates task spec)
   |
   v
Human approval (required)
   |
   v
agent-router (chooses the right specialist)
   |
   v
specialist agent(s) implement only inside scope
   |
   v
validation (npm run verify)
   |
   v
single-line commit + delete finished spec
   |
   v
PR reviewer checks full branch diff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you only remember one thing, remember this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No spec, no code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why I Changed My Old Approach
&lt;/h2&gt;

&lt;p&gt;My old approach was "ask Claude, get code, patch later." It works for small one-offs, but on real projects it breaks down:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Context drift: the assistant forgets intent across long sessions.&lt;/li&gt;
&lt;li&gt;Scope creep: "small fix" turns into touching five unrelated files.&lt;/li&gt;
&lt;li&gt;Weak handoffs: if I return the next day, I lose the reasoning trail.&lt;/li&gt;
&lt;li&gt;Review pain: reviewers see diffs, but not the decision process.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The new setup solves that by forcing an explicit path from request to commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Core Pieces I Set Up
&lt;/h2&gt;

&lt;p&gt;My template has 11 setup tasks. In plain language, they boil down to six pillars:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A project contract (&lt;code&gt;CLAUDE.md&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Agent roles (architect, router, specialists, reviewer)&lt;/li&gt;
&lt;li&gt;A strict spec template&lt;/li&gt;
&lt;li&gt;Behavioral playbook (&lt;code&gt;.claude/CLAUDE.md&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Hard enforcement (permissions + hooks)&lt;/li&gt;
&lt;li&gt;Memory that persists across sessions&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  1) Project Contract (&lt;code&gt;CLAUDE.md&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;This file tells Claude:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which commands exist (&lt;code&gt;dev&lt;/code&gt;, &lt;code&gt;test&lt;/code&gt;, &lt;code&gt;verify&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;architecture boundaries&lt;/li&gt;
&lt;li&gt;routing table for domains&lt;/li&gt;
&lt;li&gt;commit policy and safety rules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I treat this like an engineering contract, not notes.&lt;/p&gt;

&lt;h3&gt;
  
  
  2) Agent Roles Instead of One "Do Everything" Assistant
&lt;/h3&gt;

&lt;p&gt;I split responsibilities into clear workers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;spec-architect&lt;/code&gt;: turns request into atomic tasks (&lt;code&gt;&amp;lt;= 30 min&lt;/code&gt; each)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;agent-router&lt;/code&gt;: dispatches to the right domain specialist&lt;/li&gt;
&lt;li&gt;specialists: implement only inside owned paths&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pr-reviewer&lt;/code&gt;: reviews full branch diff at the end&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This prevents one agent from improvising across the whole repo.&lt;/p&gt;

&lt;h3&gt;
  
  
  3) Spec Template (the Unit of Work)
&lt;/h3&gt;

&lt;p&gt;Each change gets a &lt;code&gt;TASK-YYYY-MM-DD-###.spec.md&lt;/code&gt; file with fields like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;goal&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;scope_in&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;scope_out&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;constraints&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;validation&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;status&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A spec is tiny, explicit, and reviewable.&lt;/p&gt;

&lt;h3&gt;
  
  
  4) Behavioral Playbook
&lt;/h3&gt;

&lt;p&gt;I keep a second file (&lt;code&gt;.claude/CLAUDE.md&lt;/code&gt;) that says what to do in real time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;start protocol&lt;/li&gt;
&lt;li&gt;pre-action gate&lt;/li&gt;
&lt;li&gt;exact sequence for code-change requests&lt;/li&gt;
&lt;li&gt;what counts as a workflow violation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of root &lt;code&gt;CLAUDE.md&lt;/code&gt; as policy and &lt;code&gt;.claude/CLAUDE.md&lt;/code&gt; as execution checklist.&lt;/p&gt;

&lt;h3&gt;
  
  
  5) Two-Layer Guardrails
&lt;/h3&gt;

&lt;p&gt;This is the part that made the biggest difference.&lt;/p&gt;

&lt;p&gt;Layer 1 blocks risky patterns before execution (deny list).&lt;br&gt;
Layer 2 inspects runtime command context with a hook script.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Attempted command
   |
   +--&amp;gt; Layer 1: permissions deny list
   |      - blocks: --no-verify, --force push, git add .
   |
   +--&amp;gt; Layer 2: workflow-guard.sh
          - blocks: commit without spec
          - blocks: artifact staging
          - blocks: multiline or co-authored-by commit formats
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means I don't rely on memory or discipline alone. The system enforces the behavior.&lt;/p&gt;

&lt;h3&gt;
  
  
  6) Memory System
&lt;/h3&gt;

&lt;p&gt;I keep persistent memory files for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;user preferences&lt;/li&gt;
&lt;li&gt;team conventions&lt;/li&gt;
&lt;li&gt;project constraints&lt;/li&gt;
&lt;li&gt;repeated corrections&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So each session starts with context, not from zero.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Exact Request-to-Commit Flow
&lt;/h2&gt;

&lt;p&gt;Here is my real flow for every code change.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Spec First
&lt;/h3&gt;

&lt;p&gt;I ask Claude to create spec(s) from the request.&lt;/p&gt;

&lt;p&gt;Example request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Add retry logic to scraper API and surface retry count in admin UI."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Typical output from &lt;code&gt;spec-architect&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Spec A (&lt;code&gt;tools-domain&lt;/code&gt;): API retry behavior&lt;/li&gt;
&lt;li&gt;Spec B (&lt;code&gt;admin-domain&lt;/code&gt; + design collaborator): retry count UI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a task can't fit in about 30 minutes, it gets split.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Human Approval Gate
&lt;/h3&gt;

&lt;p&gt;Specs stay &lt;code&gt;draft&lt;/code&gt; until I approve.&lt;/p&gt;

&lt;p&gt;This is where I fix assumptions before code exists, which is much cheaper than fixing code later.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Route to the Right Specialist
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;agent-router&lt;/code&gt; reads the approved spec and dispatches.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sequential by default&lt;/li&gt;
&lt;li&gt;Parallel only if truly independent and non-overlapping paths&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 4: Implement Inside Scope
&lt;/h3&gt;

&lt;p&gt;Specialist agent implements only inside &lt;code&gt;scope_in&lt;/code&gt;, respects &lt;code&gt;scope_out&lt;/code&gt;, then runs validation.&lt;/p&gt;

&lt;p&gt;No "while I'm here" edits.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Commit Discipline
&lt;/h3&gt;

&lt;p&gt;One spec equals one commit.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;run validation&lt;/li&gt;
&lt;li&gt;explicit &lt;code&gt;git add &amp;lt;file1&amp;gt; &amp;lt;file2&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;single-line commit format: &lt;code&gt;type(scope): description&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;delete completed spec file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then move to the next spec.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6: PR-Level Review
&lt;/h3&gt;

&lt;p&gt;After all specs are done, &lt;code&gt;pr-reviewer&lt;/code&gt; checks full branch diff against base branch.&lt;/p&gt;

&lt;p&gt;This catches cross-spec regressions that per-task review can miss.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Simple End-to-End Example
&lt;/h2&gt;

&lt;p&gt;Let me show one tiny scenario:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Request: "Add CSV import button in catalog page"

Spec 1 (catalog-domain)
- goal: add button + file input + happy-path upload
- scope_in: catalog page + upload component
- scope_out: auth module, billing module
- validation: npm run verify

Spec 2 (backend)
- goal: accept CSV endpoint + validation errors
- scope_in: api route + service
- scope_out: db schema

Flow:
spec-architect -&amp;gt; approval -&amp;gt; router -&amp;gt; catalog specialist + backend specialist -&amp;gt; verify -&amp;gt; commits -&amp;gt; PR review
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because scope is explicit, I avoid accidental touching of unrelated modules.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Workflow Works (for Me)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  It separates thinking from typing
&lt;/h3&gt;

&lt;p&gt;Specs force me to design first, code second.&lt;/p&gt;

&lt;h3&gt;
  
  
  It makes context explicit
&lt;/h3&gt;

&lt;p&gt;I don't depend on "assistant memory vibes." Scope and constraints are written down.&lt;/p&gt;

&lt;h3&gt;
  
  
  It improves recoverability
&lt;/h3&gt;

&lt;p&gt;If I stop mid-work, I can resume from specs and status instantly.&lt;/p&gt;

&lt;h3&gt;
  
  
  It reduces blast radius
&lt;/h3&gt;

&lt;p&gt;Owned paths and scope boundaries prevent silent repo-wide changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  It makes reviews faster
&lt;/h3&gt;

&lt;p&gt;Reviewers can trace: request -&amp;gt; spec -&amp;gt; diff -&amp;gt; validation.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Usually Breaks and How I Handle It
&lt;/h2&gt;

&lt;h3&gt;
  
  
  "This is just a one-liner"
&lt;/h3&gt;

&lt;p&gt;One-liners are where policy violations start. I still create a small spec.&lt;/p&gt;

&lt;h3&gt;
  
  
  "Can we skip validation this time?"
&lt;/h3&gt;

&lt;p&gt;No. If validation is too slow, optimize validation. Don't skip it.&lt;/p&gt;

&lt;h3&gt;
  
  
  "The agent touched out-of-scope files"
&lt;/h3&gt;

&lt;p&gt;I stop and correct via new scoped spec. I don't merge "almost correct" behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Current Folder Layout
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;project/
├── CLAUDE.md
├── specs/
│   ├── TASK-2026-05-04-001.spec.md
│   └── templates/task.spec.template.md
└── .claude/
    ├── CLAUDE.md
    ├── settings.local.json
    ├── hooks/workflow-guard.sh
    └── agents/
        ├── spec-architect.md
        ├── agent-router.md
        ├── pr-reviewer.md
        ├── backend-specialist.md
        ├── database-specialist.md
        ├── ui-ux-frontend-design-specialist.md
        └── *-domain-specialist.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Alternatives I Want to Explore Next
&lt;/h2&gt;

&lt;p&gt;This setup works well, but I still want to experiment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Alternative 1: Lightweight Mode for Tiny Repos
&lt;/h3&gt;

&lt;p&gt;For personal throwaway projects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;keep spec + approval&lt;/li&gt;
&lt;li&gt;collapse router + specialist into one constrained specialist&lt;/li&gt;
&lt;li&gt;keep hooks mandatory&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This may cut overhead while preserving safety.&lt;/p&gt;

&lt;h3&gt;
  
  
  Alternative 2: Stronger CI-Based Enforcement
&lt;/h3&gt;

&lt;p&gt;Right now guardrails run locally in Claude Code. Next step is mirroring the same checks in CI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;reject non-conforming commit messages&lt;/li&gt;
&lt;li&gt;reject artifact staging patterns&lt;/li&gt;
&lt;li&gt;reject PRs without validation status&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That makes enforcement team-wide, not machine-local.&lt;/p&gt;

&lt;h3&gt;
  
  
  Alternative 3: Test-First Specs
&lt;/h3&gt;

&lt;p&gt;I currently define validation commands in specs. I want to push this further:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;require failing test case in spec for bug fixes&lt;/li&gt;
&lt;li&gt;require new test case mapping for new behavior&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes completion criteria even more objective.&lt;/p&gt;

&lt;h3&gt;
  
  
  Alternative 4: Domain Risk Scoring
&lt;/h3&gt;

&lt;p&gt;Not all tasks need the same process depth. I want an auto score in &lt;code&gt;spec-architect&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;low risk: single-spec path&lt;/li&gt;
&lt;li&gt;high risk: mandatory collaborator + expanded review checklist&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Alternative 5: Multi-Tool Strategy
&lt;/h3&gt;

&lt;p&gt;I use Claude as primary orchestrator. I may test a hybrid path where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude handles decomposition + routing&lt;/li&gt;
&lt;li&gt;another tool handles narrow code transforms&lt;/li&gt;
&lt;li&gt;same spec/hook rules apply&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key is keeping the workflow stable even if tools change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical Advice if You Want to Copy This
&lt;/h2&gt;

&lt;p&gt;Start small. Do this in order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add the spec template&lt;/li&gt;
&lt;li&gt;Add pre-action gate rules in &lt;code&gt;CLAUDE.md&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add hook + deny list&lt;/li&gt;
&lt;li&gt;Add router and one domain specialist&lt;/li&gt;
&lt;li&gt;Expand domain specialists only when needed&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you skip hard enforcement, the workflow eventually degrades.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Takeaway
&lt;/h2&gt;

&lt;p&gt;My Claude workflow is not "just prompting better." It is a small operating system for code changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;specs define intent&lt;/li&gt;
&lt;li&gt;agents separate responsibilities&lt;/li&gt;
&lt;li&gt;hooks enforce rules&lt;/li&gt;
&lt;li&gt;review closes the loop&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It works because it is explicit, constrained, and difficult to bypass.&lt;/p&gt;

&lt;p&gt;If you are already shipping production code with AI assistants, this is the shift I recommend first: make the process executable, not just documented.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>claude</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
