$ recombobulate _
home / tips / assign-claude-a-role-for-better-specialised-output
0

Assign Claude a Role for Better Specialised Output

bagwaa @bagwaa · Mar 25, 2026 · Prompting
assign-claude-a-role-for-better-specialised-output

Framing your prompt with a specific role can significantly sharpen the quality of Claude's output. It's not magic — it tells Claude which angle to take and which expertise to emphasise.

You are a senior security engineer doing a code audit. Review 
`app/Http/Controllers/AuthController.php` for authentication 
vulnerabilities, focusing on token handling and session fixation.

Role prompts work especially well for reviews, rewrites, and design decisions where the perspective matters as much as the task. Be specific — "senior PHP developer who cares about readability" beats "expert developer" every time.

Some roles that work particularly well:

# For documentation
You are a technical writer. Rewrite this function's docblock so a 
junior developer can understand it without reading the implementation.
# For infrastructure
You are a DevOps engineer. Audit this Dockerfile for security issues 
and unnecessary build steps that slow down CI.
# For architecture
You are a staff engineer reviewing a pull request. Give direct, 
actionable feedback — don't soften it.

The role doesn't need to go at the very start of your prompt, but putting it first helps. Think of it as setting the lens before asking Claude to look through it.

The role you assign shapes the perspective Claude brings — choose it deliberately.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Ask Claude to Scaffold New Features Using Your Existing Code Conventions

Before asking Claude to scaffold a new feature, point it at your existing code first — it will match your naming, structure, error handling, and test patterns exactly rather than defaulting to framework boilerplate.

bagwaa @bagwaa · 2 hours ago
0
Describe the Entire Feature in Plain English Before Claude Starts Building

Give Claude the full picture upfront before it writes any code, so it builds the right thing the first time with fewer correction rounds.

bagwaa @bagwaa · 3 hours ago
0
Pass Multiline Prompts to Claude Code with Shell HEREDOCs

Complex prompts are unreadable as escaped single-liners. Use shell HEREDOCs to write clean, structured prompts directly in your scripts.

bagwaa @bagwaa · 6 hours ago