@knowcode/doc-builder 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/assets/css/notion-style.css +3 -3
- package/assets/css/style.css +3 -3
- package/cli.js +283 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,37 @@ All notable changes to @knowcode/doc-builder will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.3.2] - 2025-07-19
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- New `claude-hints` command to generate Claude.md documentation standards
|
|
12
|
+
- Comprehensive guide for Claude AI to produce consistent markdown documentation
|
|
13
|
+
- Support for both markdown and plain text output formats
|
|
14
|
+
- Option to save hints directly to a file
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- Further reduced top spacing to exactly 40px from the horizontal bar
|
|
18
|
+
- Adjusted header height from 50px to 40px
|
|
19
|
+
- Removed breadcrumb height entirely (0px) for minimal spacing
|
|
20
|
+
- Set content top padding to fixed 40px for precise control
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
- Document structure standards with metadata requirements
|
|
24
|
+
- Naming conventions for different document types
|
|
25
|
+
- Mermaid diagram best practices
|
|
26
|
+
- Information verification standards (✅/❓)
|
|
27
|
+
- File organization patterns
|
|
28
|
+
- Git commit practices
|
|
29
|
+
- Markdown formatting guidelines
|
|
30
|
+
- Security and maintenance considerations
|
|
31
|
+
|
|
32
|
+
### Usage
|
|
33
|
+
```bash
|
|
34
|
+
doc-builder claude-hints # Display to console
|
|
35
|
+
doc-builder claude-hints -o CLAUDE.md # Save to file
|
|
36
|
+
doc-builder claude-hints --format text # Plain text format
|
|
37
|
+
```
|
|
38
|
+
|
|
8
39
|
## [1.3.1] - 2025-07-19
|
|
9
40
|
|
|
10
41
|
### Fixed
|
|
@@ -125,8 +125,8 @@
|
|
|
125
125
|
/* Layout */
|
|
126
126
|
--container-padding-mobile: 20px;
|
|
127
127
|
--container-padding-desktop: 40px;
|
|
128
|
-
--header-height:
|
|
129
|
-
--breadcrumb-height:
|
|
128
|
+
--header-height: 40px;
|
|
129
|
+
--breadcrumb-height: 0px;
|
|
130
130
|
--sidebar-width: 280px;
|
|
131
131
|
}
|
|
132
132
|
|
|
@@ -705,7 +705,7 @@ pre code {
|
|
|
705
705
|
|
|
706
706
|
.content {
|
|
707
707
|
flex: 1;
|
|
708
|
-
padding:
|
|
708
|
+
padding: 40px var(--space-8);
|
|
709
709
|
overflow-y: auto;
|
|
710
710
|
background: var(--color-bg-default);
|
|
711
711
|
}
|
package/assets/css/style.css
CHANGED
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
/* Layout */
|
|
45
45
|
--sidebar-width: 280px;
|
|
46
46
|
--content-max-width: 65rem;
|
|
47
|
-
--header-height:
|
|
48
|
-
--breadcrumb-height:
|
|
47
|
+
--header-height: 40px;
|
|
48
|
+
--breadcrumb-height: 0px;
|
|
49
49
|
--banner-offset: 0rem;
|
|
50
50
|
|
|
51
51
|
/* Transitions */
|
|
@@ -1087,7 +1087,7 @@ em, i {
|
|
|
1087
1087
|
.content {
|
|
1088
1088
|
flex: 1;
|
|
1089
1089
|
margin-left: var(--sidebar-width);
|
|
1090
|
-
padding:
|
|
1090
|
+
padding: 40px var(--space-2xl) var(--space-xl);
|
|
1091
1091
|
max-width: calc(var(--content-max-width) + var(--space-2xl) * 2);
|
|
1092
1092
|
transition: margin-left var(--transition-base);
|
|
1093
1093
|
}
|
package/cli.js
CHANGED
|
@@ -471,6 +471,289 @@ ${chalk.yellow('What gets created:')}
|
|
|
471
471
|
}
|
|
472
472
|
});
|
|
473
473
|
|
|
474
|
+
// Claude hints command
|
|
475
|
+
program
|
|
476
|
+
.command('claude-hints')
|
|
477
|
+
.description('Generate Claude.md hints for documentation standards')
|
|
478
|
+
.option('-o, --output <path>', 'output file path (default: stdout)')
|
|
479
|
+
.option('--format <format>', 'output format: md or text (default: md)')
|
|
480
|
+
.addHelpText('after', `
|
|
481
|
+
${chalk.yellow('What this does:')}
|
|
482
|
+
Generates a comprehensive guide for Claude.md configuration
|
|
483
|
+
that helps Claude produce well-structured markdown documentation
|
|
484
|
+
following best practices and consistent standards.
|
|
485
|
+
|
|
486
|
+
${chalk.yellow('Usage:')}
|
|
487
|
+
${chalk.gray('$')} doc-builder claude-hints ${chalk.gray('# Display to console')}
|
|
488
|
+
${chalk.gray('$')} doc-builder claude-hints -o CLAUDE.md ${chalk.gray('# Save to file')}
|
|
489
|
+
${chalk.gray('$')} doc-builder claude-hints --format text ${chalk.gray('# Plain text format')}
|
|
490
|
+
|
|
491
|
+
${chalk.yellow('What gets included:')}
|
|
492
|
+
• Document structure standards
|
|
493
|
+
• Naming conventions for different doc types
|
|
494
|
+
• Mermaid diagram best practices
|
|
495
|
+
• Information verification standards (✅/❓)
|
|
496
|
+
• File organization patterns
|
|
497
|
+
• Git commit practices
|
|
498
|
+
• Markdown formatting guidelines
|
|
499
|
+
`)
|
|
500
|
+
.action((options) => {
|
|
501
|
+
const claudeHints = `# Documentation Standards for Claude.md
|
|
502
|
+
|
|
503
|
+
Add these instructions to your CLAUDE.md file to ensure consistent, high-quality documentation generation.
|
|
504
|
+
|
|
505
|
+
## Document Standards and Conventions
|
|
506
|
+
|
|
507
|
+
### Document Structure
|
|
508
|
+
|
|
509
|
+
**Document Title Format**
|
|
510
|
+
- Use \`# Document Title\`
|
|
511
|
+
- Include metadata:
|
|
512
|
+
- **Generated**: YYYY-MM-DD HH:MM UTC
|
|
513
|
+
- **Status**: Draft/In Progress/Complete
|
|
514
|
+
- **Verified**: ✅ (for verified information) / ❓ (for speculated information)
|
|
515
|
+
|
|
516
|
+
### Overview Section
|
|
517
|
+
- Provide a brief description of the document's contents
|
|
518
|
+
- Clearly explain the purpose and scope
|
|
519
|
+
|
|
520
|
+
## Content Sections
|
|
521
|
+
### Subsection
|
|
522
|
+
Content with clear headings and logical flow.
|
|
523
|
+
|
|
524
|
+
## Document History
|
|
525
|
+
| Date | Author | Changes |
|
|
526
|
+
|------|--------|---------|
|
|
527
|
+
| YYYY-MM-DD | Name | Initial creation |
|
|
528
|
+
| YYYY-MM-DD | Name | Updated section X |
|
|
529
|
+
|
|
530
|
+
### Naming Conventions
|
|
531
|
+
|
|
532
|
+
- Analysis documents: analysis-{topic}-{specifics}.md
|
|
533
|
+
- Design documents: design-{component}-{feature}.md
|
|
534
|
+
- Implementation plans: plan-{feature}-implementation.md
|
|
535
|
+
- Technical guides: {component}-{topic}-guide.md
|
|
536
|
+
- Overview documents: {system}-overview.md
|
|
537
|
+
- Testing documents: test-{component}-{type}.md
|
|
538
|
+
- Troubleshooting guides: troubleshoot-{issue}-guide.md
|
|
539
|
+
- API documentation: api-{service}-reference.md
|
|
540
|
+
|
|
541
|
+
## Content Standards
|
|
542
|
+
|
|
543
|
+
### 1. Mermaid Diagrams
|
|
544
|
+
- Include diagrams wherever they help explain complex concepts
|
|
545
|
+
- Use consistent node naming and styling
|
|
546
|
+
- Add clear labels and descriptions
|
|
547
|
+
- Example:
|
|
548
|
+
\`\`\`mermaid
|
|
549
|
+
graph TD
|
|
550
|
+
A[Start] --> B{Decision}
|
|
551
|
+
B -->|Yes| C[Process]
|
|
552
|
+
B -->|No| D[End]
|
|
553
|
+
|
|
554
|
+
style A fill:#f9f,stroke:#333,stroke-width:2px
|
|
555
|
+
style B fill:#bbf,stroke:#333,stroke-width:2px
|
|
556
|
+
\`\`\`
|
|
557
|
+
|
|
558
|
+
### 2. Information Verification
|
|
559
|
+
- Mark all information as either verified (✅) or speculated (❓)
|
|
560
|
+
- Include sources for verified information
|
|
561
|
+
- Clearly indicate assumptions
|
|
562
|
+
- Example:
|
|
563
|
+
- ✅ **Verified**: Based on official documentation
|
|
564
|
+
- ❓ **Speculated**: Assumed based on common patterns
|
|
565
|
+
|
|
566
|
+
### 3. Code Examples
|
|
567
|
+
- Use proper syntax highlighting
|
|
568
|
+
- Include context and explanations
|
|
569
|
+
- Show both correct and incorrect usage where applicable
|
|
570
|
+
- Add comments explaining key concepts
|
|
571
|
+
|
|
572
|
+
### 4. File Organization
|
|
573
|
+
- Active files in appropriate directories
|
|
574
|
+
- Unused files moved to archive/ with descriptive names
|
|
575
|
+
- Temporary files include "temp" in filename
|
|
576
|
+
- Create docs/ directory structure:
|
|
577
|
+
\`\`\`
|
|
578
|
+
docs/
|
|
579
|
+
├── architecture/
|
|
580
|
+
├── api/
|
|
581
|
+
├── guides/
|
|
582
|
+
├── troubleshooting/
|
|
583
|
+
└── README.md
|
|
584
|
+
\`\`\`
|
|
585
|
+
|
|
586
|
+
### 5. Version Control
|
|
587
|
+
- Commit after material changes or milestones
|
|
588
|
+
- Use descriptive commit messages
|
|
589
|
+
- Group related changes
|
|
590
|
+
- Example commit messages:
|
|
591
|
+
- "Add API authentication guide"
|
|
592
|
+
- "Update deployment architecture diagram"
|
|
593
|
+
- "Fix broken links in troubleshooting guide"
|
|
594
|
+
|
|
595
|
+
## Markdown Best Practices
|
|
596
|
+
|
|
597
|
+
### Headers
|
|
598
|
+
- Use hierarchical structure (H1 for title, H2 for main sections)
|
|
599
|
+
- Don't skip header levels
|
|
600
|
+
- Keep headers concise but descriptive
|
|
601
|
+
|
|
602
|
+
### Lists
|
|
603
|
+
- Use bullet points for unordered lists
|
|
604
|
+
- Use numbers for sequential steps
|
|
605
|
+
- Indent nested lists properly
|
|
606
|
+
|
|
607
|
+
### Tables
|
|
608
|
+
- Include headers and alignment
|
|
609
|
+
- Keep tables readable in raw markdown
|
|
610
|
+
- Example:
|
|
611
|
+
\`\`\`markdown
|
|
612
|
+
| Feature | Status | Notes |
|
|
613
|
+
|---------|--------|-------|
|
|
614
|
+
| Auth | ✅ Done | Uses JWT |
|
|
615
|
+
| API | 🚧 WIP | In progress |
|
|
616
|
+
\`\`\`
|
|
617
|
+
|
|
618
|
+
### Links
|
|
619
|
+
- Use descriptive link text, not "click here"
|
|
620
|
+
- Prefer relative links for internal docs
|
|
621
|
+
- Check links regularly for validity
|
|
622
|
+
|
|
623
|
+
### Images
|
|
624
|
+
- Include alt text and captions
|
|
625
|
+
- Store images in docs/assets/ or docs/images/
|
|
626
|
+
- Use descriptive filenames
|
|
627
|
+
|
|
628
|
+
## Documentation Requirements
|
|
629
|
+
|
|
630
|
+
### Timestamp
|
|
631
|
+
- Always include generation date at top
|
|
632
|
+
- Format: **Generated**: YYYY-MM-DD HH:MM UTC
|
|
633
|
+
|
|
634
|
+
### Status Tracking
|
|
635
|
+
- Mark document status (Draft/Complete)
|
|
636
|
+
- Include last review date
|
|
637
|
+
- Note planned updates
|
|
638
|
+
|
|
639
|
+
### Cross-references
|
|
640
|
+
- Link to related documents
|
|
641
|
+
- Create index/navigation pages
|
|
642
|
+
- Maintain a documentation map
|
|
643
|
+
|
|
644
|
+
### Examples
|
|
645
|
+
- Include practical examples
|
|
646
|
+
- Show real-world use cases
|
|
647
|
+
- Provide sample configurations
|
|
648
|
+
|
|
649
|
+
### Troubleshooting
|
|
650
|
+
- Add common issues and solutions
|
|
651
|
+
- Include error messages verbatim
|
|
652
|
+
- Provide step-by-step resolution
|
|
653
|
+
|
|
654
|
+
## Quality Standards
|
|
655
|
+
|
|
656
|
+
### Clarity
|
|
657
|
+
- Write for your audience's technical level
|
|
658
|
+
- Define acronyms on first use
|
|
659
|
+
- Avoid jargon without explanation
|
|
660
|
+
|
|
661
|
+
### Completeness
|
|
662
|
+
- Cover all aspects of the topic
|
|
663
|
+
- Include edge cases
|
|
664
|
+
- Document limitations
|
|
665
|
+
|
|
666
|
+
### Accuracy
|
|
667
|
+
- Verify technical details
|
|
668
|
+
- Test code examples
|
|
669
|
+
- Update when systems change
|
|
670
|
+
|
|
671
|
+
### Consistency
|
|
672
|
+
- Use same terminology throughout
|
|
673
|
+
- Follow established patterns
|
|
674
|
+
- Maintain style guide compliance
|
|
675
|
+
|
|
676
|
+
### Maintenance
|
|
677
|
+
- Review quarterly
|
|
678
|
+
- Update version numbers
|
|
679
|
+
- Archive outdated content
|
|
680
|
+
|
|
681
|
+
## Special Considerations
|
|
682
|
+
|
|
683
|
+
### Security
|
|
684
|
+
- Never include credentials or sensitive data
|
|
685
|
+
- Use placeholders for secrets
|
|
686
|
+
- Document security implications
|
|
687
|
+
|
|
688
|
+
### Performance
|
|
689
|
+
- Document performance implications
|
|
690
|
+
- Include benchmarks where relevant
|
|
691
|
+
- Note resource requirements
|
|
692
|
+
|
|
693
|
+
### Dependencies
|
|
694
|
+
- List all dependencies and versions
|
|
695
|
+
- Note compatibility requirements
|
|
696
|
+
- Document upgrade paths
|
|
697
|
+
|
|
698
|
+
### Compatibility
|
|
699
|
+
- Note platform/version requirements
|
|
700
|
+
- Document breaking changes
|
|
701
|
+
- Provide migration guides
|
|
702
|
+
|
|
703
|
+
### Accessibility
|
|
704
|
+
- Use clear language and structure
|
|
705
|
+
- Provide text alternatives
|
|
706
|
+
- Consider screen reader users
|
|
707
|
+
|
|
708
|
+
## Additional Claude.md Instructions
|
|
709
|
+
|
|
710
|
+
### When Creating Documentation
|
|
711
|
+
- Always put md documents in the docs/ directory
|
|
712
|
+
- Use mermaid diagrams whenever it makes sense to explain something
|
|
713
|
+
- Explain things diagrammatically when possible
|
|
714
|
+
- Create any new md docs into the docs directory and put in a relevant folder
|
|
715
|
+
|
|
716
|
+
### Git Practices
|
|
717
|
+
- Do a git commit after material changes or milestone
|
|
718
|
+
- After any material changes or a milestone commit the changes to git
|
|
719
|
+
- As files become unused - move them to archive and rename
|
|
720
|
+
|
|
721
|
+
### Testing and Temporary Files
|
|
722
|
+
- When creating temporary temp files for testing - put "temp" in the file name
|
|
723
|
+
- Create temp files with descriptive names like "temp-test-api-response.json"
|
|
724
|
+
|
|
725
|
+
### Documentation Maintenance
|
|
726
|
+
- Regularly remove outdated mermaid diagram files (.md) from docs/ directory
|
|
727
|
+
- When diagram generation scripts are run, they should REPLACE existing MD files
|
|
728
|
+
- Use clean, consistent naming without version suffixes
|
|
729
|
+
|
|
730
|
+
This comprehensive guide ensures consistent, high-quality documentation that is easy to maintain and navigate.`;
|
|
731
|
+
|
|
732
|
+
// Output the hints
|
|
733
|
+
if (options.output) {
|
|
734
|
+
try {
|
|
735
|
+
fs.writeFileSync(options.output, claudeHints);
|
|
736
|
+
console.log(chalk.green(`✅ Claude hints saved to ${options.output}`));
|
|
737
|
+
} catch (error) {
|
|
738
|
+
console.error(chalk.red(`Error writing file: ${error.message}`));
|
|
739
|
+
process.exit(1);
|
|
740
|
+
}
|
|
741
|
+
} else {
|
|
742
|
+
// Output to console
|
|
743
|
+
if (options.format === 'text') {
|
|
744
|
+
// Strip markdown formatting for plain text
|
|
745
|
+
const plainText = claudeHints
|
|
746
|
+
.replace(/#{1,6}\s/g, '')
|
|
747
|
+
.replace(/\*\*/g, '')
|
|
748
|
+
.replace(/`([^`]+)`/g, '$1')
|
|
749
|
+
.replace(/\[([^\]]+)\]\([^)]+\)/g, '$1');
|
|
750
|
+
console.log(plainText);
|
|
751
|
+
} else {
|
|
752
|
+
console.log(claudeHints);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
});
|
|
756
|
+
|
|
474
757
|
// Parse arguments
|
|
475
758
|
program.parse(process.argv);
|
|
476
759
|
|