Command Palette

Search for a command to run...

Back to skills
skill № 09871

constraint-scaffold

This skill should be used when generating the Layer 1 dependency-cruiser import-boundary gate (client modules importing server secrets) into a Next.js product…

FreeRuns bundled scripts
jikig-aiby jikig-ai★ 21 GitHub stars

Install constraint-scaffold in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

Grok Build (plugins/soleur/lib/harness.ts invokeSkill()): Read this SKILL.md in this process and run it to completion. A one-segment soleur:<name> in this document names a SKILL — on Grok Build, Read plugins/soleur/skills/<name>/SKILL.md in this process; it is not a nested tool_use. A multi-segment id such as soleur:<domain>:<name> names an AGENT: spawn it, never Read it, and on Grok Build spawn_subagent takes the id with its colons replaced by hyphens (agentIdToGrokSubagentType). Claude Code: Skill tool for a skill (soleur:<name>), Task tool with subagent_type for an agent. Forbidden is executing a subset, not the Read.

constraint-scaffold

Generates one deterministic, no-LLM Layer-1 structural gate into a Next.js product codebase: a dependency-cruiser import-boundary gate that fails closed when a "use client" module takes a value (non-type-only) import on the server-only tree (server/**) — i.e. a server secret leaking into the browser bundle. The gate runs in CI and rejects the violation before the LLM-judged review layer (soleur:review). See ADR-071 (mechanism = Option D) and knowledge-base/project/plans/archive/20261013-032858-2026-06-30-feat-constraint-scaffold-l1-gate-generator-plan.md.

This gate covers this one boundary only, CI-only, Next.js-only. It catches BOTH direct client→server-secret value imports AND transitive ones (a "use client" module reaching a server secret through a chain of value imports, e.g. a non-client lib/ helper) — the transitive reachable rule was added in the 2026-07-01 #5777 amendment (ADR-071 §Amendment). Naming / contract / pre-commit / multi-stack coverage remain deferred (ADR-071 Consequences).

Agent-owns-gates recovery model (load-bearing)

The gate is fail-closed, and the target user is a non-technical founder who can never hand-edit a .cjs config, a baseline, or a workflow. So the agent — never the founder — owns gate maintenance and recovery:

  1. The agent authors and maintains the gate. The founder never touches .dependency-cruiser.cjs, .dependency-cruiser-known-violations.json, the shared runner, or the workflow.
  2. When the agent's own change trips the gate:
    • real leak → the agent fixes the offending import;
    • legitimate new cross-boundary import → the agent runs constraint-scaffold.sh --refresh-baseline (clean-tree + origin/main merge-base capture, so a same-PR violation is never grandfathered); the baseline diff is PR-reviewable.
  3. In-code escape hatch (agent-owned, used sparingly): dependency-cruiser's native // dependency-cruiser-disable-next-line comment on the importing line.
  4. Founder hotfix with no agent in the loop (the brand-survival deadlock). A GitHub-web hotfix or a machine without the repo tooling can trip the gate with no agent present. Recovery is automatic and zero-touch: the two-stage auto-recovery dispatcher (fix-constraints-stage-a → fix-constraints-stage-b, ADR-074) fires on the PR, fixes the offending import, and opens a draft follow-up PR the founder can merge — no comment, no command, no agent-in-the-loop required. (A real leak the agent cannot fix is surfaced for a maintainer; auto-recovery is fix-only and never grows the suppression baseline.) The gate stays informational / non-blocking — it is NOT promoted to a required check (promotion is now blocked only on #5778; the #5791 dispatcher half is satisfied by ADR-074), so it cannot deadlock a founder hotfix. No override label, no .cjs edit, no second human required.
  5. The founder is never required to read or unblock the gate.

Usage

Generate the gate into apps/web-platform (default mode — detect Next.js, require app/, components/ and server/ to exist under the target, emit config + shared runner + CI workflow, capture the initial baseline, prove the gate bites (see Bite-proof below), then write the boundary README and the agent-instructions pointer last). Non-destructive: refuses to overwrite an existing .cjs, runner, or workflow (there is no --force); only two artifacts are ever re-written: the baseline JSON via --refresh-baseline, and the Stage A auto-recovery workflow via --refresh-stage-a (below); the README block and the pointer line are append-once (marker-keyed, never rewritten):

bash "${CLAUDE_PLUGIN_ROOT}/skills/constraint-scaffold/scripts/constraint-scaffold.sh"

Refresh the baseline after a legitimate new cross-boundary import (agent-only; clean tree required; captures against the origin/main merge-base). Refresh mode runs the bite-proof too — it catches config/runner drift a baseline entry can never grandfather (a rule soft

Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

  • references/boundary-readme.template
  • references/constraint-gates-workflow.template
  • references/depcruise-config.template
  • references/fix-constraints-stage-a.emitted.sha256
  • references/fix-constraints-stage-a.template
  • references/fix-constraints-stage-b.template
  • references/shared-runner.template
  • scripts/constraint-scaffold.sh

FAQ

What does the constraint-scaffold skill do?

This skill should be used when generating the Layer 1 dependency-cruiser import-boundary gate (client modules importing server secrets) into a Next.js product codebase's CI.

How do I install the constraint-scaffold skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the constraint-scaffold skill run scripts?

Yes, this skill bundles executable scripts. Review the source before installing.

Related skills

Compare constraint-scaffold with