/john-skills:ec2-claude-codefrom john-skills
Creates an Ubuntu 24.04 EC2 instance on AWS with Claude Code, Playwright, tmux, git, beads task tracking, and agent-deck pre-installed. Use to spin up a cloud dev environment or remote Claude Code instance.
Ships in john-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Provision a ready-to-use AWS EC2 instance with Claude Code, Playwright (headless Chromium), tmux, git, beads (bd) task tracking, and agent-deck session manager.
gh) authenticated with repo accessAsk user for:
Generate unique names using profile and timestamp to allow multiple instances per account:
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
STACK_NAME="claude-code-${AWS_PROFILE}-${TIMESTAMP}"
KEY_NAME="claude-code-key-${AWS_PROFILE}-${TIMESTAMP}"
DEPLOY_KEY_NAME="deploy-key-${STACK_NAME}"
DEPLOY_KEY_TITLE="EC2-${STACK_NAME}"
Parse the GitHub repo URL to extract owner and repo name:
# Extract owner/repo from URL (handles both https://github.com/owner/repo and [email protected]:owner/repo.git)
REPO_FULL=$(echo "$GITHUB_REPO" | sed -E 's|https://github.com/||; s|[email protected]:||; s|\.git$||')
REPO_OWNER=$(echo "$REPO_FULL" | cut -d'/' -f1)
REPO_NAME=$(echo "$REPO_FULL" | cut -d'/' -f2)
aws ec2 create-key-pair \
--profile $AWS_PROFILE \
--key-name $KEY_NAME \
--query 'KeyMaterial' \
--output text > ${KEY_NAME}.pem
chmod 400 ${KEY_NAME}.pem
Generate a new SSH key pair specifically for this EC2/repo combination:
ssh-keygen -t ed25519 -f ${DEPLOY_KEY_NAME} -N "" -C "${DEPLOY_KEY_TITLE}"
chmod 400 ${DEPLOY_KEY_NAME}
Add the public key as a deploy key to the GitHub repo with write access:
gh repo deploy-key add ${DEPLOY_KEY_NAME}.pub \
--repo ${REPO_OWNER}/${REPO_NAME} \
--title "${DEPLOY_KEY_TITLE}" \
--allow-write
Copy template from skill assets to working directory, then deploy:
cp <skill-assets>/cloudformation-ec2-claude-code.yaml .
aws cloudformation create-stack \
--profile $AWS_PROFILE \
--stack-name $STACK_NAME \
--template-body file://cloudformation-ec2-claude-code.yaml \
--parameters \
ParameterKey=KeyPairName,ParameterValue=$KEY_NAME \
ParameterKey=InstanceType,ParameterValue=t3.medium \
ParameterKey=SSHLocation,ParameterValue=0.0.0.0/0 \
ParameterKey=GitHubRepo,ParameterValue=$GITHUB_REPO
aws cloudformation wait stack-create-complete \
--profile $AWS_PROFILE \
--stack-name $STACK_NAME
aws cloudformation describe-stacks \
--profile $AWS_PROFILE \
--stack-name $STACK_NAME \
--query 'Stacks[0].Outputs' \
--output table
Wait ~90 seconds for user data to complete (Playwright installation takes longer), then verify:
ssh -o StrictHostKeyChecking=no -i ${KEY_NAME}.pem ubuntu@<PUBLIC_IP> \
"cat ~/setup-complete.txt && git --version && tmux -V && ~/.local/bin/claude --version && bd --version && npx playwright --version"
Give user the SSH command and note that:
claude is available at ~/.local/bin/claudebd (beads) is available for task trackingagent-deck is available for managing Claude Code sessions/home/ubuntu/.claudeCopy the deploy key to the EC2 and configure SSH for GitHub access:
Copy the deploy key to the EC2:
scp -i ${KEY_NAME}.pem ${DEPLOY_KEY_NAME} ubuntu@<PUBLIC_IP>:~/.ssh/
Configure SSH to use the deploy key for GitHub:
ssh -i ${KEY_NAME}.pem ubuntu@<PUBLIC_IP> "
chmod 600 ~/.ssh/${DEPLOY_KEY_NAME}
cat >> ~/.ssh/config << EOF
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/${DEPLOY_KEY_NAME}
IdentitiesOnly yes
EOF
chmod 600 ~/.ssh/config
"
Update the cloned repo's remote URL to use SSH:
ssh -i ${KEY_NAME}.pem ubuntu@<PUBLIC_IP> "
cd ~/${REPO_NAME}
git remote set-url origin [email protected]:${REPO_OWNER}/${REPO_NAME}.git
"
Verify GitHub authentication:
ssh -i ${KEY_NAME}.pem ubuntu@<PUBLIC_IP> "ssh -o StrictHostKeyChecking=no -T [email protected]"
Important: The cleanup removes the deploy key from GitHub by looking up its ID using the unique title. This ensures only the specific key for this EC2 instance is removed.
# Remove the deploy key from GitHub (lookup by title to get the key ID)
DEPLOY_KEY_ID=$(gh repo deploy-key list --repo ${REPO_OWNER}/${REPO_NAME} --json id,title \
-q ".[] | select(.title == \"${DEPLOY_KEY_TITLE}\") | .id")
if [ -n "$DEPLOY_KEY_ID" ]; then
gh repo deploy-key delete --repo ${REPO_OWNER}/${REPO_NAME} $DEPLOY_KEY_ID
echo "Removed deploy key '${DEPLOY_KEY_TITLE}' from ${REPO_OWNER}/${REPO_NAME}"
else
echo "Warning: Deploy key '${DEPLOY_KEY_TITLE}' not found in ${REPO_OWNER}/${REPO_NAME}"
fi
# Delete AWS resources
aws cloudformation delete-stack --profile $AWS_PROFILE --stack-name $STACK_NAME
aws ec2 delete-key-pair --profile $AWS_PROFILE --key-name $KEY_NAME
# Remove local key files
rm -f ${KEY_NAME}.pem ${DEPLOY_KEY_NAME} ${DEPLOY_KEY_NAME}.pub
Located at: assets/cloudformation-ec2-claude-code.yaml
Creates:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
AWS, Playwright, Git
ec2, cloud-development, claude-code, aws-infrastructure, dev-environment
32 skills in this plugin
/architecture-decision-recordsWrite and maintain Architecture Decision Records (ADRs) that capture the context and rationale behind significant technical decisions. Use when documenting an architectural or technology choice, recording a design trade-off, superseding a past decision, or setting up an ADR process. Also use proactively to offer an ADR when a significant decision is made during a coding session (database, framework, auth scheme, API style, integration pattern). Triggers on "write an ADR", "document this decision", "record this architecture choice", "add a decision record", "supersede ADR"./aws-learningsProactively catch common AWS infrastructure mistakes before they happen. Use when creating or modifying AWS components — CloudFormation, CDK, Lambda, API Gateway, IAM, S3, CloudFront, EC2, EventBridge, SQS, Secrets Manager, or SSM — to find and apply hard-won deployment lessons and avoid known pitfalls. Read-only: fetches lessons, does not add them./aws-learnings-addContribute a new lesson to the AWS Learnings library (the llms.txt-format library at github.com/jbdamask/aws-learnings-library). Use this whenever you've just debugged, fixed, or discovered a non-obvious AWS gotcha — CloudFormation, CDK, Lambda, API Gateway, IAM, S3, CloudFront, EC2, EventBridge, SQS, Secrets Manager, SSM — and want to capture it for next time. Triggers on phrases like 'add an AWS learning', 'save this AWS lesson', 'capture this gotcha', 'add this to the learnings library', or after solving a tricky AWS deployment problem worth remembering. This skill WRITES files (a new lesson file + an updated index) and prepares a pull request; it is the write companion to the read-only 'aws-learnings' skill./aws-quick-endpointCreate a token-secured REST API endpoint backed by AWS Lambda and DynamoDB with full CRUD and paginated list support. Deploys via CloudFormation. Use when user wants to quickly spin up an API endpoint, create a simple REST API on AWS, build a quick data store with an API, set up a Lambda+DynamoDB endpoint, or needs a fast way to log and retrieve structured data. Triggers on "create an endpoint", "quick API", "Lambda endpoint", "DynamoDB API", "CRUD endpoint", "log data to AWS"./build-my-voiceAnalyzes samples of the user's writing and creates or updates a structured `voice-profile.yaml` describing their writing voice as weighted, evidence-backed features, then asks the author a short round of questions to confirm the inferences the samples cannot settle on their own. Use when the user wants to capture, build, learn, profile, or update their writing voice or style from writing samples — "build my voice profile", "analyze my writing style", "learn how I write", "create a voice profile from these posts", "update my voice profile with this new sample". This skill only ANALYZES writing and produces the profile; it never drafts new content in the user's voice — use the my-voice skill for that./bullshit-testsAudit a codebase's test suite for tests that pass for no good reason — no assertions, tautologies, assertions on mocks only, swallowed exceptions, unawaited async assertions, permanently skipped tests, and other patterns that stay green no matter how broken the code is. Produces a red/yellow/green report. Use when the user says "bullshit tests", "find fake tests", "audit my test suite", "which tests are useless", "are these tests actually testing anything", "check test quality", "find tests that always pass", or asks whether green CI means anything.npx claudepluginhub jbdamask/john-claude-skills --plugin john-skillsOther plugins' skills for the same job