Skip to content

Commit f5d7b26

Browse files
Refresh docs site for v0.2.1 (eight platforms, init instructions, skill versioning)
Bring the VitePress site up to date with the v0.2.0 / v0.2.1 surface that has landed since the last docs refresh: - Eight platform adapters wherever 3 were listed (index, guide, concepts diagram, reference flag enums, platforms index/comparison) and a dedicated page for each new adapter (cursor, gemini-cli, github-copilot, windsurf, continue). - `skern init --instructions` / `--tool-forming-loop` / `--target` / `--print-instructions` documented in the quick-start, agent-setup, and command reference. Agent-setup now leads with `init --instructions` instead of the manual `echo … >> AGENTS.md` recipe. - Reference reorganized: registry vs. platform command groups, full pages for `skill import`, `skill version`, `skill diff`, capacity reporting on install/uninstall, `--enforce-budget`, `--with-platforms`, batch install/uninstall. - Validation page split into errors / warnings / hints with the trigger-prefix and recommended-section hints. - Skill format page corrected to the nested `metadata.author` / `metadata.version` / `metadata.modified-by` schema and includes the import workflow. - Installation page covers macOS, Linux, and Windows (PowerShell) one-liners plus version pinning, custom install dir, source build, manual install, uninstall. - Contributing/development reflects the declarative platform spec, updated Make targets, and the `cli/instructions/` package. - Sidebar adds the new platform pages and a Writing Skills entry under Guide. Build verified with `npm run docs:build` (clean). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3a2b09b commit f5d7b26

22 files changed

Lines changed: 783 additions & 286 deletions

docs/.vitepress/config.mts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export default defineConfig({
4040
{ text: 'Installation', link: '/guide/installation' },
4141
{ text: 'Quick Start', link: '/guide/quick-start' },
4242
{ text: 'Agent Setup', link: '/guide/agent-setup' },
43+
{ text: 'Writing Skills', link: '/writing-skills' },
4344
],
4445
},
4546
],
@@ -73,6 +74,11 @@ export default defineConfig({
7374
{ text: 'Claude Code', link: '/platforms/claude-code' },
7475
{ text: 'Codex CLI', link: '/platforms/codex-cli' },
7576
{ text: 'OpenCode', link: '/platforms/opencode' },
77+
{ text: 'Cursor', link: '/platforms/cursor' },
78+
{ text: 'Gemini CLI', link: '/platforms/gemini-cli' },
79+
{ text: 'GitHub Copilot', link: '/platforms/github-copilot' },
80+
{ text: 'Windsurf', link: '/platforms/windsurf' },
81+
{ text: 'Continue', link: '/platforms/continue' },
7682
],
7783
},
7884
],

docs/concepts/index.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ Skern separates concerns into four layers:
55
```
66
Skill Author --> skern --> Registry --> Agent Runtime
77
|
8-
+-------+-------+
9-
| | |
10-
Claude Codex OpenCode
11-
Code CLI
8+
+---------+---------+---------+---------+
9+
| | | | | | |
10+
Claude Codex Open Cursor Gemini Copilot Continue / Windsurf / ...
11+
Code CLI Code CLI
1212
```
1313

1414
## Layers
1515

1616
### Skill Definition
1717

18-
Metadata and behavior live in a single `SKILL.md` file. The file uses YAML frontmatter for structured fields (name, description, author, version, allowed-tools) and markdown body for the skill's instructions.
18+
Metadata and behavior live in a single `SKILL.md` file. The file uses YAML frontmatter for structured fields (name, description, author, version, tags, allowed-tools) and markdown body for the skill's instructions.
1919

2020
See [Skill Format](/concepts/skill-format) for the full specification.
2121

@@ -30,12 +30,20 @@ See [Registry](/concepts/registry) for details.
3030

3131
### Validation
3232

