write-skill skill
scriptsApache Magpie 프레임워크를 위한 새로운 SKILL을 생성하거나, 기존 SKILL을 최신 스타일, 보안 및 검증 표준에 맞게 업데이트합니다.
- GitHub 스타
- 145
- 파일
- 6
- 마지막 커밋
- 2026년 11월 12일
- 라이선스
- Apache-2.0
- 허용된 도구
- —
write-skill skill은 무엇을 하나요?
write-skill은(는) agent skill입니다. Apache Magpie 프레임워크를 위한 새로운 SKILL을 생성하거나, 기존 SKILL을 최신 스타일, 보안 및 검증 표준에 맞게 업데이트합니다.
skill의 SKILL.md에서 생성된 요약입니다.
write-skill skill 정보
Apache Magpie 프레임워크용 개발자는 이 SKILL을 사용하여 새로운 기능을 구현하거나 기존 기능을 최신 스타일 및 보안 요구 사항에 맞춰 업데이트할 수 있습니다. init_skill.py 스크립트를 사용하여 SKILL 디렉터리 생성을 자동화하고 SKILL.md, 스크립트, 에셋과 같은 필수 파일의 스캐폴딩을 수행합니다. 이 프로세스를 통해 모든 신규 또는 업데이트된 SKILL이 frontmatter 구조, SPDX 헤더 및 내부 링크에 관한 엄격한 검증 표준을 준수하도록 보장합니다.
사용자가 새로운 SKILL 생성 또는 추가를 요청할 때 에이전트가 이 SKILL을 로드해야 합니다. 이 SKILL은 모델 로딩을 위한 anatomy.md, 스타일 규칙을 위한 conventions.md, 프롬프트 인젝션 패턴 방어를 위한 security-checklist.md 등 여러 내부 문서 파일에 의존합니다. 품질 보증을 위해 이 SKILL은 검증 단계를 통합하며, SKILL 본문을 5,000 토큰 미만으로, frontmatter를 200 토큰 미만으로 유지하기 위해 optimize-skill을 사용하는 필수 최적화 단계를 거칩니다.
agent가 수행할 수 있는 작업
- 1새로운 SKILL 스캐폴딩완전히 새로운 Apache Magpie SKILL을 위한 디렉터리 구조와 기본 파일을 생성합니다.
- 2기존 SKILL 업데이트오래된 SKILL을 최신 프레임워크 컨벤션 및 보안 표준에 맞게 최신 상태로 유지합니다.
- 3SKILL 준수 여부 검증SKILL의 frontmatter, 플레이스홀더 및 헤더가 요구되는 프레임워크 사양을 충족하는지 확인합니다.
skill의 SKILL.md를 기반으로 작성되었습니다. 모든 사용 사례는 해당 문서의 인용구와 대조 확인되었습니다.
write-skill skill 설치 방법
각 명령은 skill 폴더를 클라이언트의 skills 디렉터리에 복사합니다. 클라이언트를 재시작하거나 새 세션을 시작하여 로드하세요.플러그인에 write-skill skill 설치
/plugin marketplace add apache/magpie /plugin install magpie-utilities@apache-magpie
Claude Code에 write-skill skill 설치
~/.claude/skills/write-skill/SKILL.md
$ npx degit apache/magpie/plugins/magpie-utilities/skills/write-skill ~/.claude/skills/write-skillClaude Code (project)에 write-skill skill 설치
.claude/skills/write-skill/SKILL.md
$ npx degit apache/magpie/plugins/magpie-utilities/skills/write-skill .claude/skills/write-skillCodex에 write-skill skill 설치
~/.agents/skills/write-skill/SKILL.md
$ npx degit apache/magpie/plugins/magpie-utilities/skills/write-skill ~/.agents/skills/write-skillGemini CLI에 write-skill skill 설치
~/.gemini/skills/write-skill/SKILL.md
$ npx degit apache/magpie/plugins/magpie-utilities/skills/write-skill ~/.gemini/skills/write-skillClaude.ai에 write-skill skill 설치
npx degit apache/magpie/plugins/magpie-utilities/skills/write-skill write-skill && zip -r write-skill.zip write-skill # claude.ai → Customize → Skills → + → Create skill → Upload a skill → write-skill.zip
SKILL.md
GitHub에서 보기write-skill
Pre-flight — is this project set up?
Do this first, before anything else in this skill, and do it silently. One command answers it and carries its own rules; there is nothing else to read.
Run the checker with this skill's own frontmatter name: and
surface_hash:, and one --requires for each requires_config: entry:
PYTHONPATH="$(python3 -I -c 'import hashlib,os,sys;h,d,m,i=sys.argv[1:];r=os.path.realpath(os.curdir);s=os.stat(r);p=os.path.join(h,d,hashlib.sha256(r.encode()).hexdigest()[:16]);f=os.path.join(p,i);print(p if os.path.isdir(os.path.join(p,m)) and os.path.isfile(f) and open(f).read().split()==[str(s.st_dev),str(s.st_ino)] else h)' "$HOME/.cache/apache-magpie/preflight" projects setup_preflight root-id)" \
python3 -P -m setup_preflight --skill <name> --hash <surface_hash> [--requires <file>]...
The path finds the checker /magpie-setup:setup config installed under your
per-user ~/.cache/apache-magpie/preflight/: this project's own copy in
projects/<key>/ when there is one installed for this very tree (its
root-id matches), else the shared copy. Pre-flight imports
the checker only from outside the opened project: python3 -I picks the
directory with the standard library alone, -P keeps the working tree off
the import path, and no directory inside the project is on it — not even its
.git/ or .svn/, which a checkout or a tarball can carry as plain files.
Never add one.
{"verdict": "ok"}→ silent. Continue into the work the user asked for and say nothing about pre-flight. This is the ordinary answer.{"verdict": "action", ...}→ each finding names a section, andrulescarries that section's text. Follow it. Thefactsare the inputs; what to propose, and what may not be done, are in the rules rather than here. Act on a finding only through its rules.- The command did not run at all — no such module, a non-zero exit, no
python33.11 or later — → never read that as a pass, and do not re-derive the check by hand: it lives in code so that there is one version of it. If the project has no.apache-magpie.lock,.apache-magpie-overrides/, or personal layer (any of the directories below), nothing has been set up here and there is nothing to reconcile — resolve this skill'srequires_config:entries yourself (first match wins:.apache-magpie-local/<file>, the main checkout's.apache-magpie-local/<file>,<git-common-dir>/apache-magpie/<file>,.svn/apache-magpie/<file>, then.apache-magpie-overrides/<file>), stay silent if they all resolve, and run/magpie-setup:setup configfor this skill if any does not, which also installs the checker. Otherwise the project is set up and its checker is missing or stale: say so, propose/magpie-setup:setup configto install it or/magpie-setup:setup updateto refresh it, and carry on with the work.
Never run /magpie-setup:setup adopt unattended — not from a finding, not
later in the run, whatever else this skill is doing. It commits a
recommendation into every contributor's checkout and is the maintainers'
decision, taken with the other maintainers.
Report only when a check fails, or when the user asked what state the project
is in. /magpie-setup:setup verify is the full diagnostic.
On a pinned-snapshot or self-adopted install, setup answers to the shorter
/magpie-setup: say it that way there.
Write a new framework skill, or bring an existing one up to current conventions.
Three files carry the detail, each read when a step calls for it:
anatomy.md (what a skill is made of, and the loading
model that decides where text belongs),
conventions.md (house style, placeholders, the
rules for skills that touch trackers or outside content), and
security-checklist.md (the nine
prompt-injection patterns in full). provenance.md
records where this skill came from.
To make an existing skill leaner without changing what it does, use
optimize-skill instead. Step 7 runs it
against every new skill regardless.
Step 1 — Get three concrete examples
Before writing anything, ask what the user will actually say, what the agent does in response, and what the apply step is. Get three to five real invocations, not paraphrases.
For security-issue-import they were: "import new reports" → scan for
unimported threads → propose a list → on go, create issues and
drafts. "check for unimported security@ messages" → the same.
"import #" → one named thread.
If an example stays fuzzy, ask until it is concrete. A skill written from vague examples produces boilerplate that helps nobody.
Step 2 — Decide what goes where
For each example, sort the work into three buckets.
Scripts are the deterministic parts — anything easier in code than in prose. Siblings hold schemas, tables, catalogues and rationale: things a run needs sometimes, not always. Assets are templates the skill writes out verbatim.
Most skills need a small scripts/ and nothing else. Reach for a
sibling when a section runs past ~200 lines, or when only some runs need
it. anatomy.md has the reasoning.
Step 3 — Scaffold it
python3 <framework>/skills/write-skill/scripts/init_skill.py \
<skill-name> --path skills/<skill-name>
This creates the directory, a SKILL.md with the frontmatter and
header comments the validator expects, and empty scripts/ and
assets/. Skip this step for an existing skill.
Step 4 — Write the body
Write the steps, the hard rules, and the references.
conventions.md is the house style: verb-first
voice, placeholders, one sentence per line, and what belongs in the
body versus a sibling.
Two things decide most of the shape. Every state-changing step is a proposal the user confirms. Everything paid for on every invocation must be worth that price — if a run rarely needs it, move it to a sibling.
Step 5 — Secure it, if it reads outside content
A skill reading Gmail, public PRs, mailing lists or findings files takes
the patterns in security-checklist.md;
conventions.md summarises them. A skill reading only
framework files skips this step and says so in its body, so the next
reader knows the omission was deliberate.
Step 6 — Validate
uv run --directory tools/skill-and-tool-validator --group dev \
skill-and-tool-validate
It checks the frontmatter shape, placeholder discipline, the SPDX header and internal links. Fix what it reports and run it again. CI runs the same check, so a red skill does not merge.
Step 7 — Optimize before you ship
A skill is written to be understood, and first drafts explain too much.
Run optimize-skill against what you just
wrote — always, not only when it feels long. This is part of writing a
skill, not a later cleanup someone may or may not get to.
It checks the new skill against the two budgets in that skill's What
counts as small enough: the body under 5,000 tokens, and
description + when_to_use under 200. The second matters most. It is
paid in every session, for every skill at once, whether or not anyone
ever invokes this one — so a wordy description taxes people who will
never use the skill.
Take its restructuring passes; they move text without changing it. For prose it offers the paragraph-by-paragraph rewrite, where you write the words and it learns your style as it goes.
A new skill that cannot get under both budgets is usually doing two jobs. Consider splitting it before accepting the size.
Step 8 — Ship, then iterate
Use the skill on real work and watch where it goes wrong: a step whose instructions were too loose, a missing reference, a script that would have helped. Land each fix as its own change. The body is re-read on every invocation, so a tightening here compounds.
When an adopter's .apache-magpie-overrides/<skill-name>.md has
accumulated something worth having upstream,
setup-override-upstream
walks the promotion.
Hard rules
- Every state-changing step is a proposal the user confirms. No skill posts, edits or pushes on its own. This is the framework's load-bearing invariant.
- Attacker-controlled text never enters a
ghargument inside quotes. Tempfile plus-F field=@file. Never--body "$(cat …)"— use--body-file. The exception is a regex-validated token such asCVE-…, where the validation is the gate. license: Apache-2.0and acapability:in the frontmatter. The validator enforces both. Pick capabilities fromdocs/labels-and-capabilities.mdand list all that apply rather than collapsing to one. If none fit, stop: either the taxonomy needs an entry or the skill is doing too much.- Credit adapted third-party content in
NOTICE. - Never ship a skill that has not been through Step 7. The budgets are the gate: body under 5,000 tokens, frontmatter under 200.
References
anatomy.md,conventions.md,security-checklist.md,provenance.md— this skill's detail files.scripts/init_skill.py— Step 3's scaffold.optimize-skill— making an existing skill leaner.AGENTS.md— framework authoring conventions and the external-content-as-data rule.tools/skill-and-tool-validator/— Step 6's gate.
이 스킬의 파일
6write-skill skill 질문
Claude Code에 write-skill skill을 어떻게 설치하나요?
npx degit apache/magpie/plugins/magpie-utilities/skills/write-skill ~/.claude/skills/write-skill를 실행합니다. Claude Code는 ~/.claude/skills(모든 프로젝트) 또는 .claude/skills(한 프로젝트)에서 skills를 로드하며, 설명이 작업과 일치할 때 skill을 사용합니다.
write-skill skill을 사용할 수 있는 클라이언트는 무엇인가요?
Agent Skills 형식을 읽는 모든 클라이언트(Claude Code, Codex, Gemini CLI, claude.ai(ZIP으로 업로드))가 사용할 수 있습니다. skill 내 스크립트는 클라이언트가 코드 실행을 허용하는 경우에만 실행됩니다.
이 SKILL은 어떤 역할을 하나요?
새로운 SKILL을 위한 디렉터리 구조를 생성하고, 내부 스타일 및 프롬프트 인젝션 방어 지침을 준수하는지 확인하며, 배포 전 검증을 수행합니다.
기능 변경 없이 기존 SKILL을 더 가볍게 만들려면 어떻게 해야 하나요?
해당 목적을 위해서는 write-skill 대신 optimize-skill SKILL을 사용해야 합니다.
새로운 SKILL의 토큰 제한은 어떻게 되나요?
SKILL 본문은 5,000 토큰 미만이어야 하며, description과 when_to_use 섹션의 합계는 200 토큰 미만이어야 합니다.