mirror of
https://github.com/waybarrios/opencode-power-pack.git
synced 2026-11-19 02:16:19 +00:00
docs(site): separate human and agent installation paths
This commit is contained in:
@@ -3,11 +3,12 @@ const copyButtons = document.querySelectorAll("[data-copy]");
|
||||
for (const button of copyButtons) {
|
||||
button.addEventListener("click", async () => {
|
||||
const value = button.dataset.copy;
|
||||
const copyLabel = button.dataset.copyLabel ?? "Command";
|
||||
const status = button.closest(".terminal-shell")?.querySelector(".copy-status");
|
||||
|
||||
try {
|
||||
await navigator.clipboard.writeText(value);
|
||||
if (status) status.textContent = "Command copied to clipboard.";
|
||||
if (status) status.textContent = `${copyLabel} copied to clipboard.`;
|
||||
const label = button.querySelector("b") ?? button;
|
||||
const original = label.textContent;
|
||||
label.textContent = "Copied";
|
||||
@@ -21,6 +22,34 @@ for (const button of copyButtons) {
|
||||
});
|
||||
}
|
||||
|
||||
const installTabs = [...document.querySelectorAll('[role="tab"][aria-controls]')];
|
||||
|
||||
function selectInstallTab(selectedTab, moveFocus = false) {
|
||||
for (const tab of installTabs) {
|
||||
const selected = tab === selectedTab;
|
||||
tab.setAttribute("aria-selected", String(selected));
|
||||
tab.tabIndex = selected ? 0 : -1;
|
||||
const panel = document.getElementById(tab.getAttribute("aria-controls"));
|
||||
if (panel) panel.hidden = !selected;
|
||||
}
|
||||
|
||||
if (moveFocus) selectedTab.focus();
|
||||
}
|
||||
|
||||
for (const [index, tab] of installTabs.entries()) {
|
||||
tab.addEventListener("click", () => selectInstallTab(tab));
|
||||
tab.addEventListener("keydown", (event) => {
|
||||
let targetIndex;
|
||||
if (event.key === "ArrowRight" || event.key === "ArrowDown") targetIndex = (index + 1) % installTabs.length;
|
||||
if (event.key === "ArrowLeft" || event.key === "ArrowUp") targetIndex = (index - 1 + installTabs.length) % installTabs.length;
|
||||
if (event.key === "Home") targetIndex = 0;
|
||||
if (event.key === "End") targetIndex = installTabs.length - 1;
|
||||
if (targetIndex === undefined) return;
|
||||
event.preventDefault();
|
||||
selectInstallTab(installTabs[targetIndex], true);
|
||||
});
|
||||
}
|
||||
|
||||
const filter = document.querySelector("#skill-filter");
|
||||
const skills = [...document.querySelectorAll("[data-skill]")];
|
||||
const filterStatus = document.querySelector("#filter-status");
|
||||
|
||||
+79
-18
@@ -212,26 +212,87 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<section class="terminal-shell" aria-label="Quick npm installation command">
|
||||
<div class="terminal-bar">
|
||||
<span>TERMINAL</span>
|
||||
<span>RECOMMENDED PROFILE</span>
|
||||
<div class="install-switcher">
|
||||
<div class="install-tabs" role="tablist" aria-label="Choose an installation method">
|
||||
<button
|
||||
id="human-install-tab"
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected="true"
|
||||
aria-controls="human-install-panel"
|
||||
>
|
||||
<span>01</span> Install it myself
|
||||
</button>
|
||||
<button
|
||||
id="agent-install-tab"
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected="false"
|
||||
aria-controls="agent-install-panel"
|
||||
tabindex="-1"
|
||||
>
|
||||
<span>02</span> Let my agent install it
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
class="copy-command"
|
||||
type="button"
|
||||
data-copy="npx @waybarrios/opencode-power-pack install --profile recommended"
|
||||
>
|
||||
<span class="copy-command-text">
|
||||
<small>Recommended profile</small>
|
||||
<code>npx @waybarrios/opencode-power-pack install --profile recommended</code>
|
||||
</span>
|
||||
<b>Copy</b>
|
||||
</button>
|
||||
<p class="copy-status" aria-live="polite"></p>
|
||||
</section>
|
||||
|
||||
<p class="hero-install-note">Installs a balanced skill pack for Claude Code, Codex, OpenCode, and Pi.</p>
|
||||
<section
|
||||
class="install-mode-panel"
|
||||
id="human-install-panel"
|
||||
role="tabpanel"
|
||||
aria-labelledby="human-install-tab"
|
||||
>
|
||||
<div class="terminal-shell" role="group" aria-label="Quick npm installation command">
|
||||
<div class="terminal-bar">
|
||||
<span>HUMAN INSTALL</span>
|
||||
<span>RECOMMENDED PROFILE</span>
|
||||
</div>
|
||||
<button
|
||||
class="copy-command"
|
||||
type="button"
|
||||
data-copy="npx @waybarrios/opencode-power-pack install --profile recommended"
|
||||
>
|
||||
<span class="copy-command-text">
|
||||
<small>Run this in your terminal</small>
|
||||
<code>npx @waybarrios/opencode-power-pack install --profile recommended</code>
|
||||
</span>
|
||||
<b>Copy</b>
|
||||
</button>
|
||||
<p class="copy-status" aria-live="polite"></p>
|
||||
</div>
|
||||
<p class="hero-install-note">You choose the profile, scope, and command.</p>
|
||||
</section>
|
||||
|
||||
<section
|
||||
class="install-mode-panel"
|
||||
id="agent-install-panel"
|
||||
role="tabpanel"
|
||||
aria-labelledby="agent-install-tab"
|
||||
hidden
|
||||
>
|
||||
<div class="terminal-shell" role="group" aria-label="Prompt for agent-assisted installation">
|
||||
<div class="terminal-bar">
|
||||
<span>AGENT INSTALL</span>
|
||||
<span>DRY RUN → INSTALL → VERIFY</span>
|
||||
</div>
|
||||
<button
|
||||
class="copy-command"
|
||||
type="button"
|
||||
data-copy-label="Agent prompt"
|
||||
data-copy="Install OpenCode Power Pack's recommended profile in this Git repository. Require Node.js 20 or newer. First run npx @waybarrios/opencode-power-pack install --profile recommended --project --dry-run and report the destination, selected skills, companions, and conflicts. If the preview is safe, run the same command without --dry-run. Do not use --force or modify package.json. Then verify the installed skills for the current host. If this is Claude Code, show me the two native plugin commands instead."
|
||||
>
|
||||
<span class="copy-command-text">
|
||||
<small>Paste this into your coding agent</small>
|
||||
<code>Preview the destination. Install the recommended pack. Verify every skill.</code>
|
||||
</span>
|
||||
<b>Copy prompt</b>
|
||||
</button>
|
||||
<p class="copy-status" aria-live="polite"></p>
|
||||
</div>
|
||||
<p class="hero-install-note">
|
||||
The agent follows a safe, project-local checklist. <a href="agent-install.md">Read its instructions.</a>
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<nav class="hero-routes" aria-label="Explore OpenCode Power Pack">
|
||||
<a href="docs/skills/">Browse all 54 skills <span aria-hidden="true">→</span></a>
|
||||
|
||||
+70
-1
@@ -264,6 +264,63 @@ code {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.install-switcher {
|
||||
width: min(100%, 48rem);
|
||||
}
|
||||
|
||||
.install-tabs {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 1px;
|
||||
margin-bottom: var(--space-3);
|
||||
border: 1px solid var(--line);
|
||||
background: var(--line);
|
||||
}
|
||||
|
||||
.install-tabs button {
|
||||
display: flex;
|
||||
gap: var(--space-3);
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 3.25rem;
|
||||
padding: var(--space-3) var(--space-4);
|
||||
border: 0;
|
||||
color: var(--muted);
|
||||
background: var(--ink-raised);
|
||||
font: inherit;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.install-tabs button span {
|
||||
color: var(--dim);
|
||||
}
|
||||
|
||||
.install-tabs button[aria-selected="true"] {
|
||||
color: var(--ink);
|
||||
background: var(--power);
|
||||
}
|
||||
|
||||
.install-tabs button[aria-selected="true"] span {
|
||||
color: #4a3d00;
|
||||
}
|
||||
|
||||
.install-tabs button:focus-visible {
|
||||
outline: 2px solid var(--paper);
|
||||
outline-offset: -4px;
|
||||
}
|
||||
|
||||
.install-mode-panel[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.install-mode-panel .terminal-shell {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.terminal-bar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@@ -367,13 +424,17 @@ code {
|
||||
}
|
||||
|
||||
.hero-install-note {
|
||||
margin: -0.5rem 0 0;
|
||||
margin: var(--space-3) 0 0;
|
||||
color: var(--muted);
|
||||
font-size: 0.72rem;
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.hero-install-note a {
|
||||
color: var(--power);
|
||||
}
|
||||
|
||||
.hero-routes {
|
||||
display: flex;
|
||||
max-width: 55rem;
|
||||
@@ -974,6 +1035,14 @@ code {
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.install-tabs {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.install-tabs button {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.proof-strip {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user