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.
Files changed (59) hide show
  1. package/README.md +31 -25
  2. package/claude/hooks/.vulyk +3 -0
  3. package/claude/hooks/AGENTS.md +3 -0
  4. package/claude/hooks/claude-hooks.md +30 -0
  5. package/claude/{.claude/hooks → hooks}/notification.sh +0 -0
  6. package/claude/{.claude/hooks → hooks}/protect-files.sh +0 -0
  7. package/claude/scripts/render-settings.ts +25 -9
  8. package/dist/claude/scripts/render-settings.js +22 -9
  9. package/dist/eslint/pasika/index.d.ts +2 -0
  10. package/dist/eslint/pasika/index.js +14 -0
  11. package/dist/eslint/pasika/rules/organization-imports.d.ts +2 -0
  12. package/dist/eslint/pasika/rules/organization-imports.js +124 -0
  13. package/docs/agent-conventions.md +21 -0
  14. package/docs/code-organization-guide/code-organization-guide.md +65 -0
  15. package/docs/code-organization-guide/references/application-architecture-reference.md +107 -0
  16. package/docs/code-organization-guide/rules/component-placement-rule.md +135 -0
  17. package/docs/code-organization-guide/rules/configuration-rule.md +42 -0
  18. package/docs/code-organization-guide/rules/constants-rule.md +77 -0
  19. package/docs/code-organization-guide/rules/exports-and-imports-rule.md +81 -0
  20. package/docs/code-organization-guide/rules/folder-nesting-rule.md +83 -0
  21. package/docs/code-organization-guide/rules/hook-extraction-rule.md +142 -0
  22. package/docs/code-organization-guide/rules/interactive-component-rule.md +100 -0
  23. package/docs/code-organization-guide/rules/jsx-hygiene-rule.md +68 -0
  24. package/docs/code-organization-guide/rules/locales-rule.md +55 -0
  25. package/docs/code-organization-guide/rules/nameable-visual-concept-rule.md +66 -0
  26. package/docs/code-organization-guide/rules/native-prop-forwarding-rule.md +38 -0
  27. package/docs/code-organization-guide/rules/no-mixed-concerns-rule.md +64 -0
  28. package/docs/code-organization-guide/rules/repeated-structure-rule.md +93 -0
  29. package/docs/code-organization-guide/rules/smart-vs-dumb-component-rule.md +116 -0
  30. package/docs/code-organization-guide/rules/sole-state-owner-rule.md +102 -0
  31. package/docs/code-organization-guide/rules/types-and-schemas-rule.md +138 -0
  32. package/docs/code-organization-guide/rules/utilities-rule.md +87 -0
  33. package/docs/documentation-guide/_templates/guide.md +19 -0
  34. package/docs/documentation-guide/_templates/reference.md +17 -0
  35. package/docs/documentation-guide/_templates/rule.md +21 -0
  36. package/docs/documentation-guide/documentation-guide.md +13 -0
  37. package/docs/documentation-guide/references/documentation-types-reference.md +9 -0
  38. package/docs/documentation-guide/rules/guide-creation-rule.md +112 -0
  39. package/docs/documentation-guide/rules/reference-creation-rule.md +132 -0
  40. package/docs/documentation-guide/rules/rule-creation-rule.md +81 -0
  41. package/docs/documentation-guide/rules/template-usage-rule.md +48 -0
  42. package/docs/shadcn-theme.md +121 -0
  43. package/docs/styling-guide/rules/class-composition-rule.md +32 -0
  44. package/docs/styling-guide/rules/color-role-naming-rule.md +115 -0
  45. package/docs/styling-guide/rules/component-state-rule.md +26 -0
  46. package/docs/styling-guide/rules/component-variant-rule.md +128 -0
  47. package/docs/styling-guide/rules/global-style-system-rule.md +63 -0
  48. package/docs/styling-guide/rules/style-placement-rule.md +49 -0
  49. package/docs/styling-guide/rules/tailwind-utility-rule.md +48 -0
  50. package/docs/styling-guide/rules/theme-and-utility-definition-rule.md +129 -0
  51. package/docs/styling-guide/rules/theme-token-rule.md +32 -0
  52. package/docs/styling-guide/styling-guide.md +17 -0
  53. package/package.json +24 -10
  54. package/AGENTS.md +0 -15
  55. package/docs/common/merge-behavior.md +0 -17
  56. package/docs/common/overview.md +0 -20
  57. /package/{CLAUDE.md → claude/hooks/CLAUDE.md} +0 -0
  58. /package/claude/{.claude/hooks → hooks}/status-line/index.js +0 -0
  59. /package/claude/{.claude/settings.base.json → settings.base.json} +0 -0
