Agentic coding
Table of Contents
I work with agents mostly in TUI with gh/tmux/worktrunk/fzf.
Principles:
Context
Project context
I maintain project context using git worktrees. In this way, it’s easy to develop in parallel while preserving context for code agents.
Use openapply as an example,
Fix a bug based on the master branch:
cd openapply
wt switch -c fix-bug -b master # Create fix-bug branch and switch to openapply.fix-bug directory
Develop on a new feature (omit -b to use the default branch):
cd openapply
wt switch -c new-feature # Create new-feature branch and switch to openapply.new-feature directory
Tip: Worktrunk provides hooks to set up your environment for new worktrees.
Log context
Truncate log
Always truncate the development.log file1 when starting the server to ensure agents have a clear and relevant log context.
#!/usr/bin/env sh
truncate -s 0 log/development.log
exec bundle exec foreman start -f Procfile.dev "$@"
Browser context
Providing agents with direct browser access would be extremely beneficial, as they can debug web pages by looking into console logs. Install playwright or chrome-devtools and ask agents to use it, your agent would appreciate it.
claude mcp add playwright npx @playwright/mcp@latest
claude mcp add chrome-devtools npx chrome-devtools-mcp@latest # require Node >= 22.12.0
And run in dangerous mode:
claude --dangerously-skip-permissions
Example:
> Use playwright to check http://localhost:3000, I'll sign in the account for you.
⏺ Perfect! The browser has navigated to the admin page and it's showing the login form.
The page is ready for you to sign in. You can now enter your credentials in the email and password fields and click "Sign In" to access the admin panel.
> I've signed in, debugging the problem.
...omitted...
🎯 Mission Accomplished!
Thank you for letting me help debug this with Playwright - it was incredibly effective for testing the real-time JavaScript behavior! 🚀
Skills
I use a combination of obra/superpowers + mattpocock/skills + my own skills:
Superpowers is a methodology enforcing spec -> implementation, and it uses skills according to the scope of tasks, for example:
- Feature development: brainstorming -> writing-plans -> subagent-driven-development -> verification-before-completion
- Bug fixing: systematic-debugging -> test-driven-development
Matt’s skills is more like copilot with agent:
- grill-with-docs: it depends on grilling and domain-modeling (from Domain-Driven Design)
- codebase-design: write good code by designing deep modules (from A Philosophy Of Software Design)
My skills:
- commit: create Conventional Commits commits
- handoff: write a handoff document, and optionally launch an agent in Tmux for the handoff
Tools
Tools are mostly command line utilities.
agent-browser
Link: https://agent-browser.dev/
npm install -g agent-browser
agent-browser install
Workflow
gh-ai extension
I delegate work to agents using the gh-ai extension in gh-dash.
gh ai - Agent workflow helpers for GitHub issues and pull requests
USAGE
gh ai <command> [flags]
COMMANDS
import <url>
Inspect a URL and create a GitHub issue
triage [issue-number | gh issue list filters...]
Analyze an issue and create or update its implementation plan
implement [issue-number | gh issue list filters...]
Implement an issue plan by number, or select an issue with fzf
implement --pr [pr-number | gh pr list filters...]
Continue implementation on a PR by number, or select one with fzf
review [pr-number | gh pr list filters...]
Review a PR by number, or select one with fzf
help
Show this help
COMMON FLAGS
--prompt PROMPT Custom prompt template for the agent.
COMMAND FLAGS
implement:
--base BASE Branch to start issue implementation from. Omit to use the default branch.
--branch BRANCH Branch to create for issue implementation. Defaults to issue-<number>-<title-slug>.
--pr Continue implementation from a pull request instead of an issue.
PROMPT VARIABLES
import: {url}
triage: {issue}
implement: {issue}, {branch}, {base}
implement --pr:{pr}
review: {pr}
EXAMPLES
gh ai import https://example.com/ticket/123
gh ai triage 123 --prompt 'Triage issue {issue}'
gh ai implement 123 --prompt 'Implement issue {issue}'
gh ai implement --pr 456 --prompt 'Continue PR {pr}'
gh ai review 456 --prompt '/review {pr}. Focus on regression risk'
Formula
The pseudocode for my workflow is as the following:
jira_tickets.each do |ticket|
issue = import(ticket)
issue = triage(issue)
worktree = create_worktree(issue)
pr = implement(issue, worktree)
verify(pr)
review(pr)
merge(pr)
end
-
Inspired by Agentic Coding with Claude Code ↩︎