pasika 0.1.0 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -25
- package/claude/hooks/.vulyk +3 -0
- package/claude/hooks/AGENTS.md +3 -0
- package/claude/hooks/claude-hooks.md +30 -0
- package/claude/{.claude/hooks → hooks}/notification.sh +0 -0
- package/claude/{.claude/hooks → hooks}/protect-files.sh +0 -0
- package/claude/scripts/render-settings.ts +25 -9
- package/dist/claude/scripts/render-settings.js +22 -9
- package/dist/eslint/pasika/index.d.ts +2 -0
- package/dist/eslint/pasika/index.js +14 -0
- package/dist/eslint/pasika/rules/organization-imports.d.ts +2 -0
- package/dist/eslint/pasika/rules/organization-imports.js +124 -0
- package/docs/agent-conventions.md +21 -0
- package/docs/code-organization-guide/code-organization-guide.md +65 -0
- package/docs/code-organization-guide/references/application-architecture-reference.md +107 -0
- package/docs/code-organization-guide/rules/component-placement-rule.md +135 -0
- package/docs/code-organization-guide/rules/configuration-rule.md +42 -0
- package/docs/code-organization-guide/rules/constants-rule.md +77 -0
- package/docs/code-organization-guide/rules/exports-and-imports-rule.md +81 -0
- package/docs/code-organization-guide/rules/folder-nesting-rule.md +83 -0
- package/docs/code-organization-guide/rules/hook-extraction-rule.md +142 -0
- package/docs/code-organization-guide/rules/interactive-component-rule.md +100 -0
- package/docs/code-organization-guide/rules/jsx-hygiene-rule.md +68 -0
- package/docs/code-organization-guide/rules/locales-rule.md +55 -0
- package/docs/code-organization-guide/rules/nameable-visual-concept-rule.md +66 -0
- package/docs/code-organization-guide/rules/native-prop-forwarding-rule.md +38 -0
- package/docs/code-organization-guide/rules/no-mixed-concerns-rule.md +64 -0
- package/docs/code-organization-guide/rules/repeated-structure-rule.md +93 -0
- package/docs/code-organization-guide/rules/smart-vs-dumb-component-rule.md +116 -0
- package/docs/code-organization-guide/rules/sole-state-owner-rule.md +102 -0
- package/docs/code-organization-guide/rules/types-and-schemas-rule.md +138 -0
- package/docs/code-organization-guide/rules/utilities-rule.md +87 -0
- package/docs/documentation-guide/_templates/guide.md +19 -0
- package/docs/documentation-guide/_templates/reference.md +17 -0
- package/docs/documentation-guide/_templates/rule.md +21 -0
- package/docs/documentation-guide/documentation-guide.md +13 -0
- package/docs/documentation-guide/references/documentation-types-reference.md +9 -0
- package/docs/documentation-guide/rules/guide-creation-rule.md +112 -0
- package/docs/documentation-guide/rules/reference-creation-rule.md +132 -0
- package/docs/documentation-guide/rules/rule-creation-rule.md +81 -0
- package/docs/documentation-guide/rules/template-usage-rule.md +48 -0
- package/docs/shadcn-theme.md +121 -0
- package/docs/styling-guide/rules/class-composition-rule.md +32 -0
- package/docs/styling-guide/rules/color-role-naming-rule.md +115 -0
- package/docs/styling-guide/rules/component-state-rule.md +26 -0
- package/docs/styling-guide/rules/component-variant-rule.md +128 -0
- package/docs/styling-guide/rules/global-style-system-rule.md +63 -0
- package/docs/styling-guide/rules/style-placement-rule.md +49 -0
- package/docs/styling-guide/rules/tailwind-utility-rule.md +48 -0
- package/docs/styling-guide/rules/theme-and-utility-definition-rule.md +129 -0
- package/docs/styling-guide/rules/theme-token-rule.md +32 -0
- package/docs/styling-guide/styling-guide.md +17 -0
- package/package.json +24 -10
- package/AGENTS.md +0 -15
- package/docs/common/merge-behavior.md +0 -17
- package/docs/common/overview.md +0 -20
- /package/{CLAUDE.md → claude/hooks/CLAUDE.md} +0 -0
- /package/claude/{.claude/hooks → hooks}/status-line/index.js +0 -0
- /package/claude/{.claude/settings.base.json → settings.base.json} +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Theme and Utility Definition Rule
|
|
2
|
+
|
|
3
|
+
Tailwind theme namespaces generate broad utility APIs, while custom utilities expose one intentional treatment. This rule resets unused defaults and chooses the narrowest public API for every project-owned design value.
|
|
4
|
+
|
|
5
|
+
- The project MUST reset Tailwind's default theme with `--*: initial` and explicitly define every theme value it uses.
|
|
6
|
+
- A static design value intended to generate a Tailwind utility namespace MUST be defined through `@theme`.
|
|
7
|
+
- A static theme value MUST be defined directly in plain `@theme` when it has no runtime variable indirection.
|
|
8
|
+
- A theme value that references a CSS variable changed by a theme selector or custom variant MUST be mapped through `@theme inline`.
|
|
9
|
+
- A property-specific value MUST remain a private CSS variable and be exposed through one named `@utility` rather than a broad theme namespace.
|
|
10
|
+
- A repeated multi-property treatment MUST be defined through one named `@utility`.
|
|
11
|
+
- Project-owned style declarations inside `@utility` and unavoidable global selectors MUST use `@apply`.
|
|
12
|
+
- A custom utility MUST use Tailwind custom-property or arbitrary-property utility syntax through `@apply` when no named built-in utility represents the property value.
|
|
13
|
+
- A custom utility that owns interaction behavior MUST keep its hover, active, focus, and disabled treatments in the same utility block.
|
|
14
|
+
- Component markup MUST NOT contain literal arbitrary values in place of missing project tokens or utilities.
|
|
15
|
+
|
|
16
|
+
## Incorrect — Default Theme Kept and Property-Specific Color Exposed Broadly
|
|
17
|
+
|
|
18
|
+
```css
|
|
19
|
+
@theme {
|
|
20
|
+
--color-header-ink: var(--header-ink);
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
<h1 className="text-header-ink">Title</h1>
|
|
26
|
+
<div className="bg-header-ink" />
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Why: the default theme remains active, and registering a text-only color in `--color-*` also creates unintended background, border, ring, and other color utilities.
|
|
30
|
+
|
|
31
|
+
## Correct — Custom Theme and Property-Specific Utility
|
|
32
|
+
|
|
33
|
+
```css
|
|
34
|
+
:root {
|
|
35
|
+
--header-ink: #111827;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@theme {
|
|
39
|
+
--*: initial;
|
|
40
|
+
--spacing: 0.25rem;
|
|
41
|
+
--font-body: Inter, sans-serif;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@utility text-header {
|
|
45
|
+
@apply text-(--header-ink);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
<h1 className="text-header">Title</h1>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Why: only explicitly defined theme values remain available, while the private header color exposes exactly one text utility.
|
|
54
|
+
|
|
55
|
+
## Incorrect — Runtime Theme Variable Mapped Without `inline`
|
|
56
|
+
|
|
57
|
+
```css
|
|
58
|
+
:root {
|
|
59
|
+
--primary: #7c3aed;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.dark {
|
|
63
|
+
--primary: #a78bfa;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@theme {
|
|
67
|
+
--color-primary: var(--primary);
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Why: the public token uses runtime variable indirection without the inline mapping intended for selector-driven theme values.
|
|
72
|
+
|
|
73
|
+
## Correct — Runtime Theme Variable Mapped Inline
|
|
74
|
+
|
|
75
|
+
```css
|
|
76
|
+
:root {
|
|
77
|
+
--primary: #7c3aed;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.dark {
|
|
81
|
+
--primary: #a78bfa;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@theme inline {
|
|
85
|
+
--color-primary: var(--primary);
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Why: generated color utilities reference the selector-driven runtime value directly.
|
|
90
|
+
|
|
91
|
+
## Incorrect — Treatment Split Across Utilities and Raw Declarations
|
|
92
|
+
|
|
93
|
+
```css
|
|
94
|
+
@utility surface-primary {
|
|
95
|
+
background-color: var(--primary-canvas);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@utility surface-primary-hover {
|
|
99
|
+
background-color: var(--primary-canvas-hover);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
<button className="surface-primary hover:surface-primary-hover">Save</button>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Why: the treatment is split across public utilities, its state is reconstructed in markup, and project-owned declarations bypass Tailwind composition.
|
|
108
|
+
|
|
109
|
+
## Correct — Complete Treatment Composed with `@apply`
|
|
110
|
+
|
|
111
|
+
```css
|
|
112
|
+
@utility surface-primary {
|
|
113
|
+
@apply rounded-md bg-(--primary-canvas) px-3 py-2 text-(--primary-ink);
|
|
114
|
+
|
|
115
|
+
&:hover {
|
|
116
|
+
@apply bg-(--primary-canvas-hover);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&:focus-visible {
|
|
120
|
+
@apply outline-2 outline-(--focus-ring);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
<button className="surface-primary">Save</button>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Why: the named utility owns the complete treatment and composes every project-owned declaration through Tailwind.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Theme Token Rule
|
|
2
|
+
|
|
3
|
+
Application chrome must remain themeable, while artwork, user content, data, and faithful external visuals may carry color as content. This rule gives shared interface decisions semantic names without turning content colors into interface tokens.
|
|
4
|
+
|
|
5
|
+
- Application chrome MUST use semantic project tokens and readable canvas/ink pairs.
|
|
6
|
+
- Shared interface colors, surfaces, borders, typography roles, and reusable measurements MUST use semantic project tokens.
|
|
7
|
+
- Components MUST NOT use palette utilities or literal colors for ordinary navigation, forms, dialogs, controls, status feedback, or focus treatment when a semantic role exists.
|
|
8
|
+
- A new semantic token MUST represent a recurring interface meaning that existing roles cannot express.
|
|
9
|
+
- Token names SHOULD describe purpose rather than a palette value or one component's implementation.
|
|
10
|
+
- Content, artwork, user-selected media, data visualization, and faithful third-party visual reproductions MAY use literal colors when color is part of the content itself.
|
|
11
|
+
- Opacity modifiers SHOULD express interaction and layering differences without creating a new semantic token.
|
|
12
|
+
|
|
13
|
+
## Incorrect — Palette Colors Used for Interface Controls
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<Button className="bg-purple-600 text-white hover:bg-purple-500">Save</Button>
|
|
17
|
+
<input className="border-[#6b7280] focus:ring-[#7c3aed]" />
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Why: ordinary controls are tied to palette and literal values instead of the project's semantic action, canvas, ink, border, and focus roles.
|
|
21
|
+
|
|
22
|
+
## Correct — Semantic Tokens Used for Interface Controls
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
<Button tone="primary">Save</Button>
|
|
26
|
+
<input className="border-border focus-visible:ring-focus/50" />
|
|
27
|
+
|
|
28
|
+
// A product preview preserves the external brand color as content.
|
|
29
|
+
<ProductPreview brandColor="#1db954" />
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Why: ordinary interface styling uses the component API and semantic roles, while the faithful external visual retains the content color that defines it.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Styling Guide
|
|
2
|
+
|
|
3
|
+
This guide keeps component styling predictable without making consumers learn a component's DOM or a project's CSS internals. Use it whenever you add or change UI styling.
|
|
4
|
+
|
|
5
|
+
## How To Style a Component
|
|
6
|
+
|
|
7
|
+
Use this workflow when implementing a component or changing one of its visual treatments.
|
|
8
|
+
|
|
9
|
+
1. Follow the [Tailwind Utility Rule](rules/tailwind-utility-rule.md) so ordinary, local styling stays visible beside the markup it affects.
|
|
10
|
+
2. Follow the [Class Composition Rule](rules/class-composition-rule.md) so conditional and consumer-supplied classes merge predictably.
|
|
11
|
+
3. Follow the [Component Variant Rule](rules/component-variant-rule.md) so supported internal appearances are a typed component API.
|
|
12
|
+
4. Follow the [Color Role Naming Rule](rules/color-role-naming-rule.md) so color utilities state whether they supply a general color, a background, readable text, or a complete surface.
|
|
13
|
+
5. Follow the [Theme and Utility Definition Rule](rules/theme-and-utility-definition-rule.md) so CSS-first theme tokens and custom utilities expose only the intended API.
|
|
14
|
+
6. Follow the [Theme Token Rule](rules/theme-token-rule.md) so application chrome, content visuals, and shared measurements use the right kind of value.
|
|
15
|
+
7. Follow the [Global Style System Rule](rules/global-style-system-rule.md) so global CSS has one source of truth and a clear ownership boundary.
|
|
16
|
+
8. Follow the [Style Placement Rule](rules/style-placement-rule.md) so reusable styling has one appropriate owner.
|
|
17
|
+
9. Follow the [Component State Rule](rules/component-state-rule.md) so interaction, disabled, selected, loading, and error states stay coherent.
|
package/package.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pasika",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Reusable
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "Reusable agent setup package",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/Bredansky/pasika"
|
|
8
|
+
},
|
|
5
9
|
"license": "MIT",
|
|
6
10
|
"type": "module",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
13
|
-
"prepack": "npm run build"
|
|
11
|
+
"exports": {
|
|
12
|
+
"./eslint": {
|
|
13
|
+
"types": "./dist/eslint/pasika/index.d.ts",
|
|
14
|
+
"import": "./dist/eslint/pasika/index.js"
|
|
15
|
+
}
|
|
14
16
|
},
|
|
15
17
|
"bin": {
|
|
16
18
|
"pasika": "dist/scripts/pasika.js"
|
|
@@ -23,12 +25,24 @@
|
|
|
23
25
|
"CLAUDE.md",
|
|
24
26
|
"README.md"
|
|
25
27
|
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "rm -rf dist && tsc -p tsconfig.json && tsc -p tsconfig.eslint.json",
|
|
30
|
+
"check": "npm run lint && npm run typecheck",
|
|
31
|
+
"docs:generate": "rm -f AGENTS.md CLAUDE.md && npx vulyk docs",
|
|
32
|
+
"fix": "eslint . --fix",
|
|
33
|
+
"lint": "eslint .",
|
|
34
|
+
"prepack": "npm run build",
|
|
35
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.eslint.json --noEmit"
|
|
36
|
+
},
|
|
26
37
|
"devDependencies": {
|
|
27
38
|
"@types/node": "^24.12.2",
|
|
28
39
|
"eslint": "^9.39.4",
|
|
29
40
|
"prettier": "^3.8.1",
|
|
30
41
|
"typescript": "^5.9.2",
|
|
31
|
-
"vulyk": "
|
|
42
|
+
"vulyk": "github:Bredansky/vulyk#829cac4a244add961304070474db3e978db01d2a",
|
|
32
43
|
"zirka": "^0.0.28"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=22"
|
|
33
47
|
}
|
|
34
48
|
}
|
package/AGENTS.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# pasika
|
|
2
|
-
pasika scope and usage.
|
|
3
|
-
Full documentation: docs/common/overview.md
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Merge Behavior
|
|
8
|
-
How pasika merges into existing Claude settings.
|
|
9
|
-
Full documentation: docs/common/merge-behavior.md
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# Claude Hooks
|
|
14
|
-
Shared Claude hooks shipped by pasika.
|
|
15
|
-
Full documentation: docs/claude/hooks.md
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# Merge Behavior
|
|
2
|
-
|
|
3
|
-
`pasika` merges into an existing `.claude/settings.json` by default.
|
|
4
|
-
|
|
5
|
-
It updates the Claude base pieces owned by `pasika`:
|
|
6
|
-
|
|
7
|
-
- `hooks.Notification`
|
|
8
|
-
- `hooks.PreToolUse`
|
|
9
|
-
- `statusLine`
|
|
10
|
-
|
|
11
|
-
It preserves unrelated project-specific settings such as:
|
|
12
|
-
|
|
13
|
-
- custom permissions
|
|
14
|
-
- extra hooks like `PostToolUse`
|
|
15
|
-
- plugin and marketplace config
|
|
16
|
-
|
|
17
|
-
Use `--force` only when you want to replace the file instead of merging.
|
package/docs/common/overview.md
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# pasika
|
|
2
|
-
|
|
3
|
-
`pasika` is a reusable Claude Code base package.
|
|
4
|
-
|
|
5
|
-
## Scope
|
|
6
|
-
|
|
7
|
-
- Claude only for v1
|
|
8
|
-
- shared hooks and base settings
|
|
9
|
-
- merge-friendly project integration
|
|
10
|
-
- no project-specific skills, rules, or plugin choices
|
|
11
|
-
|
|
12
|
-
## Usage
|
|
13
|
-
|
|
14
|
-
Install `pasika` as a dev dependency, then run:
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npx pasika claude
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
That generates or updates `.claude/settings.json` to point shared hooks at `./node_modules/pasika/claude/...`.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|