clojure-namespace-architect

Align Clojure namespace declarations with snake_case file paths.

6|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/open-hax/opencode-skills --skill clojure-namespace-architect
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clojure-namespace-architect
Source: https://github.com/open-hax/opencode-skills/tree/main/.opencode/skills/clojure-namespace-architect
Command: npx skills add https://github.com/open-hax/opencode-skills --skill clojure-namespace-architect

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Resolves Clojure namespace-path mismatches and classpath errors by providing a single source of truth for mapping kebab-case namespaces to snake_case file paths, reducing load-time failures.

Core Features & Use Cases

  • Enforces the Dash-Underscore Convention: namespaces use dashes while file paths use underscores; prevents misalignment between code and structure.
  • Enforces the Source Root Rule: roots like src, test, and resources are not part of the namespace, preventing incorrect ns declarations.
  • Segment Mapping: each namespace segment maps to a directory level, with nested namespaces reflected in the directory structure.
  • Diagnostic Tools: includes an audit_clojure_ns utility to verify declared namespaces against file paths and suggest fixes.
  • Use Case: refactoring or creating Clojure files, diagnosing and correcting namespace declarations to match filesystem layout.

Quick Start

Run audit_clojure_ns on a Clojure source file to verify namespace-path alignment and apply the recommended fix.

Frequently Asked Questions about clojure-namespace-architect

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix a Clojure namespace mismatch causing FileNotFoundException?

A Clojure namespace mismatch causing FileNotFoundException happens when kebab-case namespace declarations do not align with snake_case file paths. Matching namespace segments to directory structures using dash-underscore convention rules resolves these load-time failures.

Why does my Clojure namespace declaration fail to load on the classpath?

Clojure namespace declarations fail to load on the classpath when source roots like src or test are incorrectly included in the namespace. Removing source roots from ns declarations and mapping each segment to its correct directory level fixes the path alignment.

How do I audit Clojure file paths against their namespace declarations?

You audit Clojure file paths against namespace declarations by running a diagnostic utility that verifies declared namespaces versus actual filesystem layout. The audit reports misalignments and proposes fixes enforcing the dash-underscore convention and segment-to-directory mapping rules.

What is the dash-underscore convention in Clojure projects?

The dash-underscore convention in Clojure projects requires namespaces to use dashes while corresponding file paths use underscores. This mapping rule prevents misalignment between code declarations and physical directory structures, reducing classpath errors during file loading.

Can I use this namespace audit workflow for Clojure projects using kebab-case and snake_case?

Yes, this namespace audit workflow specifically targets Clojure projects using kebab-case namespaces and snake_case file paths. It diagnoses common classpath errors and applies source-root handling and segment-to-directory mapping to verify and correct path alignment.