Fix a Portwood merge-tag or parser bug correctly across all of its resolution paths.

Apache-2.0Auto-check passedDocuments & Office

Install Fix Merge Tag

skills CLI
$ npx skills add Portwood-Global-Solutions/Portwood --skill fix-merge-tag -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Portwood-Global-Solutions/Portwood fix-merge-tag --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Portwood-Global-Solutions/Portwood.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/fix-merge-tag .claude/skills/fix-merge-tag && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
fix-merge-tag
GitHub stars
126
Token cost
~1.4k tokens
SKILL.md length
570 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
Apache-2.0

At a glance

Fix a Portwood merge-tag or parser bug correctly across all of its resolution paths.

  • Works in 4 steps: In-memory —… → SOQL fallback —… → Parent-level —… → …
  • Changing tag parsing
  • SKILL.md covers The three merge-tag resolution…, The four {#ChartBucket}…, Query Config formats and Constraints you must not regress, plus 1 more section
  • Calls npm

What it does

Fix Merge Tag is an agent skill from Portwood-Global-Solutions/Portwood. Fix a Portwood merge-tag or parser bug correctly across all of its resolution paths. Use when changing tag parsing, section/loop tags, conditionals, aggregates, or chart buckets — a fix in one path silently does not reach the others.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Documents & Office. It works with Salesforce. The repository describes itself as: Free, native document generation for Salesforce. PDF, DOCX, XLSX, PPTX — merge tags, images, barcodes, QR codes, bulk generation, Flow actions. 100% Apex + LWC, zero external… The licence is Apache-2.0.

When your agent uses it

  • Changing tag parsing
  • Section/loop tags
  • Chart buckets — a fix in one path silently does not reach the others

Example prompts

  • “/fix-merge-tag”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. In-memory — DocGenChartBucketResolver.preprocessInline against pre-loaded
  2. SOQL fallback — tryFallbackSoqlAggregateAdvanced, when the relationship isn't
  3. Parent-level — resolveParentMergeTags()'s regex skips {#…} prefixes so charts
  4. Giant-query parent — resolveGiantChartBuckets for charts targeting the giant

What it can do on your machine

Read from SKILL.md and the folder at commit 70ede0c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Fix Merge Tag loads about 1.4k tokens when it runs. Until then it costs about 62 tokens; SKILL.md has 570 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~62
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Portwood-Global-Solutions/Portwood at commit 70ede0c, republished under its Apache-2.0 licence (© Portwood-Global-Solutions). 570 words, ~1,367 tokens.

Download SKILL.mdSave it as .claude/skills/fix-merge-tag/SKILL.md (or your agent's skills folder).
name
fix-merge-tag
description
Fix a Portwood merge-tag or parser bug correctly across all of its resolution paths. Use when changing tag parsing, section/loop tags, conditionals, aggregates, or chart buckets — a fix in one path silently does not reach the others.

Fixing a merge-tag bug

The trap: there is more than one place that resolves tags, and they do not share code. A fix landed in one path leaves the others broken, and the failure is silent — the tag just prints raw or evaluates wrong for templates that happen to take a different route.

Before writing a fix, work out which path(s) the reported template takes.

The three merge-tag resolution paths

DocGenGiantQueryAssembler does not call processXml(). So:

PathResolved byReached when
Row-level loop bodiesDocGenService.processXml()normal templates
Parent-level tags outside the loopDocGenGiantQueryAssembler.resolveParentMergeTags()giant-query templates (>2000 child rows)
Grand-total aggregatesDocGenGiantQueryAssembler.resolveGiantAggregateTags()giant-query templates

A section-tag fix in processXml covers only row-level loop bodies. If the change needs to behave consistently for giant-query templates, mirror it in the assembler or route it through processXmlForTest the same way format-suffix tags already do.

Always check whether your fix needs the same change in the giant-query parent path, and add an e2e-07 assertion either way — including one that proves it doesn't need it.

The four {#ChartBucket} resolution paths

{#ChartBucket:relationship:field[:mod=val&...]}body{/ChartBucket} has its own set, and all four must stay consistent:

  1. In-memory — DocGenChartBucketResolver.preprocessInline against pre-loaded relationship records. Used when child count <2000 and no where=/groupBy=. SOQL-free, fastest.
  2. SOQL fallback — tryFallbackSoqlAggregateAdvanced, when the relationship isn't on the data map or where=/groupBy= force it. Schema-auto-discovers child object and FK via ChildRelationship, issues a GROUP BY aggregate at constant cost. This is how 30K-scale templates work.
  3. Parent-level — resolveParentMergeTags()'s regex skips {#…} prefixes so charts pass through, then processXmlForTest routes to the inline path.
  4. Giant-query parent — resolveGiantChartBuckets for charts targeting the giant relationship. Same modifiers, same shape.

SOQL budget: 50 chart aggregates per transaction (DocGenChartBucketResolver.chartSoqlBudget). When exhausted, charts render a sentinel "Chart limit reached" bucket — never silently empty.

The five modifiers

Composable, and all four paths must honour each:

ModifierBehavior
colors=#aaa,#bbbOverride the default 8-color palette, cycling by row index
where=Field='X' AND Y != nullSanitized SOQL fragment appended to the WHERE. Forces SOQL fallback.
split=;Multi-select delimiter; percentages summing >100% is expected
groupBy=Field__cCross-tab pivot; each row gets a cols sub-list. Forces SOQL fallback.
colSort=v1,v2Column ordering for groupBy=; named first, rest alpha, Total last
Show full SKILL.md (211 more words)Show less

Query Config formats

V1 (flat string) and V3 (node tree) reproduce similar patterns in different code — V3's processChildNodes and V1's stitchGrandchildren. A fix often needs to land in both.

Constraints you must not regress

Zero-heap PDF image rendering

For PDF output, {%ImageField} tags with ContentVersion IDs skip blob loading. currentOutputFormat is set to 'PDF' before processXml() calls; in buildImageXml(), when the format is 'PDF' and the value is a 068 ID, query only Id, FileExtension — never VersionData — and store the relative URL /sfc/servlet.shepherd/version/download/<cvId>.

If your fix touches processXml:

  • Do not add VersionData to the PDF-path SOQL.
  • Do not prepend URL.getOrgDomainUrl() anywhere in the image pipeline.

Image URLs for Blob.toPdf must be relative. Absolute URLs and data: URIs render broken.

Exception ordering

processXml's try/catch must rethrow HeapPressureException ahead of the generic catch. Order: HeapPressureException → DocGen* → generic.

Verifying the fix

  1. Add a regression assertion in e2e-07-syntax5 (or a new syntax6) exercising the pattern via processXmlForTest. syntax1–syntax4 are near the 18,000-char ceiling.
  2. Add an e2e-07 assertion for the giant-query parent path — even if the answer is "unchanged", the assertion is what stops the next person breaking it.
  3. npm run qa -- --suite merge-tags
  4. Scoped Apex tests, then npm run format:check.

See the run-tests skill for the constraints on writing e2e assertions.

© Portwood-Global-Solutions, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/fix-merge-tag of Portwood-Global-Solutions/Portwood.

Open the folder on GitHubat commit 70ede0c

Compare with similar skills

Fix Merge Tag next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Fix Merge Tag compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Fix Merge Tag this skillPortwood-Global-Solutions/Portwood126—~1.4kAutomated safety check: PassApache-2.0
Automation Sandbox Post Copy Config Generateforcedotcom/sf-skills1.1k—~4.1kAutomated safety check: PassApache-2.0
Automation Sandbox Post Copy Config Generateforcedotcom/sf-skills1.1k—~4.2kAutomated safety check: PassApache-2.0
Education Cloud Academic Calendar Generateforcedotcom/sf-skills1.1k—~4.4kAutomated safety check: PassApache-2.0
Implementing Zero Trust For SaaS Applicationsmukul975/Anthropic-Cybersecurity-Skills34k—~2.9kAutomated safety check: PassApache-2.0
Education Cloud Course Catalog Migrateforcedotcom/sf-skills1.1k—~5.4kAutomated safety check: PassApache-2.0

Similar skills

  • Generate the JSON config file that the Salesforce sandbox post-copy automation tool consumes, from a customer SOP in any format (PDF, xlsx, csv, JSON, docx, Markdown, plain text, or a screenshot of…

    1.1k GitHub stars~4.1k tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • Generate the JSON config file that the Salesforce sandbox post-copy automation tool consumes, from a customer SOP in any format (PDF, xlsx, csv, JSON, docx, Markdown, plain text, or a screenshot of…

    1.1k GitHub stars~4.2k tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • A skill your agent uses to set up, create, or generate an academic calendar for Education Cloud orgs.

    1.1k GitHub stars~4.4k tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • Implementing Zero Trust For SaaS Applications

    mukul975/Anthropic-Cybersecurity-Skills

    Secures SaaS apps (Microsoft 365, Google Workspace, Salesforce, Slack) via CASB/SSPM deployment, conditional access policies, OAuth app governance, and session-level DLP controls enforcing identity…

    34k GitHub stars~2.9k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • A skill your agent uses to migrate course catalog data from external sources (CSV, PDF, website) and bulk-create Learning and LearningCourse records in Education Cloud.

    1.1k GitHub stars~5.4k tokensUpdated yesterday
    Data & AnalyticsAuto-check passed
  • Dx Devops Test Failures Analyze

    forcedotcom/sf-skills

    Analyzes DevOps Center test failures and Code Analyzer violations in plain language — failure category, offending file/class/method/line, rule violated, fix direction, and prioritized improvement…

    1.1k GitHub stars~1.4k tokensUpdated yesterday
    Testing & QAAuto-check passed

More from Portwood-Global-Solutions/Portwood

  • Canvas Designer

    Portwood-Global-Solutions/Portwood

    Work on Portwood's Canvas designer (docGenCanvas LWC and canvasModel.js).

    126 GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed
  • Dev Setup

    Portwood-Global-Solutions/Portwood

    Get from a fresh clone of Portwood to a working, fully-tested Salesforce org.

    126 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • HTML Template Authoring

    Portwood-Global-Solutions/Portwood

    Author or repair a Portwood HTML template that renders correctly through Blob.toPdf (Flying Saucer).

    126 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Triage Report

    Portwood-Global-Solutions/Portwood

    Decide whether a Portwood bug report is a real code defect or a template-authoring problem, before any code is written.

    126 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Managed Package Rules

    Portwood-Global-Solutions/Portwood

    Constraints that only bite in a real managed-package install of Portwood — global visibility, Flow Apex-Defined types, namespace-prefixed keys, USERMODE on internal reads, immutable API names.

    126 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Run Tests

    Portwood-Global-Solutions/Portwood

    Run Portwood's test suites — the one-command QA harness, the anonymous-Apex e2e scripts, Apex unit tests, prettier, and Code Analyzer.

    126 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Fix Merge Tag

What does Fix Merge Tag do?

Fix a Portwood merge-tag or parser bug correctly across all of its resolution paths. Fix Merge Tag is an agent skill from Portwood-Global-Solutions/Portwood. Fix a Portwood merge-tag or parser bug correctly across all of its resolution paths.

When should I use Fix Merge Tag?

Fix Merge Tag fits situations like: changing tag parsing; section/loop tags; chart buckets — a fix in one path silently does not reach the others.

How do I install Fix Merge Tag in Claude Code?

Run `npx skills add Portwood-Global-Solutions/Portwood --skill fix-merge-tag -a claude-code`. Or copy the skill folder (.claude/skills/fix-merge-tag in Portwood-Global-Solutions/Portwood) into .claude/skills/fix-merge-tag in your project. Claude Code loads it when a task matches its description.

How do I install Fix Merge Tag in Codex?

Run `npx skills add Portwood-Global-Solutions/Portwood --skill fix-merge-tag -a codex`. Or copy the skill folder (.claude/skills/fix-merge-tag in Portwood-Global-Solutions/Portwood) into .agents/skills/fix-merge-tag in your project. Codex loads it when a task matches its description.

Can I use Fix Merge Tag in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Portwood-Global-Solutions/Portwood --skill fix-merge-tag -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/fix-merge-tag, .gemini/skills/fix-merge-tag, .github/skills/fix-merge-tag and .opencode/skills/fix-merge-tag in your project.

What does Fix Merge Tag need to run?

Going by SKILL.md and its folder, Fix Merge Tag needs the command-line tools its instructions call (npm).

Does Fix Merge Tag access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Fix Merge Tag safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Fix Merge Tag use?

Fix Merge Tag is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Fix Merge Tag use?

About 1.4k tokens (SKILL.md is roughly 5.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Fix Merge Tag?

Skills that share tags, products or a category with Fix Merge Tag: Automation Sandbox Post Copy Config Generate (forcedotcom/sf-skills, 1.1k stars), Automation Sandbox Post Copy Config Generate (forcedotcom/sf-skills, 1.1k stars), Education Cloud Academic Calendar Generate (forcedotcom/sf-skills, 1.1k stars) and Implementing Zero Trust For SaaS Applications (mukul975/Anthropic-Cybersecurity-Skills, 34k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Fix Merge Tag?

Portwood-Global-Solutions (a GitHub organization) maintains it in Portwood-Global-Solutions/Portwood, which has 126 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 9, 2026.

Source: Portwood-Global-Solutions/Portwood on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.