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
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ jobs:
--merge \
--repo ${{ github.repository }}

- name: Delete release branch
run: |
git push origin --delete "${{ env.PR_BRANCH }}"

- name: Post success comment
if: success()
run: |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@salve-software/ai-workers",
"version": "0.1.1",
"version": "0.1.2",
"description": "Central package for AI configurations and Claude Code rules.",
"scripts": {
"postinstall": "bash scripts/setup.sh"
Expand Down
7 changes: 0 additions & 7 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,5 @@ for file in "$AIWORKERS_DIR/src/rules"/*.md; do
fi
done

echo ""

# Link settings.json
echo "Settings:"
ln -sfn "$AIWORKERS_DIR/settings.json" "$CLAUDE_DIR/settings.json"
echo " βœ“ settings.json"

echo ""
echo "Done. AIWorkers is fully linked to $CLAUDE_DIR"
12 changes: 10 additions & 2 deletions src/commands/land/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,23 @@ Read and follow `.claude/skills/aiworkers/commit/SKILL.md`.

Instruct the commit agent to:
- Check if `.claude/.aiworkers-context.tmp` exists
- If yes: read its contents as the diff, then delete it with `rm .claude/.aiworkers-context.tmp`
- If yes: read its contents as the diff instead of running `git diff HEAD`
- If no: run `git diff HEAD` normally

### 4. Run /pr (if requested)
### 4. Delete temp file

After /commit completes (success or failure), the orchestrator deletes the temp file:
```bash
rm .claude/.aiworkers-context.tmp
```

### 5. Run /pr (if requested)

If the user's original request included creating a PR, read and follow `.claude/skills/aiworkers/pr/SKILL.md`.

## Rules

- The orchestrator is solely responsible for saving and deleting `.claude/.aiworkers-context.tmp` β€” skills only read it, never delete it
- Always delete `.claude/.aiworkers-context.tmp` after /commit, even if commit fails
- If /branch fails, delete the tmp file before stopping
- Never push the branch unless /pr is being run (which handles pushing itself)
15 changes: 14 additions & 1 deletion src/rules/skills-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## User-invokable commands (`/name`)

Commands are invoked directly by the user with `/name`. Use `commands/<name>/SKILL.md`:
Commands are invoked **only** when the user explicitly types `/name`. Claude must never auto-trigger a command based on context β€” that is exclusively for skills. Use `commands/<name>/SKILL.md`:

```
commands/
Expand All @@ -15,6 +15,19 @@ commands/

Examples: `/feature`, `/ship`

## Routing rule

**Before invoking any skill or command, apply this decision tree β€” no exceptions:**

1. Did the user's message contain the exact slash command text (e.g. `/aiworkers:land`, `/feature`)?
- **YES** β†’ use the matching `commands/<name>/SKILL.md`
- **NO** β†’ go to step 2

2. Find the relevant context-triggered skill in `skills/` and read its `SKILL.md` directly.

**Never use `commands/` when the user did not type the slash command.** Pattern-matching intent (e.g. "commit my changes" β†’ `/aiworkers:land`) is forbidden. Always route through `skills/` for natural language requests.


## Context-triggered skills

Skills are invoked automatically by Claude when relevant β€” never by the user. Always include `user-invocable: false` in frontmatter. Use `skills/<name>/SKILL.md`:
Expand Down
2 changes: 1 addition & 1 deletion src/skills/commit/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Your job is to analyze the git changes and create conventional commits.

## Process

1. Run `git status` and `git diff HEAD` to understand what changed
1. If `.claude/.aiworkers-context.tmp` exists: read its contents as the diff. Otherwise run `git status` and `git diff HEAD` to understand what changed
2. Inspect specific files with `git diff HEAD -- <file>` as needed
3. Group related files by semantic context
4. For each group, determine the commit type and create the commit
Expand Down
26 changes: 22 additions & 4 deletions src/skills/pr/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,36 @@ If `$ARGUMENTS` is provided, use it as the title instead.

Use the gathered context (commits, feature.md content, branch name) to fill every section of the PR template. Do not leave placeholder comments unfilled.

### 6. Create the PR
### 6. Ensure base branch exists on remote

Before creating the PR, verify the base branch exists on the remote:

```bash
git ls-remote --exit-code origin <base-branch> 2>/dev/null
```

- If it exists: proceed normally.
- If it does **not** exist: create and push it from `main` as a fallback:

```bash
gh pr create --title "<title>" --body "$(cat <<'EOF'
git checkout main
git checkout -b <base-branch>
git push -u origin <base-branch>
git checkout <current-branch>
```

Then continue with PR creation.

### 7. Create the PR

```bash
gh pr create --title "<title>" --base <base-branch> --body "$(cat <<'EOF'
<filled template body>
EOF
)"
```

### 7. Output the PR URL

### 8. Output the PR URL

Display: `βœ“ PR created: <URL>`

Expand All @@ -72,6 +89,7 @@ Display: `βœ“ PR created: <URL>`
## Rules

- If the branch has no upstream, push it automatically with `git push -u origin <branch>` before creating the PR
- If the base branch does not exist on the remote, create it from `main` and push it β€” then return to the current branch before creating the PR
- Do not set reviewers, labels, or assignees β€” leave that to the user
- If the branch has no commits ahead of base, stop and warn the user
- **Never invent a PR body.** Always read the template file and use it as the body structure β€” including all emojis, sections, and checkboxes exactly as they appear