Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions src/components/SkillInstallTabs.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
/**
* Shell picker for the skill-install commands, shared by /start and /skill.
* CSS-only: radios drive which panel shows, so the tabs work without
* JavaScript and stay keyboard-operable (arrow keys switch). Radio ids are
* page-unique as long as the component appears once per page.
*/
---

<div class="shell-tabs">
<input type="radio" name="skill-shell" id="skill-shell-bash" checked />
<input type="radio" name="skill-shell" id="skill-shell-cmd" />
<input type="radio" name="skill-shell" id="skill-shell-powershell" />
<div class="shell-tab-labels">
<label for="skill-shell-bash">bash</label>
<label for="skill-shell-cmd">cmd</label>
<label for="skill-shell-powershell">PowerShell</label>
</div>
<div class="shell-panel" data-shell="bash">
<pre><code>mkdir -p .claude/skills/pegma
curl -fsSL https://pegma.dev/skill.md -o .claude/skills/pegma/SKILL.md</code></pre>
<pre><code>mkdir -p .grok/skills/pegma
curl -fsSL https://pegma.dev/skill.md -o .grok/skills/pegma/SKILL.md</code></pre>
</div>
<div class="shell-panel" data-shell="cmd">
<pre><code>mkdir .claude\skills\pegma
curl -fsSL https://pegma.dev/skill.md -o .claude\skills\pegma\SKILL.md</code></pre>
<pre><code>mkdir .grok\skills\pegma
curl -fsSL https://pegma.dev/skill.md -o .grok\skills\pegma\SKILL.md</code></pre>
</div>
<div class="shell-panel" data-shell="powershell">
<pre><code>New-Item -ItemType Directory -Force .claude\skills\pegma
curl.exe -fsSL https://pegma.dev/skill.md -o .claude\skills\pegma\SKILL.md</code></pre>
<pre><code>New-Item -ItemType Directory -Force .grok\skills\pegma
curl.exe -fsSL https://pegma.dev/skill.md -o .grok\skills\pegma\SKILL.md</code></pre>
<p class="form-note">
<code>curl.exe</code> on purpose: in Windows PowerShell 5.1,
plain <code>curl</code> is an alias for <code>Invoke-WebRequest</code>
and rejects these flags.
</p>
</div>
</div>

<style>
.shell-tabs {
margin: 1rem 0 1.5rem;
}

.shell-tabs > input[type='radio'] {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
clip-path: inset(50%);
overflow: hidden;
}

.shell-tab-labels {
display: flex;
gap: 0.25rem;
border-bottom: 1px solid var(--line);
}

.shell-tab-labels label {
padding: 0.35rem 0.9rem;
font-size: 0.9rem;
font-weight: 650;
color: var(--slate);
cursor: pointer;
border: 1px solid transparent;
border-bottom: none;
border-radius: 0.4rem 0.4rem 0 0;
margin-bottom: -1px;
}

#skill-shell-bash:checked ~ .shell-tab-labels label[for='skill-shell-bash'],
#skill-shell-cmd:checked ~ .shell-tab-labels label[for='skill-shell-cmd'],
#skill-shell-powershell:checked
~ .shell-tab-labels
label[for='skill-shell-powershell'] {
color: var(--ink);
background: var(--paper);
border-color: var(--line);
border-bottom: 1px solid var(--paper);
}

#skill-shell-bash:focus-visible ~ .shell-tab-labels label[for='skill-shell-bash'],
#skill-shell-cmd:focus-visible ~ .shell-tab-labels label[for='skill-shell-cmd'],
#skill-shell-powershell:focus-visible
~ .shell-tab-labels
label[for='skill-shell-powershell'] {
outline: 2px solid var(--ink);
outline-offset: -2px;
}

.shell-panel {
display: none;
}

#skill-shell-bash:checked ~ .shell-panel[data-shell='bash'],
#skill-shell-cmd:checked ~ .shell-panel[data-shell='cmd'],
#skill-shell-powershell:checked ~ .shell-panel[data-shell='powershell'] {
display: block;
}
</style>
7 changes: 2 additions & 5 deletions src/pages/skill.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import Base from '../layouts/Base.astro';
import SkillInstallTabs from '../components/SkillInstallTabs.astro';
---

<Base
Expand Down Expand Up @@ -36,11 +37,7 @@ import Base from '../layouts/Base.astro';
<code>.claude/skills/pegma/SKILL.md</code>, <code>.agents/skills/pegma/SKILL.md</code>,
or a project <code>AGENTS.md</code> / rules file that points at the same text).
</p>
<pre><code>mkdir -p .grok/skills/pegma
curl -fsSL https://pegma.dev/skill.md -o .grok/skills/pegma/SKILL.md
# or
mkdir -p .claude/skills/pegma
curl -fsSL https://pegma.dev/skill.md -o .claude/skills/pegma/SKILL.md</code></pre>
<SkillInstallTabs />
<p>
Many tools treat a directory containing <code>SKILL.md</code> (with YAML
frontmatter) as an installable skill. Keep the frontmatter; do not strip it.
Expand Down
100 changes: 2 additions & 98 deletions src/pages/start.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import Base from '../layouts/Base.astro';
import SkillInstallTabs from '../components/SkillInstallTabs.astro';
---

