Skip to content

docs: add ast-grep-config documentation page - #50

Merged
amondnet merged 10 commits into
mainfrom
amondnet/doc-ast
Oct 14, 2026
Merged

amondnet merged 10 commits into
mainfrom
amondnet/doc-ast

Conversation

@amondnet

@amondnet amondnet commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a documentation page for @pleaseai/ast-grep-config to the docs site (English and Korean) and links it from both READMEs.

  • New page apps/docs/src/content/docs/{en,ko}/ast-grep-config.mdx:
    • installation, including bun trustedDependencies
    • sgconfig.yml usage
    • the five ADR-0022 principles
    • layer 2 (ast-grep rules) vs layer 3 (please-style check)
    • the 11-rule table, linking to each rule README, with per-rule-group summaries
    • per-language error file locations
    • framework file exemptions, including the Nuxt 3 workaround
    • compatibility
  • Adds an "ast-grep Config" card to the home page (index.mdx) in both locales.
  • Adds an install/usage section to README.md and README.ko.md that links to the new page.

Documentation only. No code or package changes.

Related issue

None.

Checklist

  • PR title follows Conventional Commits
  • Packages build (bun run build) — produced dist/{en,ko}/ast-grep-config.html
  • Lint/format pass (bun run lint) — not run; bun run typecheck (astro check) reports 0 errors/0 warnings and bun run lint:docs passes on 22 files
  • Documentation updated if behavior changed
  • No breaking change, or a BREAKING CHANGE: note is included

Summary by cubic

Adds English and Korean documentation for @pleaseai/ast-grep-config, plus README install/usage sections and home-page cards linking to it. Documentation only; no code or package changes.

  • New page covers installation (including bun trustedDependencies), sgconfig.yml usage, the five ADR-0022 principles, layer 2 versus layer 3 (please-style check), the 11-rule table with per-rule-group summaries, per-language error file locations and matching conditions, and compatibility.
  • Framework exemptions apply only to the default-export rules, including the Nuxt 3 two-command workaround for root directories, the Nuxt 4 migration to a single ast-grep scan, and the *.d.ts exemption shared with the error rules.
  • Adds an "ast-grep Config" card to the docs home page in both locales.
  • README.md and README.ko.md gain an install/usage section pointing to the page, with headings made unique per package.

Written for commit 0883773. Summary will update on new commits.

Turn on auto-fix

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Deploying code-style with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0883773
Status: ✅  Deploy successful!
Preview URL: https://31b96f6c.code-style.pages.dev
Branch Preview URL: https://amondnet-doc-ast.code-style.pages.dev

View logs

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds comprehensive documentation for the @pleaseai/ast-grep-config package in both English and Korean, including updates to the main READMEs and documentation index pages. The review feedback suggests a medium-severity improvement to clarify the Nuxt 3 terminology in the English documentation, specifically changing 'root layouts' to 'root directories' or 'root structure' to avoid confusion.

Comment thread apps/docs/src/content/docs/en/ast-grep-config.mdx Outdated
@amondnet
amondnet marked this pull request as ready for review October 14, 2026 06:26
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files

