Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .claude/skills/cleanup-branch/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Run the following commands in order:
BRANCH=$(git rev-parse --abbrev-ref HEAD)

# Switch to master and pull
git checkout master && git pull
git fetch --all --prune --jobs=10
git switch master && git pull

# Delete the feature branch (-D handles branches already merged via remote)
[ "$BRANCH" != "master" ] && git branch -D "$BRANCH" && echo "Deleted branch: $BRANCH"
Expand Down
26 changes: 13 additions & 13 deletions .claude/skills/implement-spec/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
name: implement-spec
description: Implements a spec end-to-end from a spec file. Creates a GitHub issue, a kebab-case feature branch, writes all required files, commits, and opens a PR via create-pr.sh. Works for new faker providers as well as general workflow or tooling specs. Invoke manually with the path to a spec file.
argument-hint: <path/to/SPEC.md>
description: Implements a spec end-to-end from a spec file. Creates a GitHub issue, a kebab-case feature branch, writes all required files, commits, and opens a PR via create-pr.sh. Works for new faker providers as well as general workflow or tooling specs. Invoke manually with the path to a spec file, or with no argument to implement from current git changes.
argument-hint: [path/to/SPEC.md]
disable-model-invocation: true
allowed-tools: Bash, Read, Write, Edit, Glob, Grep
---

Implement the feature described in the spec file below.
Implement the feature described below.

---

## Spec file: $ARGUMENTS
## Spec content

```
!`cat "$ARGUMENTS"`
!`if [ -n "$ARGUMENTS" ]; then cat "$ARGUMENTS"; else git diff HEAD; git status --short; fi`
```

---
Expand Down Expand Up @@ -48,20 +48,20 @@ Apply every relevant lesson during implementation in Step 4. These are hard-won

### Step 2 — Create a GitHub issue

Create an issue in the `TheJavaGuy/java-faker` repository. Derive the title from the spec's **Overview** section (one concise sentence). Use the full spec content as the body.
Create an issue in the `TheJavaGuy/java-faker` repository. Derive the title from the spec's **Overview** section (one concise sentence).

```bash
gh issue create \
--repo TheJavaGuy/java-faker \
--title "<feature title from spec Overview>" \
--body "$(cat '$ARGUMENTS')"
```
- If a spec file was provided (`$ARGUMENTS` is non-empty): write the body to a temp file and use `--body-file` (required to avoid backtick/shell parsing issues — see LEARNINGS.md #6):
```bash
cat '$ARGUMENTS' > /tmp/issue-body.md
gh issue create --repo TheJavaGuy/java-faker --title "<title>" --body-file /tmp/issue-body.md
```
- If no spec file was provided: derive the body from the git diff summary you read in Step 1, write it to `/tmp/issue-body.md`, then use `--body-file`.

Record the issue number printed (e.g., `#42`). You will reference it in the commit message.

### Step 3 — Create a feature branch

Derive a descriptive kebab-case branch name from the spec's content:
Derive a descriptive kebab-case branch name from the feature being implemented:

- **New faker spec**: `add-<feature-name>-faker` (e.g., `add-credit-card-faker`, `add-markdown-faker`)
- **General spec**: a name that reflects the nature of the change (e.g., `add-pre-commit-hooks`, `update-build-config`, `fix-yaml-quoting`)
Expand Down
8 changes: 7 additions & 1 deletion LEARNINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ return faker.bothify(pattern, true);

**Solution**: Follow the SKILL.md instructions manually, step by step. The `disable-model-invocation` flag means the skill is a pure prompt template — not a model-callable tool.

### 8. `git pull` fails when there are unstaged changes on master

**Problem**: When invoking `implement-spec` with no argument, the changes are already present as unstaged modifications. Running `git checkout master && git pull` fails with `error: cannot pull with rebase: You have unstaged changes`.

**Solution**: When already on `master` with the target changes present, skip `git pull` and just create the feature branch directly with `git checkout -b <branch>`. The unstaged changes carry over to the new branch automatically.

---

*Last updated: 2026-03-01*
*Last updated: 2026-03-02*