Safely Modify an Existing KMP Skill

VerifiedCaution

Guarded workflow for modifying an existing KMP skill: add or update a section, fix a pattern, bump library versions, or resolve a flagged quality gap.

Sby Skills Guide Bot
DevelopmentIntermediate
9/13/2026
Claude Code
#skill-maintenance#kotlin-multiplatform#markdown-authoring#repo-conventions#quality-audit

Recommended for

Automated summary

This skill edits an existing SKILL.md in the KMP Agent Skills repository while preserving mandatory sections, version freshness, and test consistency.

Strengths

  • Explicit checklist of required sections and fields (frontmatter, When to Use, Anti-Patterns, Related Skills…) that must never be removed
  • Runs scripts/scan_skill_issues.py first so open quality gaps are surfaced before any edit
  • Concrete guardrails for edits: bump last-updated, keep Kotlin snippets compilable, follow the Testing section format with a Fake and at least two @Test cases
  • Reminds the author to update unit tests and satisfy the pre-commit hook when a Python script changes

Limitations

  • Assumes the exact repo layout (skills/, scripts/, tests/, skills.json) and will not work as-is elsewhere
  • Covers in-place modification only — it does not create, rename, or merge skills
  • Rule numbering is inconsistent (rule 8 appears before rule 7) and the Step 3 section is truncated in the file
  • Relies on external audit scripts that are not bundled with the skill
When to use it

Use it when a contributor needs to fix, extend, or refresh an existing KMP skill without breaking the repository's audit pipeline.

When not to use it

Avoid it for creating a brand-new skill, renaming a skill directory, or working in a repo that does not use the KMP Agent Skills structure and audit scripts.

Security analysis

Caution
Quality score82/100

The skill does not contain destructive, exfiltration, or obfuscated instructions. However, it is a maintainer workflow that invokes local Python scripts, shell commands, git commits, and a release script. The main risks are unquoted argument interpolation and automated commit/release actions without explicit confirmation. These are legitimate but powerful operations, so the appropriate rating is caution rather than safe.

Findings
  • •No allowed-tools declaration despite instructing execution of `python3`, `git`, `grep`, and repository scripts; tool permissions are implicit.
  • •Interpolates `$ARGUMENTS` unquoted into shell commands such as `grep $ARGUMENTS` and `git add skills/kmp-$ARGUMENTS/SKILL.md`, which can break or enable shell metacharacter injection if arguments are untrusted.
  • •Runs `git commit` and `python3 scripts/release.py patch` as part of the workflow without an explicit confirmation gate, making repository/release actions consequential.
  • •Executes local repository scripts (`scan_skill_issues.py`, `audit_skills_repo.py`, `release.py`) whose behavior depends on repo contents and could modify files.
How this analysis is made

Examples

Add a Testing section
/kmp-modify-skill repository-pattern — add a Testing section with a FakeRepository and two @Test functions (happy path + error case), keeping all required sections intact.
Bump a library version
/kmp-modify-skill design-system — update the Ktor version in the TOML snippets to 3.0.1, adjust the Freshness rule text, and bump last-updated in the frontmatter.
Record a new anti-pattern
/kmp-modify-skill kmp-repository-pattern — add an anti-pattern about exposing DTOs from the repository layer, with a before/after Kotlin code pair under Common Anti-Patterns.

/kmp-modify-skill $ARGUMENTS

KMP Agent Skills — modify an existing skill safely: add or update a section, fix a pattern, bump library versions, or resolve a flagged quality gap.

Skill name: $ARGUMENTS (e.g. repository-pattern, design-system)


Rules — read before touching any SKILL.md

These protect the collection's coherence. Violating them breaks the audit and pipeline.

1. Never remove required sections

Every SKILL.md must keep all of these — removing any one will fail audit_skills_repo.py:

| Section / field | Where it lives | |---|---| | YAML frontmatter (name, description, metadata, last-updated) | Top of file | | ## When to Use This Skill | Body | | **Trigger keywords:** | Inside "When to Use" | | **Freshness rule:** | Inside "When to Use" or early body | | ## Recommendation First | Body | | ## Common Anti-Patterns | Body | | ## Related Skills | Body | | ## Output Style | Body |

2. Always bump last-updated

Any substantive edit must update last-updated: '<YYYY-MM-DD>' in the frontmatter. Typo fixes may skip this. When in doubt, update it.

