Commit Graph

8 Commits (e4a659b2693bef9cc37aff6d1f539b8ce3bceb76)

Author SHA1 Message Date
Jason Stirnaman e4a659b269 fix: write logs to stderr to avoid interfering with piped output
Change log() function to use console.error instead of console.log.
This ensures that when stdout is piped (e.g., to 'code -'), only
the prompt file path is sent through the pipe, while progress
messages remain visible on the terminal via stderr.

Usage:
  echo 'content' | yarn --silent docs:create --products X | code -
2025-11-01 10:24:55 -05:00
Jason Stirnaman 45a5de02b6 feat: environment-aware prompt output for external tools
When running outside Claude Code, script now outputs prompt file path
to stdout by default (or prompt text with --print-prompt flag).
This enables integration with external AI tools without requiring flags.

Inside Claude Code, script continues to run Task() agent automatically.

Changes:
- Add isClaudeCode() detection function
- Add outputPromptForExternalUse() helper
- Add PROMPT_FILE constant for .tmp/scaffold-prompt.txt
- Update both URL-based and draft-based workflows
- Update help text with environment-aware behavior examples
2025-11-01 10:18:57 -05:00
Jason Stirnaman 4288c3b1aa feat: add --print-prompt flag to output AI prompt to stdout
Allows piping prompt to other AI tools or saving to file:
  yarn docs:create --print-prompt draft.md > prompt.txt
  yarn docs:create --print-prompt draft.md | llm -m gpt-4

The flag:
- Prepares context and selects products
- Generates the full AI prompt
- Outputs to stdout and exits
- Works with both URL-based and draft-based workflows
2025-11-01 10:09:01 -05:00
Jason Stirnaman 70272534a8 feat: accept product keys (not display names) in --products flag
- --products now accepts keys from products.yml (influxdb3_core, telegraf, etc.)
- automatically expands multi-version products to all versions
- maintains backwards compatibility with display names
- provides clear error messages with list of valid product keys

Examples:
  --products influxdb3_core
  --products influxdb3_core,influxdb3_enterprise
  --products telegraf
2025-11-01 09:03:57 -05:00
Jason Stirnaman c24878651a fix: require --products flag when using stdin, remove TTY check from promptUser
- stdin now requires --products flag with product keys
- removed early return in promptUser() that prevented interactive prompts
- updated help text with stdin + --products examples
- prevents 'No products selected' error when running interactively
2025-10-31 17:31:36 -05:00
Jason Stirnaman 9373446ea6 WIP: follow external links in a draft, accept draft via stdin 2025-10-30 10:06:54 -04:00
Jason Stirnaman ecbb65b045 chore(scripts): docs:create and docs:edit scripts for content creation and editing 2025-10-27 23:43:08 -04:00
Jason Stirnaman 52e676b092 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
2025-10-27 21:27:34 -04:00