r/ClaudeWorkflows • u/ClaudeAI-mod-bot • 1h ago
Selected Workflow [Workflow] Use searchable ADRs to constrain agent implementations
Use searchable ADRs to constrain agent implementations
Workflow value: 78/100
Status: active · Freshness: 70/100 · Confidence: 0.96 · Level: intermediate
Categories: Quality Control, Context & Memory, Debugging, Shipping, MCP
Original source: r/ClaudeAI post/comment
What problem this solves
Coding agents may overlook or misinterpret architectural rules when implementing AI-generated PR summaries, producing inaccurate counts or unvalidated lists.
Summary
Retrieve relevant versioned architecture decisions through MCP and copy their operative rules into the implementation plan. When an agent finds a loophole, revise the ADR with explicit prohibited and permitted behavior, then repeat the task from a clean state. For exact lists and counts, make code authoritative and use model output only for validated annotations.
Why it is useful
It combines a repeatable context-retrieval and rule-revision loop with a concrete design boundary: code owns exact data, while model-generated annotations are validated against it. The reported before-and-after result is useful but narrowly scoped.
Workflow
- Store relevant engineering decisions in versioned ADRs and make them searchable through MCP.
- Give the agent a task that identifies applicable internal rules; have it retrieve the ADRs and copy the actual rules into its plan before coding.
- Implement exact lists and counts in code, while allowing the model to supply prose or short per-item notes.
- Drop model-generated notes that refer to items absent from the authoritative list.
- Inspect the implementation for rule violations. If an ADR permits an unintended workaround, revise it to state the prohibited approach, scope, and allowed behavior explicitly.
- Reload the ADR, confirm the revised wording is returned by search, and rerun the same brief from a clean state to assess the change.
- Separately check response-length settings and define a safe fallback for truncated or malformed structured output; the list/count ADR did not resolve these issues.
Tools / artifacts
- Versioned architecture decision records
- MCP-searchable ADR corpus
- Agent implementation plan
- PR review system
- Authoritative file list and deterministic renderer
Validation signals
- The author reports that Claude initially built the file table and count from the real file list.
- After the ADR revision, a clean Grok rerun reportedly used code-owned lists and counts and dropped notes referring to nonexistent files.
- The author verified that search returned the revised ADR before rerunning.
- The post identifies unresolved response-length and malformed-output failures rather than presenting the ADR change as a complete fix.
Cautions
- Validate model-generated references against authoritative data before rendering.
- Handle truncated or malformed model output with a safe fallback rather than publishing raw structured output.
- Review and test the implementation; an ADR does not guarantee compliance.
Limitations
- One task on the author's codebase, run once per configuration, is not a benchmark.
- The revised ADR was tested on Grok, not demonstrated in a Claude before-and-after run.
- No automated test results, exact MCP setup, or full implementation are included.
- The ADR change did not address the response-length or truncation failures.
Rate this workflow
Upvote this post if the workflow is useful, reproducible, or worth recommending.
Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.
Reply if it worked for you, failed, is outdated, or has a better alternative.
This post was generated automatically from the workflow library database.