From sync-ai-instructions
Assemble (or refresh) AI agent instruction files for the current project by pulling base + a chosen stack overlay from github.com/freaxnx01/ai-instructions. Idempotent — safe to run on a fresh project (first-time init) or on a project that already has the files (updates them). Writes CLAUDE.md, .github/copilot-instructions.md, SKILL.md, .ai/base-instructions.md, one file under .ai/stacks/, plus shared files under .ai/skills/ and .claude/commands/. Use when the user wants to bootstrap or refresh AI agent instructions in a project — triggers include "init AI instructions", "set up CLAUDE.md", "bootstrap copilot instructions", "sync ai-instructions", or running /sync-ai-instructions. Run from the target project's working directory, never from the ai-instructions source repo.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sync-ai-instructions:sync-ai-instructionsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Pull the canonical AI agent instructions from `github.com/freaxnx01/ai-instructions` and assemble them into this project as `CLAUDE.md`, `.github/copilot-instructions.md`, `SKILL.md`, plus the shared skill files under `.ai/skills/`.
Pull the canonical AI agent instructions from github.com/freaxnx01/ai-instructions and assemble them into this project as CLAUDE.md, .github/copilot-instructions.md, SKILL.md, plus the shared skill files under .ai/skills/.
Idempotent: safe to run for first-time setup or to refresh an already-initialized project.
Run this skill from the target project's working directory, not from the ai-instructions repo itself.
Target: $ARGUMENTS (optional: stack name, e.g. dotnet)
The source repository is github.com/freaxnx01/ai-instructions. Its shape:
.ai/
base-instructions.md ← stack-agnostic
stacks/
<stack>.md ← one file per supported stack
skills/
commit.md · push.md
ui-brainstorm.md · ui-flow.md · ui-build.md · ui-review.md
A project consumes base + exactly one stack overlay. That is what keeps an agent's context clean: a Flutter project never sees .NET content, and vice versa.
Resolve the stack in this order:
$ARGUMENTS names a stack, use that. Verify it exists in the source repo (see available-stacks command below); stop if it doesn't..ai/stacks/*.md in the target project.
dotnet.md → dotnet) silently, as an update of an existing init.Available-stacks command (use either):
gh api repos/freaxnx01/ai-instructions/contents/.ai/stacks --jq '.[].name'curl -s https://api.github.com/repos/freaxnx01/ai-instructions/contents/.ai/stacks | jq -r '.[].name'If the user (or $ARGUMENTS) names a stack that does not exist in the source repo, stop and tell them — do not silently fall back. Offer: "Create stacks/<name>.md in the ai-instructions repo first, then re-run."
When resolving by auto-detect, confirm in the report which stack was picked and from where (e.g. "detected dotnet from .ai/stacks/dotnet.md"), so the user can correct if it's wrong.
For the chosen stack <name>, fetch these raw files from main:
https://raw.githubusercontent.com/freaxnx01/ai-instructions/main/.ai/base-instructions.mdhttps://raw.githubusercontent.com/freaxnx01/ai-instructions/main/.ai/stacks/<name>.mdhttps://raw.githubusercontent.com/freaxnx01/ai-instructions/main/.ai/skills/commit.mdhttps://raw.githubusercontent.com/freaxnx01/ai-instructions/main/.ai/skills/push.mdhttps://raw.githubusercontent.com/freaxnx01/ai-instructions/main/.ai/skills/ui-brainstorm.mdhttps://raw.githubusercontent.com/freaxnx01/ai-instructions/main/.ai/skills/ui-flow.mdhttps://raw.githubusercontent.com/freaxnx01/ai-instructions/main/.ai/skills/ui-build.mdhttps://raw.githubusercontent.com/freaxnx01/ai-instructions/main/.ai/skills/ui-review.mdUse curl -sSfL -o <path> <url> or WebFetch.
Create these files in the current working directory (the target project):
.ai/
base-instructions.md ← copy of fetched base
stacks/
<stack>.md ← only the chosen stack
skills/
commit.md push.md
ui-brainstorm.md ui-flow.md ui-build.md ui-review.md
.claude/
commands/
commit.md push.md
ui-brainstorm.md ui-flow.md ui-build.md ui-review.md
CLAUDE.md ← assembled: base + stacks/<stack>.md (see Step 4)
.github/copilot-instructions.md ← same assembled content, tool-specific framing
SKILL.md ← same assembled content, OpenClaw framing
The target project gets exactly one stack under .ai/stacks/. That is the whole point — no other stacks land on disk, so they never enter any agent's context.
Note: /sync-ai-instructions and /release-notes are no longer copied into the target project's .claude/commands/ or .ai/skills/. They live as standalone plugins in the marketplace and are available globally once installed. Remove any stale .claude/commands/init-instructions.md, .claude/commands/sync-ai-instructions.md, .claude/commands/release-notes.md, .ai/skills/init-instructions.md, .ai/skills/sync-ai-instructions.md, or .ai/skills/release-notes.md you find during an update run.
Each of these three files is the concatenation of:
base-instructions.mdstacks/<stack>.mdHeaders:
CLAUDE.md
[//]: # (Source of truth: .ai/base-instructions.md + .ai/stacks/<stack>.md — update those, then regenerate this file by re-running /sync-ai-instructions)
# CLAUDE.md
Agent context for Claude Code. Read this before taking any action in this repository.
.github/copilot-instructions.md
[//]: # (Source of truth: .ai/base-instructions.md + .ai/stacks/<stack>.md — update those, then regenerate by re-running /sync-ai-instructions)
# GitHub Copilot Instructions
Follow all conventions below when generating or completing code.
SKILL.md
[//]: # (Source of truth: .ai/base-instructions.md + .ai/stacks/<stack>.md — update those, then regenerate by re-running /sync-ai-instructions)
# SKILL.md — OpenClaw Agent Skill
This skill configures OpenClaw for this project.
[Unreleased] scaffolding if missingIf the target project has no CHANGELOG.md, create one with the Keep a Changelog header and an empty [Unreleased] section. If it has no cliff.toml, suggest running git cliff --init separately.
Print a summary of files written, the stack chosen, and the commit SHA of ai-instructions that was fetched (from gh api repos/freaxnx01/ai-instructions/commits/main --jq .sha). The user will commit the changes themselves — do not commit automatically.
CLAUDE.md / copilot-instructions.md / SKILL.md without showing a diff first if they already existCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub freaxnx01/agent-skills --plugin sync-ai-instructions