Skip to content

feat(dialtone-docs): DDT-1622 add AI documentation package — content, validation, and templates#1051

Open
belumontoya wants to merge 18 commits intostagingfrom
docs/planning-phase1
Open

feat(dialtone-docs): DDT-1622 add AI documentation package — content, validation, and templates#1051
belumontoya wants to merge 18 commits intostagingfrom
docs/planning-phase1

Conversation

@belumontoya
Copy link
Contributor

@belumontoya belumontoya commented Feb 12, 2026

🛠️ Type Of Change

  • Feature
  • Documentation

📖 Description

Adds packages/dialtone-docs/, a new package that provides AI-discoverable documentation for the Dialtone design system. This PR covers Milestones 1-2 of a 7-milestone plan — package foundation and content authoring. No other package depends on this yet, so merging carries zero risk.

What this adds

Package infrastructure (packages/dialtone-docs/):

  • package.json with dependencies (gray-matter, glob, handlebars, vitest)
  • project.json for NX build and test targets
  • vite.config.js with Vitest configuration and path aliases

22 content files across 5 categories, all researched from the actual codebase:

Category Files Covers
architecture/ 4 + INDEX Monorepo structure, build system, documentation system, design token pipeline
development/ 5 + INDEX Component workflow, CSS utilities, design tokens, icons, testing
workflows/ 6 + INDEX Release process, branch strategy, conventional commits, component lifecycle, Figma sync, CI pipeline
reference/ 2 + INDEX Component API patterns (cross-cutting contracts), accessibility checklist
standards/ 2 + INDEX Internal AI documentation standards, external GEO optimization

2 Handlebars templates for generating new docs:

  • component.md.hbs — Component documentation template
  • architecture.md.hbs — Architecture documentation template

3 test helpers for parsing and validating markdown content:

  • fileReader.js — Finds content files by glob pattern
  • frontmatterParser.js — Parses YAML frontmatter via gray-matter
  • markdownParser.js — Extracts headings, sections, and stripped text from markdown

4 test suites (26 tests, all passing):

  • structure.test.js — Package config, directories, test helpers exist
  • frontmatter.test.js — YAML frontmatter validation (required fields, types, keyword count, ai_summary length)
  • searchability.test.js — Content uses actual package names and technical terms, no placeholder content
  • completeness.test.js — All category directories, INDEX files, content docs, and templates exist

Planning documents in docs/:

  • Implementation plan, brainstorm, executive summary, methodology, planning index
  • AI documentation standards reference (936-line comprehensive guide)

🧪 How To Test

# Run all 26 validation tests
pnpm nx run dialtone-docs:test

# Expected output:
# Test Files  4 passed (4)
#      Tests  26 passed (26)

The tests validate:

  1. Structure — Package has all required config files, directories, and test helpers
  2. Frontmatter — Every content .md file has valid YAML frontmatter with required fields (type, category, keywords with 3+ items, ai_summary ≤ 150 chars)
  3. Searchability — Content mentions actual Dialtone package names and technical terms; no placeholder text like "Lorem ipsum" or "TBD"
  4. Completeness — All 5 content directories exist with INDEX files, all expected docs are present, templates exist

No build step is needed yet — that's Milestone 3. This package only has tests at this stage.

💡 Context

Problem: AI assistants need structured, searchable documentation to help developers use Dialtone effectively. Current docs are optimized for human reading on dialtone.dialpad.com but lack the structure for AI consumption.

Approach: A dedicated package that validates and generates AI-optimized documentation following three principles:

  1. Searchability — Content uses actual component names and technical terms (grep-able)
  2. Completeness — Every major system has documentation
  3. Structure — Standardized YAML frontmatter with required fields

