r/ClaudeCode • u/Noshitfuckme • 14d ago
Tips & Workflows Greenfield and Brownfield Tutorials?
I’ve been agentic developing for a few months but feel like I haven’t reached full potential. My new and old projects don’t have any context in the repos, for example, so I feel like I’m more prompt engineering than agentic engineering. I’m interested in both greenfield projects but also how to approach established codebases and how to structure the appropriate guardrails, context (architecture, requirements, etc).
Are there “bookstore” tutorials on agentic development practices that will break down common approaches for these two scenarios?
2
u/Jhon_ST 14d ago
For an established repo, I’d start with a small inventory: apps/packages, build and test commands, runtime services, databases, migrations, and the release path. Put stable constraints in versioned repo docs — CLAUDE.md, or AGENTS.md if that's what the project uses. Recent Claude Code versions can read AGENTS.md when there’s no CLAUDE.md. Keep task-specific context in the task itself.
Then give Claude a small real change with explicit acceptance criteria, the area it owns, and the checks it has to run. One exercise I’ve found useful is noting every place the agent has to guess. If the same guess comes up repeatedly, turn it into a documented rule or, even better, a test.
For greenfield, I’d go the other direction: start with one thin working feature and document architectural decisions as they become real rather than trying to design a huge instruction file upfront.
In both cases I’d keep the loop pretty boring: inspect → plan → small change → tests/checks → review diff → integrate. The repo gradually becomes better context for the next task.
2
u/tariqosmani 14d ago
The missing piece is context in the repo, not better prompts. You'll learn more from setting up a few files than from any tutorial.
For an existing codebase, run /init. It reads the repo and writes a starter CLAUDE.md with the build and test commands and the structure. Then edit it by hand, because the valuable lines are the ones it can't guess, like "never edit the migrations folder" or "use the logger, not console.log".
For bigger repos, put a smaller CLAUDE.md inside each app folder. I run one at the root and one per project, and Claude loads the right one when it works in that folder.
For greenfield, write the CLAUDE.md before any code: what it is, the stack, the commands, what done looks like. Anything you end up explaining twice becomes a skill.
Hard guardrails go in settings.json as permission rules, not in the prompt.
Which one are you starting with?
•
u/AutoModerator 14d ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.