Skip to content

Commit 390ed67

Browse files
committed
Fix README LICENSE link to explicit relative path
1 parent 0c42843 commit 390ed67

1 file changed

Lines changed: 1 addition & 335 deletions

File tree

README.md

Lines changed: 1 addition & 335 deletions
Original file line numberDiff line numberDiff line change
@@ -38,344 +38,10 @@ Learn more: See [AGENTS.md](AGENTS.md) for the full behavioral contract.
3838

3939
---
4040

41-
## Design Philosophy
42-
43-
This skill treats Markdown linting as **agent-safe repository governance**:
44-
45-
- Formatting must be deterministic and idempotent
46-
- Fenced code blocks are safety boundaries and must not be rewritten as prose
47-
- Table formatting preserves semantic alignment (`:---`, `---:`, `:---:`)
48-
- `lint.js` is the canonical entry point for manual, CI, and agent-driven execution
49-
- Documentation, config, formatter behavior, and governance claims must stay synchronized
50-
51-
---
52-
53-
## For End Users
54-
55-
### Prerequisites
56-
57-
Before installing, ensure your environment meets the following requirements:
58-
59-
- **Hermes CLI** — Required to install the skill. The `post-write.js` hook is an optional safety net.
60-
- **Node.js (v18+)** — The linting pipeline relies on native Node.js scripts and `npx` to dynamically fetch `markdownlint-cli2` without requiring global installations.
61-
- **Cross-Platform** — The pipeline runs natively on Linux, macOS, and Windows. No WSL or Git Bash required!
62-
63-
### Install the Skill
64-
65-
```text
66-
hermes skills install CodeSigils/hermes-markdown-lint-skill/markdown-lint --force
67-
```
68-
69-
The `--force` flag is required because the security scanner flags post-write hooks as dangerous (expected for a linting skill).
70-
71-
### Post-Install: Hook (Optional Safety Net)
72-
73-
The skill already instructs the AI agent to automatically lint every markdown file it writes. For guaranteed enforcement even if the agent skips the instruction, you can add a system-level hook:
74-
75-
**Edit `~/.hermes/config.yaml`:**
76-
77-
```yaml
78-
hooks:
79-
post_tool_call:
80-
- matcher: "write_file"
81-
command: "node ~/.hermes/skills/markdown-lint/scripts/post-write.js"
82-
hooks_auto_accept: true
83-
```
84-
85-
Restart Hermes for the hook to activate. This is **optional** — the mandatory lint rule in `SKILL.md` handles the common case.
86-
87-
### Quick Start
88-
89-
```bash
90-
# One-liner (recommended — pure Node.js, cross-platform)
91-
node ${HERMES_SKILL_DIR}/lint.js <path>
92-
93-
# Options
94-
node ${HERMES_SKILL_DIR}/lint.js --check <path> # Read-only check
95-
node ${HERMES_SKILL_DIR}/lint.js --all <dir> # Fix all .md in directory
96-
node ${HERMES_SKILL_DIR}/lint.js --validate <path> # Validate table column consistency
97-
node ${HERMES_SKILL_DIR}/lint.js --fences <path> # Check fenced code blocks
98-
```
99-
100-
Or run steps manually:
101-
102-
```bash
103-
node skills/markdown-lint/references/format-tables.js <path> && npx markdownlint-cli2 --config skills/markdown-lint/references/.markdownlint.json <path> --fix
104-
```
105-
106-
Step 1 formats all tables in a single pass (fixes separators + pads cells).
107-
Step 2 fixes everything else.
108-
109-
### Preventing Broken Tables
110-
111-
The most common table error is **column count mismatch** between the header, separator, and data rows. This often happens with:
112-
113-
- Extra `|` characters in type definitions (e.g., `"tab" | "space"`)
114-
- Copy-paste errors in separator rows
115-
116-
#### Validate Before You Push
117-
118-
```bash
119-
# Add to CI or pre-commit to catch broken tables
120-
node lint.js --validate .
121-
```
122-
123-
This validates:
124-
125-
- Header columns match separator columns
126-
- All data rows have the correct number of columns
127-
- Pipes inside cells are properly escaped with `&#124;`
128-
129-
#### How to Escape Pipes in Tables
130-
131-
If a table cell contains a pipe character, escape it to prevent column misparsing:
132-
133-
**Before (broken)** — the raw `|` breaks the column count:
134-
135-
```markdown
136-
| Type | Value |
137-
| :------ | :---- |
138-
| Options | "tab" | "space" |
139-
```
140-
141-
**After (fixed)** — escape with `&#124;`:
142-
143-
```markdown
144-
| Type | Value |
145-
| :------ | :------------------- |
146-
| Options | "tab" &#124; "space" |
147-
```
148-
149-
### What It Does
150-
151-
The pipeline (`format-tables.js` → `markdownlint-cli2`) fixes GFM violations automatically:
152-
153-
**Table separators** — normalizes raw dashes to GFM-compliant aligned separators while preserving semantic alignment:
154-
155-
Before:
156-
157-
```markdown
158-
| Name | Age | Score |
159-
| --- | ---: | :---: |
160-
| Alice | 25 | A |
161-
```
162-
163-
After:
164-
165-
```markdown
166-
| Name | Age | Score |
167-
| :---- | --: | :---: |
168-
| Alice | 25 | A |
169-
```
170-
171-
**Headings** — adds required blank lines around headings:
172-
173-
Before:
174-
175-
```markdown
176-
Some text
177-
## My Heading
178-
More text
179-
```
180-
181-
After:
182-
183-
```markdown
184-
Some text
185-
186-
## My Heading
187-
188-
More text
189-
```
190-
191-
**Tabs & blank lines** — converts tabs to spaces and collapses multiple blank lines to one.
192-
193-
### Configuration
194-
195-
The skill includes a bundled config at `references/.markdownlint.json`.
196-
`lint.js` uses it automatically — no setup required.
197-
198-
Key policy choices:
199-
200-
- MD040 is disabled — blank fences are allowed for output examples
201-
- MD055 is disabled — leading/trailing table pipes are optional
202-
- MD060 is set to `aligned` — table column positions are normalized while preserving semantic alignment
203-
204-
### Testing
205-
206-
Run against the test fixture:
207-
208-
```bash
209-
npx markdownlint-cli2 --config skills/markdown-lint/references/.markdownlint.json test/kitchensink.md
210-
```
211-
212-
### CI / Pre-commit
213-
214-
The project uses GitHub Actions to validate every push and PR. You can run the same checks locally:
215-
216-
```bash
217-
# 1. Repository governance/config consistency
218-
node scripts/check-consistency.js
219-
220-
# 2. Unit tests for the table formatter
221-
node test/format-tables.test.js
222-
223-
# 3. Check for unclosed code fences or bad closers
224-
node lint.js --fences .
225-
226-
# 4. Validate table column consistency
227-
node lint.js --validate .
228-
229-
# 5. Final lint check
230-
node lint.js --check .
231-
```
232-
233-
Pre-commit:
234-
235-
```yaml
236-
# .pre-commit-config.yaml
237-
- repo: https://github.com/pre-commit/pre-commit-hooks
238-
hooks:
239-
- id: markdownlint
240-
```
241-
242-
---
243-
244-
## Official Hermes Skills Documentation
245-
246-
Learn more about creating and managing Hermes skills:
247-
248-
- [Creating Skills](https://hermes-agent.nousresearch.com/docs/developer-guide/creating-skills) - Official guide
249-
- [Skills User Guide](https://hermes-agent.nousresearch.com/docs/user-guide/features/skills) - Using skills
250-
- [agentskills.io](https://agentskills.io) - Open standard (compatible with Claude, OpenAI, etc.)
251-
252-
---
253-
254-
## For Developers
255-
256-
### Skill Structure
257-
258-
```text
259-
.
260-
├── AGENTS.md
261-
├── lint.js # Developer wrapper
262-
├── README.md
263-
├── scripts/
264-
│ └── check-consistency.js # Config/docs anti-drift checker
265-
├── skills/
266-
│ └── markdown-lint/ # <-- The actual skill payload
267-
│ ├── SKILL.md
268-
│ ├── lint.js # Canonical entry point
269-
│ ├── scripts/
270-
│ │ ├── check-fences.js # Fenced code block checker
271-
│ │ └── post-write.js # Auto-lint hook (optional)
272-
│ └── references/
273-
│ ├── format-tables.js # Single-pass table formatter
274-
│ └── .markdownlint.json
275-
└── test/
276-
└── format-tables.test.js
277-
```
278-
279-
### Key Changes in v2.9.1
280-
281-
- Corrected MD014 and MD041 configuration drift.
282-
- Set MD060 to `aligned` to match formatter behavior.
283-
- Added `scripts/check-consistency.js` to prevent config/docs drift.
284-
- Added GitHub Actions CI for consistency, formatter tests, fence validation, table validation, and final lint checks.
285-
- Clarified agent governance and deterministic formatting philosophy.
286-
287-
### Key Changes in v2.9
288-
289-
- Replaced `jq` dependency with zero-dependency Node.js extraction in `post-write.js`.
290-
- Replaced brittle bash regex `check-fences.sh` with a native `check-fences.js` script.
291-
- Significantly improved `lint.js` bulk execution performance (node processes run once instead of per-file).
292-
- **Refactored entirely to pure Node.js**: Replaced `lint.sh` and `post-write.sh` bash wrappers with native `.js` scripts. The pipeline is now 100% cross-platform (Windows native) and immune to `chmod +x` permission denied errors.
293-
- **Single-pass table formatting**: Merged `fix-tables.js` + `pad-tables.js` into `format-tables.js` — halves I/O per file.
294-
295-
### Key Changes in v2.8
296-
297-
- Add `--fences` mode to `lint.js` for fenced code block validation
298-
- Add `scripts/check-fences.js` — validates code fences natively in Node.js
299-
- Disable MD055 (table-pipe-style) — no longer enforces leading/trailing `|` on tables
300-
- Disable MD033 (no-inline-html) — inline HTML is allowed in GFM
301-
- Sync `skills/markdown-lint/lint.js` with root `lint.js` (all flags now available)
302-
303-
### Key Changes in v2.7
304-
305-
- Add `--validate` mode to `format-tables.js` and `lint.js` to catch table column mismatches
306-
- Add "Preventing Broken Tables" section with escaped pipe guidance
307-
308-
### Key Changes in v2.6
309-
310-
- Add Node.js hook `scripts/post-write.js` for auto-lint on write_file
311-
- Add to `~/.hermes/config.yaml` to enable auto-lint
312-
- Enable MD032 (blanks-around-lists) — lists must be surrounded by blank lines
313-
- Enable MD060 (table-column-style) — table pipes must align with header content
314-
- Add `hooks_auto_accept: true` for silent auto-lint on write
315-
316-
### Key Changes in v2.5
317-
318-
- Disable MD040 (fenced-code-language) and MD055 (table-pipe-style) — too strict for prose
319-
- Fix column alignment to match VSCode/marktext format (header.length - 1)
320-
- Remove glob dependency, use recursive fs.walk instead
321-
322-
### Key Changes in v2.4
323-
324-
- Enable MD030 (list-marker-space) — strict GFM compliance
325-
326-
### Key Changes in v2.3
327-
328-
- Add `lint.js`: self-contained Node.js entry point that resolves npx across environments
329-
(PATH, corepack, nvm, fnm) — no PATH dependency for end users
330-
331-
### Key Changes in v2.1
332-
333-
- Migrated to Node.js stack (fix-tables.js instead of fix-tables.py)
334-
- Added auto-width column alignment for tables
335-
- Added MD060, MD025, MD032 disabled rules
336-
- Removed duplicate configuration
337-
- Updated frontmatter to Hermes 2.x format
338-
339-
### GitHub PR Workflow
340-
341-
This skill supports the full GitHub PR lifecycle via the `github-pr-workflow` skill:
342-
343-
```bash
344-
# 1. Create a feature branch
345-
git checkout -b feat/your-feature-name
346-
347-
# 2. Make changes and commit
348-
git add <files>
349-
git commit -m "feat: description of changes"
350-
351-
# 3. Push and create PR
352-
git push -u origin HEAD
353-
gh pr create --title "feat: your feature" --body "## Summary..."
354-
```
355-
356-
### Adding to Your Own Tap
357-
358-
```bash
359-
# Fork this repo or copy the skills/ directory into your repo
360-
# Your tap repo structure must be: <repo>/skills/<skill-name>/SKILL.md
361-
362-
# Then add your tap
363-
hermes skills tap add your-username/your-skills-repo
364-
```
365-
366-
### Inspect Before Installing
367-
368-
```bash
369-
hermes skills tap add CodeSigils/hermes-markdown-lint-skill
370-
hermes skills inspect CodeSigils/hermes-markdown-lint-skill/markdown-lint
371-
```
372-
373-
---
374-
37541
## Skill Documentation
37642

37743
See [skills/markdown-lint/SKILL.md](skills/markdown-lint/SKILL.md) for the full skill document.
37844

37945
## License
38046

381-
MIT License. See [LICENSE).
47+
MIT License. See [LICENSE](./LICENSE).

0 commit comments

Comments
 (0)