diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml new file mode 100644 index 0000000..6952c46 --- /dev/null +++ b/.github/workflows/vale.yml @@ -0,0 +1,37 @@ +name: Vale + +on: + pull_request: + paths: + - ".github/workflows/vale.yml" + - ".pre-commit-config.yaml" + - ".vale.ini" + - ".vale/**" + - "docs/**/*.md" + - "docs/**/*.mdx" + - "templates/**/*.md" + - "templates/**/*.mdx" + workflow_dispatch: + +permissions: + contents: read + pull-requests: write + +jobs: + vale: + name: Vale advisory lint + runs-on: ubuntu-latest + continue-on-error: true + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Run Vale + uses: errata-ai/vale-action@v2.1.1 + with: + files: '["docs", "templates"]' + fail_on_error: true + filter_mode: added + vale_flags: "--minAlertLevel=error" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..ec05aec --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +repos: + - repo: local + hooks: + - id: vale-docs + name: Vale docs language lint + entry: vale --minAlertLevel=error + language: system + files: ^(docs|templates)/.*\.(md|mdx)$ diff --git a/.vale.ini b/.vale.ini new file mode 100644 index 0000000..c9e7878 --- /dev/null +++ b/.vale.ini @@ -0,0 +1,8 @@ +StylesPath = .vale/styles +MinAlertLevel = suggestion + +[formats] +mdx = md + +[*.{md,mdx}] +BasedOnStyles = Yellow diff --git a/.vale/styles/Yellow/AISlop.yml b/.vale/styles/Yellow/AISlop.yml new file mode 100644 index 0000000..d983cd5 --- /dev/null +++ b/.vale/styles/Yellow/AISlop.yml @@ -0,0 +1,34 @@ +extends: existence +message: "Avoid '%s'. Use direct, concrete wording." +level: error +ignorecase: true +tokens: + - "—" + - "–" + - "\\bdelve\\b" + - "\\bleverage\\b" + - "\\bunlock\\b" + - "\\bharness(?:es|ed|ing)?\\b" + - "\\bseamlessly\\b" + - "\\bseamless\\b" + - "\\brobust\\b" + - "\\bpowerful\\b" + - "\\bboasts?\\b" + - "\\beffortless\\b" + - "\\belevate\\b" + - "\\bstreamline\\b" + - "\\brevolutionary\\b" + - "\\bcutting-edge\\b" + - "\\bbleeding-edge\\b" + - "\\bin today's\\b" + - "\\bit's worth noting\\b" + - "\\bit is important to note\\b" + - "\\bnavigating the landscape\\b" + - "\\bthe world of\\b" + - "\\bat the end of the day\\b" + - "\\bthat being said\\b" + - "\\byou may want to\\b" + - "\\byou might consider\\b" + - "\\bfeel free to\\b" + - "\\bembark on your journey\\b" + - "\\bunlock the power of\\b" diff --git a/.vale/styles/Yellow/BuildPageShape.yml b/.vale/styles/Yellow/BuildPageShape.yml new file mode 100644 index 0000000..869ec1f --- /dev/null +++ b/.vale/styles/Yellow/BuildPageShape.yml @@ -0,0 +1,6 @@ +extends: occurrence +message: "Build how-to pages should include TL;DR, Step-by-step, Verify, and Next steps headings." +level: warning +scope: raw +token: "(?m)^## (TL;DR|Step-by-step|Verify|Next steps)\\b" +min: 4 diff --git a/.vale/styles/Yellow/CrossLink.yml b/.vale/styles/Yellow/CrossLink.yml new file mode 100644 index 0000000..4dbe8cb --- /dev/null +++ b/.vale/styles/Yellow/CrossLink.yml @@ -0,0 +1,6 @@ +extends: occurrence +message: "Learn and Protocol pages should declare their counterpart link in frontmatter." +level: warning +scope: raw +token: "(?m)^(protocol_link|learn_link):" +min: 1 diff --git a/.vale/styles/Yellow/NeedBasedLabels.yml b/.vale/styles/Yellow/NeedBasedLabels.yml new file mode 100644 index 0000000..40eb440 --- /dev/null +++ b/.vale/styles/Yellow/NeedBasedLabels.yml @@ -0,0 +1,11 @@ +extends: existence +message: "Consider a task-based title instead of internal label '%s'." +level: suggestion +scope: heading +ignorecase: true +tokens: + - "\\bwdk-wallet-ton\\b" + - "\\bnitronode-rpc-overview\\b" + - "\\bsdk-compat-eventpoller\\b" + - "\\bapp-sessions-multi-party\\b" + - "\\b[a-z0-9]+(?:-[a-z0-9]+){2,}\\b" diff --git a/.vale/styles/Yellow/NoMetaphor.yml b/.vale/styles/Yellow/NoMetaphor.yml new file mode 100644 index 0000000..1368b93 --- /dev/null +++ b/.vale/styles/Yellow/NoMetaphor.yml @@ -0,0 +1,11 @@ +extends: existence +message: "Avoid analogy or metaphor in reference prose: '%s'." +level: warning +ignorecase: true +tokens: + - "\\blike a\\b" + - "\\blike an\\b" + - "\\bas if\\b" + - "\\bthink of\\b" + - "\\banalogy\\b" + - "\\bmetaphor\\b" diff --git a/.vale/styles/Yellow/NoNarrative.yml b/.vale/styles/Yellow/NoNarrative.yml new file mode 100644 index 0000000..86660f9 --- /dev/null +++ b/.vale/styles/Yellow/NoNarrative.yml @@ -0,0 +1,6 @@ +extends: occurrence +message: "Reference prose should stay terse. Split long paragraphs before they become narrative." +level: warning +scope: paragraph +token: "\\b\\w+\\b" +max: 90 diff --git a/.vale/styles/Yellow/SpecVoice.yml b/.vale/styles/Yellow/SpecVoice.yml new file mode 100644 index 0000000..cd70021 --- /dev/null +++ b/.vale/styles/Yellow/SpecVoice.yml @@ -0,0 +1,10 @@ +extends: existence +message: "Use definitional spec voice instead of narrative phrasing: '%s'." +level: warning +ignorecase: true +tokens: + - "\\bwe (?:will|can|should|need to)\\b" + - "\\byou (?:will|can|should|need to)\\b" + - "\\blet's\\b" + - "\\bthis guide (?:shows|walks|explains)\\b" + - "\\bin this (?:guide|page|section)\\b" diff --git a/templates/api-reference-method.md b/templates/api-reference-method.md new file mode 100644 index 0000000..f2ccd84 --- /dev/null +++ b/templates/api-reference-method.md @@ -0,0 +1,51 @@ +--- +title: +description: +--- + +# + + + +## Signature + +```text +() -> +``` + +## Parameters + +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `` | `` | Yes | | + +## Response + +| Field | Type | Description | +| --- | --- | --- | +| `` | `` | | + +## Errors + +| Code | Meaning | +| --- | --- | +| `` | | + +## SDK equivalents + +| SDK | Call | +| --- | --- | +| TypeScript | `` | +| Go | `` | + +## Example envelope + +```json +[ + "", + "", + "", + {}, + "" +] +``` diff --git a/templates/build-howto.mdx b/templates/build-howto.mdx new file mode 100644 index 0000000..1427363 --- /dev/null +++ b/templates/build-howto.mdx @@ -0,0 +1,50 @@ +--- +title: +description: +sidebar_position: +--- + +# + + + +## TL;DR + + + +```bash + + + +``` + +## Step-by-step + +### 1. + + + +```bash + +``` + + + +### 2. + + + +```typescript + +``` + + + +## Verify + + + +## Next steps + +- [](./) +- [](../../api-reference/) diff --git a/templates/learn-page.mdx b/templates/learn-page.mdx new file mode 100644 index 0000000..81a1eda --- /dev/null +++ b/templates/learn-page.mdx @@ -0,0 +1,23 @@ +--- +title: +description: +protocol_link: ../protocol/ +--- + +# + + + + + +## Why it matters + + + +## How it works + + + +## Related protocol + +Read the formal definition in [](../protocol/). diff --git a/templates/protocol-page.mdx b/templates/protocol-page.mdx new file mode 100644 index 0000000..a34cb3f --- /dev/null +++ b/templates/protocol-page.mdx @@ -0,0 +1,26 @@ +--- +title: +description: +learn_link: ../learn/ +--- + +# + + + +## Definition + + + +## Invariants + +- +- + +## State transitions + + + +## Learn counterpart + +Read the builder-facing explanation in [](../learn/). diff --git a/templates/tutorial.mdx b/templates/tutorial.mdx new file mode 100644 index 0000000..b10d8b6 --- /dev/null +++ b/templates/tutorial.mdx @@ -0,0 +1,51 @@ +--- +title: +description: +sidebar_position: +--- + +# + + + +## What you build + + + +## Prerequisites + +- +- + +## Steps + +### 1. + + + +```bash + +``` + +### 2. + + + +```typescript + +``` + +## Run the app + +```bash + +``` + +## What you have now + + + +## Next steps + +- [](../build/) +- [](../api-reference/)