Output Paths for Different Sub-Skills in the Patent Disclosure Skill Repository
The handsomestWei/patent-disclosure-skill repository writes all generated artifacts to a top-level outputs/ directory, with dedicated sub-folders for Patent Search, Patent Reader, Patent OA, Exam-Policy, and case-specific Patent Disclosure folders.
Understanding the output paths for different sub-skills is essential for automating patent workflows and managing generated documents. In this repository, each sub-skill follows a strict convention that separates user-generated data from source code, ensuring clean version control and predictable file locations. This guide maps the exact directory structure as defined in the source code and SKILL files.
Output Directory Structure by Sub-Skill
Patent Search
Patent Search generates timestamped markdown reports in outputs/patent-search/SEARCH-YYYYMMDD-HHMMSS.md. As documented in skills/patent-search/SKILL.md lines 33-35, and enforced by emit_search_report.py lines 6-7, this sub-skill automatically creates the output directory and writes both markdown reports and optional JSON metadata files.
Patent Reader
Patent Reader organizes outputs under outputs/patent_reader/ or run-specific subdirectories like outputs/patent_reader/${RUN}/. According to skills/patent-reader/SKILL.md line 14 and tools like fetch_patent_pdf.py line 13, this structure stores PDF source files, extracted text, claim_tree.json, claim_mermaid.mmd diagrams, and final observation markdown files.
Patent OA (Office Action)
Patent OA uses case-specific folders located at outputs/oa/{案件}/, where {案件} represents the specific case identifier. Defined in oa/prompts/respond_office_action.md lines 107-135 and utilized by emit_opinion_docx.py line 7, these directories contain draft opinion markdown (意见陈述_时间戳.md), final Word documents, and structured YAML files such as notice_struct.yaml.
Exam-Policy
Exam-Policy generates policy briefs at outputs/exam-policy/POLICY-YYYYMMDD-HHMM.md. The path convention is documented in skills/exam-policy/SKILL.md line 14 and the emit_backlog.md prompt at line 8, storing policy brief markdown and optional appendix files with timestamped filenames.
Patent Disclosure
Patent Disclosure targets case-based directories such as outputs/case/ or outputs/{案件}/cad_views/. Tools located in skills/patent-disclosure/tools/—specifically run_step_to_views.py at line 475—use the --out-dir flag to write CAD screenshots, line-art PDFs, mermaid diagrams, generated disclosure markdown, and Word documents.
How Output Paths Are Defined in the Source Code
The output conventions are hard-coded in individual SKILL.md files and reinforced by command-line interfaces. The top-level SKILL.md establishes that all sub-skills write artifacts outside the skill package into the repository's top-level outputs/ folder. This design keeps user-generated data isolated from the codebase and respects the repository's .gitignore rules.
Most tools expose an -o/--output-dir or --out-dir parameter to override defaults. For example, skills/patent-disclosure/tools/run_step_to_views.py suggests the path "输出目录(建议 outputs/{案件}/cad_views/)" in its help text, while skills/patent-search/tools/emit_search_report.py defaults to outputs/patent-search/ when no alternative is provided.
Practical Examples for Each Sub-Skill
Running a Patent Search
python skills/patent-search/tools/cnipa_search.py \
--query "发明人:张三" \
--output-dir outputs/patent-search/
Result: outputs/patent-search/SEARCH-20231128-153200.md
Processing a Patent PDF
python skills/patent-reader/tools/extract/fetch_patent_pdf.py \
-i CN119961390A.pdf \
-o outputs/patent_reader/run1
Results:
outputs/patent_reader/run1/source/CN119961390A.pdfoutputs/patent_reader/run1/claim_tree.jsonoutputs/patent_reader/run1/claim_mermaid.mmd
Drafting an Office Action Response
python skills/patent-oa/tools/emit_opinion_docx.py \
-i outputs/oa/案1/意见陈述_20231201_1015.md \
-o outputs/oa/案1/
Result: outputs/oa/案1/意见陈述_20231201_1015.docx
Generating CAD Views for Disclosure
python skills/patent-disclosure/tools/run_step_to_views.py \
-i model.step \
-o outputs/case/cad_views/
Result: Files saved under outputs/case/cad_views/
Creating an Exam-Policy Brief
python -c "import datetime; print(datetime.datetime.now().strftime('outputs/exam-policy/POLICY-%Y%m%d-%H%M.md'))"
Result: outputs/exam-policy/POLICY-20231201-1015.md
Summary
- All sub-skills write to
outputs/in the repository root, keeping user data separate from source code and respecting.gitignorerules. - Patent Search uses auto-generated timestamped files in
outputs/patent-search/as defined inemit_search_report.py. - Patent Reader organizes runs into subdirectories under
outputs/patent_reader/with files extracted byfetch_patent_pdf.py. - Patent OA uses case-specific folders in
outputs/oa/{案件}/for draft opinions and final Word documents. - Exam-Policy generates timestamped briefs in
outputs/exam-policy/according toexam-policy/SKILL.md. - Patent Disclosure targets case folders like
outputs/case/oroutputs/{案件}/cad_views/via tools inpatent-disclosure/tools/. - Every tool supports
-o/--output-diror--out-dirflags to override default paths.
Frequently Asked Questions
Where does Patent Search save its reports by default?
By default, Patent Search saves reports to outputs/patent-search/SEARCH-YYYYMMDD-HHMMSS.md. This path is defined in skills/patent-search/SKILL.md and enforced by emit_search_report.py when no custom output directory is specified via the --output-dir flag.
How do I specify a custom output directory for Patent Reader?
Use the -o flag when running fetch_patent_pdf.py or other reader tools. For example, the command -o outputs/patent_reader/run1 creates a dedicated run folder containing the source PDF, extracted claim_tree.json, and mermaid diagrams, isolating each processing run.
Are output directories automatically created if they don't exist?
Yes. The tools in handsomestWei/patent-disclosure-skill automatically create the output directory structure, including case-specific subfolders like outputs/oa/{案件}/ or outputs/patent_reader/${RUN}/. The codebase ensures parent directories exist before writing files, preventing path errors.
How do I prevent output files from being tracked by Git?
The repository includes .gitignore rules that exclude the top-level outputs/ directory. By writing all artifacts to this location rather than inside skill packages, the design ensures that generated content remains untracked while the codebase stays clean and version-controlled.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →