From e89ce6d6b47f48043f727446325cf838624cb8b5 Mon Sep 17 00:00:00 2001 From: eumaninho54 Date: Fri, 24 Apr 2026 04:05:36 -0300 Subject: [PATCH 1/7] docs(rules): clarify command invocation rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commands should never be auto-triggered — only when explicitly invoked by the user. Skills are for context-triggered behavior. Co-Authored-By: Claude Haiku 4.5 --- src/rules/skills-format.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rules/skills-format.md b/src/rules/skills-format.md index 01d24d7..ad0357b 100644 --- a/src/rules/skills-format.md +++ b/src/rules/skills-format.md @@ -2,7 +2,7 @@ ## User-invokable commands (`/name`) -Commands are invoked directly by the user with `/name`. Use `commands//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//SKILL.md`: ``` commands/ From adba32b8b1f0a53d5c7ccaf05dc42f88e675f107 Mon Sep 17 00:00:00 2001 From: eumaninho54 Date: Fri, 24 Apr 2026 04:08:00 -0300 Subject: [PATCH 2/7] feat(pr): add fallback for missing base branch Creates and pushes base branch from main when it does not exist on the remote before opening the PR. Co-Authored-By: Claude Haiku 4.5 --- src/skills/pr/SKILL.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/skills/pr/SKILL.md b/src/skills/pr/SKILL.md index b4a5365..9c64357 100644 --- a/src/skills/pr/SKILL.md +++ b/src/skills/pr/SKILL.md @@ -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 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 "" --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>` @@ -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 From 902d35b2a1f958f48b7742584539ad3188b081b0 Mon Sep 17 00:00:00 2001 From: eumaninho54 <angelo.omarzinho@outlook.com> Date: Fri, 24 Apr 2026 04:23:48 -0300 Subject: [PATCH 3/7] ci(deploy): delete branch after merge Automatically clean up release branch post-merge. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> --- .github/workflows/deploy.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6225614..db4d960 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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: | From 696bdac624d3d20109614c052f6fe224aad117d3 Mon Sep 17 00:00:00 2001 From: eumaninho54 <angelo.omarzinho@outlook.com> Date: Fri, 24 Apr 2026 04:23:48 -0300 Subject: [PATCH 4/7] docs(rules): add command routing decision tree Clarify when to use commands vs skills. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> --- src/rules/skills-format.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/rules/skills-format.md b/src/rules/skills-format.md index ad0357b..a98af8e 100644 --- a/src/rules/skills-format.md +++ b/src/rules/skills-format.md @@ -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`: From f83d6f635642172a275b15eb78485ba0355bbcd0 Mon Sep 17 00:00:00 2001 From: eumaninho54 <angelo.omarzinho@outlook.com> Date: Fri, 24 Apr 2026 04:31:23 -0300 Subject: [PATCH 5/7] fix(setup): remove settings.json symlink Removes the automatic settings.json symlink creation from the setup script as this should be managed separately. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> --- scripts/setup.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scripts/setup.sh b/scripts/setup.sh index 03edf94..8edbaa7 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -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" From acbbba7d4f96c610d50c16513123db10354cc933 Mon Sep 17 00:00:00 2001 From: eumaninho54 <angelo.omarzinho@outlook.com> Date: Fri, 24 Apr 2026 04:36:07 -0300 Subject: [PATCH 6/7] docs(land): clarify temp file ownership and lifecycle Reorganize /land orchestrator to clarify that the orchestrator is solely responsible for managing .aiworkers-context.tmp lifecycle. Update commit skill to read from temp file if present. Improves workflow documentation. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> --- src/commands/land/SKILL.md | 12 ++++++++++-- src/skills/commit/SKILL.md | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/commands/land/SKILL.md b/src/commands/land/SKILL.md index d897b34..afcfdbc 100644 --- a/src/commands/land/SKILL.md +++ b/src/commands/land/SKILL.md @@ -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) diff --git a/src/skills/commit/SKILL.md b/src/skills/commit/SKILL.md index f9859a8..ee9e759 100644 --- a/src/skills/commit/SKILL.md +++ b/src/skills/commit/SKILL.md @@ -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 From 5891917b3f6428db4a31d85325592759c8b18698 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Apr 2026 08:22:22 +0000 Subject: [PATCH 7/7] chore(release): bump version to 0.1.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 499404a..a2ac293 100644 --- a/package.json +++ b/package.json @@ -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"