@@ -0,0 +1,138 @@
1
+ # Types and Schemas Rule
2
+
3
+ Types and schemas are easy to bury in component files or scatter across the project. This rule keeps them close to one component and gives independently used ones a consistent location.
4
+
5
+ - A type or schema used only to implement one configuration object MUST live in that object's `types/` or `schemas/` folder.
6
+ - Except for a type or schema used only to implement one configuration object, a type or schema declared in a component MUST stay in that component file until another file imports it without the component where it is defined. Importing it alongside that component does not trigger extraction.
7
+ - Except for a type or schema used only to implement one configuration object, a type or schema declared outside a component MUST stay with its declaring module until another file imports it independently.
8
+ - Extracted types and schemas MUST live in their matching `types/` or `schemas/` folder at the closest common folder (CCF) of their consumers.
9
+ - A `types/` or `schemas/` `index.ts` MAY define its exports directly.
10
+ - Types and schemas that are used together MAY be grouped in a file with a kebab-case name and named-re-exported from `index.ts`.
11
+ - When a `types/` or `schemas/` folder uses grouped files, its `index.ts` MUST only named-re-export those files.
12
+ - When a type or schema's CCF is `src/features/`, it MUST move to `src/types/` or `src/schemas/`.
13
+
14
+ ## Incorrect — Feature and Composition Type Kept in a Feature
15
+
16
+ ```text
17
+ src/
18
+ ├── compositions/
19
+ │ └── BillingDashboard.tsx
20
+ ├── features/
21
+ │ └── billing/
22
+ │ ├── invoice.tsx
23
+ │ └── types/
24
+ │ ├── billing.ts
25
+ │ └── index.ts
26
+ ```
27
+
28
+ ```tsx
29
+ // src/features/billing/invoice.tsx
30
+ import type { InvoiceStatus } from "./types";
31
+
32
+ // src/compositions/BillingDashboard.tsx
33
+ import type { InvoiceStatus } from "@/features/billing/types";
34
+ ```
35
+
36
+ Why: the feature and composition have `src/` as their CCF, but the type remains in the billing feature.
37
+
38
+ ## Correct — Feature and Composition Type in `src/types/`
39
+
40
+ ```text
41
+ src/
42
+ ├── compositions/
43
+ │ └── BillingDashboard.tsx
44
+ ├── features/
45
+ │ └── billing/
46
+ │ └── invoice.tsx
47
+ └── types/
48
+ ├── billing.ts
49
+ └── index.ts
50
+ ```
51
+
52
+ ```ts
53
+ // src/types/billing.ts
54
+ export type InvoiceStatus = "draft" | "paid";
55
+ export type PaymentMethod = "card" | "bank";
56
+
57
+ // src/types/index.ts
58
+ export type { InvoiceStatus, PaymentMethod } from "./billing";
59
+ ```
60
+
61
+ ```tsx
62
+ // src/features/billing/invoice.tsx
63
+ import type { InvoiceStatus } from "@/types";
64
+
65
+ // src/compositions/BillingDashboard.tsx
66
+ import type { InvoiceStatus } from "@/types";
67
+ ```
68
+
69
+ Why: the feature and composition have `src/` as their CCF, so the type lives in `src/types/`.
70
+
71
+ ## Incorrect — Type Imported Independently from a Component
72
+
73
+ ```tsx
74
+ // src/features/billing/invoice.tsx
75
+ export type DateRange = { from: Date; to: Date };
76
+
77
+ export function Invoice({ range }: { range: DateRange }): React.JSX.Element {
78
+ return <InvoiceView range={range} />;
79
+ }
80
+ ```
81
+
82
+ ```ts
83
+ // src/features/billing/hooks/use-billing-filter.ts
84
+ import type { DateRange } from "../invoice";
85
+ ```
86
+
87
+ Why: the hook reaches into a component file for a type it uses independently.
88
+
89
+ ## Correct — Independently Used Type Extracted
90
+
91
+ ```ts
92
+ // src/features/billing/types/index.ts
93
+ export type DateRange = { from: Date; to: Date };
94
+
95
+ // src/features/billing/hooks/use-billing-filter.ts
96
+ import { type DateRange } from "../types";
97
+ ```
98
+
99
+ Why: the component and hook can use the billing feature's types index independently.
100
+
101
+ ## Incorrect — Schema Imported Independently from a Component
102
+
103
+ ```tsx
104
+ // src/features/billing/invoice-form.tsx
105
+ import { z } from "zod";
106
+
107
+ export const invoiceSchema = z.object({
108
+ amount: z.number().positive(),
109
+ });
110
+ ```
111
+
112
+ ```ts
113
+ // src/features/billing/hooks/use-invoice-draft.ts
114
+ import { invoiceSchema } from "../invoice-form";
115
+ ```
116
+
117
+ Why: the hook reaches into a component file for a schema it uses independently.
118
+
119
+ ## Correct — Independently Used Schema Extracted
120
+
121
+ ```ts
122
+ // src/features/billing/schemas/index.ts
123
+ import { z } from "zod";
124
+
125
+ export const invoiceSchema = z.object({
126
+ amount: z.number().positive(),
127
+ });
128
+ ```
129
+
130
+ ```tsx
131
+ // src/features/billing/invoice-form.tsx
132
+ import { invoiceSchema } from "./schemas";
133
+
134
+ // src/features/billing/hooks/use-invoice-draft.ts
135
+ import { invoiceSchema } from "../schemas";
136
+ ```
137
+
138
+ Why: the component and hook can use the billing feature's schemas index independently.
@@ -0,0 +1,87 @@
1
+ # Utilities Rule
2
+
3
+ Pure functions should not be hidden in component files. This rule extracts them to a predictable `utils/` folder and keeps their imports direct.
4
+
5
+ - A pure function MUST be extracted to `utils/`, even when it has one consumer.
6
+ - A pure function returns the same result for the same arguments and does not read or write external mutable state, perform I/O, or manipulate the DOM.
7
+ - A utility used only to implement one configuration object MUST live in that object's `utils/` folder.
8
+ - An extracted utility MUST live in the `utils/` folder at the closest common folder (CCF) of its consumers.
9
+ - When a utility's CCF is `src/features/`, it MUST move to `src/utils/`.
10
+ - A utility MUST be imported directly without a barrel.
11
+ - A utility file that exports one function MUST have a name in that function's kebab-case form.
12
+ - Utilities that are used together MAY be grouped in a file with a kebab-case name.
13
+
14
+ ## Incorrect — Pure Function Left Beside Its Consumer
15
+
16
+ ```tsx
17
+ // src/features/billing/invoice.tsx
18
+ const calculateInvoiceTotal = (items: InvoiceItem[]): number => {
19
+ return items.reduce((total, item) => total + item.amount, 0);
20
+ };
21
+
22
+ export function Invoice({ items }: InvoiceProps): React.JSX.Element {
23
+ const total = calculateInvoiceTotal(items);
24
+ return <InvoiceTotal value={total} />;
25
+ }
26
+ ```
27
+
28
+ Why: the pure function is mixed into a component file.
29
+
30
+ ## Correct — Pure Function in a Directly Imported Utility File
31
+
32
+ ```ts
33
+ // src/features/billing/utils/calculate-invoice-total.ts
34
+ export function calculateInvoiceTotal(items: InvoiceItem[]): number {
35
+ return items.reduce((total, item) => total + item.amount, 0);
36
+ }
37
+ ```
38
+
39
+ ```tsx
40
+ // src/features/billing/invoice.tsx
41
+ import { calculateInvoiceTotal } from "./utils/calculate-invoice-total";
42
+
43
+ export function Invoice({ items }: InvoiceProps): React.JSX.Element {
44
+ const total = calculateInvoiceTotal(items);
45
+ return <InvoiceTotal value={total} />;
46
+ }
47
+ ```
48
+
49
+ Why: the function has a focused utility file in the billing feature's `utils/` folder.
50
+
51
+ ## Incorrect — Shared Utility Kept in a Feature
52
+
53
+ ```ts
54
+ // src/features/billing/utils/format-retry-delay.ts
55
+ export function formatRetryDelay(milliseconds: number): string {
56
+ return `${milliseconds / 1000} seconds`;
57
+ }
58
+ ```
59
+
60
+ ```tsx
61
+ // src/features/billing/invoice.tsx
62
+ import { formatRetryDelay } from "./utils/format-retry-delay";
63
+
64
+ // src/compositions/billing-dashboard.tsx
65
+ import { formatRetryDelay } from "@/features/billing/utils/format-retry-delay";
66
+ ```
67
+
68
+ Why: the utility is imported by both a feature and a composition, so it cannot stay in the billing feature.
69
+
70
+ ## Correct — Shared Utility in `src/utils/`
71
+
72
+ ```ts
73
+ // src/utils/format-retry-delay.ts
74
+ export function formatRetryDelay(milliseconds: number): string {
75
+ return `${milliseconds / 1000} seconds`;
76
+ }
77
+ ```
78
+
79
+ ```tsx
80
+ // src/features/billing/invoice.tsx
81
+ import { formatRetryDelay } from "@/utils/format-retry-delay";
82
+
83
+ // src/compositions/billing-dashboard.tsx
84
+ import { formatRetryDelay } from "@/utils/format-retry-delay";
85
+ ```
86
+
87
+ Why: the utility's CCF is `src/`, so it lives in `src/utils/`.
@@ -0,0 +1,19 @@
1
+ # [Topic] Guide
2
+
3
+ [1-2 short sentences explaining the underlying idea behind this guide and why it matters.]
4
+
5
+ ## How To [Workflow]
6
+
7
+ [What does this accomplish? When should it run?]
8
+
9
+ 1. [Step 1]
10
+ 2. [Step 2]
11
+
12
+ ## How To [Another Workflow]
13
+
14
+ [What does this accomplish? When should it run?]
15
+
16
+ 1. [Step 1]
17
+ 2. [Step 2]
18
+
19
+ [Repeat this section only when the guide has another real workflow. Otherwise delete it.]
@@ -0,0 +1,17 @@
1
+ # [Topic] Reference
2
+
3
+ [1-2 short sentences naming exactly what readers can look up here and when they should use this reference.]
4
+
5
+ [Single lookup content — table, glossary, hierarchy, catalog, or config block. Keep this branch only when the reference has exactly one lookup block; it has no section heading. Otherwise delete this branch and use one heading per lookup group below.]
6
+
7
+ ## [First Lookup Group Name]
8
+
9
+ [1-2 short sentences explaining what this group contains and why it is included.]
10
+
11
+ [Place this group's lookup content here.]
12
+
13
+ ## [Next Lookup Group Name]
14
+
15
+ [1-2 short sentences explaining what this group contains and why it is included.]
16
+
17
+ [Place this group's lookup content here. Repeat the heading, explanation, and lookup content for every remaining group; delete this multi-block branch when the reference has one lookup block.]
@@ -0,0 +1,21 @@
1
+ # [Rule Name] Rule
2
+
3
+ [What problem does this rule solve?]
4
+
5
+ - [Requirement using MUST, MUST NOT, SHOULD, SHOULD NOT, or MAY]
6
+
7
+ ## Incorrect — [Concise example description]
8
+
9
+ ```[lang]
10
+ // code
11
+ ```
12
+
13
+ Why: [What makes this incorrect?]
14
+
15
+ ## Correct — [Concise example description]
16
+
17
+ ```[lang]
18
+ // code
19
+ ```
20
+
21
+ Why: [What makes this correct?]
@@ -0,0 +1,13 @@
1
+ # Documentation Guide
2
+
3
+ This guide explains how to create Rules, References, and Guides in this repository.
4
+
5
+ ## How To Create a Document
6
+
7
+ Run this whenever you add a new doc to the repository.
8
+
9
+ 1. Pick the document kind from the [Documentation Types Reference](references/documentation-types-reference.md) so you know the right template.
10
+ 2. Follow the [Template Usage Rule](rules/template-usage-rule.md) so the doc has no leftover bracketed prompts.
11
+ 3. For a Guide, follow the [Guide Creation Rule](rules/guide-creation-rule.md) so the doc has the correct shape, naming, and folder layout.
12
+ 4. For a Rule, follow the [Rule Creation Rule](rules/rule-creation-rule.md) so the doc has the correct shape, naming, and vocabulary.
13
+ 5. For a Reference, follow the [Reference Creation Rule](rules/reference-creation-rule.md) so the doc has the correct shape, naming, and folder layout.
@@ -0,0 +1,9 @@
1
+ # Documentation Types Reference
2
+
3
+ Use this reference to look up the three standard Markdown document kinds in this repository. Their templates are in `docs/documentation-guide/_templates/`.
4
+
5
+ | Kind | Shape | Template |
6
+ | --------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------ |
7
+ | Guide | A workflow-oriented document with one or more `## How To [...]` sections. | `guide.md` |
8
+ | Rule | An opinionated project rule that states required, forbidden, recommended, or optional behavior. | `rule.md` |
9
+ | Reference | Lookup material such as a table, hierarchy, configuration block, glossary, or catalog. | `reference.md` |
@@ -0,0 +1,112 @@
1
+ # Guide Creation Rule
2
+
3
+ Guides without a consistent creation process invent their own structure. This rule defines how to create a Guide document.
4
+
5
+ - Each How To step MUST be concise and use one sentence.
6
+ - A Guide MAY reference Rules, References, and other Guides.
7
+ - Each How To step MUST link at most one documentation file total, whether that file is a Rule, Reference, or Guide.
8
+ - When a step links a Rule, Reference, or Guide, the step MUST name the concrete decision or result the reader will have after reading it.
9
+ - A step that links another Guide MUST link directly to the relevant How To section.
10
+ - How To sections MUST NOT nest inside other How To sections.
11
+ - Guide file names MUST match the document title in kebab-case and use the `-guide` suffix (e.g., `foo-guide.md`).
12
+ - A Guide with private support files MUST become a folder named the same as its entry-point file, without the `.md` extension.
13
+ - Private Rule files for a Guide MUST live in a `rules/` subfolder inside the Guide's folder.
14
+ - Private Reference files for a Guide MUST live in a `references/` subfolder inside the Guide's folder.
15
+
16
+ ## Incorrect — Private Documents Mixed at the Guide Root
17
+
18
+ ```text
19
+ feature-workflow-guide/
20
+ ├── feature-workflow-guide.md
21
+ ├── naming-rule.md
22
+ └── option-reference.md
23
+ ```
24
+
25
+ Why: mixed Markdown files turn the doc folder into an undifferentiated list once the doc grows.
26
+
27
+ ## Correct — Private Documents Grouped by Kind
28
+
29
+ ```text
30
+ feature-workflow-guide/
31
+ ├── feature-workflow-guide.md
32
+ ├── rules/
33
+ │ └── naming-rule.md
34
+ └── references/
35
+ └── option-reference.md
36
+ ```
37
+
38
+ Why: private support files stay colocated with the entry point while being grouped by document kind.
39
+
40
+ ## Incorrect — Step Links to Multiple Documents
41
+
42
+ ```markdown
43
+ 1. Follow the [Naming Rule](rules/naming-rule.md) and the [Layout Rule](rules/layout-rule.md) so the doc looks right.
44
+ ```
45
+
46
+ Why: step links two Rules and does not name a concrete decision or result.
47
+
48
+ ## Correct — Step Links to One Document
49
+
50
+ ```markdown
51
+ 1. Follow the [Naming Rule](rules/naming-rule.md) so the doc has a predictable file name.
52
+ ```
53
+
54
+ Why: step links one Rule and names the concrete result the reader will have.
55
+
56
+ ## Incorrect — Nested How To Section
57
+
58
+ ```markdown
59
+ ## How To Deploy
60
+
61
+ 1. Build the project.
62
+ ### How To Build
63
+ 1. Run the build script.
64
+ ```
65
+
66
+ Why: a How To section nests inside a step of another How To section.
67
+
68
+ ## Correct — Flat How To Sections
69
+
70
+ ```markdown
71
+ ## How To Deploy
72
+
73
+ 1. Follow [How To Build](#how-to-build) to build the project.
74
+
75
+ ## How To Build
76
+
77
+ 1. Run the build script.
78
+ ```
79
+
80
+ Why: How To sections stay flat and reference each other via links.
81
+
82
+ ## Incorrect — Multi-Sentence Step
83
+
84
+ ```markdown
85
+ 1. First, check the configuration file. Then verify all required fields are present. After that, confirm none of the fields contain invalid values.
86
+ ```
87
+
88
+ Why: step uses multiple sentences instead of one concise sentence.
89
+
90
+ ## Correct — Concise Step
91
+
92
+ ```markdown
93
+ 1. Run the config check script.
94
+ ```
95
+
96
+ Why: step is one concise sentence with a concrete action.
97
+
98
+ ## Incorrect — Guide Link Omits Its How To Section
99
+
100
+ ```markdown
101
+ 1. Follow the [Build Guide](build-guide.md) to build the project.
102
+ ```
103
+
104
+ Why: link points at a Guide file but does not anchor to a specific How To section, so the reader lands on the guide's introduction and has to search for the relevant workflow.
105
+
106
+ ## Correct — Guide Link Targets Its How To Section
107
+
108
+ ```markdown
109
+ 1. Follow [How To Build](build-guide.md#how-to-build) to build the project.
110
+ ```
111
+
112
+ Why: link anchors to the specific How To section, so the reader lands directly on the relevant workflow.
@@ -0,0 +1,132 @@
1
+ # Reference Creation Rule
2
+
3
+ References without a consistent creation process scatter lookup material. This rule defines how to create a Reference document.
4
+
5
+ - Reference file names MUST match the document title in kebab-case and use the `-reference` suffix (e.g., `foo-reference.md`).
6
+ - A Reference MUST NOT link to Rules, Guides, or other References.
7
+ - A Reference MUST NOT use RFC 2119 vocabulary (`MUST`, `MUST NOT`, `SHOULD`, `SHOULD NOT`, `MAY`), because lookup material describes what exists rather than imposing requirements.
8
+ - A Reference document overview and each section overview MUST contain one or two short sentences.
9
+ - A Reference with a single lookup block MUST NOT add a section heading for it.
10
+ - A Reference with two or more lookup blocks MUST add a section heading for every block, including the first.
11
+
12
+ ## Incorrect — Reference Links to Another Document
13
+
14
+ ```markdown
15
+ - See the [Naming Rule](../rules/naming-rule.md) for the file naming conventions.
16
+ ```
17
+
18
+ Why: reference body contains a reference to another Rule.
19
+
20
+ ## Correct — Reference States the Lookup Fact Directly
21
+
22
+ ```markdown
23
+ - File names are kebab-case, match the document title, and have a `-reference` suffix.
24
+ ```
25
+
26
+ Why: reference states lookup content directly without linking to its source.
27
+
28
+ ## Incorrect — Reference Uses Requirement Vocabulary
29
+
30
+ ```markdown
31
+ | Layer | Contents |
32
+ | ----- | ------------------------------------------------- |
33
+ | `app` | Routing files only — a route MUST NOT hold a util |
34
+ ```
35
+
36
+ Why: the cell carries RFC 2119 vocabulary, so a Reference asserts a requirement that only a Rule can own, and the same constraint ends up stated in two documents.
37
+
38
+ ## Correct — Reference Describes Existing Content
39
+
40
+ ```markdown
41
+ | Layer | Contents |
42
+ | ----- | ------------------ |
43
+ | `app` | Routing files only |
44
+ ```
45
+
46
+ Why: the cell describes what the layer holds, leaving the requirement to the Rule that owns it.
47
+
48
+ ## Incorrect — Single Lookup Block Has a Heading
49
+
50
+ ```markdown
51
+ # Option Reference
52
+
53
+ Use this reference to choose between the two supported project sizes when starting a new initiative.
54
+
55
+ ## Options
56
+
57
+ Pick the size that matches the team's headcount and timeline.
58
+
59
+ | Option | Use Case |
60
+ | ------ | -------------- |
61
+ | A | Small projects |
62
+ | B | Large projects |
63
+ ```
64
+
65
+ Why: section heading is unnecessary and forces a duplicated intro covering what the reference is for and what the group contains.
66
+
67
+ ## Correct — Single Lookup Block Has No Heading
68
+
69
+ ```markdown
70
+ # Option Reference
71
+
72
+ Use this reference to choose between the two supported project sizes when starting a new initiative.
73
+
74
+ | Option | Use Case |
75
+ | ------ | -------------- |
76
+ | A | Small projects |
77
+ | B | Large projects |
78
+ ```
79
+
80
+ Why: single lookup block sits directly under the intro without a heading.
81
+
82
+ ## Incorrect — First of Multiple Lookup Blocks Has No Heading
83
+
84
+ ```markdown
85
+ # Option Reference
86
+
87
+ Use this reference to look up the supported project sizes and the review gates each one requires.
88
+
89
+ | Option | Use Case |
90
+ | ------ | -------------- |
91
+ | A | Small projects |
92
+ | B | Large projects |
93
+
94
+ ## Review Gates
95
+
96
+ Each size carries a different approval bar.
97
+
98
+ | Option | Approvals |
99
+ | ------ | --------- |
100
+ | A | 1 |
101
+ | B | 2 |
102
+ ```
103
+
104
+ Why: the reference has two lookup blocks but only the second is headed, so the first table reads as part of the intro and cannot be scanned or linked as a group of its own.
105
+
106
+ ## Correct — Every Lookup Block Has a Heading
107
+
108
+ ```markdown
109
+ # Option Reference
110
+
111
+ Use this reference to look up the supported project sizes and the review gates each one requires.
112
+
113
+ ## Project Sizes
114
+
115
+ Pick the size that matches the team's headcount and timeline.
116
+
117
+ | Option | Use Case |
118
+ | ------ | -------------- |
119
+ | A | Small projects |
120
+ | B | Large projects |
121
+
122
+ ## Review Gates
123
+
124
+ Each size carries a different approval bar.
125
+
126
+ | Option | Approvals |
127
+ | ------ | --------- |
128
+ | A | 1 |
129
+ | B | 2 |
130
+ ```
131
+
132
+ Why: both lookup blocks are headed, so they read as peers and each is independently scannable and linkable.
@@ -0,0 +1,81 @@
1
+ # Rule Creation Rule
2
+
3
+ Rules without a consistent creation process invent their own structure and enforcement language. This rule defines how to create a Rule document.
4
+
5
+ - Rule file names MUST match the document title in kebab-case and use the `-rule` suffix (e.g., `foo-rule.md`).
6
+ - A Rule MUST contain at least one bullet point that uses [RFC 2119 vocabulary](https://datatracker.ietf.org/doc/html/rfc2119) (`MUST`, `MUST NOT`, `SHOULD`, `SHOULD NOT`, `MAY`).
7
+ - RFC 2119 vocabulary MUST appear only in bullet points, so the bullet list is the single place a requirement is stated.
8
+ - Prose outside bullet points — intros, `Why:` explanations, table cells, and code comments — MUST restate a requirement in plain language instead of repeating RFC 2119 vocabulary.
9
+ - `MUST` MUST mean required.
10
+ - `MUST NOT` MUST mean forbidden.
11
+ - `SHOULD` MUST mean recommended, with exceptions possible.
12
+ - `SHOULD NOT` MUST mean discouraged, with exceptions possible.
13
+ - `MAY` MUST mean optional.
14
+ - A Rule MUST contain at least one Incorrect/Correct pair.
15
+ - A Rule MAY contain multiple Incorrect/Correct pairs.
16
+ - An Incorrect/Correct pair MUST add a concise description after an em dash in both headings, so readers can scan the examples by decision.
17
+ - A Rule MUST NOT link to References, Guides, or other Rules.
18
+
19
+ ## Incorrect — Lowercase Requirement Words
20
+
21
+ ```markdown
22
+ - Authors must remove unused sections.
23
+ - New docs should use the -rule suffix.
24
+ ```
25
+
26
+ Why: lower-case "must" and "should" do not carry RFC 2119 meaning.
27
+
28
+ ## Correct — RFC 2119 Requirement Words
29
+
30
+ ```markdown
31
+ - Authors MUST remove unused sections.
32
+ - New docs SHOULD use the -rule suffix.
33
+ ```
34
+
35
+ Why: uppercase keywords carry their canonical RFC 2119 meaning.
36
+
37
+ ## Incorrect — Rule Links to a Reference
38
+
39
+ ```markdown
40
+ - Rule bodies MUST follow the guidance in the [Vocabulary Reference](../references/vocabulary-reference.md).
41
+ ```
42
+
43
+ Why: rule contains a reference to another Reference.
44
+
45
+ ## Correct — Rule States Its Vocabulary Directly
46
+
47
+ ```markdown
48
+ - Rule bodies MUST use RFC 2119 vocabulary: MUST, MUST NOT, SHOULD, SHOULD NOT, or MAY.
49
+ ```
50
+
51
+ Why: rule states requirements directly without referencing other docs.
52
+
53
+ ## Incorrect — Requirement Repeated in an Explanation
54
+
55
+ ```markdown
56
+ - A helper file MUST use named exports.
57
+
58
+ ## Incorrect — Default Export
59
+
60
+ // helper.ts
61
+ export default function sum(a, b) {}
62
+
63
+ Why: a helper file MUST use named exports, so `export default` is not allowed here.
64
+ ```
65
+
66
+ Why: the explanation repeats the bullet's requirement word, so the requirement now lives in two places and a later edit can leave the bullet and the explanation disagreeing about what is required.
67
+
68
+ ## Correct — Requirement Explained in Plain Language
69
+
70
+ ```markdown
71
+ - A helper file MUST use named exports.
72
+
73
+ ## Incorrect — Default Export
74
+
75
+ // helper.ts
76
+ export default function sum(a, b) {}
77
+
78
+ Why: helper files use named exports only, so `export default` does not belong here.
79
+ ```
80
+
81
+ Why: the bullet is the only place the requirement is stated, and the explanation describes the example in plain language.
@@ -0,0 +1,48 @@
1
+ # Template Usage Rule
2
+
3
+ Authoring without a template makes every doc invent its own title, orientation, and section shape. This rule keeps new docs predictable. Templates for each document kind live in `../_templates/`.
4
+
5
+ - Authors MUST start from the template for the chosen document kind.
6
+ - Authors MUST replace each bracketed prompt with the final title, explanation, step, or lookup content it asks for.
7
+ - Authors MUST delete template branches that do not apply to the document being written.
8
+
9
+ ## Incorrect — Template Prompts and Unused Branches Kept
10
+
11
+ ```markdown
12
+ # Example Guide
13
+
14
+ [1-2 short sentences explaining the underlying idea behind this guide and why it matters.]
15
+
16
+ ## How To Do Something
17
+
18
+ [What does this accomplish? When should it run?]
19
+
20
+ 1. [Step 1]
21
+ 2. [Step 2]
22
+
23
+ ## How To Another Workflow
24
+
25
+ [What does this accomplish? When should it run?]
26
+
27
+ 1. [Step 1]
28
+ 2. [Step 2]
29
+ ```
30
+
31
+ Why: committed doc still contains bracketed prompts, and the unused "Another Workflow" section was not deleted.
32
+
33
+ ## Correct — Template Prompts Replaced and Unused Branches Removed
34
+
35
+ ```markdown
36
+ # Example Guide
37
+
38
+ This guide shows how to do something useful. It matters because doing it wrong breaks the build.
39
+
40
+ ## How To Do Something
41
+
42
+ Run this before every release.
43
+
44
+ 1. Check the config.
45
+ 2. Run the deploy script.
46
+ ```
47
+
48
+ Why: all bracketed prompts are replaced, unused template branches are deleted, and no leftover brackets remain.