Claude Architect · 강의

Skill Frontmatter

context: fork, allowed-tools 및 argument-hint를 다룹니다

레슨 2/413개 단계

Skill Frontmatter은(는) CoddyKit의 무료 Claude Architect 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Claude Architect 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Claude Architect 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

Why Frontmatter Matters

In Claude Code, a skill lives under .claude/skills/ and packages a reusable workflow. The body holds the instructions; the YAML frontmatter at the top configures how the skill executes.

Three frontmatter keys do most of the architectural work:

  • context: fork — isolate verbose output from your main session.
  • allowed-tools — restrict which tools the skill may use.
  • argument-hint — document the expected input.

Getting these right is the difference between a tidy, least-privilege skill and one that floods your context window or runs tools it never should.

Anatomy of a Skill File

A skill is a markdown file. The fenced YAML block at the very top is the frontmatter; everything below is the prompt Claude follows.

Note the distinction from the older .claude/commands/ directory (legacy) — .claude/skills/ is the current home. Both share project scope via VCS, while a copy under ~/.claude/ is personal and not shared with teammates.

---
name: audit-deps
description: Scan dependencies for known CVEs and summarize risk
context: fork
allowed-tools: Read, Grep, Glob, Bash
argument-hint: <package-name> [--severity high]
---

Audit the project's dependencies. If a package name is
provided as $ARGUMENTS, focus on that package; otherwise
scan all manifests. Report only HIGH and CRITICAL findings.

context: fork — The Core Idea

context: fork runs the skill in an isolated context branched from a shared point, then returns only the result to the main conversation. The verbose, intermediate output stays in the fork and never pollutes your primary window.

This is the same isolation principle behind an Explore subagent: discovery work generates a lot of noise, so you isolate it and hand back a clean summary. Skills make that pattern declarative — one line of frontmatter.

Why Isolation Protects Reliability

Context windows are not infinite, and models attend to the start and end of a long context more than the middle ("lost-in-the-middle"). A skill that greps hundreds of files or dumps long build logs into the main session pushes your real task into that weak middle zone.

context: fork keeps that bulk out. You preserve attention for what matters and avoid burning tokens on transient tool chatter that you'll never reference again.

When to Fork (and When Not To)

Fork when the skill produces verbose output you don't need to keep: dependency scans, log analysis, broad codebase exploration, test-suite runs.

Do not fork when the skill's full output is the deliverable you want inline in the main conversation — for example a short refactor of one file you're about to discuss. Forking there just adds a round-trip and hides detail you actually wanted.

  • Fork: noisy discovery, returns a summary.
  • No fork: small, surgical edits you keep working with.
---
name: analyze-logs
description: Parse the last 24h of error logs and surface top failure modes
context: fork
allowed-tools: Read, Grep, Bash
argument-hint: [service-name]
---

Grep the log files for ERROR/FATAL lines, group by message
template, and return ONLY the top 5 failure modes with counts.
Keep raw log lines inside this fork; do not echo them back.

allowed-tools — Least Privilege

allowed-tools restricts the skill to a named set of tools. This is the principle of least privilege applied to a workflow: a read-only audit skill should never hold Write or Edit.

It mirrors how you scope an agent's allowed_tools to its role. Narrow tool access reduces blast radius and also sharpens selection — fewer, well-scoped tools are chosen more reliably than a large grab-bag.

---
name: read-only-review
description: Inspect code and report findings WITHOUT modifying files
context: fork
allowed-tools: Read, Grep, Glob
argument-hint: <path-or-glob>
---

Review the matching files for correctness issues.
You may read and search only. Report findings as a list;
never attempt to edit — you have no write tools.

Restriction Is Not Enforcement

Be precise about what allowed-tools guarantees. It limits the menu of tools the skill can pick from — a useful, deterministic boundary on capability.

But it is not a substitute for a hook when a business rule must hold with certainty. If "never refund over $500" or "never push to main" has financial, legal, or safety stakes, enforce it with a deterministic hook (e.g. PostToolUse or an outgoing-call block), not by hoping the skill's prompt and tool list behave. Prompts are ~90% probabilistic; hooks are 100%.

