Yejun Su
🌱 SEEDLING

Agentic coding

Table of Contents

I work with agents mostly in TUI with gh/tmux/worktrunk/fzf.

Principles:

  1. Use one worktree per branch with Worktrunk
  2. Dispatch tasks to agents in a new Tmux window

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 superpowers + 5 skills from mattpocock/skills + my own skills:

Superpowers is a methodology enforcing spec -> implementation, and it uses skills according to the scope of tasks, for example:

Matt’s skills is more like copilot with agent, I chose four skills for supplement:

My skills:

Tools 

Tools are mostly command line utilities.

agent-browser 

Link: https://agent-browser.dev/

npm install -g agent-browser
agent-browser install

Workflow 

Delegate work to agents 

I delegate work to agents using a gh-ai extension.

gh ai - Agent helpers for GitHub issues and pull requests

USAGE
  gh ai <command> [flags]

COMMANDS
  import <url>
      Inspect a URL and create a GitHub issue
  review [pr-number | gh-pr-list filters...]
      Review a PR by number, or select one with fzf
  resume [pr-number | gh-pr-list filters...]
      Continue work on a PR by number, or select one with fzf
  work [issue-number]
      Work on an issue by number, or select one with fzf
  help
      Show this help

GLOBAL FLAGS
  --agent COMMAND  Agent executable to run. Defaults to cx.
  --prompt PROMPT  Custom prompt template for the agent.

COMMAND FLAGS
  work:
    --base BASE      Branch to start the work from. Omit to use the default branch.
    --branch BRANCH  Branch to create for the work. Defaults to issue-<number>.

PROMPT VARIABLES
  import: {url}
  review: {pr}
  resume: {pr}
  work:   {issue}

EXAMPLES
  gh ai work 123 --prompt 'Work issue {issue}'
  gh ai import https://example.com/ticket/123
  gh ai review 456 --prompt '/review {pr}. Focus on regression risk'
  gh ai resume --author octocat --prompt 'Continue PR {pr}'

Written on and updated on