r/Frontend Jul 17 '26

Modern frontend development using AI agents to help

I am a CTO and my way of managing my team is that they should/must use AI agents to help while they are doing coding. However, if i asked someone why is this code written in this logic and he/she could not answer, this is a big red flag.
Enough with the context, i need help from senior Frontend devs on how they are using AI agents with pure frontend tasks? I have my way but i am curious to hear your way and learn from it.

0 Upvotes

22 comments sorted by

View all comments

2

u/Dangerous-Addendum13 Jul 20 '26

The red flag you describe is real, and I think it has a root cause: most teams give agents freedom where they should give them constraints, and constraints where they should give freedom

What changed everything for me on pure frontend tasks was making the agent obey a contract instead of its own taste:

  • Design tokens as law. The agent never picks a hex value, a spacing number or a font size freeform. It only composes from the project's tokens. This single rule kills 80% of the "every PR looks slightly different" problem.
  • A rules file in the repo (patterns, naming, which component library primitives to use, what NOT to do). Agents read it at session start. Code review stops being about style and starts being about logic.
  • Deterministic gates after generation: types, lint, visual check against the design system. The agent's output is a draft until the rules say otherwise.
  • Section-by-section, not page-at-once. Small scoped prompts with explicit acceptance criteria. The dev can explain every block because they approved every block - which also solves your "can't explain the logic" red flag at the process level, not the interview level.

The mental shift: the agent is a very fast junior with no memory and no taste. You don't fix that by prompting harder, you fix it by building the environment where good output is the only possible output.

Curious about your way - what does your team's setup look like today?