Create New Doclific Doc
Overview
This skill helps you create a new Doclific document by navigating the directory structure, selecting an appropriate icon, and using the insert-doc.js script to create the document structure.
Instructions
When the user asks you to create a new Doclific document:
- •
Determine the location:
- •If the user specifies a parent document (e.g., "Create a new doc under 'Getting Started'"), search the
doclific/directory recursively to find the parent document's directory by matching thetitlefield inconfig.jsonfiles. - •If no parent is specified, create the document at the root level of the
doclific/directory. - •The path should be the full directory path where the new document should be created (e.g.,
doclific/for root level, ordoclific/61ac6a60-3409-4ef6-aa86-203abbfac9d8/for a child document).
- •If the user specifies a parent document (e.g., "Create a new doc under 'Getting Started'"), search the
- •
Get the document title:
- •Use the title provided by the user, or ask for clarification if not provided.
- •
Select an appropriate icon:
- •Read the
all-icons.jsonfile from theskills/create-new-doclific-doc/directory. - •Choose an icon that semantically matches the document's purpose or title.
- •Common icon choices:
- •Documentation/Guides:
BookOpen,FileText,Book,ScrollText - •Getting Started:
Rocket,Play,Zap,Sparkles - •API Reference:
Code,Terminal,Brackets,FileCode - •Architecture:
Network,Layers,Boxes,Workflow - •Configuration:
Settings,Sliders,Wrench,Cog - •Examples:
Lightbulb,Beaker,FlaskConical,TestTube
- •Documentation/Guides:
- •If the user specifies an icon, use that icon name (validate it exists in
all-icons.json). - •If unsure, default to
FileTextor ask the user for their preference.
- •Read the
- •
Call insert-doc.js:
- •Use the
insert-doc.jsscript located atskills/create-new-doclific-doc/insert-doc.js. - •Execute it with three arguments:
bash
node skills/create-new-doclific-doc/insert-doc.js <path> <title> <icon-name>
- •Example:
bash
node skills/create-new-doclific-doc/insert-doc.js doclific/ "Getting Started" "Rocket"
- •Or for a nested document:
bash
node skills/create-new-doclific-doc/insert-doc.js doclific/61ac6a60-3409-4ef6-aa86-203abbfac9d8/ "API Reference" "Code"
- •Use the
- •
Verify creation:
- •The script will create:
- •A new directory with a random UUID
- •A
config.jsonfile with the title and icon - •A
content.mdxfile with the title as a heading
- •Confirm the document was created successfully.
- •The script will create:
- •
Optional: Generate initial content:
- •After creating the document, you can optionally use the
generate-doclific-mdxskill to populate thecontent.mdxfile with initial documentation based on the document's title and purpose.
- •After creating the document, you can optionally use the
Workflow Example
- •User: "Create a new document called 'API Reference' under 'Getting Started'"
- •Search
doclific/for aconfig.jsonwithtitle: "Getting Started" - •Find the directory path (e.g.,
doclific/61ac6a60-3409-4ef6-aa86-203abbfac9d8/) - •Select icon:
Code(appropriate for API Reference) - •Execute:
node skills/create-new-doclific-doc/insert-doc.js doclific/61ac6a60-3409-4ef6-aa86-203abbfac9d8/ "API Reference" "Code" - •Confirm creation and optionally generate initial content using
generate-doclific-mdx
Important Notes
- •The
insert-doc.jsscript will generate a random UUID for the document directory name. - •The script validates that the icon name exists in
all-icons.jsonbefore creating the document. - •Always use absolute paths or paths relative to the project root when calling
insert-doc.js. - •If the parent directory doesn't exist, the script will create it (with
recursive: true). - •After creating the document structure, you can use the
generate-doclific-mdxskill to populate the content.