Design decisions:

  • Content researched entirely from the actual codebase — no placeholders or made-up information
  • Kebab-case filenames with category prefix (e.g. architecture-build-system.md)
  • "Rebuild everything" build pattern (matching build-dialtone-vue-docs.mjs)
  • Reference folder kept to 2 files — cross-cutting API contracts only, not lookup tables (that's what MCP tools do)
  • Standards split from one 936-line doc into 2 focused files (internal AI + external GEO)

🔮 Future Milestones (separate branch)

After merge, a docs/planning-phase2 branch will implement:

  • Milestone 3 — Generator (markdown → ai-docs.json)
  • Milestone 4 — MCP server integration (search_docs tool)
  • Milestone 5 — Distribution system
  • Milestone 6 — Component doc generation from Vue files
  • Milestone 7 — CI validation workflow

📝 Checklist

  • I have ensured no private Dialpad links or info are in the code or pull request description.
  • I have reviewed my changes.
  • I have added all relevant documentation.
  • I have considered the performance impact of my change.
  • All 26 tests pass (pnpm nx run dialtone-docs:test)

This commit contains the planning and discovery phase documentation for
implementing AI-friendly documentation in Dialtone.

Includes:
- Analysis of current documentation system (HOW_DOCS_WORK.md)
- Research findings and brainstorming (BRAINSTORM_AI_GEO_DOCS.md)
- Planning methodology documentation (PLANNING_METHODOLOGY.md)
- Detailed Phase 1 implementation plan (PHASE_1_IMPLEMENTATION_PLAN.md)
- Executive summary and navigation (PLANNING_INDEX.md, PLANNING_EXECUTIVE_SUMMARY.md)

Key decisions:
- Two-track approach: Internal AI Standards + External GEO
- Root docs/ for AI context, public site for GEO optimization
- Test-driven documentation with automated validation
- Foundation-first approach (structure, tests, templates before content)

This documentation explains WHY and HOW we planned, not implementation.
No code changes or actual documentation structure created yet.

Phase 1 execution will follow in subsequent commits.
Merged best practices from design-studio and beacon-app repos into single authoritative standards document.

Key sections:
- Three core principles: Searchability, Completeness, Structure
- Content Quality guidelines (substantive content, no placeholders)
- File Naming Conventions for all 5 categories
- Complete directory structure for docs/
- External GEO Reference (6 principles for public docs)
- Validation guidelines (automated vs manual)
- Tools & Resources for documentation authors
- Enhanced checklist (20 items)

This provides complete guidance for both internal AI context docs and external GEO optimization.
Add comprehensive 7-day implementation plan for new packages/dialtone-docs/ package that generates AI-discoverable documentation. Plan includes incremental milestones for test infrastructure, content validation, documentation generation, MCP integration, and CI/CD.

Also includes adapted Task 2.1 from original planning phase.
Create new packages/dialtone-docs/ package with:
- Basic directory structure (src/, tests/helpers/, tests/tests/)
- package.json with dependencies (gray-matter, glob, handlebars, vitest)
- Build and test scripts configuration

This is Milestone 1, Tasks 1-2 of the implementation plan.
@wiz-inc-55b470eb7e
Copy link

wiz-inc-55b470eb7e bot commented Feb 26, 2026

Wiz Scan Summary

⚠️ Many findings detected
Many findings were detected, but only a subset of the findings are displayed inline due to API constraints. To view all findings inline, please click here.
Scanner Findings
Vulnerability Finding Vulnerabilities 51 High 28 Medium 6 Low
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total 51 High 28 Medium 6 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

belumontoya and others added 7 commits February 27, 2026 09:00
Add project.json with build and test targets for NX orchestration. Enables running package tasks via nx run commands and integrates with monorepo caching and dependency graph.
Add markdownParser.js, fileReader.js, and frontmatterParser.js test helpers
plus vite.config.js and updated plan file. Completes the test infrastructure
layer for the dialtone-docs package.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add structure.test.js as a development scaffold test to validate package
setup during active development. All 9 tests pass via nx run dialtone-docs:test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add architecture-monorepo-structure.md and architecture-build-system.md
with AI-discoverable frontmatter, real package names, and detailed guidance
on adding new packages to the monorepo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add INDEX.md, monorepo structure, build system, documentation system,
and design token pipeline docs to src/content/architecture/.
Adds 5 development workflow guides and an index under
packages/dialtone-docs/src/content/development/:

- Component workflow: Yeoman generator, 8-file structure, JSDoc
  conventions for props/slots/events, constants pattern, data-qa
- CSS utilities: static LESS vs PostCSS generator approaches, naming
  convention, responsive/hover/focus variants, Gulp build pipeline
- Design tokens: raw vs semantic token distinction, JSON format,
  token reference syntax, build steps after changes
- Icons: SVG requirements, category structure, keywords, Gulp
  pipeline that generates Vue components, size variants
- Testing: Vitest setup, coverage thresholds, standard test pattern,
  mount vs shallowMount, shared fixtures and assertion helpers
Adds 6 workflow documentation files and an index under
packages/dialtone-docs/src/content/workflows/:

- Release process: Tuesday 10AM UTC cron, semantic-release per
  package, tag format {name}/v{version}, changelog plugins, npmPublish
  disabled, staging-to-production fast-forward auto-merge
- Branch strategy: staging as main dev branch, all PRs target staging,
  production only updated via release, deploy preview URL patterns,
  required checks before merge
- Conventional commits: full format with JIRA requirement, 11 allowed
  types, version bump mapping, breaking change syntax, custom
  @dialpad/conventional-changelog-angular behavior
- Component lifecycle: ready/beta/planned status values, frontmatter
  fields, component status page rendering, planned nav items
- Figma sync: both sync script directions, env vars required, Tokens
  Studio vs Style Dictionary format, GitHub Actions workflows
- CI pipeline: all workflows with triggers, commands, required checks,
  GCP deployment destinations, secrets reference table
@belumontoya
Copy link
Contributor Author

codex (@codex)

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 605e732d51

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "codex (@codex) address that feedback".

…lengths

- Add component.md.hbs and architecture.md.hbs templates
- Add frontmatter, searchability, and completeness validation tests
- Fix ai_summary fields exceeding 150-char limit across 6 content files
- Fix YAML parse error in architecture-documentation-system.md frontmatter
- All 26 tests pass
@belumontoya belumontoya changed the title Docs/planning phase1 feat(dialtone-docs): add AI documentation package — content, validation, and templates Mar 10, 2026
@belumontoya belumontoya changed the title feat(dialtone-docs): add AI documentation package — content, validation, and templates feat(dialtone-docs): DDT-1622 add AI documentation package — content, validation, and templates Mar 11, 2026
…tion extraction, sync lockfile

- Remove build target from project.json (src/generators/build.mjs is Milestone 3 work, not yet created)
- Fix extractSections to end sections at same-or-higher level headings, matching the documented contract
- Commit updated pnpm-lock.yaml so CI --frozen-lockfile passes
Planning, brainstorming, and discovery files served their purpose during
Milestones 1-2 and are not part of the shipping package.
AI_DOCUMENTATION_STANDARDS.md was already split into
standard-ai-documentation.md and standard-geo-optimization.md inside
packages/dialtone-docs/src/content/standards/.
belumontoya and others added 2 commits March 12, 2026 12:19
…it isFilePath

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@belumontoya
Copy link
Contributor Author

belumontoya commented Mar 12, 2026

Brad Paugh (@braddialpad) thank you for the thorough review
thank you

Copy link
Contributor

@braddialpad Brad Paugh (braddialpad) left a comment

Choose a reason for hiding this comment

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

Looks good, I think the only remaining change that needs to be made is the beforeAll. Pre-approving

@iropolo
Copy link
Contributor

I was thinking while checking the PR, about Ai-docs and context we provide to AI to be up to date with changes.
Are we updating those? Im thinking on some actions that we can run every Friday/Wednesday that it will go trough all the changes and update these docs?, Also maybe this can brings up some unwanted change we did.

I will probably never check this docs to be honest 🥴🥴

@belumontoya
Copy link
Contributor Author

I was thinking while checking the PR, about Ai-docs and context we provide to AI to be up to date with changes. Are we updating those? Im thinking on some actions that we can run every Friday/Wednesday that it will go trough all the changes and update these docs?, Also maybe this can brings up some unwanted change we did.

I will probably never check this docs to be honest 🥴🥴

I have another PR coming, where I'm adding skills and tools to help syncronize docs, also this should evolve in having the docs automatically made

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.

3 participants