Skip to content

Commit ed3c791

Browse files
committed
initial commit
0 parents  commit ed3c791

17 files changed

Lines changed: 2864 additions & 0 deletions

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
id-token: write
14+
packages: write
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
registry-url: 'https://registry.npmjs.org'
22+
- run: npm ci
23+
- run: npm run build
24+
- run: npm test
25+
26+
- name: Publish to NPM
27+
run: npm publish
28+
env:
29+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30+
31+
- name: Setup for GitHub Packages
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: '20'
35+
registry-url: 'https://npm.pkg.github.com'
36+
scope: '@veldica'
37+
38+
- name: Publish to GitHub Packages
39+
run: npm publish
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules/
2+
dist/
3+
.DS_Store
4+
*.log
5+
GEMINI.md
6+
.env
7+
.idea/
8+
.vscode/
9+
npm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
coverage/

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Changelog

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Veldica
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# @veldica/prose-linter
2+
3+
A deterministic style-contract library and AI-writing style audit for high-quality prose.
4+
5+
`@veldica/prose-linter` provides the engine for evaluating text against explicit structural targets (sentence length, lexical density, scannability) and identifies common "AI-style" markers. It is designed to be used programmatically in CLIs, editors, and agent feedback loops.
6+
7+
## Features
8+
9+
- **Deterministic Style Contracts**: Define targets for word counts, complexity, and structural variety.
10+
- **AI Marker Inventory**: Detect stock phrases, assistant residue, and repetitive structural patterns common in LLM output.
11+
- **Actionable Revision Levers**: Get prioritized advice on how to fix style violations.
12+
- **Readability Integration**: Built-in support for Gunning-Fog, Flesch-Kincaid, and more.
13+
14+
## Installation
15+
16+
```bash
17+
npm install @veldica/prose-linter
18+
```
19+
20+
## API Usage
21+
22+
### Linting Text
23+
24+
The `lintText` function is the primary entry point for evaluating text against a profile.
25+
26+
```typescript
27+
import { lintText } from '@veldica/prose-linter';
28+
29+
const profile = {
30+
targets: {
31+
sentence_metrics: {
32+
avg_words_per_sentence: { value: 20, operator: 'at_most' },
33+
sentence_length_stddev: { value: 5, operator: 'at_least' }
34+
}
35+
},
36+
track_ai_patterns: true
37+
};
38+
39+
const result = lintText("Your prose goes here...", profile);
40+
41+
console.log(result.summary.score); // Fit score out of 100
42+
console.log(result.violations); // Array of failed CheckResults
43+
```
44+
45+
### Inventory AI Markers
46+
47+
Audit a document specifically for "AI-ish" patterns without full structural linting.
48+
49+
```typescript
50+
import { inventoryMarkers } from '@veldica/prose-linter';
51+
52+
const analysis = inventoryMarkers(text, { track_ai_patterns: true });
53+
54+
console.log(analysis.style_band); // "low" | "moderate" | "high" | "very_high"
55+
console.log(analysis.matches); // Array of matches with line/column locations
56+
```
57+
58+
## Result Structure
59+
60+
The `LintResult` object returned by `lintText` includes:
61+
62+
- `summary`: High-level compliance numbers (score, counts).
63+
- `checks`: All checks performed (passed, failed, and skipped).
64+
- `violations`: Specifically failed checks.
65+
- `skipped_checks`: Checks that couldn't be run due to missing data.
66+
- `ai_analysis`: Detailed report on AI-style markers.
67+
- `revision_levers`: Ranked suggestions for improvement.
68+
69+
## License
70+
71+
MIT

0 commit comments

Comments
 (0)