argument-hint — Documenting Input

argument-hint describes the arguments the skill expects. It surfaces usage to the caller and documents intent — the angle-bracket and bracket convention signals required vs optional parameters.

Inside the body, those arguments arrive via $ARGUMENTS (or positional $1, $2). The hint is for humans and tooling; it does not parse or validate — your skill body decides how to interpret the input.

---
name: scaffold-endpoint
description: Generate a REST endpoint with handler, route, and test
allowed-tools: Read, Write, Edit, Glob
argument-hint: <resource-name> <http-method> [--auth]
---

Scaffold an endpoint for $1 using HTTP method $2.
If --auth is present, wire in the auth middleware.

Writing a Good argument-hint

A good hint follows the same discipline as a good tool description: state the input format, show the expected shape, and signal which parts are optional.

  • Use <required> for mandatory arguments.
  • Use [optional] for flags and extras.
  • Order positional arguments the way the body reads them.

An ambiguous hint causes misuse the same way an ambiguous tool description causes misrouting — clarity at the boundary prevents errors downstream.

The Three Keys Together

The keys compose into one coherent contract. A well-formed skill says: here is what I take (argument-hint), here is what I'm allowed to touch (allowed-tools), and here is how I keep your session clean (context: fork).

Read together, the frontmatter lets a teammate understand the skill's behavior and safety boundary without reading the body — exactly what shared, version-controlled config should provide.

---
name: security-scan
description: Static security scan; returns a ranked findings summary
context: fork
allowed-tools: Read, Grep, Glob, Bash
argument-hint: <path> [--fail-on critical]
---

Scan $1 for injection, secrets, and unsafe deserialization.
Run analysis in this fork; return a ranked summary only.
You have no Write/Edit tools — report, do not patch.

Scope and Sharing

Where the skill file lives decides who gets it. A skill in the project's .claude/skills/ is committed to VCS and shared with the whole team. A skill under ~/.claude/skills/ is personal — a new teammate cloning the repo will never see it.

This is the same trade-off as user-level vs project-level CLAUDE.md. If a skill encodes a team standard, commit it to project scope so the contract travels with the code.

Quick Check

Apply what you've learned to a concrete design decision.

Recap

Skill frontmatter is a compact safety-and-clarity contract built from three keys:

  • context: fork — isolate verbose output, return a clean summary, protect the main context window from lost-in-the-middle dilution.
  • allowed-tools — least-privilege capability boundary; restricts the tool menu but does NOT enforce business rules — use a deterministic hook for policies with financial/legal/safety stakes.
  • argument-hint — documents expected input (<required> vs [optional]); like a good tool description, clarity here prevents misuse. It does not validate.

Commit team skills to project .claude/skills/ so the contract ships with the code; keep personal ones in ~/.claude/.

무료로 시작

AI 튜터와 함께 Python을(를) 배우세요 — 무료

브라우저에서 실제 코드를 작성하고 실행하며, 24/7 AI 튜터로부터 즉각적인 도움을 받고, 웹이나 앱에서 중단한 부분부터 계속 학습하세요.

코스
26
레슨
104

자주 묻는 질문

“Skill Frontmatter” 강의는 무료인가요?

네 — “Skill Frontmatter” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Claude Architect 강의 전체를 잠금 해제할 수 있습니다. Claude Architect 강의에는 총 4개의 강의가 포함되어 있습니다.

“Skill Frontmatter”에서 뭘 배우나요?

context: fork, allowed-tools 및 argument-hint를 다룹니다 브라우저에서 직접 실행하는 실습 코드로 Claude Architect을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Claude Architect을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Claude Architect은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.

“Skill Frontmatter” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Claude Architect 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Claude Architect 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 사용자 지정 명령과 Skills
  2. Skill Frontmatter
  3. 계획 모드와 직접 실행
  4. 예시를 활용한 반복적 개선
← Claude Architect(으)로 돌아가기