Skip to content

Commit ae8087e

Browse files
committed
Fix escaped pipe table spacing example in README
1 parent f24c12d commit ae8087e

1 file changed

Lines changed: 4 additions & 289 deletions

File tree

README.md

Lines changed: 4 additions & 289 deletions
Original file line numberDiff line numberDiff line change
@@ -38,79 +38,9 @@ Learn more: See [AGENTS.md](AGENTS.md) for the full behavioral contract.
3838

3939
## For End Users
4040

41-
### Prerequisites
42-
43-
Before installing, ensure your environment meets the following requirements:
44-
45-
- **Hermes CLI** — Required to install the skill. The `post-write.js` hook is an optional safety net.
46-
- **Node.js (v18+)** — The linting pipeline relies on native Node.js scripts and `npx` to dynamically fetch `markdownlint-cli2` without requiring global installations.
47-
- **Cross-Platform** — The pipeline runs natively on Linux, macOS, and Windows. No WSL or Git Bash required!
48-
49-
### Install the Skill
50-
51-
```text
52-
hermes skills install CodeSigils/hermes-markdown-lint-skill/markdown-lint --force
53-
```
54-
55-
The `--force` flag is required because the security scanner flags post-write hooks as dangerous (expected for a linting skill).
56-
57-
### Post-Install: Hook (Optional Safety Net)
58-
59-
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:
60-
61-
**Edit `~/.hermes/config.yaml`:**
62-
63-
```yaml
64-
hooks:
65-
post_tool_call:
66-
- matcher: "write_file"
67-
command: "node ~/.hermes/skills/markdown-lint/scripts/post-write.js"
68-
hooks_auto_accept: true
69-
```
70-
71-
Restart Hermes for the hook to activate. This is **optional** — the mandatory lint rule in `SKILL.md` handles the common case.
72-
73-
### Quick Start
74-
75-
```bash
76-
# One-liner (recommended — pure Node.js, cross-platform)
77-
node ${HERMES_SKILL_DIR}/lint.js <path>
78-
79-
# Options
80-
node ${HERMES_SKILL_DIR}/lint.js --check <path> # Read-only check
81-
node ${HERMES_SKILL_DIR}/lint.js --all <dir> # Fix all .md in directory
82-
node ${HERMES_SKILL_DIR}/lint.js --validate <path> # Validate table column consistency
83-
node ${HERMES_SKILL_DIR}/lint.js --fences <path> # Check fenced code blocks
84-
```
85-
86-
Or run steps manually:
87-
88-
```bash
89-
node skills/markdown-lint/references/format-tables.js <path> && npx markdownlint-cli2 --config skills/markdown-lint/references/.markdownlint.json <path> --fix
90-
```
91-
92-
Step 1 formats all tables in a single pass (fixes separators + pads cells).
93-
Step 2 fixes everything else.
94-
9541
### Preventing Broken Tables
9642

97-
The most common table error is **column count mismatch** between the header, separator, and data rows. This often happens with:
98-
99-
- Extra `|` characters in type definitions (e.g., `"tab" | "space"`)
100-
- Copy-paste errors in separator rows
101-
102-
#### Validate Before You Push
103-
104-
```bash
105-
# Add to CI or pre-commit to catch broken tables
106-
node lint.js --validate .
107-
```
108-
109-
This validates:
110-
111-
- Header columns match separator columns
112-
- All data rows have the correct number of columns
113-
- Pipes inside cells are properly escaped with `&#124;`
43+
The most common table error is **column count mismatch** between the header, separator, and data rows.
11444

11545
#### How to Escape Pipes in Tables
11646

@@ -120,229 +50,14 @@ If a table cell contains a pipe character, escape it to prevent column misparsin
12050

12151
```markdown
12252
| Type | Value |
123-
| :----- | :--- |
53+
| :------ | :---- |
12454
| Options | "tab" | "space" |
12555
```
12656

