contribute-upstream
Skill4 starsChanged 7 months agoMITView on GitHub
Push project improvements back to the claude-code-toolkit template. Triggers on /cct:contribute-upstream.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- user-level-reference/CLAUDE.mdCLAUDE.md
- challengeSkill
- commitSkill
- jevSkill
- karpathy-guidelinesSkill
- mcp-usageSkill
- retro-reviewSkill
- sprintSkill
- sync-templateSkill
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
- Very specific: line 17
Call template_load_manifest(project_path=".", skill_version="not-a-skill") (this is not the sync-template skill, so it passes the bypass …
- Distinctive: line 23
If no candidates: "No locally modified template files.
- Distinctive: line 39
Ask: Generalizable (benefits any project using this variant) or Project-specific (unique to this project)?
- Distinctive: line 41
Do NOT auto-classify. Always confirm with the user.
- Distinctive: line 50
If the user spots issues, they can provide corrected content
- Very specific: line 57
If can_propagate is true (all variants have identical content): offer to propagate to all variants
- Very specific: line 58
If can_propagate is false (variants differ): only update the current variant and warn:
- Very specific: line 75
Call template_apply_file(project_path=".", file_path=F, source="skip") to update the manifest entry (marks the file as back in sync with …
- Very specific: line 77
Write the JSON array of all template_apply_file results to a scratchpad file with the Write tool, then call …
- Distinctive: line 98
NEVER write to the template repo without showing the diff first
- Distinctive: line 99
NEVER auto-classify — always confirm with the user whether a change is generalizable or project-specific
- Distinctive: line 100
ALWAYS show reversed content for confirmation before writing to template
- Distinctive: line 101
Do NOT commit in the template repo — write files only, let the user review and commit
- Very specific: line 102
Do NOT modify PROJECT_CONTEXT.md in the template (always project-specific)
- Distinctive: line 103
All placeholder reversal is handled by the MCP tools — do NOT reverse placeholders manually
≈ “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.
Files
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.md2. Diff and Classify Each Candidate
For each candidate file:
- Call
template_get_diff(project_path=".", file_path=F, diff_type="local_changes") - Show the diff to the user
- 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:
- Call
template_reverse_placeholders(project_path=".", file_path=F) - Show the
replacements_madelist so the user can verify placeholders were restored correctly - Show the
reversed_content(or a relevant excerpt) for confirmation - If the user spots issues, they can provide corrected content
4. Check Cross-Variant Propagation
For each confirmed file:
- Call
template_check_cross_variant(template_repo=..., variant=..., file_path=F) - If
can_propagateis true (all variants have identical content): offer to propagate to all variants - If
can_propagateis 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.mdin the template (always project-specific) - All placeholder reversal is handled by the MCP tools — do NOT reverse placeholders manually
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
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.

