Skip to content

Km updates#92

Open
longieirl wants to merge 31 commits into
mainfrom
km-updates
Open

Km updates#92
longieirl wants to merge 31 commits into
mainfrom
km-updates

Conversation

@longieirl
Copy link
Copy Markdown
Member

@longieirl longieirl commented Jan 16, 2026

This extraction provides the foundation for:

  • Automated validation based on 111 real improvement patterns
  • Quality benchmarking against 5 proven examples
  • Smart corrections using 19 identified typo patterns
  • Template generation from high-scoring documentation
  • Continuous learning from documented feedback patterns

The successful extraction of 30 commits worth of KM expertise into actionable patterns demonstrates that the system can effectively learn from institutional knowledge and apply it consistently across all future documentation changes.

This data now powers the entire docs-linter system, ensuring that the rules and validations are based on real KM team feedback rather than generic documentation standards.

@longieirl longieirl self-assigned this Jan 16, 2026
Copy link
Copy Markdown
Member Author

@longieirl longieirl left a comment

Choose a reason for hiding this comment

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

Great.

@longieirl longieirl marked this pull request as ready for review January 22, 2026 11:34
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 27, 2026

🔗 Link Check Results

The link checker has completed. This is an optional check and will not block the PR.

View workflow run for details

If broken links were found, please review them at your convenience.


Last updated: Run #219 at 2026-05-12T08:48:01Z

Comment thread docs-linter/src/rules/technical.js Fixed
Comment thread docs-linter/src/rules/technical.js Fixed
Comment thread docs-linter/src/rules/content.js Fixed
Comment thread docs-linter/src/rules/content.js Fixed
Comment thread docs-linter/src/rules/structural.js Fixed
Comment thread docs-linter/src/cli.js Fixed
longieirl and others added 22 commits March 11, 2026 12:44
Initialize docs/ and prompts/ directories with template files for:
- Documentation guidelines and style guides
- PR checklists and review processes
- Troubleshooting templates
- Knowledge management workflows

Co-Authored-By: Claude <noreply@anthropic.com>
Fix markdown structure and formatting issues:
- Fix TOC link from #how-it-works-high-level to #how-it-works
- Convert all major sections to consistent ## (H2) heading level
- Convert all subsections to ### (H3) heading level
- Change TOC and lists from dash (-) to asterisk (*) format
- Add blank line after "How It Works" heading
- Add blank line after "For example:" paragraph in Principal Propagation

Add missing content from main branch:
- Add "What This Test Validates" section with detailed curl validation docs
- Add subsections: Destination Resolution, Authentication Flow, Backend Reachability, CSRF Token Handling, SAML Handling Control
- Rename "Additional Resources" to "Deployment Additional Resources" to avoid duplication

These changes bring km-updates branch in sync with main branch improvements
while fixing all markdown linting issues for better documentation quality.
Address KM documentation review high priority issues:

1. Fix heading level inconsistency (line 54)
   - Change "### How It Works" to "## How It Works"
   - Promotes section from H3 to H2 for proper hierarchy
   - "How It Works" is a standalone concept, not nested under Prerequisites

2. Standardize Table of Contents formatting (line 5)
   - Change "Table of contents" to "## Table of Contents"
   - Adds H2 heading level for better structure
   - Capitalizes for consistency with document title case

These changes improve document structure and maintain proper markdown
hierarchy for knowledge management standards.
Add README Quality Auditor prompt template for systematic documentation
review following knowledge management standards.

Features:
- Structured markdown correctness auditing
- Heading hierarchy and section flow validation
- Duplication detection and consolidation recommendations
- Clarity and readability improvements
- Consistency validation (terminology, casing, commands, env vars)
- Quality scoring with breakdown metrics
- Preserves technical accuracy while enhancing structure

Input schema supports:
- README markdown content (required)
- Project context for better understanding
- Preferred terminology glossary
- Editorial constraints (tone, word count, section ordering)

Output schema includes:
- Structural review with recommended organization
- Formatting issues detection
- Duplication findings with consolidation suggestions
- Clarity/readability recommendations
- Consistency validation results
- Improved README markdown
- Quality score (1-10) with breakdown and rationale

Designed for systematic auditing that maintains technical correctness
while improving developer experience and documentation maintainability.
Align README Quality Auditor with SAP Knowledge Management standards:

KM-Specific Standards Added:
- Heading capitalization: H1/H2 title case, H3+ sentence case
- List formatting: Use dashes (-) consistently, not asterisks
- Link phrasing: 'see' not 'refer to', 'about' not 'around'
- Code blocks: No $ prompt in commands for better copy-paste
- Writing style: Active voice strongly preferred, specific language
- SAP terminology: on-premise (hyphenated), proper product names

