agentleFS
forefyforefy/.context/skills/hunter-utils/gdocs-audit-report/SKILL.md

gdocs-audit-report

Skill153 starsChanged 44 days agoMITView on GitHub

Write and format security-audit reports in Google Docs via the Docs API - findings, tables, and severity styling. Use to build or fix a report.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always read references/api-patterns.md and references/formatting-standards.md before writing any script.

    line 13
  2. Very specific:

    After updateTextStyle splits a run, new unstyled sub-runs appear.

    line 37
  3. Distinctive:

    Delete closing backtick → style inner → delete opening backtick - all in one batch.

    line 43
  4. Very specific:

    Delete to elements[-1].endIndex - 1 (keep the required trailing \n), then insert.

    line 52
  5. Very specific:

    Use replaceAllText for ID renames (e.g.

    line 55
  6. Distinctive:

    All common op templates (style, delete, insert, hyperlink, bullets, paragraph shading)

    line 70

≈ “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.

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

Google Docs Security Audit Report

Overview

This skill provides patterns, constants, and gotcha-avoidance for building and maintaining security audit reports in Google Docs using the Docs API (service account auth). It encodes hard-won lessons around index drift, code styling multi-pass, paragraph vs text backgrounds, heading anchor URLs, and cross-reference linking.

Always read references/api-patterns.md and references/formatting-standards.md before writing any script.

Workflow

1. Auth          → make_token() from scripts/gdocs_auth.py
2. get_doc()     → fresh snapshot before EVERY batch of edits
3. Build ops     → sort ALL ops highest-index-first
4. do_batch()    → send in chunks of ≤50
5. Verify        → get_doc() again and spot-check changed ranges

Critical Gotchas (read these first)

1. Index drift

Any insert/delete shifts every index above it. Always sort ops high→low. Always get_doc() fresh.

2. Text bg ≠ paragraph bg

updateTextStyle.backgroundColor only covers character width - leaves white gaps between lines in code blocks. Use updateParagraphStyle.shading.backgroundColor + spaceAbove/Below: 0 for full-width code block backgrounds.

3. headingId already has h. prefix

Anchor URL = #heading={headingId} - not #heading=h.{headingId}.

4. Code styling needs multiple passes

After updateTextStyle splits a run, new unstyled sub-runs appear. Always do a second full-doc re-scan after the first styling pass.

5. Sort code terms longest-first

Prevents maxRelayFeeBPS matching before assetConfig.maxRelayFeeBPS and leaving a partial un-styled prefix.

6. Backtick removal order (per segment, high→low)

Delete closing backtick → style inner → delete opening backtick - all in one batch.

7. Bullet conversion

createParagraphBullets does not change indices. Then deleteContentRange the - prefix high→low in a second batch.

8. Cross-reference links: skip only already-linked runs

Scan ALL runs for X-NN regex - only skip runs where textStyle.link is already set. Do NOT also filter by font (Courier runs can contain xrefs too).

9. Table cell content replace

Delete to elements[-1].endIndex - 1 (keep the required trailing \n), then insert. Sort delete (higher) before insert (lower) in same batch.

10. replaceAllText for bulk renames

Use replaceAllText for ID renames (e.g. renumbering findings). Same-length replacements are index-safe. Do in one batch, longest/most-specific strings first.

Formatting Standards

See references/formatting-standards.md for:

  • Severity RGB colors (Critical, High, Medium, Low, Unmitigated)
  • Heading purple, code purple, code bg gray
  • Finding structure template
  • Summary table column definitions
  • Finding ID scheme (C-01, H-01, etc.)

API Patterns

See references/api-patterns.md for:

  • Auth boilerplate
  • All common op templates (style, delete, insert, hyperlink, bullets, paragraph shading)
  • Heading anchor URL construction
  • Cross-reference linking pattern
  • Inline code multi-pass approach

Resources

  • scripts/gdocs_auth.py - reusable auth + get_doc + do_batch helpers
  • references/api-patterns.md - op templates and patterns
  • references/formatting-standards.md - colors, typography, structure constants
  • references/how-to-create-google-service-account.md - one-time setup: instruct the user to create a service account, advise the user to restrict it to the AI-only Drive folder/file (via google share feature), and provide the JSON key path

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.