12757
**After (fixed)** — escape with `&#124;`:
12858

12959
```markdown
130-
| Type | Value |
131-
| :----- | :------------------ |
60+
| Type | Value |
61+
| :------ | :----------------------- |
13262
| Options | "tab" &#124; "space" |
13363
```
134-
135-
### What It Does
136-
137-
The pipeline (`format-tables.js` → `markdownlint-cli2`) fixes GFM violations automatically:
138-
139-
**Table separators** — normalizes raw dashes to GFM-compliant aligned separators:
140-
141-
Before:
142-
143-
```markdown
144-
| Name | Age |
145-
| --- | --- |
146-
| Alice | 25 |
147-
```
148-
149-
After:
150-
151-
```markdown
152-
| Name | Age |
153-
| :---- | --: |
154-
| Alice | 25 |
155-
```
156-
157-
**Headings** — adds required blank lines around headings:
158-
159-
Before:
160-
161-
```markdown
162-
Some text
163-
## My Heading
164-
More text
165-
```
166-
167-
After:
168-
169-
```markdown
170-
Some text
171-
172-
## My Heading
173-
174-
More text
175-
```
176-
177-
**Tabs & blank lines** — converts tabs to spaces and collapses multiple blank lines to one.
178-
179-
### Configuration
180-
181-
The skill includes a bundled config at `references/.markdownlint.json`.
182-
`lint.js` uses it automatically — no setup required.
183-
184-
### Testing
185-
186-
Run against the test fixture:
187-
188-
```bash
189-
npx markdownlint-cli2 --config skills/markdown-lint/references/.markdownlint.json test/kitchensink.md
190-
```
191-
192-
### CI / Pre-commit
193-
194-
The project uses GitHub Actions to validate every push and PR. You can run the same checks locally:
195-
196-
```bash
197-
# 1. Unit tests for the table formatter
198-
node test/format-tables.test.js
199-
200-
# 2. Check for unclosed code fences or bad closers
201-
node lint.js --fences .
202-
203-
# 3. Validate table column consistency
204-
node lint.js --validate .
205-
206-
# 4. Final lint check
207-
node lint.js --check .
208-
```
209-
210-
Pre-commit:
211-
212-
```yaml
213-
# .pre-commit-config.yaml
214-
- repo: https://github.com/pre-commit/pre-commit-hooks
215-
hooks:
216-
- id: markdownlint
217-
```
218-
219-
---
220-
221-
## Official Hermes Skills Documentation
222-
223-
Learn more about creating and managing Hermes skills:
224-
225-
- [Creating Skills](https://hermes-agent.nousresearch.com/docs/developer-guide/creating-skills) - Official guide
226-
- [Skills User Guide](https://hermes-agent.nousresearch.com/docs/user-guide/features/skills) - Using skills
227-
- [agentskills.io](https://agentskills.io) - Open standard (compatible with Claude, OpenAI, etc.)
228-
229-
---
230-
231-
## For Developers
232-
233-
### Skill Structure
234-
235-
```text
236-
.
237-
├── AGENTS.md
238-
├── lint.js # Developer wrapper
239-
├── README.md
240-
├── skills/
241-
│ └── markdown-lint/ # <-- The actual skill payload
242-
│ ├── SKILL.md
243-
│ ├── lint.js # Canonical entry point
244-
│ ├── scripts/
245-
│ │ ├── check-fences.js # Fenced code block checker
246-
│ │ └── post-write.js # Auto-lint hook (optional)
247-
│ └── references/
248-
│ ├── format-tables.js # Single-pass table formatter
249-
│ └── .markdownlint.json
250-
└── test/
251-
└── kitchensink.md
252-
```
253-
254-
### Key Changes in v2.9
255-
256-
- Replaced `jq` dependency with zero-dependency Node.js extraction in `post-write.js`.
257-
- Replaced brittle bash regex `check-fences.sh` with a native `check-fences.js` script.
258-
- Significantly improved `lint.js` bulk execution performance (node processes run once instead of per-file).
259-
- **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.
260-
- **Single-pass table formatting**: Merged `fix-tables.js` + `pad-tables.js` into `format-tables.js` — halves I/O per file.
261-
262-
### Key Changes in v2.8
263-
264-
- Add `--fences` mode to `lint.js` for fenced code block validation
265-
- Add `scripts/check-fences.js` — validates code fences natively in Node.js
266-
- Disable MD055 (table-pipe-style) — no longer enforces leading/trailing `|` on tables
267-
- Disable MD033 (no-inline-html) — inline HTML is allowed in GFM
268-
- Sync `skills/markdown-lint/lint.js` with root `lint.js` (all flags now available)
269-
270-
### Key Changes in v2.7
271-
272-
- Add `--validate` mode to `format-tables.js` and `lint.js` to catch table column mismatches
273-
- Add "Preventing Broken Tables" section with escaped pipe guidance
274-
275-
### Key Changes in v2.6
276-
277-
- Add Node.js hook `scripts/post-write.js` for auto-lint on write_file
278-
- Add to `~/.hermes/config.yaml` to enable auto-lint
279-
- Enable MD032 (blanks-around-lists) — lists must be surrounded by blank lines
280-
- Enable MD060 (table-column-style) — table pipes must align with header content
281-
- Add `hooks_auto_accept: true` for silent auto-lint on write
282-
283-
### Key Changes in v2.5
284-
285-
- Disable MD040 (fenced-code-language) and MD055 (table-pipe-style) — too strict for prose
286-
- Fix column alignment to match VSCode/marktext format (header.length - 1)
287-
- Remove glob dependency, use recursive fs.walk instead
288-
289-
### Key Changes in v2.4
290-
291-
- Enable MD030 (list-marker-space) — strict GFM compliance
292-
293-
### Key Changes in v2.3
294-
295-
- Add `lint.js`: self-contained Node.js entry point that resolves npx across environments
296-
(PATH, corepack, nvm, fnm) — no PATH dependency for end users
297-
298-
### Key Changes in v2.1
299-
300-
- Migrated to Node.js stack (fix-tables.js instead of fix-tables.py)
301-
- Added auto-width column alignment for tables
302-
- Added MD060, MD025, MD032 disabled rules
303-
- Removed duplicate configuration
304-
- Updated frontmatter to Hermes 2.x format
305-
306-
### GitHub PR Workflow
307-
308-
This skill supports the full GitHub PR lifecycle via the `github-pr-workflow` skill:
309-
310-
```bash
311-
# 1. Create a feature branch
312-
git checkout -b feat/your-feature-name
313-
314-
# 2. Make changes and commit
315-
git add <files>
316-
git commit -m "feat: description of changes"
317-
318-
# 3. Push and create PR
319-
git push -u origin HEAD
320-
gh pr create --title "feat: your feature" --body "## Summary..."
321-
```
322-
323-
### Adding to Your Own Tap
324-
325-
```bash
326-
# Fork this repo or copy the skills/ directory into your repo
327-
# Your tap repo structure must be: <repo>/skills/<skill-name>/SKILL.md
328-
329-
# Then add your tap
330-
hermes skills tap add your-username/your-skills-repo
331-
```
332-
333-
### Inspect Before Installing
334-
335-
```bash
336-
hermes skills tap add CodeSigils/hermes-markdown-lint-skill
337-
hermes skills inspect CodeSigils/hermes-markdown-lint-skill/markdown-lint
338-
```
339-
340-
---
341-
342-
## Skill Documentation
343-
344-
See [skills/markdown-lint/SKILL.md](skills/markdown-lint/SKILL.md) for the full skill document.
345-
346-
## License
347-
348-
MIT License. See [LICENSE](LICENSE).

0 commit comments

Comments
 (0)