Quality Scoring Alignment:
- Structure: ±10 points (hierarchy, ordering)
- Content: ±20 points (no placeholders, completeness)
- Technical: ±15 points (syntax, versions, examples)
- Clarity: ±15 points (voice, specificity, phrasing)
- Links: ±10 points (working, formatted, HTTPS)
- Formatting: ±10 points (consistency)
- Required sections: ±15 points (presence)
- Terminology: ±5 points (SAP terms, acronyms)

Based on analysis of docs/km-style-guide.md and 30+ KM feedback commits.
Version upgraded from 1.0.0 to 2.0.0.
Add blank lines after H3 headings and around lists to comply with markdownlint rules (MD022, MD032)
Apply KM style guide rules for link phrasing and prepositions:
- Change "refer to" → "see" (10 instances)
- Change "information around" → "information about" (1 instance)
- Improve grammar and natural phrasing

Files updated:
- misc/cicd/README.md
- misc/s4hana/README.md
- misc/sslcerts/README.md
- neo-migration/README.md
- thirdpartylibrary/ztravelapp/README.md

Related to KM documentation standards in docs/km-style-guide.md
This commit establishes a hybrid documentation review system combining
automated linting with AI-powered contextual analysis.

- New skill at .claude/skills/km-review.md
- Applies comprehensive KM standards to documentation files
- Supports --fix flag for auto-fixes
- Supports --score-only for quick quality checks
- Supports --ai-only to skip linter (AI review only)
- Integrates with docs-linter when available

- Complete CLI implementation in docs-linter/src/cli.js
- Commands: check, fix, validate
- Color-coded output with severity levels
- JSON output support for programmatic use
- Dry-run mode for previewing fixes

- Fixed remark processor initialization
- Removed unnecessary remarkStringify dependency
- Prepared for ESM/CommonJS compatibility

The system provides two complementary review approaches:

**Fast Automated Review (docs-linter)**
- Rule-based checking using AST parsing
- Instant feedback on objective violations
- Safe auto-fixes for common issues
- Pre-commit hook integration ready

**Deep Contextual Review (/km-review)**
- AI-powered analysis with full context
- Understands intent and technical meaning
- Explains why issues matter
- Catches subjective quality issues

/km-review misc/onpremise/README.md --score-only

/km-review misc/onpremise/README.md

/km-review misc/onpremise/README.md --fix

node docs-linter/src/cli.js validate misc/onpremise/README.md

- ✅ /km-review skill: Fully functional
- ✅ docs-linter CLI: Implemented
- ✅ docs-linter rules: Complete (structural, formatting, content, technical)
- ⚠️ docs-linter ESM compatibility: Needs remark ESM module fix
- ✅ Integration design: Ready for when linter is functional

1. Fix remark ESM imports in docs-linter (convert to ESM or use compatible versions)
2. Add pre-commit hook to run docs-linter automatically
3. Test hybrid mode with both linter + AI review
4. Add CI/CD integration for automated checks

Related to KM documentation standards initiative and PR #115
The linter CLI now gracefully handles remark ESM module initialization
failure and suggests using /km-review skill instead. This allows the
pre-push hook to succeed while the ESM compatibility is being resolved.
Converts the entire docs-linter codebase from CommonJS to ES modules,
resolving compatibility issues with ESM-only dependencies (remark v15,
unified v11, unist-util-visit v5).

Changes:
- Add "type": "module" to package.json with Node.js >=14.13.0 requirement
- Convert all require() to import statements across 8 files
- Convert all module.exports to export default
- Add .js extensions to local imports (ESM requirement)
- Implement ESM-compatible __dirname using fileURLToPath
- Change fs methods to named imports (readFileSync, writeFileSync, existsSync)
- Remove graceful degradation code from cli.js (no longer needed)
- Update README to reflect ESM as fully implemented

