SoftCopyright - Intelligent Software Copyright Application Material Generation Tool
Overview
When users need to apply for software copyright, this skill will automatically complete the following processes:
- Read user input, if it's keywords, first search for relevant content
- Analyze project source code structure and content
- Generate a detailed software manual (about 2000-3000 words)
- Generate compliant source code documents (60 pages, 50 lines per page)
- Export to PDF format for software copyright application use
Supported Trigger Commands
Users can trigger this skill in the following ways:
- "Help me generate software copyright application materials" - Process the current directory project
- "Generate software manual" - Only generate the software manual
- "Generate source code document" - Only generate the source code document
- Any keywords - First search for relevant content, then ask whether to generate software copyright materials
Workflow
Step 1: Understand User Intent
First determine the type of user input:
javascript
// 检查用户输入类型
if (用户输入包含 "软著" || "著作权") {
生成类型 = "全部材料"
} else if (用户输入包含 "软件说明书") {
生成类型 = "说明书"
} else if (用户输入包含 "源代码" || "源码") {
生成类型 = "源代码文档"
} else if (用户输入是关键词) {
先搜索相关内容
询问用户是否生成软著材料
}
Step 2: Project Path Confirmation
javascript
// 默认使用当前目录
let projectPath = process.cwd()
// 询问用户确认路径
await confirmProjectPath(projectPath)
Step 3: Generate Software Copyright Materials Using CLI
It is recommended to use the CLI tool to generate software copyright materials:
bash
# 方式1: 使用关键词触发index.js(交互式)
cd ~/.claude/skills/softcopyright
node scripts/index.js 软著
# 方式2: 使用cli.js直接生成(推荐)
node scripts/cli.js generate --project <项目路径>
# 方式3: 使用快捷命令(最佳体验)
~/.claude/skills/softcopyright/softcopyright-generate --project . --auto-pdf
# 方式4: 技能系统自动调用
用户输入"帮我生成软著" → 自动执行: softcopyright-generate --project . --auto-pdf
This tool will:
- Automatically scan project source code
- Identify source code file types
- Analyze project structure and technology stack
- Generate HTML-formatted software manuals and source code documents
- Ask users whether to automatically open in the browser and print as PDF
Step 4: Generation Options
Users can choose:
- Generate all materials (software manual + source code document)
- Only generate software manual
- Only generate source code document
- Only view project statistics
Step 5: Output Location
Default output path:
<项目目录>/softcopyright-output/
Generated files:
Step 6: Export to PDF
There are two ways to convert HTML to PDF:
Method 1: Automatic conversion (Recommended)
bash
# 添加--auto-pdf选项
node scripts/cli.js generate --project <项目路径> --auto-pdf
- Automatically open HTML in the browser
- Automatically pop up the print dialog after 3 seconds
- Select "Save as PDF" to complete
Method 2: Manual conversion
- Open the generated HTML file in the browser
- Press Cmd+P (macOS) or Ctrl+P (Windows/Linux)
- In print settings:
- Expand "More settings"
- Check "Headers and footers"
- Select "Save as PDF"
- Save the PDF file
Tool Script Usage Instructions
scanner.js - Source Code Scanning Tool
Scan project directories and analyze structure:
bash
node ~/.claude/skills/softcopyright/scripts/scanner.js <项目路径>
Output a JSON file of project analysis.
doc-generator.js - Software Manual Generator
Generate detailed software manuals:
bash
node ~/.claude/skills/softcopyright/scripts/doc-generator.js \
--type manual \
--input <项目分析JSON> \
--template <模板文件> \
--output <输出PDF路径>
source-exporter.js - Source Code Document Generator
Generate source code documents that meet software copyright requirements:
bash
node ~/.claude/skills/softcopyright/scripts/source-exporter.js \
--input <源码目录> \
--output <输出PDF路径> \
--pages 60 \
--lines-per-page 50
Usage Examples
Example 1: Complete Software Copyright Material Generation
User: "Help me generate software copyright application materials"
Claude Execution Process:
- Confirm project path: Current directory
- Run source code scanning tool
- Analyze project structure and technology stack
- Generate software manual
- Generate source code document
- Export PDF files
- Show generation results to user
Example 2: Generate After Keyword Search
User: "React e-commerce system"
Claude Execution Process:
- Search for information related to "React e-commerce system"
- Display search results
- Ask: "Do you need to generate software copyright application materials for the React e-commerce system?"
- Execute the complete generation process after user confirmation
Example 3: Only Generate Software Manual
User: "Help me generate a software manual"
Claude Execution Process:
- Scan project source code
- Analyze project functions
- Generate software manual
- Export PDF file
Output File Specifications
Software Manual PDF
- File name:
- Word count requirement: 2000-3000 words
- Contains all required chapters
- Professional typesetting and formatting
Source Code Document PDF
- File name:
- Page count requirement: 60 pages (or process all code)
- Lines per page: No less than 50 lines
- No comments and no copyright information
- Ensure code continuity
Software Copyright Application Requirements
Source Code Document Requirements
- Page count requirement: Usually 20-60 pages are required
- Format requirement: No more than 50 lines of code per page
- Comment requirement: All comments need to be removed, only pure code remains
- Headers and footers: Need to include software name and version number
- Code continuity: Need to ensure code continuity and integrity
Software Manual Requirements
- Detailed content: About 2000-3000 words
- Complete structure: Contains all required chapters
- Highlight key points: Highlight the originality of the software
- Professional description: Use professional technical descriptions
Technology Stack
- Node.js: Main runtime environment
- PDFKit: PDF document generation
- glob: File pattern matching
- commander: CLI parameter parsing
- chalk: Terminal color output
- inquirer: Interactive command-line interface
Dependency Installation
Use nvm to manage Node.js versions:
bash
# 确保使用合适的 Node 版本
nvm use 18
# 安装依赖
cd ~/.claude/skills/softcopyright
npm install
Best Practices
- Accurate project analysis: Ensure correct identification of project type and technology stack
- Detailed and professional content: Generate professional technical descriptions and function explanations
- Standard and compliant formatting: Strictly format according to software copyright application requirements
- User-friendly interaction: Provide clear progress prompts and confirmation processes
- Document integrity: Ensure the completeness and accuracy of generated materials
Security Notes
- Source code security: Do not modify original source code, only read and analyze
- Privacy protection: Do not upload source code to external services
- Local processing: All processing is done locally
- User confirmation: Require user confirmation before important operations
Troubleshooting
Scan Failure
bash
# 检查项目路径
ls -la <项目路径>
# 检查权限
chmod -R 755 <项目路径>
PDF Generation Failure
bash
# 检查依赖安装
cd ~/.claude/skills/softcopyright
npm list
# 重新安装依赖
npm install
Insufficient Memory
For large projects, you can:
- Exclude unnecessary directories (node_modules, .git, etc.)
- Process source code files in batches
- Increase Node.js memory limit
Development and Expansion
To add support for new file types, edit
:
javascript
const SUPPORTED_EXTENSIONS = {
'.rs': {
'single_line': '//',
'multi_line': ['/*', '*/'],
'language': 'rust'
},
'.go': {
'single_line': '//',
'multi_line': ['/*', '*/'],
'language': 'go'
}
}
Version: 1.0.0
Author: peterfei
License: MIT