원클릭으로
sk-code
Multi-stack coding standards and verification. Smart router auto-detects the active surface and loads matching code patterns.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Multi-stack coding standards and verification. Smart router auto-detects the active surface and loads matching code patterns.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Routes non-trivial requests to matching skills through standalone MCP metadata and stable advisor tool ids.
Unified spec-folder workflow + context preservation: Levels 1-3+, validation, Spec Kit Memory. Required for file modifications.
OpenCode CLI orchestrator: external dispatch, in-OpenCode parallel sessions, cross-AI handback with full runtime context.
Shared deep-loop runtime: executor + prompt-pack + validation + atomic state + coverage-graph + Bayesian scoring + fallback routing.
Iterative codebase-context-gathering deep loop. Runs a configurable pool over a shared scope in parallel (native-only by default; optional heterogeneous CLI seats) and synthesizes a reuse-first Context Report for planning/implementation. Use before /speckit:plan or /speckit:implement to map existing code, integration points, and conventions.
Unified deep-loop workflow skill: routes a request to one of five modes (context, research, review, ai-council, improvement) over the shared deep-loop-runtime backend. Holds no per-mode logic — it dispatches by workflowMode through mode-registry.json. Use for codebase-context gathering, autonomous research, iterative code review, multi-seat AI Council planning, and evaluator-first agent/model/skill/non-dev-system improvement.
| name | sk-code |
| description | Multi-stack coding standards and verification. Smart router auto-detects the active surface and loads matching code patterns. |
| allowed-tools | ["Bash","Edit","Glob","Grep","Read","Task","Write"] |
| version | 3.5.0.0 |
sk-code is the single code-work skill. It first decides which code surface is in front of it, then loads the right implementation, quality, debugging, and verification resources.
Core principle: Code surface detection -> Intent classification -> Surface resources -> Verification evidence.
Use this skill when doing code work in either supported surface:
.opencode/, including skills, agents, commands, MCP servers, hooks, scripts, tests, JSON/JSONC config, TypeScript, JavaScript, Python, and Shell.Also use this skill for cross-stack Motion.dev reference work when the question is about Motion APIs, snippets, integration modes, performance pitfalls, or CSS/Motion/GSAP/WAAPI trade-offs that should live in references/motion_dev/ or assets/motion_dev/ rather than inside Webflow-only guidance.
Use it for implementation, code quality, debugging, verification, test failures, build failures, and before any completion claim.
Do not use this skill for documentation-only changes (sk-doc), git workflow (sk-git), pure browser inspection (mcp-chrome-devtools), or formal findings-first review output (sk-code-review baseline plus this skill's surface evidence).
Documentation-only edits to skill markdown route to sk-doc, even when the file lives under .opencode/skills/. Examples: updating a SKILL.md headline, clarifying a README paragraph, rewriting a description section, or adding a one-line summary at the top of a markdown file. Negative example: "Update the sk-code SKILL.md headline section to clarify the two-axis routing model and add a one-line summary" is sk-doc, not sk-code, because the requested change is prose-only and does not modify executable behavior or routing logic.
| Phase | Purpose | Requirement |
|---|---|---|
| Phase 0: Research | Understand unfamiliar code or risky changes | Optional, but required for complex work |
| Phase 1: Implementation | Write or modify code using surface patterns | Read actual files first; apply the Design Restraint Ladder before writing new code. |
| Phase 1.5: Code Quality Gate | Apply P0/P1/P2 checks and surface standards | Required before claiming implementation done |
| Phase 2: Debugging | Trace symptom to root cause and fix one cause at a time | Required when tests/runtime fail |
| Phase 3: Verification | Run surface verification commands and record evidence | Required before any done/works claim |
Iron Law: no completion claim without fresh verification evidence from the detected surface.
Baseline & blast-radius: before Phase 1, capture the starting gate state (pass/fail counts + the names of failing tests, base commit) so Phase 3 reports the delta, not just a green — a green suite says nothing about a path it never ran. Open non-trivial work with a one-phrase blast-radius read ("low-blast, reversible" / "high-blast: touches auth + data") so effort matches stakes.
sk-code-review owns findings format, severity model, and baseline security/quality/test review. sk-code owns surface detection and surface-specific standards evidence.
When called from /speckit:complete with an .opencode/ implementation target (step_10_development activity), sk-code surfaces the matching authoring checklist plus the spec_folder_write recipe AT WRITE-TIME (before the orchestrator's first write), not just at review-time.
| Target Path | Authoring Checklist Surfaced | Recipe |
|---|---|---|
.opencode/skills/ | assets/opencode/checklists/skill_authoring.md | — |
.opencode/agents/ | assets/opencode/checklists/agent_authoring.md | — |
.opencode/commands/ | assets/opencode/checklists/command_authoring.md | — |
.opencode/specs/ | assets/opencode/checklists/spec_folder_authoring.md | assets/opencode/recipes/spec_folder_write.md |
| MCP server source | assets/opencode/checklists/mcp_server_authoring.md | — |
Authoring-time load is the contract documented in system-spec-kit/SKILL.md §16-17 cross-skill routing and the cross_skill_authoring_load block in /speckit:complete YAMLs. Review-time sk-code-review baseline + sk-code router-selected evidence overlay remains unchanged.
Detection is context-aware and uses CWD plus changed/target files. Precedence: OPENCODE target/CWD wins over WEBFLOW markers (because mixed-marker workspaces are common — .opencode/ system tools sometimes ship frontend animation libraries internally). When neither matches, fall through to UNKNOWN.
Machine-readable stack folder contract:
STACK_FOLDERS = {
"WEBFLOW": ["src/2_javascript/", "*.webflow.js"],
"OPENCODE": [".opencode/skills/", ".opencode/agents/", ".opencode/commands/", ".opencode/specs/"],
"MOTION_DEV": ["references/motion_dev/", "assets/motion_dev/"],
}
# Use early-return precedence — never let later branches overwrite an earlier match.
# 1. OPENCODE - takes precedence: CWD or any changed/target file under .opencode/
if [[ "$PWD" == */.opencode/* ]] \
|| [[ "$TARGET_FILE" == */.opencode/* ]]; then
SURFACE="OPENCODE"
# 2. Explicit non-Webflow guard - a prompt can ask for Motion.dev cross-stack
# guidance without making the implementation surface WEBFLOW.
elif printf '%s\n' "${PROMPT_TEXT:-}" | grep -Eiq \
'(^|[^[:alnum:]])(not webflow|no webflow designer|without webflow|non-webflow|vanilla html/css/js only|vanilla html css js only|stack-agnostic)([^[:alnum:]]|$)'; then
SURFACE="UNKNOWN"
# 3. WEBFLOW - frontend HTML/CSS/JS and Webflow-specific vanilla animation web
elif [[ -d "src/2_javascript" ]] \
|| ls *.webflow.js 2>/dev/null | head -1 \
|| grep -lq "Webflow\.push\|--vw-" src/**/*.{js,css,html} 2>/dev/null \
|| grep -lqE "window\.Motion|window\.gsap|gsap\.(to|from|set|timeline|registerPlugin)|new Lenis|new Hls|new Swiper|FilePond" \
src/**/*.{js,mjs,ts,html} *.{js,mjs,ts,html} 2>/dev/null \
|| [[ -f "wrangler.toml" ]]; then
SURFACE="WEBFLOW"
# 4. UNKNOWN - not owned by this skill; ask for runtime + verification commands
else
SURFACE="UNKNOWN"
fi
Why OPENCODE wins precedence: .opencode/skills/sk-doc/scripts/preview-server.js is an OPENCODE system tool that may import vanilla animation libraries (Lenis, GSAP) for its preview UI. A first-match-WEBFLOW pseudocode would route this OPENCODE work to the wrong standards. The target/CWD path is the strongest unambiguous signal of which surface owns the work.
Supported surfaces:
WEBFLOW: frontend HTML/CSS/JS, Webflow conventions, vanilla animation libraries, CDN/minification, and browser evidence.OPENCODE: .opencode/ system code and config with language sub-detection.UNKNOWN: ask a short disambiguation question and do not pretend unsupported stacks are covered.For details: references/stack_detection.md.
Returned when no supported surface matches, when intent confidence is low (max(intent_scores) < 0.5), or when the user explicitly asks for stack-agnostic guidance. Ask for the missing routing inputs instead of guessing:
.opencode/ system code.Do not load Go / Next.js / React Native / Swift resources — canonical sk-code owns only WEBFLOW + OPENCODE + MOTION_DEV. Full fallback logic: references/smart_routing.md §8.
TASK CONTEXT
|
+- STEP 0: Detect surface from CWD + target files (primary routing key)
| +- references/<surface>/ (webflow / opencode)
| +- assets/<surface>/ (webflow / opencode)
|
+- STEP 1: Detect language sub-key (OPENCODE only) for verification commands
|
+- STEP 2: Weighted intent scoring (top-2 when ambiguity delta is small)
|
+- Phase 1: Implementation -> per-language style + standards + implementation trio
+- Phase 2: Debugging -> debugging refs + universal error recovery
+- Phase 3: Verification -> surface-appropriate verification commands + checklist
The Iron Law: NO COMPLETION CLAIMS WITHOUT RUNNING SURFACE-APPROPRIATE VERIFICATION.
Phase contract details: references/phase_detection.md.
When surface is OPENCODE, detect language from changed/target file extensions first, then weighted keywords:
| Language | Extensions / Signals | Resources |
|---|---|---|
| JAVASCRIPT | .js, .mjs, .cjs, CommonJS, Node, MCP | references/opencode/javascript/* |
| TYPESCRIPT | .ts, .tsx, .mts, .d.ts, tsconfig, interfaces | references/opencode/typescript/* |
| PYTHON | .py, pytest, argparse, docstrings | references/opencode/python/* |
| SHELL | .sh, .bash, shebang, pipefail | references/opencode/shell/* |
| CONFIG | .json, .jsonc, schema, descriptor | references/opencode/config/* |
Ambiguous multi-language tasks load the top matching language references plus the universal OpenCode checklist.
references/universal/: surface-agnostic error recovery, code quality, style, and research guidance.references/: detection, intent scoring, loading, and lifecycle internals.references/webflow/, assets/webflow/: live Webflow/frontend per-language references under references/webflow/{javascript,css,html}/* — JS and CSS each carry style_guide.md, quality_standards.md, quick_reference.md; CSS additionally carries patterns.md (Webflow tokens, state machines, focus/form patterns); HTML carries style_guide.md only (Webflow Designer manages most HTML). Cross-language rules + enforcement workflow + dev workflow live under references/webflow/shared/*. Categorical workflow patterns (implementation, debugging, verification, performance, deployment) and copy-paste templates (assets/webflow/templates/component_template.{js,css}) round out the surface. Mirrors the OPENCODE per-language layout so the smart router resolves both surfaces with identical key-derived patterns.references/motion_dev/, assets/motion_dev/: cross-stack Motion.dev API, timeline, scroll/gesture, performance, decision-matrix, integration, install, playbook hook, and snippet resources. Webflow docs link here for generic Motion details while keeping Webflow-CDN and Designer guidance in references/webflow/.references/opencode/, assets/opencode/: OpenCode system-code language standards, shared patterns, hooks, alignment automation, and quality checklists.assets/webflow/scripts/: Webflow build, minification, and runtime verification utilities.assets/scripts/: Cross-surface helper scripts, including the OpenCode alignment verifier.Loading follows the canonical three levels; the finer ALWAYS / SURFACE / INTENT / LANGUAGE / ON_DEMAND tiers live in references/smart_routing.md §3.
| Level | When to Load | Resources |
|---|---|---|
| ALWAYS | Every sk-code invocation | references/stack_detection.md, references/smart_routing.md, references/phase_detection.md, and the references/universal/ quality + error-recovery baseline |
| CONDITIONAL | After surface + intent (and OPENCODE language) detection | the detected references/<surface>/ + assets/<surface>/ trees, the matching language standards, intent-mapped resources, the authoring checklists below, and references/motion_dev/ for MOTION_DEV intent |
| ON_DEMAND | Only on an explicit deep-dive request | extended checklists and niche references, plus the full INTENT_MODEL / RESOURCE_MAP in references/smart_routing.md |
| Resource | Path | When to load |
|---|---|---|
| skill_authoring | assets/opencode/checklists/skill_authoring.md | CONDITIONAL (intent: authoring new skill) |
| agent_authoring | assets/opencode/checklists/agent_authoring.md | CONDITIONAL (intent: authoring new agent) |
| command_authoring | assets/opencode/checklists/command_authoring.md | CONDITIONAL (intent: authoring new command) |
| mcp_server_authoring | assets/opencode/checklists/mcp_server_authoring.md | CONDITIONAL (intent: authoring MCP server) |
| spec_folder_authoring | assets/opencode/checklists/spec_folder_authoring.md | CONDITIONAL (intent: spec folder write) |
| spec_folder_write recipe | assets/opencode/recipes/spec_folder_write.md | CONDITIONAL (intent: spec folder write) |
After surface detection, score task text for intents: IMPLEMENTATION, CODE_QUALITY, DEBUGGING, VERIFICATION, TESTING, DEPLOYMENT, PERFORMANCE, ANIMATION, MOTION_DEV, FORMS, VIDEO, API, HOOKS, CONFIG, and LANGUAGE_STANDARDS.
Top intent always loads. A close second intent also loads when scores are within the ambiguity threshold.
MOTION_DEV is a resource intent, not a third code surface. It loads references/motion_dev/ and assets/motion_dev/ for cross-stack Motion questions after WEBFLOW/OPENCODE/UNKNOWN surface handling has established where implementation work is happening.
| Surface | Required verification evidence |
|---|---|
| WEBFLOW | node .opencode/skills/sk-code/assets/webflow/scripts/minify-webflow.mjs, node .opencode/skills/sk-code/assets/webflow/scripts/verify-minification.mjs, node .opencode/skills/sk-code/assets/webflow/scripts/test-minified-runtime.mjs, plus desktop/mobile browser console clean evidence when runtime behavior changes |
| OPENCODE | python3 .opencode/skills/sk-code/assets/scripts/verify_alignment_drift.py --root <changed-scope>, plus targeted language/project tests such as vitest, pytest, shellcheck, JSON validation, or spec validation for changed spec folders |
| UNKNOWN | User-selected verification command set before completion claim |
Apply these alongside the commands above, scaled to blast radius:
Smart Router pseudocode (full implementation): see references/smart_routing.md for the authoritative INTENT_MODEL, RESOURCE_MAP, load tiers, and surface→intent routing logic.
references/motion_dev/ as the cross-stack peer reference and keep Webflow-specific CDN guidance in references/webflow/..opencode/ context from CWD or target files..opencode/skills/sk-code/scripts/check-comment-hygiene.sh <file> on each modified file before committing. Zero violations required. Three automatic enforcement gates also run independently: scripts/hooks/claude-posttooluse.sh (write-time warning, Claude Code), .opencode/hooks/pre-commit (commit-time block, all runtimes), and .github/workflows/comment-hygiene.yml (CI gate, all PRs).sk-code-review for formal findings-first review; use this skill for standards evidence.Ask for the runtime surface and required verification commands. Do not route generic Node.js, React Native, Swift, Go, or Next.js as supported unless a future route is explicitly added to sk-code.
verify_alignment_drift.py on the changed scope..opencode/ system code.sk-code-review: findings-first review baseline; pair with sk-code surface evidence.system-spec-kit: spec folder gates, validation, memory, and context preservation.mcp-chrome-devtools: browser evidence for Webflow/frontend runtime behavior.sk-doc: markdown/documentation quality.sk-git: commits, branches, PRs, and finish workflow.Start with references/stack_detection.md, references/smart_routing.md, references/smart_routing.md, and references/phase_detection.md. Then load references/webflow/** or references/opencode/** based on detected surface.
Scripts: .opencode/skills/sk-code/assets/webflow/scripts/minify-webflow.mjs, .opencode/skills/sk-code/assets/webflow/scripts/verify-minification.mjs, .opencode/skills/sk-code/assets/webflow/scripts/test-minified-runtime.mjs, .opencode/skills/sk-code/assets/scripts/verify_alignment_drift.py, .opencode/skills/sk-code/assets/scripts/test_verify_alignment_drift.py.