33-
Before a skill enters the registry, skern validates it against the [Agent Skills](https://agentskills.io) specification. This includes name format checks, description requirements, and overlap detection against existing skills.
33+
Before a skill enters the registry, skern validates it against the [Agent Skills](https://agentskills.io) specification. This includes name format checks, description requirements, folder integrity (referenced files exist), and overlap detection against existing skills. Validation also surfaces stylistic **hints** (short body, vague description, missing trigger prefix) that don't affect validity.
3434

3535
See [Validation](/reference/validation) and [Overlap Detection](/reference/overlap-detection) for rules and thresholds.
3636

3737
### Platform Adapters
3838

39-
Each supported platform has an adapter that knows where to install skills. Adapters copy the `SKILL.md` to the platform-specific directory, making the skill immediately available to the agent runtime.
39+
Each supported platform has an adapter that knows where to install skills. Adapters copy the skill directory (`SKILL.md` plus any sibling files and subdirectories) to the platform-specific location, making the skill immediately available to the agent runtime.
4040

41-
See [Platform Adapters](/concepts/platform-adapters) for how adapters work.
41+
Adapters are **declarative**: every supported platform is one row in `Specs` in [`internal/platform/spec.go`](https://github.com/devrimcavusoglu/skern/blob/main/internal/platform/spec.go). A single generic `Adapter` struct implements every platform's interface from the spec — no per-platform Go file is required.
42+
43+
See [Platform Adapters](/concepts/platform-adapters) for how adapters work and the full path reference.
44+
45+
## Dynamic Skill Loading
46+
47+
Skern is not just a one-shot installer. The `install` and `uninstall` commands return a `capacity` block (installed count, per-scope threshold, headroom, over-budget flag) so agents can size their working set to a context budget. Pass `--enforce-budget` to refuse installs that would exceed the threshold.
48+
49+
See the [Quick Start](/guide/quick-start#3-install-to-a-platform) for the workflow.

docs/concepts/skill-format.md

Lines changed: 70 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,131 @@
11
# Skill Format
22

3-
Skills follow the [Agent Skills](https://agentskills.io) open standard. Each skill is a single `SKILL.md` file with YAML frontmatter and a markdown body.
3+
Skills follow the [Agent Skills](https://agentskills.io) open standard. Each skill is a directory containing a `SKILL.md` file with YAML frontmatter and a markdown body, plus any optional companion files.
44

55
## Structure
66

77
```markdown
88
---
99
name: code-review
10-
description: Review PRs for style and correctness
10+
description: |
11+
Use when reviewing pull requests for style and correctness.
1112
tags:
1213
- review
1314
- quality
14-
version: 1.0.0
15-
author:
16-
name: Jane Doe
17-
type: human
1815
allowed-tools:
1916
- Read
2017
- Grep
2118
- Glob
19+
metadata:
20+
author:
21+
name: Jane Doe
22+
type: human # human | agent
23+
platform: claude-code # only when type=agent
24+
version: "1.0.0"
25+
modified-by: # append-only provenance
26+
- name: codex-cli
27+
type: agent
28+
platform: codex-cli
29+
date: "2026-04-12T10:30:00Z"
2230
---
2331

24-
## Instructions
32+
## Overview
2533

26-
Review pull requests for:
27-
- Code style consistency
28-
- Correctness of logic
29-
- Test coverage
34+
1-2 sentence core principle of the skill.
35+
36+
## When to Use
37+
38+
- Triggering conditions and symptoms
39+
40+
## Core Pattern
41+
42+
The main technique or pattern (before/after for techniques).
3043
```
3144

3245
## Frontmatter Fields
3346

3447
| Field | Required | Description |
3548
|-------|----------|-------------|
36-
| `name` | Yes | Skill name matching `[a-z0-9]+(-[a-z0-9]+)*`, 1-64 chars |
37-
| `description` | Yes | What the skill does, max 1024 chars |
38-
| `version` | No | Semantic version (e.g., `1.0.0`) |
39-
| `author.name` | No | Author name |
40-
| `author.type` | No | `human` or `agent` |
41-
| `author.platform` | No | Platform name (e.g., `claude-code`) |
49+
| `name` | Yes | Skill name matching `[a-z0-9]+(-[a-z0-9]+)*`, 1-64 chars. Must equal the directory name. |
50+
| `description` | Yes | What the skill does — start with "Use when…". Max 1024 chars. |
4251
| `tags` | No | List of classification tags |
43-
| `allowed-tools` | No | List of tools the skill may use |
44-
| `modified-by` | No | Modification history entries |
52+
| `allowed-tools` | No | Tools the skill may use. No empty entries. |
53+
| `metadata.author.name` | No | Author name |
54+
| `metadata.author.type` | No | `human` or `agent` |
55+
| `metadata.author.platform` | No | Platform name (e.g. `claude-code`) — used when `type: agent` |
56+
| `metadata.version` | No | Semantic version (e.g. `1.0.0`); defaults to `0.0.1` on `skill create` |
57+
| `metadata.modified-by` | No | Append-only modification history (set via `skern skill edit --modified-by`) |
58+
59+
`name` and `description` are the only hard requirements. The rest help discovery, validation, and provenance.
4560

4661
## Body
4762

4863
The markdown body contains the skill's instructions. This is what the agent reads when the skill is activated. It must be non-empty.
4964

65+
The recommended body structure (also what `skern skill create` scaffolds) is:
66+
67+
1. **Overview** — 1-2 sentence core principle
68+
2. **When to Use** — triggering conditions
69+
3. **Core Pattern** — the main technique
70+
4. **Quick Reference** — scannable summary
71+
5. **Common Mistakes** — frequent errors and fixes
72+
73+
See [Writing Skills](/writing-skills) for details on what makes a discoverable, well-structured skill.
74+
5075
## Author Provenance
5176

52-
Skills track author metadata and an optional `modified-by` history. `skern skill show` displays the full provenance chain when present, including editor name, type (human/agent), platform, and date.
77+
Skills track an author and an append-only `modified-by` history. `skern skill show` prints the full provenance chain when present, including editor name, type (human/agent), platform, and date. `skern skill edit --modified-by <name>` adds a new entry without overwriting earlier ones.
5378

5479
## Folder Structure
5580

56-
Skills can include additional files alongside `SKILL.md` — helper scripts, templates, configuration files, and other assets. When a skill is installed to a platform, the entire directory is copied.
81+
A skill is a directory. `SKILL.md` is the manifest; sibling files travel with it.
5782

5883
```
5984
my-skill/
6085
├── SKILL.md
86+
├── references/
87+
│ └── notes.md
6188
├── scripts/
6289
│ ├── convert.py
6390
│ └── setup.sh
6491
└── assets/
6592
└── template.json
6693
```
6794

68-
The `scripts/` directory is language-agnostic — skills can include Python, shell, JavaScript, or any other scripts. The agent decides which language is appropriate for the skill.
95+
When a skill is installed to a platform, the **entire directory** is copied. The `scripts/` directory is language-agnostic — skills can include Python, shell, JavaScript, or any other scripts. The agent decides which language is appropriate.
6996

70-
Use `skern skill show <name>` to see which files are bundled with a skill, and `skern skill validate <name>` to check that files referenced in the skill body actually exist.
97+
`skern skill validate <name>` checks that files referenced in the body (via backticks or markdown links) actually exist in the skill directory. Missing references produce **warnings**, not errors. `skern skill show <name>` lists every file bundled with the skill.
7198

7299
## Creating Skills
73100

74101
Use `skern skill create` to scaffold a new skill:
75102

76103
```sh
77104
skern skill create code-review \
78-
--description "Review PRs for style and correctness" \
105+
--description "Use when reviewing PRs for style and correctness" \
79106
--author "Jane Doe" \
80-
--author-type human
107+
--author-type human \
108+
--version 1.0.0 \
109+
--tags review,quality
81110
```
82111

83-
Or seed from another skill. `--from-template <dir>` requires a **skill directory**
84-
— a directory containing `SKILL.md` and any optional companion files
85-
(`references/`, `templates/`, `VENDORED.md`, …). Skern parses the template's
86-
frontmatter and copies every sibling into the new skill:
112+
Or seed from another skill. `--from-template <dir>` requires a **skill directory** — a directory containing `SKILL.md` and any optional companion files (`references/`, `templates/`, `VENDORED.md`, …). Skern parses the template's frontmatter and copies every sibling into the new skill:
113+
114+
```sh
115+
skern skill create code-review \
116+
--from-template ~/.skern/skills/source-template
117+
```
118+
119+
A bare file path (a `SKILL.md` or a body-only markdown file) is rejected with an error pointing at the parent directory. The CLI `<name>` argument always wins over the template's name; other flags (`--description`, `--tags`, `--author*`, `--version`) override template values when explicitly set, otherwise the template's values are preserved.
120+
121+
## Importing Skills
122+
123+
`skern skill import <url>` pulls an existing skill into the registry from a GitHub repository directory or gist:
87124

88125
```sh
89-
# Seeds the new skill from an existing skill directory. SKILL.md frontmatter
90-
# (description, tags, metadata.author, metadata.version) is preserved; all
91-
# sibling files and subdirectories are copied alongside the new SKILL.md.
92-
skern skill create code-review --from-template ~/.skern/skills/source-template
126+
skern skill import https://github.com/owner/repo/tree/main/skills/code-review
127+
skern skill import https://gist.github.com/<id>
128+
skern skill import <url> --name local-name --scope project
93129
```
94130

95-
A bare file path (e.g., a `SKILL.md` or a markdown body file) is rejected with
96-
an error pointing you at the parent directory. The CLI `<name>` argument
97-
always wins over the template's `name`; other flags
98-
(`--description`, `--tags`, `--author*`, `--version`) override template values
99-
when explicitly set, otherwise the template's values are preserved.
131+
Overlap detection runs on import too — pass `--force` to override a near-duplicate block.

docs/contributing/development.md

Lines changed: 64 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,94 @@
33
## Build
44

55
```sh
6-
make build # Build binary with version/commit/date injected
6+
make build # Build binary with version/commit/date injected via ldflags
77
```
88

99
The binary is placed at the repository root as `skern`.
1010

1111
## Test
1212

1313
```sh
14-
make test # Run unit tests
15-
make test-v # Verbose test output
16-
make test-cover # Generate coverage report
17-
make test-smoke # Smoke & E2E tests against built binary
14+
make test # Run unit tests
15+
make test-v # Verbose test output
16+
make test-cover # Generate coverage report (coverage.out + coverage.html)
17+
make test-install # Run installer script tests
18+
make test-smoke # Build binary and run smoke tests against it
19+
make test-manual-setup # Set up manual test scenarios under /tmp
20+
make test-manual-report # Generate the manual test pass/fail checklist
21+
make test-manual-teardown # Clean up manual test environment
1822
```
1923

24+
Tests use stdlib `testing` plus `testify`. Integration tests that touch the filesystem must use `t.TempDir()`. Table-driven test patterns are preferred.
25+
2026
## Lint & Format
2127

2228
```sh
23-
make lint # Run golangci-lint
24-
make fmt # Format code with gofmt
29+
make lint # golangci-lint run
30+
make fmt # gofmt -w .
2531
```
2632

33+
Linter config lives in `.golangci.yml`.
34+
2735
## Clean
2836

2937
```sh
30-
make clean # Remove build artifacts
38+
make clean # Remove binary and coverage files
3139
```
3240

3341
## Project Structure
3442

3543
```
36-
cmd/skern/main.go # Entry point
44+
cmd/skern/main.go # Entry point
3745
internal/
38-
cli/ # Cobra commands (root, version, init, completion, skill_*, platform_*)
39-
skill/ # Domain: Skill struct, manifest parse/write, validation, scaffolding
40-
overlap/ # Fuzzy name matching (Levenshtein) + description similarity scoring
41-
registry/ # Filesystem CRUD over ~/.skern/skills/ and .skern/skills/
42-
platform/ # Adapters: Claude Code, Codex CLI, OpenCode
43-
output/ # JSON/text output formatting (--json, --quiet)
46+
cli/ # Cobra commands (root, version, init, completion, skill_*, platform_*)
47+
instructions/ # Embedded snippets used by `skern init --instructions`
48+
skill/ # Domain: Skill struct, manifest parse/write, validation, scaffolding, versioning, importer
49+
overlap/ # Fuzzy name matching (Levenshtein) + description similarity scoring
50+
registry/ # Filesystem CRUD over ~/.skern/skills/ and .skern/skills/
51+
platform/ # Declarative Spec table (spec.go) + a single generic Adapter (adapter.go)
52+
output/ # JSON/text output formatting (--json, --quiet)
53+
scripts/
54+
install.sh # Unix installer
55+
install.ps1 # Windows PowerShell installer
56+
install_test.sh # Installer tests
57+
smoke_test.sh # Smoke tests for built binary
58+
tests/manual/ # Agent-driven test scenarios (11 scenarios)
59+
docs/ # VitePress documentation site
4460
```
4561

4662
## Conventions
4763

48-
- Tests are table-driven with `testify` and use `t.TempDir()` for temp dirs
49-
- `cli/` package uses injectable `newRegistryFunc` / `newDetectorFunc` for test isolation
50-
- Errors are wrapped with `fmt.Errorf("context: %w", err)`
51-
- Dependencies: `cobra`, `yaml.v3`, `testify`
64+
- `cli/` is wiring, flag parsing, and output. Business logic lives in `skill/`, `registry/`, `platform/`, `overlap/`.
65+
- Adding a new platform = one row in `internal/platform/spec.go` plus one `Type` constant. No per-platform Go file.
66+
- Errors are wrapped with `fmt.Errorf("context: %w", err)`.
67+
- Exit codes: `0` success, `1` error, `2` validation failure.
68+
- The `cli/` package uses injectable `NewRegistry` / `NewDetector` on `CommandContext` for test isolation.
69+
70+
## Dependencies
71+
72+
| Dependency | Purpose |
73+
|------------|---------|
74+
| `github.com/spf13/cobra` | CLI framework |
75+
| `gopkg.in/yaml.v3` | YAML frontmatter parsing |
76+
| `github.com/stretchr/testify` | Test assertions |
77+
78+
## Issue Tracking
79+
80+
Development is tracked using GitHub Issues via the `gh` CLI. Reference issues in commits as `#<number>`.
81+
82+
```sh
83+
gh issue list # List open issues
84+
gh issue create --title "Title" --body "" # Create a new issue
85+
gh issue view <number> # View issue details
86+
```
87+
88+
## Branching
89+
90+
Work is organized by milestone using feature branches:
91+
92+
- **Branch naming**: `feature/m<N>-<slug>` (e.g. `feature/m7-platform-registry`)
93+
- **Created from**: `main`
94+
- **Merged via**: pull request to `main`
95+
96+
See [AGENTS.md](https://github.com/devrimcavusoglu/skern/blob/main/AGENTS.md) in the repo root for the complete development guide.

0 commit comments

Comments
 (0)