Commit Graph

2 Commits (copilot/fix-6290)

Author SHA1 Message Date
Jason Stirnaman e8a48e3482
chore(docs): Redesign docs CLI tools for creating and editing content, add content/create.md tutorial page for the How to creat… (#6506)
* chore(docs): Add content/create.md tutorial page for the How to create your own documentation tutorial

chore(scripts): docs:create and docs:edit scripts for content creation and editing

Major improvements to docs:create UX for both Claude Code and external tool integration:

**New `docs` CLI command:**
- Add scripts/docs-cli.js - main CLI with subcommand routing
- Add bin field to package.json for `docs` command
- Usage: `docs create` and `docs edit` (cleaner than yarn commands)

**Smart piping detection:**
- Auto-detect when stdout is piped (\!process.stdout.isTTY)
- When piping: automatically output prompt text (no flag needed)
- When interactive: output prompt file path
- --print-prompt flag now optional (auto-enabled when piping)

**Specify products:**
- simplify link following behavior - treat relative paths as local files, all HTTP/HTTPS as external
- stdin now requires --products flag with product keys
- --products now accepts keys from products.yml (influxdb3_core, telegraf, etc.)

Examples:
  --products influxdb3_core
  --products influxdb3_core,influxdb3_enterprise
  --products telegraf

**Usage examples:**
  # Inside Claude Code - automatic execution
  docs create drafts/new-feature.md

  # Pipe to external AI - prompt auto-detected
  docs create FILE --products X | claude -p
  docs create FILE --products X | copilot -p

  # Pipe from stdin
  echo 'content' | docs create --products X | claude -p

Benefits:
- Cleaner syntax (no yarn --silent needed)
- No manual --print-prompt flag when piping
- Consistent with industry tools (git, npm, etc.)
- Backward compatible with yarn commands

WIP: docs:create usage examples

- Redesign of the docs CLI tools for creating and editing content
- Cleaner interface works better for piping output to agents and downstream utilities
- Updates README.md and other authoring docs

This repository includes a `docs` CLI tool for common documentation workflows:

```sh
npx docs create drafts/new-feature.md --products influxdb3_core

npx docs edit https://docs.influxdata.com/influxdb3/core/admin/

npx docs placeholders content/influxdb3/core/admin/upgrade.md

npx docs --help
```

**Run test cases:**

```sh
npx docs test
```

* Update content/create.md

* Update content/create.md

* Update content/create.md

* Update content/create.md

* Update scripts/templates/chatgpt-prompt.md

* Update DOCS-SHORTCODES.md
2025-11-03 10:18:15 -06:00
Jason Stirnaman 56b459659d
Jts agentsmd (#6486)
* feat(docs): add content scaffolding system with AI-powered analysis

Add yarn docs:create command for intelligent content scaffolding:

- Phase 1: Script analyzes draft and repository structure
- Phase 2: Claude command generates file structure and frontmatter
- Phase 3: Script creates files from proposal

New files:
- scripts/docs-create.js: Main orchestration script
- scripts/lib/content-scaffolding.js: Core scaffolding logic
- scripts/lib/file-operations.js: File I/O utilities
- .claude/commands/scaffold-content.md: Claude analysis command

Features:
- Intelligent product detection (Core, Enterprise, Cloud, etc.)
- Generates complete frontmatter
- Dry-run and interactive confirmation modes

Usage:
  yarn docs:create --from path/to/draft.md
  /scaffold-content
  yarn docs:create --execute

* chore(scripts): docs:create and docs:edit scripts for content creation and editing
2025-10-28 07:20:13 -05:00