Files modified:
- docs-linter/package.json: Added type:module and engines field
- docs-linter/src/cli.js: ESM syntax, removed compatibility wrapper
- docs-linter/src/linter.js: ESM imports, __dirname equivalent
- docs-linter/src/rules/*.js: All 4 rule files converted to ESM
- docs-linter/README.md: Moved ESM from "In Progress" to "Implemented"

Testing:
✓ All syntax checks pass
✓ CLI commands work (--help, check, validate)
✓ npm scripts verified
✓ Successfully parses markdown and applies rules

This completes the ESM migration, making the linter fully compatible
with the modern JavaScript module ecosystem.
Adds a new "Documentation Validation" section to the PR template with
instructions on how to run the docs-linter locally to validate README
changes before submitting.

Changes:
- Add docs-linter usage examples (check, validate, fix)
- Add checkbox for documentation review in checklist
- Explain what the linter validates (KM standards)

This helps contributors validate their documentation changes locally
and ensures consistency with SAP Knowledge Management standards.
Fixes high-severity security issue where SAP domain validation used
substring matching instead of proper hostname validation, allowing
malicious URLs to bypass validation.

Vulnerability:
- Previous code: url.includes('community.sap.com')
- Allowed: evil.com/community.sap.com, community.sap.com.evil.com
- Risk: URL injection attacks, subdomain hijacking

Fix:
- Parse URLs with URL() constructor to extract hostname
- Validate hostname ends with .sap.com (not just contains it)
- Prevents path/query/subdomain injection attacks

Testing:
✓ Legitimate URLs pass: help.sap.com, community.sap.com
✓ Malicious URLs blocked: evil.com/community.sap.com
✓ Subdomain hijacking blocked: community.sap.com.evil.com
✓ Query param injection blocked: evil.com?redirect=community.sap.com

File: docs-linter/src/rules/technical.js (line 103-133)
Security Issue: CodeQL - Incomplete URL substring sanitization

This prevents attackers from crafting malicious URLs that appear to
be SAP domains but actually redirect to phishing sites.
Removes unused 'file' variable from destructuring pattern in
displayValidationResults function. The variable was declared but
never used in the function body.

This addresses the CodeQL code quality issue:
"Unused variables should be either removed from declarations or
put to actual use"

File: docs-linter/src/cli.js (line 229)
Change: Removed 'file' from const { file, score, ... } destructuring
Removes unused 'file' variable from destructuring pattern in
checkCompleteness function. The variable was declared but never
used in the function body.

This addresses CodeQL code quality issues for unused variables.

File: docs-linter/src/rules/content.js (line 130)
Change: Removed 'file' from const { content, file } destructuring
Converts last two files from CommonJS to ESM:
- template-generator.js: Convert require to import, add __dirname
- utils/data-loader.js: Convert require to import, add __dirname

All files now use ES modules. No require() statements remain.

Addresses diagnostic warnings about mixed module systems.
Adds completion status banner to ESM_MIGRATION_PLAN.md noting
the migration was successfully completed on 2026-02-27.

Document retained for historical reference.
Remove ESM_MIGRATION_PLAN.md as migration is complete and documented
in commit history. Clean up unused variables and imports in rule files:

- content.js: Remove unused 'visit' import and 'afterText' variable
- structural.js: Remove unused 'text' destructuring in checkHeadingHierarchy
- technical.js: Improve URL validation security with proper hostname checks

These changes improve code quality without affecting functionality.
Adds a new guide under misc/successfactors covering how to configure,
consume, and troubleshoot an SAP BTP destination using
OAuth2SAMLBearerAssertion authentication against SAP SuccessFactors.
Includes full configuration steps, Postman validation, sample
destination JSON, common misconceptions, and diagnostic artifact
checklist for support tickets.
Incorporates style patterns confirmed in feature/km-review-onpremise-readme:
- ToC label must use title case ("Table of Contents")
- ToC list markers must use dashes, not asterisks
- Headings must not end with a question mark
- Prefer "using" over "via" (e.g. "using Cloud Connector")
- "back-end" must be hyphenated (not "backend" or "back end")
- HTTP error code pairs use "and" not "/" (e.g. "HTTP 401 and HTTP 403")
- Periods required after complete sentences in list items
- Noun-first heading pattern (e.g. "Additional Resources for Deployment")
Adds patterns confirmed in feature/km-review-onpremise-readme:
- Flag em dash and arrow separators in list items (use colon instead)
- Replace weak phrasing "is working"/"is functioning" with active "works"
… rules

- Extend titleCase rule to apply to H1, H2, and H3 (was H1/H2 only)
- Document Chicago-style title case: lowercase articles, short prepositions
  (four letters or fewer), and coordinating conjunctions unless first/last word
- Add Oxford comma rule: required in all lists of three or more items
- Add number formatting rules: spell out one through ten in prose,
  use numerals for 11 and above; exceptions for version numbers,
  code values, measurements, percentages, and ranges
- Update km-style-guide.md with full examples and rationale for each rule
- Update last-updated date to March 2026
- Take main's KM-reviewed versions of misc READMEs (cicd, onpremise, s4hana, successfactors)
- Take main's updated km-style-guide.md and km-doc-review.md (H1-H6 Chicago title case rule)
- Remove stale "km-updates branch only" note from km-style-guide.md Automated Checks section
- Accept main's deletion of app-with-tutorials/non-cap/sapui5/basic/manage-products/README.md
- Retain km-updates version of docs-linter/src/cli.js (new file, not on main)
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.

2 participants