Skip to content

Commit 24e5a1e

Browse files
super3claude
andcommitted
Add CLAUDE.md and update README with badges
- Add CLAUDE.md with AI assistant instructions - Emphasize 100% test coverage requirement - Add test status, coverage, and license badges to README - Update npm installation instructions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ea924de commit 24e5a1e

3 files changed

Lines changed: 99 additions & 8 deletions

File tree

CLAUDE.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# CLAUDE.md - AI Assistant Instructions
2+
3+
## Important Rules
4+
5+
1. **Test Coverage**: Please run test/coverage before and after any work. Coverage needs to be 100% for a task to be complete.
6+
```bash
7+
npm run test:coverage
8+
```
9+
10+
2. **No Commits Without Permission**: Don't commit or push code unless I explicitly tell you to.
11+
12+
3. **Code Quality Standards**:
13+
- Maintain 100% test coverage at all times
14+
- Follow existing code style and patterns
15+
- Use CommonJS modules (not ES6 modules) for compatibility
16+
- Keep the zero-dependency philosophy
17+
18+
## Project Structure
19+
20+
```
21+
mdtail.dev/
22+
├── lib/
23+
│ ├── mdtail.js # Main application class
24+
│ ├── display.js # Terminal display logic
25+
│ ├── fileManager.js # File operations and watching
26+
│ └── errors.js # Custom error classes
27+
├── test/
28+
│ ├── mdtail.test.js # Core unit tests
29+
│ ├── mdtail.integration.test.js # Integration tests
30+
│ ├── mdtail.edge.test.js # Edge cases
31+
│ ├── display.test.js # Display module tests
32+
│ ├── fileManager.test.js # File manager tests
33+
│ └── errors.test.js # Error classes tests
34+
├── index.js # CLI entry point
35+
├── index.d.ts # TypeScript definitions
36+
└── package.json
37+
38+
```
39+
40+
## Testing Commands
41+
42+
```bash
43+
npm test # Run all tests
44+
npm run test:watch # Run tests in watch mode
45+
npm run test:coverage # Run tests with coverage report
46+
```
47+
48+
## Common Tasks
49+
50+
### Adding New Features
51+
1. Run tests first to ensure 100% coverage: `npm run test:coverage`
52+
2. Implement the feature
53+
3. Add comprehensive tests for the new feature
54+
4. Run tests again to ensure 100% coverage is maintained
55+
5. Do NOT commit unless explicitly asked
56+
57+
### Refactoring
58+
1. Run tests first to ensure 100% coverage
59+
2. Make refactoring changes
60+
3. Ensure all tests still pass
61+
4. Verify 100% coverage is maintained
62+
5. Do NOT commit unless explicitly asked
63+
64+
### Bug Fixes
65+
1. Add a failing test that reproduces the bug
66+
2. Fix the bug
67+
3. Ensure the test now passes
68+
4. Verify 100% coverage is maintained
69+
5. Do NOT commit unless explicitly asked
70+
71+
## Key Implementation Details
72+
73+
- **File Watching**: Uses `fs.watchFile` with 100ms polling interval
74+
- **Terminal Features**: Graceful degradation for non-TTY environments
75+
- **Error Handling**: Custom error classes with helpful suggestions
76+
- **Display**: ANSI escape codes with fallbacks for limited terminals
77+
- **Navigation**: Arrow keys for multi-file tab switching
78+
79+
## NPM Publishing
80+
81+
The package is published as `mdtail` on npm. When preparing releases:
82+
1. Ensure all tests pass with 100% coverage
83+
2. Update version in package.json
84+
3. Test the package locally with `npm pack`
85+
4. Only publish after explicit approval

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# mdtail.dev
22

3+
[![npm version](https://badge.fury.io/js/mdtail.svg)](https://www.npmjs.com/package/mdtail)
4+
[![Test Status](https://img.shields.io/github/actions/workflow/status/super3/mdtail.dev/ci.yml?branch=main&label=tests)](https://github.com/super3/mdtail.dev/actions/workflows/ci.yml)
5+
[![Coverage Status](https://coveralls.io/repos/github/super3/mdtail.dev/badge.svg?branch=main)](https://coveralls.io/github/super3/mdtail.dev?branch=main)
6+
[![License](https://img.shields.io/badge/license-MIT-blue.svg?label=license)](https://github.com/super3/mdtail.dev/blob/main/LICENSE)
7+
38
A simple terminal app that displays and live-refreshes markdown files.
49

510
## Features
@@ -14,25 +19,26 @@ A simple terminal app that displays and live-refreshes markdown files.
1419

1520
## Installation
1621

22+
### npm (Recommended)
23+
```bash
24+
npm install -g mdtail
25+
```
26+
27+
### From Source
1728
```bash
1829
git clone https://github.com/super3/mdtail.dev.git && cd mdtail.dev
1930
npm install
31+
npm link # Install mdtail command globally
2032
```
2133

2234
## Usage
2335

24-
### Local
2536
```bash
26-
npm start # Watch TODO.md (default)
27-
```
28-
29-
### Global Installation
30-
```bash
31-
npm link # Install mdtail command globally
32-
mdtail # Watch TODO.md
37+
mdtail # Watch TODO.md (default)
3338
mdtail README.md # Watch specific file
3439
mdtail *.md # Watch all markdown files with tabs
3540
mdtail TODO.md README.md # Watch multiple specific files
41+
mdtail --help # Show help
3642
```
3743

3844
### Navigation

mdtail-1.0.0.tgz

5.85 KB
Binary file not shown.

0 commit comments

Comments
 (0)