nk_jtb 0.24.1 → 0.25.1
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/.ai/guidelines/jtb-framework.md +7 -0
- package/.ai/prompts/create-component.md +39 -0
- package/.ai/prompts/create-utility.md +16 -0
- package/.ai/prompts/jtb-code-review.md +65 -65
- package/.ai/prompts/jtb-review-documentation.md +93 -93
- package/.ai/skills/jtb-conversion/SKILL.md +10 -5
- package/.ai/skills/jtb-documentation/SKILL.md +2 -2
- package/.ai/skills/jtb-layouts-and-structures/SKILL.md +70 -0
- package/.ai/skills/scss-engineer/SKILL.md +40 -3
- package/AGENTS.md +217 -0
- package/CLAUDE.md +90 -17
- package/docs/components/button.md +86 -86
- package/docs/introduction.md +127 -127
- package/docs/margin-padding-spacing.md +12 -15
- package/docs/showcase-ui.md +38 -38
- package/docs/themes.md +118 -118
- package/docs/utilities/border.md +58 -0
- package/docs/variable-system.md +58 -58
- package/framework-status.md +343 -325
- package/package.json +1 -1
- package/scripts/ai-sync.js +1 -1
- package/scripts/jtb-nav.json +137 -0
- package/scripts/navigation.js +5 -4
- package/src/components/_button.scss +33 -33
- package/src/components/_list.scss +4 -0
- package/src/utilities/_border.scss +31 -0
- package/src/utilities/_misc.scss +6 -25
- package/src/utilities/_themes.scss +17 -17
- package/tasks.md +16 -0
- package/working-with-nathan.md +117 -0
- package/.ai/prompts/misc.md +0 -18
- package/.ai/skills/jtb-layout/SKILL.md +0 -92
- package/scripts/nav.json +0 -70
|
@@ -53,3 +53,10 @@ use `gap` instead.
|
|
|
53
53
|
- Hardcoded values — use variables
|
|
54
54
|
- Deep nesting — maximum 3 levels
|
|
55
55
|
- `!important` — never use
|
|
56
|
+
|
|
57
|
+
## Common Pitfalls
|
|
58
|
+
|
|
59
|
+
- Use JTB class names only.
|
|
60
|
+
- Positional spacing utilities use `pxy` / `mxy`, not `p` / `m`.
|
|
61
|
+
- If a class name is not confirmed in JTB docs or source, stop and check
|
|
62
|
+
before using it.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Build `[component]` using JTB utilities.
|
|
2
|
+
|
|
3
|
+
Invoke the `jtb-layouts-and-structures` skill before starting.
|
|
4
|
+
|
|
5
|
+
## Output
|
|
6
|
+
|
|
7
|
+
Check `index.html`.
|
|
8
|
+
|
|
9
|
+
- If it contains no meaningful content, write there.
|
|
10
|
+
- If it already has content, ask whether to add to it or create a new file.
|
|
11
|
+
|
|
12
|
+
## Design Reference
|
|
13
|
+
|
|
14
|
+
[Attach image or describe the component.]
|
|
15
|
+
|
|
16
|
+
## Responsive Behaviour
|
|
17
|
+
|
|
18
|
+
[Describe how this should adapt, or leave blank for ai to ask.]
|
|
19
|
+
|
|
20
|
+
## Target Markup
|
|
21
|
+
|
|
22
|
+
[Optional: if you have a specific markup structure in mind.]
|
|
23
|
+
|
|
24
|
+
## Post-Build Report
|
|
25
|
+
|
|
26
|
+
After building, report only actionable items:
|
|
27
|
+
|
|
28
|
+
- **Issues** — anything that could not be expressed cleanly in JTB. State the
|
|
29
|
+
problem and what workaround was used.
|
|
30
|
+
- **Framework Gaps** — utilities, tokens, patterns, or primitives that seem
|
|
31
|
+
missing, weak, or awkward.
|
|
32
|
+
- **Guideline Gaps** — places where the component-creation guidance or JTB docs
|
|
33
|
+
were unclear or insufficient.
|
|
34
|
+
- **Skill Gaps** — places where the invoked skill was unclear, insufficient,
|
|
35
|
+
misleading, or failed to help with a relevant decision.
|
|
36
|
+
- **Recommendations** — concrete, minimal changes worth considering.
|
|
37
|
+
|
|
38
|
+
Do not report clean decisions or resolved choices unless they expose a real
|
|
39
|
+
problem.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Add `[utility name]` to the JTB framework.
|
|
2
|
+
|
|
3
|
+
Invoke the `scss-engineer` and `jtb-documentation` skills before starting.
|
|
4
|
+
|
|
5
|
+
## What It Does
|
|
6
|
+
|
|
7
|
+
[Describe the utility and the problem it solves.]
|
|
8
|
+
|
|
9
|
+
## API
|
|
10
|
+
|
|
11
|
+
[List the expected class names if known. Leave blank if the API shape needs to
|
|
12
|
+
be worked out.]
|
|
13
|
+
|
|
14
|
+
## Notes
|
|
15
|
+
|
|
16
|
+
[Optional constraints, related utilities, or implementation notes.]
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
Review the code changes for the NK JTB SCSS framework.
|
|
2
|
-
|
|
3
|
-
Invoke the `jtb-documentation` skill before starting.
|
|
4
|
-
|
|
5
|
-
## Guidelines
|
|
6
|
-
|
|
7
|
-
- **Framework Alignment:** Ensure all code strictly follows JTB conventions,
|
|
8
|
-
naming, and architecture. Do not use Tailwind or other frameworks as reference
|
|
9
|
-
for implementation details.
|
|
10
|
-
- **Directory Structure:** Verify files are placed in the correct directories
|
|
11
|
-
(`base`, `components`, `forms`, `utilities`, `mixins`, `functions`,
|
|
12
|
-
`maps_and_variables`).
|
|
13
|
-
- **Import Rules:** Only `@use` and `@forward` are permitted. `@import` is
|
|
14
|
-
prohibited.
|
|
15
|
-
- **Component Structure:** Components should provide structure only, not
|
|
16
|
-
decoration. Styling must be handled by utilities.
|
|
17
|
-
- **Modifiers:** Only use context-aware modifiers (e.g., `.primary`), never
|
|
18
|
-
component-specific ones (e.g., `.btn-primary`).
|
|
19
|
-
- **Variables:** All values must use variables or maps — no hardcoded values.
|
|
20
|
-
- **Nesting:** No selector nesting deeper than 3 levels.
|
|
21
|
-
- **Override Order:** Confirm the import order: base → components → forms →
|
|
22
|
-
utilities.
|
|
23
|
-
- **Documentation:** All new or changed code must be documented using JTB
|
|
24
|
-
documentation conventions. Drafts go in `docs-for-review/`, finalized docs
|
|
25
|
-
in `docs/`.
|
|
26
|
-
|
|
27
|
-
## Review Checklist
|
|
28
|
-
|
|
29
|
-
1. Does the code follow JTB naming, structure, and logical property conventions?
|
|
30
|
-
2. Are all values variable-driven and override-friendly?
|
|
31
|
-
3. Is the code placed in the correct directory and imported in the right order?
|
|
32
|
-
4. Is documentation provided or updated as required?
|
|
33
|
-
|
|
34
|
-
Provide clear, actionable feedback. If you suggest changes, reference the
|
|
35
|
-
specific JTB documentation section or rule.
|
|
36
|
-
|
|
37
|
-
## Skill File Review
|
|
38
|
-
|
|
39
|
-
When any source-of-truth files are included in the changeset, review them for
|
|
40
|
-
accuracy against the actual codebase.
|
|
41
|
-
|
|
42
|
-
**Accuracy**
|
|
43
|
-
|
|
44
|
-
- Do the documented conventions match how the SCSS actually works?
|
|
45
|
-
- Are examples valid and runnable — not invented or outdated?
|
|
46
|
-
- Do file paths, class names, and patterns reflect the real codebase?
|
|
47
|
-
|
|
48
|
-
**Completeness**
|
|
49
|
-
|
|
50
|
-
- Are new patterns or workflows introduced in this changeset documented?
|
|
51
|
-
- Are deprecated patterns removed or flagged?
|
|
52
|
-
|
|
53
|
-
**Internal Consistency**
|
|
54
|
-
|
|
55
|
-
- Do the files agree with each other? Flag contradictions between skill files
|
|
56
|
-
and documentation.
|
|
57
|
-
- Does a change in one file require an update in another?
|
|
58
|
-
|
|
59
|
-
**Scope Drift**
|
|
60
|
-
|
|
61
|
-
- Do changes silently expand or restrict the skill scope without clear intent?
|
|
62
|
-
|
|
63
|
-
**Output Format:**
|
|
64
|
-
List issues grouped by file. For each issue: severity (blocking/suggestion),
|
|
65
|
-
the violated rule, and a suggested fix.
|
|
1
|
+
Review the code changes for the NK JTB SCSS framework.
|
|
2
|
+
|
|
3
|
+
Invoke the `jtb-documentation` skill before starting.
|
|
4
|
+
|
|
5
|
+
## Guidelines
|
|
6
|
+
|
|
7
|
+
- **Framework Alignment:** Ensure all code strictly follows JTB conventions,
|
|
8
|
+
naming, and architecture. Do not use Tailwind or other frameworks as reference
|
|
9
|
+
for implementation details.
|
|
10
|
+
- **Directory Structure:** Verify files are placed in the correct directories
|
|
11
|
+
(`base`, `components`, `forms`, `utilities`, `mixins`, `functions`,
|
|
12
|
+
`maps_and_variables`).
|
|
13
|
+
- **Import Rules:** Only `@use` and `@forward` are permitted. `@import` is
|
|
14
|
+
prohibited.
|
|
15
|
+
- **Component Structure:** Components should provide structure only, not
|
|
16
|
+
decoration. Styling must be handled by utilities.
|
|
17
|
+
- **Modifiers:** Only use context-aware modifiers (e.g., `.primary`), never
|
|
18
|
+
component-specific ones (e.g., `.btn-primary`).
|
|
19
|
+
- **Variables:** All values must use variables or maps — no hardcoded values.
|
|
20
|
+
- **Nesting:** No selector nesting deeper than 3 levels.
|
|
21
|
+
- **Override Order:** Confirm the import order: base → components → forms →
|
|
22
|
+
utilities.
|
|
23
|
+
- **Documentation:** All new or changed code must be documented using JTB
|
|
24
|
+
documentation conventions. Drafts go in `docs-for-review/`, finalized docs
|
|
25
|
+
in `docs/`.
|
|
26
|
+
|
|
27
|
+
## Review Checklist
|
|
28
|
+
|
|
29
|
+
1. Does the code follow JTB naming, structure, and logical property conventions?
|
|
30
|
+
2. Are all values variable-driven and override-friendly?
|
|
31
|
+
3. Is the code placed in the correct directory and imported in the right order?
|
|
32
|
+
4. Is documentation provided or updated as required?
|
|
33
|
+
|
|
34
|
+
Provide clear, actionable feedback. If you suggest changes, reference the
|
|
35
|
+
specific JTB documentation section or rule.
|
|
36
|
+
|
|
37
|
+
## Skill File Review
|
|
38
|
+
|
|
39
|
+
When any source-of-truth files are included in the changeset, review them for
|
|
40
|
+
accuracy against the actual codebase.
|
|
41
|
+
|
|
42
|
+
**Accuracy**
|
|
43
|
+
|
|
44
|
+
- Do the documented conventions match how the SCSS actually works?
|
|
45
|
+
- Are examples valid and runnable — not invented or outdated?
|
|
46
|
+
- Do file paths, class names, and patterns reflect the real codebase?
|
|
47
|
+
|
|
48
|
+
**Completeness**
|
|
49
|
+
|
|
50
|
+
- Are new patterns or workflows introduced in this changeset documented?
|
|
51
|
+
- Are deprecated patterns removed or flagged?
|
|
52
|
+
|
|
53
|
+
**Internal Consistency**
|
|
54
|
+
|
|
55
|
+
- Do the files agree with each other? Flag contradictions between skill files
|
|
56
|
+
and documentation.
|
|
57
|
+
- Does a change in one file require an update in another?
|
|
58
|
+
|
|
59
|
+
**Scope Drift**
|
|
60
|
+
|
|
61
|
+
- Do changes silently expand or restrict the skill scope without clear intent?
|
|
62
|
+
|
|
63
|
+
**Output Format:**
|
|
64
|
+
List issues grouped by file. For each issue: severity (blocking/suggestion),
|
|
65
|
+
the violated rule, and a suggested fix.
|
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
Review the documentation for the JTB framework.
|
|
2
|
-
|
|
3
|
-
Invoke the `jtb-documentation` skill before starting. Read these in full first
|
|
4
|
-
— these define what is correct:
|
|
5
|
-
|
|
6
|
-
- `introduction.md`
|
|
7
|
-
- `docs/conventions-and-architecture-rules.md`
|
|
8
|
-
|
|
9
|
-
## Goals
|
|
10
|
-
|
|
11
|
-
1. Validate what exists — is documentation correct, consistent, and
|
|
12
|
-
rule-compliant?
|
|
13
|
-
2. Identify what's missing — what is absent but expected?
|
|
14
|
-
|
|
15
|
-
## Process
|
|
16
|
-
|
|
17
|
-
This review runs in three passes:
|
|
18
|
-
|
|
19
|
-
1. **Identify** — surface contradictions and gaps. Incomplete docs are expected;
|
|
20
|
-
flag them without treating incompleteness as a failure.
|
|
21
|
-
2. **Triage** — decide what's worth pursuing before any work happens.
|
|
22
|
-
3. **Sweep** — act only on approved items.
|
|
23
|
-
|
|
24
|
-
## Scope
|
|
25
|
-
|
|
26
|
-
Review only:
|
|
27
|
-
|
|
28
|
-
- `docs/` — all foundational documentation
|
|
29
|
-
- `src/maps_and_variables/` — all variable and configuration files
|
|
30
|
-
|
|
31
|
-
Do not review:
|
|
32
|
-
|
|
33
|
-
- `src/mixins/` — build system internals
|
|
34
|
-
- `src/functions/` — build system internals
|
|
35
|
-
- `src/base/` — output layer
|
|
36
|
-
|
|
37
|
-
## Review Questions
|
|
38
|
-
|
|
39
|
-
### Validation
|
|
40
|
-
|
|
41
|
-
1. Do the variable files in `src/maps_and_variables/` match what the
|
|
42
|
-
conventions doc describes?
|
|
43
|
-
2. Do all final maps follow the `-map` suffix rule?
|
|
44
|
-
3. Is the three-map pattern applied consistently across all variable files?
|
|
45
|
-
4. Is `smart-merge` order correct — variants first, values second?
|
|
46
|
-
5. Are `!default` flags present where the conventions require them?
|
|
47
|
-
6. Do the breakpoint values in `_base.scss` match what `responsive-design.md`
|
|
48
|
-
describes?
|
|
49
|
-
7. Does `index.scss` forward all expected files?
|
|
50
|
-
|
|
51
|
-
### Gap Identification
|
|
52
|
-
|
|
53
|
-
1. Are there variable files with no corresponding documentation?
|
|
54
|
-
2. Are there conventions described in the docs with no implementation in
|
|
55
|
-
`src/maps_and_variables/`?
|
|
56
|
-
|
|
57
|
-
## Priority Definitions
|
|
58
|
-
|
|
59
|
-
- `critical` — contradicts a source of truth or produces incorrect guidance.
|
|
60
|
-
Must fix.
|
|
61
|
-
- `high` — likely causes confusion, inconsistency, or future breakage. Should
|
|
62
|
-
fix.
|
|
63
|
-
- `low` — style, preference, or minor improvement. Fix if you want.
|
|
64
|
-
- `missing` — expected content that isn't there.
|
|
65
|
-
|
|
66
|
-
## Output Requirements
|
|
67
|
-
|
|
68
|
-
- Be direct and critical.
|
|
69
|
-
- Do not praise unnecessarily.
|
|
70
|
-
- Separate findings by type clearly.
|
|
71
|
-
- Suggest improvements with trade-offs.
|
|
72
|
-
- If something is unclear or inconsistent, call it out explicitly.
|
|
73
|
-
|
|
74
|
-
Write results to `review-docs-run1.md` in the project root.
|
|
75
|
-
|
|
76
|
-
Use these sections in order:
|
|
77
|
-
|
|
78
|
-
- **Confirmed Issues** — rule violations, bugs, mismatches
|
|
79
|
-
- **Gaps** — missing docs, tests, examples, or conventions
|
|
80
|
-
- **Findings** — observations that don't rise to issues
|
|
81
|
-
- **Pass** — if no confirmed issues: `No blocking issues found.`
|
|
82
|
-
|
|
83
|
-
For every confirmed issue use this format:
|
|
84
|
-
|
|
85
|
-
**Issue title** · `critical/high/low`
|
|
86
|
-
`file:line`
|
|
87
|
-
Rule: brief quote
|
|
88
|
-
Fix: one line
|
|
89
|
-
|
|
90
|
-
For every gap use this format:
|
|
91
|
-
|
|
92
|
-
**Gap title** · `missing`
|
|
93
|
-
What's absent and where it's expected.
|
|
1
|
+
Review the documentation for the JTB framework.
|
|
2
|
+
|
|
3
|
+
Invoke the `jtb-documentation` skill before starting. Read these in full first
|
|
4
|
+
— these define what is correct:
|
|
5
|
+
|
|
6
|
+
- `introduction.md`
|
|
7
|
+
- `docs/conventions-and-architecture-rules.md`
|
|
8
|
+
|
|
9
|
+
## Goals
|
|
10
|
+
|
|
11
|
+
1. Validate what exists — is documentation correct, consistent, and
|
|
12
|
+
rule-compliant?
|
|
13
|
+
2. Identify what's missing — what is absent but expected?
|
|
14
|
+
|
|
15
|
+
## Process
|
|
16
|
+
|
|
17
|
+
This review runs in three passes:
|
|
18
|
+
|
|
19
|
+
1. **Identify** — surface contradictions and gaps. Incomplete docs are expected;
|
|
20
|
+
flag them without treating incompleteness as a failure.
|
|
21
|
+
2. **Triage** — decide what's worth pursuing before any work happens.
|
|
22
|
+
3. **Sweep** — act only on approved items.
|
|
23
|
+
|
|
24
|
+
## Scope
|
|
25
|
+
|
|
26
|
+
Review only:
|
|
27
|
+
|
|
28
|
+
- `docs/` — all foundational documentation
|
|
29
|
+
- `src/maps_and_variables/` — all variable and configuration files
|
|
30
|
+
|
|
31
|
+
Do not review:
|
|
32
|
+
|
|
33
|
+
- `src/mixins/` — build system internals
|
|
34
|
+
- `src/functions/` — build system internals
|
|
35
|
+
- `src/base/` — output layer
|
|
36
|
+
|
|
37
|
+
## Review Questions
|
|
38
|
+
|
|
39
|
+
### Validation
|
|
40
|
+
|
|
41
|
+
1. Do the variable files in `src/maps_and_variables/` match what the
|
|
42
|
+
conventions doc describes?
|
|
43
|
+
2. Do all final maps follow the `-map` suffix rule?
|
|
44
|
+
3. Is the three-map pattern applied consistently across all variable files?
|
|
45
|
+
4. Is `smart-merge` order correct — variants first, values second?
|
|
46
|
+
5. Are `!default` flags present where the conventions require them?
|
|
47
|
+
6. Do the breakpoint values in `_base.scss` match what `responsive-design.md`
|
|
48
|
+
describes?
|
|
49
|
+
7. Does `index.scss` forward all expected files?
|
|
50
|
+
|
|
51
|
+
### Gap Identification
|
|
52
|
+
|
|
53
|
+
1. Are there variable files with no corresponding documentation?
|
|
54
|
+
2. Are there conventions described in the docs with no implementation in
|
|
55
|
+
`src/maps_and_variables/`?
|
|
56
|
+
|
|
57
|
+
## Priority Definitions
|
|
58
|
+
|
|
59
|
+
- `critical` — contradicts a source of truth or produces incorrect guidance.
|
|
60
|
+
Must fix.
|
|
61
|
+
- `high` — likely causes confusion, inconsistency, or future breakage. Should
|
|
62
|
+
fix.
|
|
63
|
+
- `low` — style, preference, or minor improvement. Fix if you want.
|
|
64
|
+
- `missing` — expected content that isn't there.
|
|
65
|
+
|
|
66
|
+
## Output Requirements
|
|
67
|
+
|
|
68
|
+
- Be direct and critical.
|
|
69
|
+
- Do not praise unnecessarily.
|
|
70
|
+
- Separate findings by type clearly.
|
|
71
|
+
- Suggest improvements with trade-offs.
|
|
72
|
+
- If something is unclear or inconsistent, call it out explicitly.
|
|
73
|
+
|
|
74
|
+
Write results to `review-docs-run1.md` in the project root.
|
|
75
|
+
|
|
76
|
+
Use these sections in order:
|
|
77
|
+
|
|
78
|
+
- **Confirmed Issues** — rule violations, bugs, mismatches
|
|
79
|
+
- **Gaps** — missing docs, tests, examples, or conventions
|
|
80
|
+
- **Findings** — observations that don't rise to issues
|
|
81
|
+
- **Pass** — if no confirmed issues: `No blocking issues found.`
|
|
82
|
+
|
|
83
|
+
For every confirmed issue use this format:
|
|
84
|
+
|
|
85
|
+
**Issue title** · `critical/high/low`
|
|
86
|
+
`file:line`
|
|
87
|
+
Rule: brief quote
|
|
88
|
+
Fix: one line
|
|
89
|
+
|
|
90
|
+
For every gap use this format:
|
|
91
|
+
|
|
92
|
+
**Gap title** · `missing`
|
|
93
|
+
What's absent and where it's expected.
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: jtb-conversion
|
|
3
3
|
description: >-
|
|
4
|
-
Use this skill whenever
|
|
5
|
-
components
|
|
6
|
-
PHP, JS, or
|
|
7
|
-
|
|
4
|
+
Use this skill whenever translating an existing implementation into NK JTB
|
|
5
|
+
classes and components — for example from Tailwind, custom CSS, plain HTML,
|
|
6
|
+
PHP, JS, or another framework. Do not wait for an explicit request — if
|
|
7
|
+
there is a source implementation that needs to be converted into JTB, this
|
|
8
|
+
skill applies.
|
|
8
9
|
---
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
Do not use this skill for greenfield JTB component builds, design-to-code work
|
|
12
|
+
from screenshots/mockups, or general component composition from scratch.
|
|
13
|
+
|
|
14
|
+
For layout decisions during conversion, invoke the
|
|
15
|
+
`jtb-layouts-and-structures` skill.
|
|
11
16
|
|
|
12
17
|
If the output file is not specified, ask before proceeding.
|
|
13
18
|
|
|
@@ -88,8 +88,8 @@ Rules:
|
|
|
88
88
|
- Keep review notes, implementation commentary, and TODOs out of the main doc.
|
|
89
89
|
- Group examples by usage, not by SCSS implementation detail.
|
|
90
90
|
- Use `+demo-folded class="bx"` for interactive examples.
|
|
91
|
-
- Use `preview-class="..."` for
|
|
92
|
-
|
|
91
|
+
- Use `preview-class="..."` for visual aids in the docs so they do not affect
|
|
92
|
+
the code being copied.
|
|
93
93
|
- Use `class="..."` for the outer demo wrapper when the preview needs a
|
|
94
94
|
container such as `bx`.
|
|
95
95
|
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: jtb-layouts-and-structures
|
|
3
|
+
description: >-
|
|
4
|
+
Use this skill whenever making layout or structural decisions — choosing
|
|
5
|
+
between grid and flex, building page shells, or structuring internal
|
|
6
|
+
component layouts. Do not wait for an explicit request — if layout or
|
|
7
|
+
structural decisions are being made, this skill applies.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
For layout or responsive work, read:
|
|
11
|
+
|
|
12
|
+
- `docs/responsive-design.md`
|
|
13
|
+
- `docs/layouts-and-structures.md`
|
|
14
|
+
- `docs/magic-classes.md`
|
|
15
|
+
|
|
16
|
+
## Scope
|
|
17
|
+
|
|
18
|
+
Use this skill for structural layout decisions:
|
|
19
|
+
|
|
20
|
+
- page shells
|
|
21
|
+
- layout patterns
|
|
22
|
+
- reusable internal structures
|
|
23
|
+
- split layouts
|
|
24
|
+
- grid vs flex choices
|
|
25
|
+
- container and width strategy
|
|
26
|
+
- responsive visibility strategy
|
|
27
|
+
|
|
28
|
+
Do not use this skill for general documentation or for framework-internals work.
|
|
29
|
+
|
|
30
|
+
## Decision Order
|
|
31
|
+
|
|
32
|
+
1. Classify the problem first — page-level layout or internal component
|
|
33
|
+
structure?
|
|
34
|
+
2. Choose the right primitive:
|
|
35
|
+
- `grid` with `cols-*` for column-based structures
|
|
36
|
+
- `flex` for linear, single-axis arrangements
|
|
37
|
+
- `container-*` for width and placement
|
|
38
|
+
3. Check whether JTB already provides an approved magic or composite class that
|
|
39
|
+
reduces responsive noise for the pattern you need.
|
|
40
|
+
4. Build mobile-first. Add explicit `{bp}:` responsive utilities only when no
|
|
41
|
+
documented higher-level pattern expresses the layout cleanly.
|
|
42
|
+
5. Only escalate to custom solutions when documented primitives cannot express
|
|
43
|
+
the need cleanly.
|
|
44
|
+
|
|
45
|
+
## Markup
|
|
46
|
+
|
|
47
|
+
- Do not add `data-*` attributes unless explicitly requested.
|
|
48
|
+
|
|
49
|
+
## Rules
|
|
50
|
+
|
|
51
|
+
- Prefer mobile-first base layouts with responsive enhancement.
|
|
52
|
+
- Default to the fewest structural elements that cleanly express the layout.
|
|
53
|
+
- Combine width, rhythm, and internal layout on the same element when they do
|
|
54
|
+
not need isolation.
|
|
55
|
+
- Do not split `container`, padding, and grid/flex across extra wrappers unless
|
|
56
|
+
one of those concerns genuinely needs its own box.
|
|
57
|
+
- Put shared layout/presentation utilities on the highest valid parent. Only
|
|
58
|
+
repeat them on children when a child genuinely needs a different value.
|
|
59
|
+
- Treat `container-*` as a layout primitive with built-in inline gutter. Do not
|
|
60
|
+
add extra horizontal padding on the same element.
|
|
61
|
+
- Let the component own its internal padding. Use the container for width and
|
|
62
|
+
placement only.
|
|
63
|
+
- Default section rhythm:
|
|
64
|
+
- `py-4-3-2` for standard sections
|
|
65
|
+
- `py-5-3-2` for more prominent sections
|
|
66
|
+
- Prefer approved magic/composite classes when they express an established
|
|
67
|
+
responsive pattern more clearly than explicit breakpoint chains. Common
|
|
68
|
+
examples include `py-*`, `gap-*`, and `cols-*` patterns.
|
|
69
|
+
- Use `{bp}:` for progressive layout changes.
|
|
70
|
+
- Use `to-` and `on-` primarily for visibility windows, not layout progression.
|
|
@@ -9,8 +9,45 @@ description: >-
|
|
|
9
9
|
|
|
10
10
|
Read `docs/conventions-and-architecture-rules.md` before starting.
|
|
11
11
|
|
|
12
|
+
## General Rules
|
|
13
|
+
|
|
14
|
+
- Check existing source, docs, and `framework-status.md` before adding a new
|
|
15
|
+
framework API so you extend or formalise instead of duplicating.
|
|
16
|
+
- If formalising an existing helper requires a structural decision, stop and
|
|
17
|
+
discuss it before proceeding. Examples: doc home, utility family scope, and
|
|
18
|
+
what to do with related experimental variants.
|
|
19
|
+
- Do not invent variants, scales, or an expanded utility family. If the work
|
|
20
|
+
suggests them, stop and discuss the API first. Default to the smallest useful
|
|
21
|
+
addition.
|
|
22
|
+
- Extend an existing domain file in `src/utilities/` or `src/components/`
|
|
23
|
+
before creating a new partial.
|
|
24
|
+
- Prefer the build system (`build-classes`, `build-composite-classes`,
|
|
25
|
+
`child-combinator`) over hand-written selectors when the pattern fits.
|
|
26
|
+
- Add or extend variables/maps in `src/maps_and_variables/` only when the new
|
|
27
|
+
API needs reusable configuration or scale values.
|
|
28
|
+
|
|
12
29
|
## Component Workflow
|
|
13
30
|
|
|
14
|
-
1. Add variables to `src/maps_and_variables/_components.scss
|
|
15
|
-
|
|
16
|
-
|
|
31
|
+
1. Add variables to `src/maps_and_variables/_components.scss` only if the
|
|
32
|
+
component needs framework-level configuration.
|
|
33
|
+
2. Create or update the component file in `src/components/`.
|
|
34
|
+
3. Export via `src/components/index.scss` if this is a new component file.
|
|
35
|
+
4. Invoke `jtb-documentation` to document the component.
|
|
36
|
+
5. Update `framework-status.md` when the component or its docs change status.
|
|
37
|
+
|
|
38
|
+
## Utility Workflow
|
|
39
|
+
|
|
40
|
+
1. Choose the correct existing utility partial in `src/utilities/`. Create a
|
|
41
|
+
new partial only when the utility introduces a new domain.
|
|
42
|
+
2. If the utility fits the build system, implement it with `build-classes` or
|
|
43
|
+
`build-composite-classes` rather than ad hoc selectors.
|
|
44
|
+
3. Use `child-combinator` for direct-child utilities such as spacing or
|
|
45
|
+
dividers instead of duplicating selector logic by hand.
|
|
46
|
+
4. Add or extend variables/maps only when the utility exposes real framework
|
|
47
|
+
configuration. Fixed helpers can stay local to the utility partial.
|
|
48
|
+
5. If the utility already exists as an informal helper, formalise or migrate it
|
|
49
|
+
instead of creating a duplicate implementation.
|
|
50
|
+
6. Keep related variants together in the same domain partial. Do not formalise
|
|
51
|
+
one variant while leaving related variants behind in a different home.
|
|
52
|
+
7. Invoke `jtb-documentation` to document the utility.
|
|
53
|
+
8. Update `framework-status.md` when the utility or its docs change status.
|