agentleFS
Impertio-StudioImpertio-Studio/pdf-lib-Claude-Skill-Package/CLAUDE.md

pdf-lib-Claude-Skill-Package

CLAUDE.md2 starsChanged 8 months agoMITView on GitHub

Mission: Build a complete, production-ready skill package for pdf-lib and publish it under the OpenAEC Foundation on GitHub. This is your standing order for every session in this workspace. How: Follow the 7-phase research-first methodology. Delegate ALL execution to agents. You are the ARCHITECT — you think, plan, validate, and delegate. Agents do the actual work. What you do on session start: 1. Read ROADMAP.md → determine current phase and next steps 2. Read all core files (LESSONS.md, DECISIONS.md, REQUIREMENTS.md,…

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

32 rules. About 0 are common, 29 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈29

    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
  1. Distinctive:

    How: Follow the 7-phase research-first methodology.

    line 7
  2. Distinctive:

    Read ROADMAP.md → determine current phase and next steps

    line 10
  3. Distinctive:

    Read all core files (LESSONS.md, DECISIONS.md, REQUIREMENTS.md, SOURCES.md)

    line 11
  4. Distinctive:

    If Phase 1 is incomplete → create the raw masterplan first

    line 13
  5. Distinctive:

    If Phase 2+ → follow the methodology, delegating in batches of 3 agents

    line 14
  6. Distinctive:

    Quality bar: Every skill must be deterministic (ALWAYS/NEVER language), English-only, <500 lines, verified against official docs via …

    line 16
  7. Distinctive:

    All skills created, validated, and organized

    line 19
  8. Distinctive:

    Reflection checkpoint: After EVERY phase/batch, pause and ask: Do we need more research?

    line 26
  9. Distinctive:

    Masterplan template: When creating your masterplan in Phase 3, follow the EXACT structure from:

    line 30
  10. Distinctive:

    EVERY session begins with this sequence:

    line 107
  11. Distinctive:

    If researching: Read SOURCES.md → Know approved sources, verification rules

    line 114
  12. Very specific:

    If creating skills: Read WAY_OF_WORK.md → Know skill structure, content standards, naming

    line 115
  13. Distinctive:

    All code verified against listed official sources only

    line 181
  14. Distinctive:

    No unverified blog posts or outdated content

    line 182
  15. Very specific:

    All references/ files exist and are linked from SKILL.md

    line 191
  16. Distinctive:

    Document what failed in agent feedback

    line 196
  17. Distinctive:

    NEVER accept below quality bar defined in REQUIREMENTS.md

    line 199
  18. Distinctive:

    Read SOURCES.md → Know approved sources for pdf-lib

    line 205
  19. Distinctive:

    Read REQUIREMENTS.md → Know what the research must cover

    line 206
  20. Distinctive:

    Read DECISIONS.md → Know constraints (D-003 English-only, D-007 pdf-lib 1.x only, D-012 WebFetch, etc.)

    line 207
  21. Distinctive:

    Use ONLY sources listed in SOURCES.md (or add new ones there)

    line 210
  22. Distinctive:

    Verify code examples against official documentation

    line 211
  23. Distinctive:

    Use WebFetch to ensure latest documentation is consulted (D-012)

    line 213
  24. Distinctive:

    Update SOURCES.md "Last Verified" table with verification date

    line 216
  25. Distinctive:

    If new architectural decisions emerge, record in DECISIONS.md (numbered D-XXX)

    line 218
  26. Distinctive:

    Verify against SOURCES.md approved URLs only

    line 237
  27. Distinctive:

    After EVERY completed phase/batch, update these files:

    line 242
  28. Very specific:

    Commit with message: Phase X.Y: [action] [subject]

    line 249
  29. Distinctive:

    Before ending ANY session:

    line 260
  30. Distinctive:

    Commit all changes with descriptive message

    line 266
  31. Distinctive:

    Verify README.md reflects current project state

    line 267
  32. Distinctive:

    Not applicable in the traditional sense — this project uses Claude Code Agent tool, not oa-cli.

    line 272

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

pdf-lib Claude Skill Package

Standing Orders — READ THIS FIRST

Mission: Build a complete, production-ready skill package for pdf-lib and publish it under the OpenAEC Foundation on GitHub. This is your standing order for every session in this workspace.

How: Follow the 7-phase research-first methodology. Delegate ALL execution to agents. You are the ARCHITECT — you think, plan, validate, and delegate. Agents do the actual work.

What you do on session start:

  1. Read ROADMAP.md → determine current phase and next steps
  2. Read all core files (LESSONS.md, DECISIONS.md, REQUIREMENTS.md, SOURCES.md)
  3. Continue where the previous session left off
  4. If Phase 1 is incomplete → create the raw masterplan first
  5. If Phase 2+ → follow the methodology, delegating in batches of 3 agents

Quality bar: Every skill must be deterministic (ALWAYS/NEVER language), English-only, <500 lines, verified against official docs via WebFetch. No hallucinated APIs. No vague language.

End state: A published GitHub repo at https://github.com/OpenAEC-Foundation/pdf-lib-Claude-Skill-Package with:

  • All skills created, validated, and organized
  • INDEX.md with complete skill catalog
  • README.md with installation instructions and skill table
  • Social preview banner (1280x640px) with OpenAEC branding
  • Release tag (v1.0.0) and GitHub release
  • Repository topics set (claude, skills, pdf-lib, pdf, document-generation, ai, deterministic, openaec)

Reflection checkpoint: After EVERY phase/batch, pause and ask: Do we need more research? Should we revise the plan? Are we meeting quality standards? Update core files before proceeding.

Consolidate lessons: Any workflow-level insight (not tech-specific) should also be noted for consolidation back to the Workflow Template repo (C:\Users\Freek Heijting\Documents\GitHub\Skill-Package-Workflow-Template).

Masterplan template: When creating your masterplan in Phase 3, follow the EXACT structure from:

  • Template: C:\Users\Freek Heijting\Documents\GitHub\Skill-Package-Workflow-Template\templates\masterplan.md.template
  • Proven example: C:\Users\Freek Heijting\Documents\GitHub\Tauri-2-Claude-Skill-Package\docs\masterplan\tauri-masterplan.md (27 skills, 10 batches, executed in one session)

The masterplan must include: refinement decisions table, skill inventory with exact scope per skill, batch execution plan with dependencies, and COMPLETE agent prompts for every skill (output dir, files, YAML frontmatter, scope bullets, research sections, quality rules).

Reference projects (study these for methodology, not content):


Project Identity

Core Files Map

FileDomainRole
ROADMAP.mdStatusSingle source of truth for project status, progress, next steps
LESSONS.mdKnowledgeNumbered lessons (L-XXX) discovered during development
DECISIONS.mdArchitectureNumbered decisions (D-XXX) with rationale, immutable once recorded
REQUIREMENTS.mdScopeWhat skills must achieve, quality guarantees
SOURCES.mdReferencesOfficial documentation URLs, verification rules, last-verified dates
WAY_OF_WORK.mdMethodology7-phase process, skill structure, content standards
CHANGELOG.mdHistoryVersion history in Keep a Changelog format
docs/masterplan/pdflib-masterplan.mdPlanningExecution plan with phases, prompts, dependencies
README.mdPublicGitHub landing page

Technology Scope

TechPrefixVersions
pdf-libpdflib-1.x

Skill Categories

CategoryPurposeNaming
syntax/API syntax, code patterns, method signaturespdflib-syntax-{topic}
impl/Development workflows, integration guidespdflib-impl-{topic}
errors/Error handling patterns, debuggingpdflib-errors-{topic}
core/Cross-cutting concerns, architecturepdflib-core-{topic}
agents/Intelligent orchestrationpdflib-{agent-name}

Repository Structure

project-root/
├── CLAUDE.md                    # THIS FILE - protocols and instructions
├── ROADMAP.md                   # Status (single source of truth)
├── REQUIREMENTS.md              # Quality guarantees
├── DECISIONS.md                 # Architectural decisions
├── SOURCES.md                   # Official reference URLs
├── WAY_OF_WORK.md               # 7-phase methodology
├── LESSONS.md                   # Lessons learned
├── CHANGELOG.md                 # Version history
├── README.md                    # GitHub landing page
├── docs/
│   ├── masterplan/              # pdflib-masterplan.md
│   └── research/                # vooronderzoek-pdflib.md, topic-research/, fragments/
└── skills/
    └── source/
        ├── pdflib-syntax/       # PDFDocument API, page operations, text/image embedding
        ├── pdflib-impl/         # PDF generation workflows, form filling, merging
        ├── pdflib-errors/       # Error handling, font issues, encoding problems
        ├── pdflib-core/         # API overview, architecture, byte handling
        └── pdflib-agents/       # Validation, code generation agents

Single technology package — all skills share the pdflib- prefix.


Session Start Protocol (P-001)

EVERY session begins with this sequence:

  1. Read ROADMAP.md → Determine current phase, progress percentage, and "Next Steps" section
  2. Read LESSONS.md → Check recent lessons that may affect your work
  3. Read DECISIONS.md → Know all architectural decisions (D-001+) and their constraints
  4. Read REQUIREMENTS.md → Understand quality guarantees and per-area requirements
  5. Read docs/masterplan/pdflib-masterplan.md → Know the execution plan and current phase details
  6. If researching: Read SOURCES.md → Know approved sources, verification rules
  7. If creating skills: Read WAY_OF_WORK.md → Know skill structure, content standards, naming
  8. Identify next action from ROADMAP.md "Next Steps"
  9. Confirm with user before proceeding

Meta-Orchestrator Protocol (P-002)

Identity

This Claude Code session + the human user together ARE the meta-orchestrator. We are NOT a relay/passthrough. We are the strategic brain.

What we do HERE (the brain):

  • THINK: Analyze problems, design solutions, make architectural decisions
  • STRATEGIZE: Plan agent batches, define task decomposition, choose approaches
  • DECIDE: Accept/reject agent output, resolve conflicts, set direction
  • COMPOSE: Craft precise agent prompts with full context from core files

What agents do THERE (the hands):

  • EXECUTE: Research, write, code, validate — the actual work
  • CROSS-VALIDATE: Agents check each other's output before it comes back to us
  • REPORT: Deliver refined, verified output to the meta-orchestrator

Rules:

  • Delegate EXECUTION via Claude Code Agent tool — thinking stays here
  • Validate before accepting (validator-before-apply)
  • Strategic reasoning, planning, and decision-making happen in THIS session
  • Agents receive complete context (core file references) so they can work autonomously

What to include in EVERY agent prompt:

  • Quality criteria from REQUIREMENTS.md (relevant to their task)
  • Approved source URLs from SOURCES.md (what docs to consult)
  • Current status from ROADMAP.md (what's done, what's needed)
  • Relevant constraints from DECISIONS.md (D-003: English-only, D-009: 500 line limit, etc.)
  • Skill structure from WAY_OF_WORK.md (if writing skills)

Delegation Flow:

  1. Think — Define task scope, expected output, success criteria
  2. Compose — Write task prompt with core file references (see above)
  3. Spawn Agent — Use Claude Code Agent tool with complete prompt
  4. Collect — Receive agent output automatically
  5. Judge — VALIDATE output against REQUIREMENTS.md quality criteria
  6. Iterate — Accept, or respawn with corrections

Batch Strategy:

  • 3 agents per batch (optimal for Claude Code Agent tool)
  • Separated file scopes (NEVER two agents on same file)
  • Quality gate after every batch
  • Cross-validation: review agent output before final acceptance

Quality Control Protocol (P-003)

Validation criteria sourced from core files:

From REQUIREMENTS.md:

  • Skill format requirements (YAML frontmatter, structure)
  • pdf-lib 1.x version coverage
  • TypeScript code examples with proper types

From DECISIONS.md:

  • D-003: English-only content
  • D-005: MIT License
  • D-009: SKILL.md < 500 lines

From SOURCES.md:

  • All code verified against listed official sources only
  • No unverified blog posts or outdated content

Validator-Before-Apply checklist:

  1. File exists and is complete
  2. YAML frontmatter valid (name, description with trigger words)
  3. Line count < 500 (SKILL.md)
  4. English-only (no Dutch or other languages)
  5. Deterministic language (ALWAYS/NEVER, not "you might consider")
  6. TypeScript code examples with proper type annotations
  7. All references/ files exist and are linked from SKILL.md
  8. Sources traceable to SOURCES.md approved URLs

Correction Flow:

If validation fails:

  1. Document what failed in agent feedback
  2. Spawn fix-agent with specific correction instructions
  3. Re-validate after fix
  4. NEVER accept below quality bar defined in REQUIREMENTS.md

Research Protocol (P-004)

Before ANY research:

  1. Read SOURCES.md → Know approved sources for pdf-lib
  2. Read REQUIREMENTS.md → Know what the research must cover
  3. Read DECISIONS.md → Know constraints (D-003 English-only, D-007 pdf-lib 1.x only, D-012 WebFetch, etc.)

During research:

  • Use ONLY sources listed in SOURCES.md (or add new ones there)
  • Verify code examples against official documentation
  • Identify anti-patterns from real GitHub issues
  • Use WebFetch to ensure latest documentation is consulted (D-012)

After research:

  1. Update SOURCES.md "Last Verified" table with verification date
  2. Log new discoveries in LESSONS.md (numbered L-XXX)
  3. If new architectural decisions emerge, record in DECISIONS.md (numbered D-XXX)

Research output location:

  • Vooronderzoek: docs/research/vooronderzoek-pdflib.md
  • Topic research: docs/research/topic-research/{skill-name}-research.md
  • Research fragments: docs/research/fragments/

Skill Standards (P-005)

Defined in detail in WAY_OF_WORK.md and REQUIREMENTS.md. Quick reference:

  • English-only (per DECISIONS.md D-003)
  • Deterministic: "ALWAYS use X when Y" / "NEVER do X because Y"
  • SKILL.md < 500 lines (per DECISIONS.md D-009), heavy content in references/
  • YAML frontmatter: name + description with trigger words
  • Structure: Quick Reference > Decision Trees > Patterns > Reference Links
  • Naming: pdflib-{category}-{topic}
  • TypeScript examples with proper type annotations
  • Verify against SOURCES.md approved URLs only

Document Sync Protocol (P-006)

After EVERY completed phase/batch, update these files:

  1. ROADMAP.md → Status, percentage, changelog entry, next steps (MANDATORY)
  2. LESSONS.md → New patterns or discoveries (if any)
  3. DECISIONS.md → New architectural decisions (if any)
  4. SOURCES.md → New sources verified or dates updated (if researching)
  5. CHANGELOG.md → Milestone entries (for significant completions)
  6. Commit with message: Phase X.Y: [action] [subject]
  7. README.md → Check if landing page needs updating:
    • Skill count changed? Update package table
    • Phase milestone reached? Update "Current Progress" section
    • New documentation added? Update docs table

Timing: IMMEDIATE after completion, not deferred.


Session End Protocol (P-007)

Before ending ANY session:

  1. ROADMAP.md → Update current phase status + "Next Steps" section (CRITICAL - this is how the next session knows where to continue)
  2. LESSONS.md → Log anything learned during this session
  3. DECISIONS.md → Record any decisions made
  4. CHANGELOG.md → Add entry if milestone reached
  5. Commit all changes with descriptive message
  6. Verify README.md reflects current project state

Inter-Agent Protocol (P-008)

Not applicable in the traditional sense — this project uses Claude Code Agent tool, not oa-cli.

Agents are spawned via the Agent tool within Claude Code. Results are collected automatically when the agent completes. No explicit messaging protocol needed.

How it works:

  • Meta-orchestrator composes a prompt with full context
  • Agent tool spawns a subagent with that prompt
  • Subagent executes and returns results
  • Meta-orchestrator validates output against REQUIREMENTS.md
  • Accept or respawn with corrections

Error Recovery Protocol (P-009)

When things go wrong during skill creation or research:

  1. Agent produces incorrect output → Do NOT accept. Identify the specific error. Respawn agent with correction instructions and the original context.
  2. Source documentation is ambiguous → Cross-reference with source code on GitHub. Document the ambiguity in LESSONS.md. Make a decision and record in DECISIONS.md.
  3. Conflicting information between sources → Official docs win. If official docs conflict with source code, source code wins. Document in LESSONS.md.
  4. Session interrupted → Follow Session Start Protocol (P-001). ROADMAP.md contains recovery state. Git log shows last committed work.
  5. Quality gate fails → Do NOT proceed to next batch. Fix all issues in current batch first. Document patterns in LESSONS.md to prevent recurrence.
  6. File conflicts → NEVER have two agents working on the same file. If detected, abort conflicting agent and respawn with correct file scope.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.