Architecture diagram
sequenceDiagram
    participant Dev as Developer
    participant BUN as bun CLI
    participant AG as ast-grep CLI
    participant CFG as ast-grep-config Package
    participant RULES as Rule Files
    participant DOCS as Docs Site
    participant PKG as Package Manager

    Note over Dev,DOCS: Documentation-Only PR - Describes Existing Runtime Flows

    Note over Dev,PKG: Installation Flow (NEW: Documented)
    Dev->>BUN: bun add -D @pleaseai/ast-grep-config @ast-grep/cli
    BUN->>PKG: Install packages
    BUN->>BUN: Check trustedDependencies
    alt bun without trustedDependencies
        BUN->>BUN: Skip @ast-grep/cli postinstall
        BUN-->>Dev: Fallback warning on every scan
    else bun with trustedDependencies
        BUN->>PKG: Run @ast-grep/cli postinstall
        PKG-->>BUN: ast-grep binary available
    end
    BUN-->>Dev: Packages installed

    Note over Dev,AG: Usage Flow (NEW: Documented)
    Dev->>AG: bunx ast-grep scan
    AG->>CFG: Read sgconfig.yml
    CFG-->>AG: ruleDirs: node_modules/@pleaseai/ast-grep-config/rules
    AG->>RULES: Load 11 rules
    RULES-->>AG: Rule definitions

    alt direct scan with package config
        Dev->>AG: bunx ast-grep scan -c node_modules/@pleaseai/ast-grep-config/sgconfig.yml
        AG->>CFG: Load package's own sgconfig.yml
        CFG-->>AG: Config with ruleDirs
    end

    AG->>AG: Run Layer 2 structural rules
    Note over AG: TypeScript/Dart/Kotlin/Java/Rust<br/>No type info - name-based matching
    AG-->>Dev: Scan report (all warnings)

    Note over AG,CFG: Layer 3 (CHANGED: Documented)
    AG->>AG: Ignore extract/ directory
    Note over AG: extract/ not in ruleDirs<br/>Only used by please-style check

    Note over Dev,CFG: Nuxt 3 Workaround (NEW: Documented)
    alt Nuxt 3 root layouts (pages/ without app/)
        Dev->>AG: ast-grep scan --off=ts-no-default-export --off=tsx-no-default-export
        Dev->>AG: ast-grep scan --filter '^(ts|tsx)-no-default-export$' --globs '!pages/**' --globs '!layouts/**'
        AG->>RULES: Apply framework ignores
        RULES-->>AG: Excluded directories
    end

    Note over Dev,DOCS: Documentation Infrastructure
    Dev->>DOCS: Access /en/ast-grep-config or /ko/ast-grep-config
    DOCS-->>Dev: Render docs page
    
    Note over DOCS: Docs site built from<br/>MDX content files
    Note over AG,CFG: Message includes README path in node_modules
    Note over AG: Warnings self-documenting for agents
Loading

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/docs/src/content/docs/en/ast-grep-config.mdx Outdated
Comment thread apps/docs/src/content/docs/en/ast-grep-config.mdx Outdated
@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low impact] The PR appears safe to merge, with both previous documentation issues addressed.

Summary

Adds English and Korean guides for @pleaseai/ast-grep-config, with README sections and home-page links.

  • The ast-grep guide shows how to install and run its rules.
  • The guide explains which code patterns the rules flag.
  • Both READMEs show how to install and run ast-grep rules.
  • The docs home pages link to the ast-grep guide.

Reviews (2) · Last reviewed commit: "chore(docs): clarify Nuxt 4 migration re..." · Reviewed by Greptile

Comment thread apps/docs/src/content/docs/en/ast-grep-config.mdx Outdated
Comment thread apps/docs/src/content/docs/en/ast-grep-config.mdx Outdated
@amondnet

Copy link
Copy Markdown
Contributor Author

/gemini review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/docs/src/content/docs/ko/ast-grep-config.mdx">

<violation number="1" location="apps/docs/src/content/docs/ko/ast-grep-config.mdx:173">
P2: This directs users to run the full `ast-grep scan` twice after migrating, duplicating the scan. Replace the two-step workaround with one plain scan.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/docs/src/content/docs/ko/ast-grep-config.mdx Outdated
@sonarqubecloud

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds comprehensive documentation for the new '@pleaseai/ast-grep-config' package, detailing its installation, usage, and core principles in both English and Korean across the READMEs and documentation pages. The review feedback points out a minor issue in the documentation examples where the invalid '--globs' option is used instead of '--glob' in the 'ast-grep scan' command.

Comment thread apps/docs/src/content/docs/en/ast-grep-config.mdx
Comment thread apps/docs/src/content/docs/ko/ast-grep-config.mdx
@amondnet
amondnet merged commit 75df21f into main Oct 14, 2026
13 checks passed
@amondnet
amondnet deleted the amondnet/doc-ast branch October 14, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant