organize-docs-from-zip
Skill3 starsChanged 8 months agoCC0-1.0View on GitHub
Unpacks a user-provided documentation zip, normalizes Markdown into magj.dev content layout (blog vs references), matches site voice and frontmatter, and stages files with draft flags and a human review handoff. Use when the user attaches or paths to a .zip of docs (e.g. samples.file.zip), asks to import or organize bundled Markdown for the blog or references, or prepare zip content for publication review.
In this repository48 other files it gives its agents.
- 3d-printingSkill
- app-securitySkill
- architecture-designSkill
- aws-genai-lensSkill
- aws-well-architected-frameworkSkill
- aws-well-architectedSkill
- azure-well-architectedSkill
- blog-post-with-diagramsSkill
- clean-architectureSkill
- clean-codeSkill
- databricks-genie-spaces-best-practicesSkill
- data-visualization-guideSkill
- design-an-interfaceSkill
- design-patternsSkill
- domain-driven-designSkill
- dry-principleSkill
- edit-articleSkill
- event-driven-designSkill
- git-best-practicesSkill
- git-guardrails-claude-codeSkill
- grill-meSkill
- hexagonal-architectureSkill
- improve-codebase-architectureSkill
- language-conventions-source-en-docs-brSkill
- learn-electronicsSkill
- linked-dataSkill
- microservices-skillSkill
- object-oriented-programmingSkill
- oop-design-patternsSkill
- oreilly-design-referenceSkill
- prd-to-issuesSkill
- prd-to-planSkill
- project-context-syncSkill
- request-refactor-planSkill
- rfc2119Skill
- scaffold-exercisesSkill
- semverSkill
- setup-pre-commitSkill
- solid-principlesSkill
- tddSkill
- todoSkill
- triage-issueSkill
- ts-otp-awsSkill
- ubiquitous-languageSkill
- ux-design-principlesSkill
- write-a-prdSkill
- write-a-skillSkill
- yagni-principleSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 41
Do not execute binaries from the zip.
- Very specific: line 52
If the active content.config.ts differs from reference.md, the repo file wins.
- Distinctive: line 57
Prefer short paragraphs; explain decisions where useful.
- Very specific: line 71
If a path already exists, do not overwrite: use a suffix (-import, -2) or stop and list options for the user.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Organize docs from zip (magj.dev)
When this applies
The user supplies a local zip path (for example ./samples.file.zip). The agent unpacks safely, classifies each Markdown file, writes or proposes paths under src/content/blog/ or src/content/references/, aligns tone with the site, and does not treat the result as published until a human confirms.
This is a local editorial workflow. It complements (does not replace) the admin References zip pipeline described in reference.md.
Quick checklist
- [ ] Confirm zip path; refuse if missing or not a file
- [ ] Inspect archive (list entries; no path traversal)
- [ ] Extract to a disposable staging directory under the repo or /tmp
- [ ] Parse each .md: frontmatter + body; classify blog vs references
- [ ] Normalize frontmatter to project Zod schemas (see reference.md)
- [ ] Choose filenames (kebab-case slugs); avoid overwriting without explicit user OK
- [ ] Edit prose for magj.dev tone (see Tone)
- [ ] Set draft for human review (blog defaults draft; force draft on references until publish)
- [ ] Leave REVIEW.md or inline PR notes: sources, assumptions, open questionsSafe unpack
- List only first:
unzip -l <zip>(or equivalent) to see paths and sizes. - Reject entries containing
.., absolute paths, or non-UTF-8 names you cannot normalize. - Extract to something like
.staging/docs-import-<date>/(gitignored if needed) or/tmp/magj-docs-import/. - Respect rough limits aligned with production zip handling: on the order of tens of Markdown files and tens of MB uncompressed; if larger, stop and ask to split the archive.
Do not execute binaries from the zip. Only treat .md (and optionally .mdx if the project supports it—this repo uses .md in content loaders) as first-class import targets.
Classify: blog vs references
| Signal | Prefer collection |
| Long-form narrative, dated post, tags like a blog | blog |
| Short entry pointing at an external canonical URL | blog with externalUrl if the schema in use supports it—verify src/content.config.ts before adding fields |
| Curated reading list / link page, stable “reference” doc | references |
| User explicitly says “blog” or “references” | As specified |
If the active content.config.ts differs from reference.md, the repo file wins.
Tone (magj.dev)
- Clear, technical, complete sentences—not telegraphic bullet chains as the only prose.
- Prefer short paragraphs; explain decisions where useful.
- Match existing posts: read one or two current files from
src/content/blog/andsrc/content/references/before heavy rewriting. - For deep edits, follow edit-article and blog-post-with-diagrams when diagrams help.
Frontmatter and drafts
- Blog (
src/content/blog/):title,summary,publishedAtrequired per schema; keepdraft: trueuntil the human approves. - References (
src/content/references/):title,description,daterequired; setdraft: truefor this workflow even though the schema default may be false—human toggles off when publishing.
Normalize dates to YYYY-MM-DD. Derive missing titles from the first H1 or filename. Add sensible tags from content.
Slugs and collisions
- Filename = kebab-case slug +
.md. - If a path already exists, do not overwrite: use a suffix (
-import,-2) or stop and list options for the user.
Handoff for human review
Deliver:
- Table of files: source path in zip → repo path → collection → draft status.
- Assumptions: anything inferred (dates, tags, blog vs references).
- Checks: suggest
bun run lintandbun run build(or project-standard commands) after edits. - Do not merge or deploy unless the user explicitly asks.
Additional detail
- Schema tables and zip pipeline alignment: reference.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

