agentleFS
dagonetdagonet/claude-code-toolkit/skills/contribute-upstream/SKILL.md

contribute-upstream

Skill4 starsChanged 7 months agoMITView on GitHub

Push project improvements back to the claude-code-toolkit template. Triggers on /cct:contribute-upstream.

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 9 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

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

    Call template_load_manifest(project_path=".", skill_version="not-a-skill") (this is not the sync-template skill, so it passes the bypass …

    line 17
  2. Distinctive:

    If no candidates: "No locally modified template files.

    line 23
  3. Distinctive:

    Ask: Generalizable (benefits any project using this variant) or Project-specific (unique to this project)?

    line 39
  4. Distinctive:

    Do NOT auto-classify. Always confirm with the user.

    line 41
  5. Distinctive:

    If the user spots issues, they can provide corrected content

    line 50
  6. Very specific:

    If can_propagate is true (all variants have identical content): offer to propagate to all variants

    line 57
  7. Very specific:

    If can_propagate is false (variants differ): only update the current variant and warn:

    line 58
  8. Very specific:

    Call template_apply_file(project_path=".", file_path=F, source="skip") to update the manifest entry (marks the file as back in sync with …

    line 75
  9. Very specific:

    Write the JSON array of all template_apply_file results to a scratchpad file with the Write tool, then call …

    line 77
  10. Distinctive:

    NEVER write to the template repo without showing the diff first

    line 98
  11. Distinctive:

    NEVER auto-classify — always confirm with the user whether a change is generalizable or project-specific

    line 99
  12. Distinctive:

    ALWAYS show reversed content for confirmation before writing to template

    line 100
  13. Distinctive:

    Do NOT commit in the template repo — write files only, let the user review and commit

    line 101
  14. Very specific:

    Do NOT modify PROJECT_CONTEXT.md in the template (always project-specific)

    line 102
  15. Distinctive:

    All placeholder reversal is handled by the MCP tools — do NOT reverse placeholders manually

    line 103

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

Contribute Upstream

Push improvements from the current project back to the claude-code-toolkit template.

Requires: template-sync-tools MCP server registered and running.

Workflow

1. Load Manifest and Find Candidates

Call template_load_manifest(project_path=".", skill_version="not-a-skill") (this is not the sync-template skill, so it passes the bypass sentinel). If errors, stop.

Call template_compute_status(project_path=".").

Collect files where locally_modified is true. Skip PROJECT_CONTEXT.md (always project-specific).

If no candidates: "No locally modified template files. Nothing to contribute."

Present the list:

Locally modified template files:
1. .claude/agents/architect.md
2. CLAUDE.md
3. .claude/agents/code-reviewer.md

2. Diff and Classify Each Candidate

For each candidate file:

  1. Call template_get_diff(project_path=".", file_path=F, diff_type="local_changes")
  2. Show the diff to the user
  3. Ask: Generalizable (benefits any project using this variant) or Project-specific (unique to this project)?

Do NOT auto-classify. Always confirm with the user.

3. Reverse Placeholders

For each file confirmed as generalizable:

  1. Call template_reverse_placeholders(project_path=".", file_path=F)
  2. Show the replacements_made list so the user can verify placeholders were restored correctly
  3. Show the reversed_content (or a relevant excerpt) for confirmation
  4. If the user spots issues, they can provide corrected content

4. Check Cross-Variant Propagation

For each confirmed file:

  1. Call template_check_cross_variant(template_repo=..., variant=..., file_path=F)
  2. If can_propagate is true (all variants have identical content): offer to propagate to all variants
  3. If can_propagate is false (variants differ): only update the current variant and warn:

    "{file} differs across variants. Only updating {variant}. Check other variants manually."

5. Write to Template

For files being propagated to all variants:

Call template_propagate_to_variants(template_repo=..., file_path=F, content=<reversed_content>, target_variants=<JSON array>).

For files only updating current variant:

Call template_propagate_to_variants(template_repo=..., file_path=F, content=<reversed_content>, target_variants=["<current_variant>"]).

6. Update Manifest

For each contributed file:

Call template_apply_file(project_path=".", file_path=F, source="skip") to update the manifest entry (marks the file as back in sync with template).

Write the JSON array of all template_apply_file results to a scratchpad file with the Write tool, then call template_finalize_sync(project_path=".", applied_files_path=<json-path>), where <json-path> is that file.

7. Report

Contribution Report

Contributed to template ({variant}):
  - .claude/agents/code-reviewer.md (propagated to: all variants)
  - CLAUDE.md (updated: {variant} only)

Skipped (project-specific):
  - .claude/agents/architect.md

Changes written to {effective location}. Review and commit when ready.

{effective location} is the template_repo_note from the template_propagate_to_variants response when present (under the v4.5.1 fallback the writes went into the server's own checkout, not the declared templateRepo), otherwise templateRepo.

Rules

  • NEVER write to the template repo without showing the diff first
  • NEVER auto-classify — always confirm with the user whether a change is generalizable or project-specific
  • ALWAYS show reversed content for confirmation before writing to template
  • Do NOT commit in the template repo — write files only, let the user review and commit
  • Do NOT modify PROJECT_CONTEXT.md in the template (always project-specific)
  • All placeholder reversal is handled by the MCP tools — do NOT reverse placeholders manually

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.