This skill should be used when the user asks to "audit libraries", "check library conventions", "validate lib structure", "find convention violations", "review library organization", or wants to verify that existing libraries follow the _.ts/__.ts namespace pattern correctly. Identifies and reports violations.
/plugin marketplace add jasonkuhrt/claude-marketplace/plugin install library-standards@jasonkuhrtThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Analyze existing libraries for convention violations and report issues.
The authoritative convention documents are:
~/.claude/docs/conventions/namespace-module.md — Core _.ts/__.ts pattern~/.claude/docs/conventions/library-local.md — Local library context (src/lib/)~/.claude/docs/conventions/library-package.md — Package-level contextRead these before auditing to understand the full rules.
Check a specific library for violations.
Steps:
_.ts content__.ts content (if exists)Scan project for all libraries and check each.
Steps:
_.ts filessrc/lib/*, package lib at src/*)After auditing, fix identified issues.
Steps:
| Violation | Description | Fix |
|---|---|---|
Missing _.ts | Library has no namespace module | Create _.ts with correct export |
Missing __.ts | Multiple impl files but no barrel | Create __.ts with re-exports |
Extra __.ts | Single impl file with barrel | Remove __.ts, update _.ts |
| Wrong location | Library not in src/lib/ | Move to correct location |
_.ts) Violations| Violation | Description | Fix |
|---|---|---|
| Wrong export target | Points to wrong file | Fix export path |
| Has imports | Contains import statements | Remove imports |
| Wrong namespace name | Doesn't match directory | Fix namespace name |
| Missing barrel reference | Has __.ts but exports from impl | Change to from './__.js' |
__.ts) Violations| Violation | Description | Fix |
|---|---|---|
Imports from _.ts | Circular dependency | Remove import |
| Value imports | Has import { x } not re-export | Convert to export { x } from |
| External imports | Imports from outside library | Move to code module |
| Parent imports | Imports from ../ | Remove or restructure |
| Violation | Description | Fix |
|---|---|---|
| Destructured namespace | import { Foo } from '#lib' | Use import { Lib } from '#lib' then Lib.Foo |
| Self namespace import | Code imports own _.ts | Use relative imports |
| Self barrel import | Code imports own __.ts | Use relative imports |
| Relative cross-lib | import from '../other-lib' | Use #other-lib |
| Violation | Description | Fix |
|---|---|---|
| Wrong import | Test imports from impl file | Import from ./_.js |
| Destructured | Test destructures namespace | Use namespace directly |
| Missing fixture namespace | Fixture doesn't export Fx | Add export namespace Fx |
## Library: <name>
### Structure
* [ ] Located at correct path (src/lib/<name>/ or src/<name>/)
* [ ] Has _.ts namespace module
* [ ] Has __.ts barrel (if multiple impl files)
* [ ] No __.ts (if single impl file)
### Namespace Module (_.ts)
* [ ] Correct export pattern
* [ ] Namespace name matches directory (PascalCase)
* [ ] No import statements
* [ ] Points to __.ts (if exists) or impl file
### Barrel Module (__.ts) - if exists
* [ ] Only contains re-exports
* [ ] No imports from _.ts
* [ ] No external package imports
* [ ] All exports from local files
### Code Modules
* [ ] No imports from own _.ts
* [ ] No imports from own __.ts
* [ ] Cross-lib imports use #<name>
* [ ] Sibling imports use relative paths
### Tests (_.test.ts)
* [ ] Imports from ./_.js only
* [ ] Uses namespace, no destructuring
* [ ] No top-level describe wrapping all tests
### Config
* [ ] package.json has imports entry
* [ ] tsconfig.json has paths entry
Library: src/lib/parser/
VIOLATIONS FOUND: 3
1. [NAMESPACE] _.ts has wrong export
Current: export * from './parser.js'
Expected: export * as Parser from './__.js'
Reason: __.ts exists, so _.ts must export namespace from barrel
2. [IMPORT] tokenizer.ts imports from own namespace
Line 3: import { Parser } from './_.js'
Fix: Use relative import: import { helper } from './helper.js'
3. [TEST] _.test.ts destructures namespace
Line 1: import { tokenize, lex } from './_.js'
Fix: import { Parser } from './_.js' then use Parser.tokenize
/fix-conventions command for automated fixingThis skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.