3. Keep code snippets compilable

Every Kotlin snippet must be syntactically valid. Do not write pseudocode or partial imports. If you can't write a complete snippet, write a prose description instead.

4. Prefer adding to anti-patterns over deleting patterns

If a pattern is superseded, mark it as such with a comment rather than deleting it. Deletion loses the institutional memory of why the pattern was wrong.

5. Testing section format

## Testing

```kotlin
class FakeXxx : XxxInterface {
    // minimal implementation for unit tests
}

@Test fun `happy path description`() = runTest {
    // ...
}

A Testing section must include:
- At least one `Fake` implementation for the skill's main abstraction
- At least two `@Test` functions (happy path + error/edge case)
- Integration test pattern if the skill wraps a real driver or platform API

### 6. Do not change skill names or directory names

The `name:` field in frontmatter and the directory name under `skills/` must match
the entry in `skills.json`. Renaming without updating `skills.json` breaks routing.

### 8. Update tests when modifying a bundled script

If the modification touches any `.py` file under `skills/kmp-$ARGUMENTS/scripts/`
or any file under the top-level `scripts/`, update the matching `tests/test_<script-name>.py`
(tests are one file per script under `tests/`) in the same commit. The pre-commit hook
(`hooks/pre-commit-audit.sh`) will block the commit otherwise.

The test update must:
- Add a test for every new function introduced
- Update or remove tests for any function signature that changed
- Verify all new `main()` exit code paths are covered

### 7. Do not merge two skills

Each SKILL.md covers one concern. If a skill feels too broad, add a `## Related Skills`
pointer to the closely related skill — do not fold one into the other.

---

## Step 1 — Identify the skill

```bash
ls skills/ | grep $ARGUMENTS

If ambiguous, show a list and ask the user to confirm.


Step 2 — Check current quality gaps

python3 scripts/scan_skill_issues.py | python3 -c "
import json, sys
d = json.load(sys.stdin)
issues = [i for i in d['issues'] if '$ARGUMENTS' in i['skill_dir']]
for i in issues:
    print(f\"{i['severity']}: {i['check']} — {i['detail']}\")
"

Show any open issues for this skill before making changes.


Step 3 — Make the edit

Apply the change following the rules above. Common modifications:

| Change type | What to do | |---|---| | Add a Testing section | Add ## Testing before ## Common Anti-Patterns | | Update a library version | Update the version in TOML snippets AND check Freshness rule | | Add an anti-pattern | Add a bullet under ## Common Anti-Patterns; include a before/after code pair | | Fix a code snippet | Replace only the affected snippet; do not touch surrounding prose | | Add a new section | Place it before ## Common Anti-Patterns unless it is a terminal section |


Step 4 — Verify the edit

python3 skills/kmp-audit/scripts/audit_skills_repo.py .

Zero findings expected. If findings appear, fix them before proceeding.


Step 5 — Update last-updated and commit

  1. Set last-updated: '<today>' in the skill's frontmatter
  2. Commit:
    git add skills/kmp-$ARGUMENTS/SKILL.md
    git commit -m "docs(<skill>): <what changed>"
    
  3. Cut a patch release:
    python3 scripts/release.py patch
    

Notes

  • If the edit closes a gap from /summarize-issues, re-run the scanner after to confirm the issue count dropped: python3 scripts/scan_skill_issues.py | python3 -c "import json,sys; d=json.load(sys.stdin); print(d['total_issues'], 'issues remaining')"
  • If you're updating library versions, also update the skill's Freshness rule: text to reflect the new minimum version and the date rechecked.
  • Do NOT modify skills.json directly — it is managed by scripts/release.py.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/safely-modify-an-existing-kmp-skill-mtzb82xc/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/safely-modify-an-existing-kmp-skill-mtzb82xc' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/safely-modify-an-existing-kmp-skill-mtzb82xc/download' --output '.skill-downloads/safely-modify-an-existing-kmp-skill-mtzb82xc/SKILL.md.part' && mv '.skill-downloads/safely-modify-an-existing-kmp-skill-mtzb82xc/SKILL.md.part' '.skill-downloads/safely-modify-an-existing-kmp-skill-mtzb82xc/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

This file does not provide a usable name/description header for this native procedure. It remains available to download and inspect; use the manual method below.

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/safely-modify-an-existing-kmp-skill-mtzb82xc/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills