paperfit-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/adjust-length.md +21 -0
- package/.claude/commands/check-visual.md +27 -0
- package/.claude/commands/fix-layout.md +31 -0
- package/.claude/commands/migrate-template.md +23 -0
- package/.claude/commands/repair-table.md +21 -0
- package/.claude/commands/show-status.md +32 -0
- package/.claude-plugin/README.md +77 -0
- package/.claude-plugin/marketplace.json +41 -0
- package/.claude-plugin/plugin.json +39 -0
- package/CLAUDE.md +266 -0
- package/CONTRIBUTING.md +131 -0
- package/LICENSE +21 -0
- package/README.md +164 -0
- package/agents/code-surgeon-agent.md +214 -0
- package/agents/layout-detective-agent.md +229 -0
- package/agents/orchestrator-agent.md +254 -0
- package/agents/quality-gatekeeper-agent.md +270 -0
- package/agents/rule-engine-agent.md +224 -0
- package/agents/semantic-polish-agent.md +250 -0
- package/bin/paperfit.js +176 -0
- package/config/agent_roles.yaml +56 -0
- package/config/layout_rules.yaml +54 -0
- package/config/templates.yaml +241 -0
- package/config/vto_taxonomy.yaml +489 -0
- package/config/writing_rules.yaml +64 -0
- package/install.sh +30 -0
- package/package.json +52 -0
- package/requirements.txt +5 -0
- package/scripts/benchmark_runner.py +629 -0
- package/scripts/compile.sh +244 -0
- package/scripts/config_validator.py +339 -0
- package/scripts/cv_detector.py +600 -0
- package/scripts/evidence_collector.py +167 -0
- package/scripts/float_fixers.py +861 -0
- package/scripts/inject_defects.py +549 -0
- package/scripts/install-claude-global.js +148 -0
- package/scripts/install.js +66 -0
- package/scripts/install.sh +106 -0
- package/scripts/overflow_fixers.py +656 -0
- package/scripts/package-for-opensource.sh +138 -0
- package/scripts/parse_log.py +260 -0
- package/scripts/postinstall.js +38 -0
- package/scripts/pre_tool_use.py +265 -0
- package/scripts/render_pages.py +244 -0
- package/scripts/session_logger.py +329 -0
- package/scripts/space_util_fixers.py +773 -0
- package/scripts/state_manager.py +352 -0
- package/scripts/test_commands.py +187 -0
- package/scripts/test_cv_detector.py +214 -0
- package/scripts/test_integration.py +290 -0
- package/skills/consistency-polisher/SKILL.md +337 -0
- package/skills/float-optimizer/SKILL.md +284 -0
- package/skills/latex_fixers/__init__.py +82 -0
- package/skills/latex_fixers/float_fixers.py +392 -0
- package/skills/latex_fixers/fullwidth_fixers.py +375 -0
- package/skills/latex_fixers/overflow_fixers.py +250 -0
- package/skills/latex_fixers/semantic_micro_tuning.py +362 -0
- package/skills/latex_fixers/space_util_fixers.py +389 -0
- package/skills/latex_fixers/utils.py +55 -0
- package/skills/overflow-repair/SKILL.md +304 -0
- package/skills/space-util-fixer/SKILL.md +307 -0
- package/skills/taxonomy-vto/SKILL.md +486 -0
- package/skills/template-migrator/SKILL.md +251 -0
- package/skills/visual-inspector/SKILL.md +217 -0
- package/skills/writing-polish/SKILL.md +289 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* PaperFit Install Script
|
|
5
|
+
* Runs during npm install to verify dependencies and prepare the environment
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { execSync } = require('child_process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
|
|
12
|
+
console.log('š¦ PaperFit Install Script\n');
|
|
13
|
+
|
|
14
|
+
const projectRoot = path.join(__dirname, '..');
|
|
15
|
+
|
|
16
|
+
// Check Python availability
|
|
17
|
+
console.log('š Checking Python...');
|
|
18
|
+
try {
|
|
19
|
+
execSync('python3 --version', { stdio: 'pipe' });
|
|
20
|
+
const pythonVersion = execSync('python3 --version', { encoding: 'utf-8' }).trim();
|
|
21
|
+
console.log(`ā
${pythonVersion}`);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
console.log('ā ļø Python 3 not found. Please install Python 3.8+');
|
|
24
|
+
console.log(' macOS: brew install python@3.11');
|
|
25
|
+
console.log(' Linux: apt-get install python3 python3-pip');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Check latexmk
|
|
29
|
+
console.log('\nš Checking LaTeX...');
|
|
30
|
+
try {
|
|
31
|
+
execSync('which latexmk', { stdio: 'pipe' });
|
|
32
|
+
console.log('ā
latexmk detected');
|
|
33
|
+
} catch (e) {
|
|
34
|
+
console.log('ā ļø latexmk not found. Install MacTeX or TeX Live');
|
|
35
|
+
console.log(' macOS: brew install --cask mactex');
|
|
36
|
+
console.log(' Linux: apt-get install texlive-full latexmk');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Check poppler
|
|
40
|
+
try {
|
|
41
|
+
execSync('which pdfinfo', { stdio: 'pipe' });
|
|
42
|
+
console.log('ā
Poppler utilities detected');
|
|
43
|
+
} catch (e) {
|
|
44
|
+
console.log('ā ļø Poppler not found. Required for PDF rendering.');
|
|
45
|
+
console.log(' macOS: brew install poppler');
|
|
46
|
+
console.log(' Linux: apt-get install poppler-utils');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Install Python dependencies
|
|
50
|
+
console.log('\nš¦ Installing Python dependencies...');
|
|
51
|
+
const requirementsPath = path.join(projectRoot, 'requirements.txt');
|
|
52
|
+
if (fs.existsSync(requirementsPath)) {
|
|
53
|
+
try {
|
|
54
|
+
execSync('pip3 install -r requirements.txt', {
|
|
55
|
+
cwd: projectRoot,
|
|
56
|
+
stdio: 'inherit'
|
|
57
|
+
});
|
|
58
|
+
console.log('ā
Python dependencies installed');
|
|
59
|
+
} catch (e) {
|
|
60
|
+
console.log('ā ļø Failed to install Python dependencies. Run manually: pip3 install -r requirements.txt');
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
console.log('ā ļø requirements.txt not found. Skipping Python dependencies.');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
console.log('\nā
Install script completed');
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# PaperFit Installation Script
|
|
3
|
+
# Usage: ./install.sh [components...]
|
|
4
|
+
# Example: ./install.sh rules hooks agents
|
|
5
|
+
|
|
6
|
+
set -e
|
|
7
|
+
|
|
8
|
+
# Colors for output
|
|
9
|
+
RED='\033[0;31m'
|
|
10
|
+
GREEN='\033[0;32m'
|
|
11
|
+
YELLOW='\033[1;33m'
|
|
12
|
+
BLUE='\033[0;34m'
|
|
13
|
+
NC='\033[0m' # No Color
|
|
14
|
+
|
|
15
|
+
# Project root
|
|
16
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
17
|
+
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
|
|
18
|
+
|
|
19
|
+
echo -e "${BLUE}š PaperFit Installation${NC}"
|
|
20
|
+
echo "========================"
|
|
21
|
+
echo ""
|
|
22
|
+
|
|
23
|
+
# Check Python
|
|
24
|
+
if ! command -v python3 &> /dev/null; then
|
|
25
|
+
echo -e "${RED}ā Python 3 not found. Please install Python 3.8+${NC}"
|
|
26
|
+
exit 1
|
|
27
|
+
fi
|
|
28
|
+
echo -e "${GREEN}ā
Python 3: $(python3 --version)${NC}"
|
|
29
|
+
|
|
30
|
+
# Check pip
|
|
31
|
+
if ! command -v pip3 &> /dev/null; then
|
|
32
|
+
echo -e "${YELLOW}ā ļø pip3 not found. Attempting to install Python dependencies may fail.${NC}"
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
# Install Python dependencies
|
|
36
|
+
echo ""
|
|
37
|
+
echo -e "${BLUE}š¦ Installing Python dependencies...${NC}"
|
|
38
|
+
if [ -f "$PROJECT_ROOT/requirements.txt" ]; then
|
|
39
|
+
pip3 install -r "$PROJECT_ROOT/requirements.txt"
|
|
40
|
+
echo -e "${GREEN}ā
Python dependencies installed${NC}"
|
|
41
|
+
else
|
|
42
|
+
echo -e "${YELLOW}ā ļø requirements.txt not found. Skipping Python dependencies.${NC}"
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
# Check system dependencies
|
|
46
|
+
echo ""
|
|
47
|
+
echo -e "${BLUE}š Checking system dependencies...${NC}"
|
|
48
|
+
|
|
49
|
+
# Check poppler
|
|
50
|
+
if command -v pdfinfo &> /dev/null; then
|
|
51
|
+
echo -e "${GREEN}ā
Poppler utilities${NC}"
|
|
52
|
+
else
|
|
53
|
+
echo -e "${YELLOW}ā ļø Poppler not found. Install with: brew install poppler${NC}"
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
# Check latexmk
|
|
57
|
+
if command -v latexmk &> /dev/null; then
|
|
58
|
+
echo -e "${GREEN}ā
latexmk${NC}"
|
|
59
|
+
else
|
|
60
|
+
echo -e "${YELLOW}ā ļø latexmk not found. Install MacTeX or TeX Live${NC}"
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
# Install rules (optional)
|
|
64
|
+
echo ""
|
|
65
|
+
read -p "Install rules to ~/.claude/rules? (y/n) " -n 1 -r
|
|
66
|
+
echo
|
|
67
|
+
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
68
|
+
mkdir -p "$HOME/.claude/rules"
|
|
69
|
+
cp -r "$PROJECT_ROOT/rules" "$HOME/.claude/rules/" 2>/dev/null || {
|
|
70
|
+
cp -r "$SCRIPT_DIR/../rules" "$HOME/.claude/rules/" 2>/dev/null || {
|
|
71
|
+
echo -e "${YELLOW}ā ļø rules directory not found. Skipping.${NC}"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
echo -e "${GREEN}ā
Rules installed to ~/.claude/rules${NC}"
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
# Install hooks (optional)
|
|
78
|
+
echo ""
|
|
79
|
+
echo -e "${BLUE}šŖ Configuring hooks...${NC}"
|
|
80
|
+
if [ -f "$PROJECT_ROOT/.claude/settings.json" ]; then
|
|
81
|
+
echo -e "${GREEN}ā
Claude Code settings found${NC}"
|
|
82
|
+
else
|
|
83
|
+
echo -e "${YELLOW}ā ļø .claude/settings.json not found. Hooks will not be configured automatically.${NC}"
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
# Create symlinks for global access
|
|
87
|
+
echo ""
|
|
88
|
+
read -p "Create global 'paperfit' command? (requires sudo) (y/n) " -n 1 -r
|
|
89
|
+
echo
|
|
90
|
+
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
91
|
+
sudo ln -sf "$SCRIPT_DIR/paperfit" /usr/local/bin/paperfit 2>/dev/null || {
|
|
92
|
+
ln -sf "$SCRIPT_DIR/paperfit" ~/bin/paperfit 2>/dev/null || {
|
|
93
|
+
echo -e "${YELLOW}ā ļø Could not create symlink. Add $SCRIPT_DIR to PATH manually.${NC}"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
echo -e "${GREEN}ā
Global command installed${NC}"
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
echo ""
|
|
100
|
+
echo -e "${GREEN}ā
Installation complete!${NC}"
|
|
101
|
+
echo ""
|
|
102
|
+
echo "Next steps:"
|
|
103
|
+
echo " 1. Run: paperfit doctor"
|
|
104
|
+
echo " 2. Run: paperfit init"
|
|
105
|
+
echo " 3. Open your LaTeX project in Claude Code"
|
|
106
|
+
echo ""
|