<Base
Expand Down Expand Up @@ -38,39 +39,7 @@ import Base from '../layouts/Base.astro';
containing <code>SKILL.md</code> (with YAML frontmatter — keep it) as an
installable skill. From your project root:
</p>
<div class="shell-tabs">
<input type="radio" name="skill-shell" id="skill-shell-bash" checked />
<input type="radio" name="skill-shell" id="skill-shell-cmd" />
<input type="radio" name="skill-shell" id="skill-shell-powershell" />
<div class="shell-tab-labels">
<label for="skill-shell-bash">bash</label>
<label for="skill-shell-cmd">cmd</label>
<label for="skill-shell-powershell">PowerShell</label>
</div>
<div class="shell-panel" data-shell="bash">
<pre><code>mkdir -p .claude/skills/pegma
curl -fsSL https://pegma.dev/skill.md -o .claude/skills/pegma/SKILL.md</code></pre>
<pre><code>mkdir -p .grok/skills/pegma
curl -fsSL https://pegma.dev/skill.md -o .grok/skills/pegma/SKILL.md</code></pre>
</div>
<div class="shell-panel" data-shell="cmd">
<pre><code>mkdir .claude\skills\pegma
curl -fsSL https://pegma.dev/skill.md -o .claude\skills\pegma\SKILL.md</code></pre>
<pre><code>mkdir .grok\skills\pegma
curl -fsSL https://pegma.dev/skill.md -o .grok\skills\pegma\SKILL.md</code></pre>
</div>
<div class="shell-panel" data-shell="powershell">
<pre><code>New-Item -ItemType Directory -Force .claude\skills\pegma
curl.exe -fsSL https://pegma.dev/skill.md -o .claude\skills\pegma\SKILL.md</code></pre>
<pre><code>New-Item -ItemType Directory -Force .grok\skills\pegma
curl.exe -fsSL https://pegma.dev/skill.md -o .grok\skills\pegma\SKILL.md</code></pre>
<p class="form-note">
<code>curl.exe</code> on purpose: in Windows PowerShell 5.1,
plain <code>curl</code> is an alias for <code>Invoke-WebRequest</code>
and rejects these flags.
</p>
</div>
</div>
<SkillInstallTabs />
<p>
Tools that use a generic agent directory follow the same shape, for
example <code>.agents/skills/pegma/SKILL.md</code>.
Expand Down Expand Up @@ -162,68 +131,3 @@ Do not invent passwords.</code></pre>
</p>
</section>
</Base>

<style>
/* CSS-only shell picker: radios drive which panel shows, so the tabs work
without JavaScript and stay keyboard-operable (arrow keys switch). */
.shell-tabs {
margin: 1rem 0 1.5rem;
}

.shell-tabs > input[type='radio'] {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
clip-path: inset(50%);
overflow: hidden;
}

.shell-tab-labels {
display: flex;
gap: 0.25rem;
border-bottom: 1px solid var(--line);
}

.shell-tab-labels label {
padding: 0.35rem 0.9rem;
font-size: 0.9rem;
font-weight: 650;
color: var(--slate);
cursor: pointer;
border: 1px solid transparent;
border-bottom: none;
border-radius: 0.4rem 0.4rem 0 0;
margin-bottom: -1px;
}

#skill-shell-bash:checked ~ .shell-tab-labels label[for='skill-shell-bash'],
#skill-shell-cmd:checked ~ .shell-tab-labels label[for='skill-shell-cmd'],
#skill-shell-powershell:checked
~ .shell-tab-labels
label[for='skill-shell-powershell'] {
color: var(--ink);
background: var(--paper);
border-color: var(--line);
border-bottom: 1px solid var(--paper);
}

#skill-shell-bash:focus-visible ~ .shell-tab-labels label[for='skill-shell-bash'],
#skill-shell-cmd:focus-visible ~ .shell-tab-labels label[for='skill-shell-cmd'],
#skill-shell-powershell:focus-visible
~ .shell-tab-labels
label[for='skill-shell-powershell'] {
outline: 2px solid var(--ink);
outline-offset: -2px;
}

.shell-panel {
display: none;
}

#skill-shell-bash:checked ~ .shell-panel[data-shell='bash'],
#skill-shell-cmd:checked ~ .shell-panel[data-shell='cmd'],
#skill-shell-powershell:checked ~ .shell-panel[data-shell='powershell'] {
display: block;
}
</style>
Loading