template-downstream

Update .claude/, .mcp.json, and .pre-commit-config.yaml from the upstream python-project-template repository into the current project. Only files that exist upstream are updated — project-only files are never deleted. Use when pulling latest tooling, rules, hooks, or skills from the canonical template into this project. Triggers on: "템플릿 최신화", "template sync", "upstream 반영", "template 업데이트".

13 stars

Best use case

template-downstream is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Update .claude/, .mcp.json, and .pre-commit-config.yaml from the upstream python-project-template repository into the current project. Only files that exist upstream are updated — project-only files are never deleted. Use when pulling latest tooling, rules, hooks, or skills from the canonical template into this project. Triggers on: "템플릿 최신화", "template sync", "upstream 반영", "template 업데이트".

Teams using template-downstream should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/template-downstream/SKILL.md --create-dirs "https://raw.githubusercontent.com/tae0y/python-project-template/main/.claude/skills/template-downstream/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/template-downstream/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How template-downstream Compares

Feature / Agenttemplate-downstreamStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Update .claude/, .mcp.json, and .pre-commit-config.yaml from the upstream python-project-template repository into the current project. Only files that exist upstream are updated — project-only files are never deleted. Use when pulling latest tooling, rules, hooks, or skills from the canonical template into this project. Triggers on: "템플릿 최신화", "template sync", "upstream 반영", "template 업데이트".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# template-downstream

Direction: Template → Project. Apply only the files that exist upstream to the current project.

**Strategy: merge-aware update, not full overwrite.**
- NEW files (upstream only) → copy as-is
- CHANGED files (both exist, content differs) → **merge, not overwrite** (see Merge Rules below)
- Files only in project → leave untouched (preserve project customizations)
- Files removed from upstream → do not auto-delete; report to user only

> Why not git submodule: `.claude/` requires per-project customization. Submodules force all-or-nothing application of upstream changes and cannot preserve project-local files selectively.

## Source Resolution

Resolve `TEMPLATE_ROOT` in this priority order:

1. **User-provided path** — ask the user: "Do you have a local clone of the template repo? If yes, provide the path." If provided and `<path>/.claude/` exists, use its parent as `TEMPLATE_ROOT`. No network required.
2. **Same remote** — if the current project's `origin` matches `https://github.com/tae0y/python-project-template.git`, use the local repo directly.
3. **Shallow clone** — otherwise, clone to a temp directory:

```bash
TMPDIR=$(mktemp -d)
git clone --depth 1 https://github.com/tae0y/python-project-template.git "$TMPDIR/template"
TEMPLATE_ROOT="$TMPDIR/template"
```

After resolution, verify `$TEMPLATE_ROOT/.claude/` exists. Abort if not.

## Scope

| Item | Strategy |
|------|----------|
| `.claude/` | Update upstream files only (preserve project-only files) |
| `.mcp.json` | Update if upstream has it; skip otherwise |
| `.pre-commit-config.yaml` | Update if upstream has it; skip otherwise |

**Never overwrite:**
- `.claude/settings.local.json` (local environment settings)
- `env` block inside `.claude/settings.json` (project-specific env vars)
- `localdocs/` (local-only, gitignored)
- `.env*` (secrets)

## Merge Rules

For CHANGED files (file exists in both upstream and project with different content):

### Structured files (`.mcp.json`, `settings.json`)

Parse both as JSON. Merge keys:
- Keys present only in upstream → add
- Keys present only in project → **preserve** (project customization)
- Keys present in both with different values → **use upstream value** but report the diff to the user

For `settings.json`, never touch the `env` block — it is always project-specific.

### YAML files (`.pre-commit-config.yaml`)

Parse both as YAML. Merge entries:
- Hooks/repos present only in upstream → add
- Hooks/repos present only in project → **preserve**
- Same hook with different config → **use upstream version** but report the diff

### Markdown / text files (`.md`, `.sh`, etc.)

Read both files. Compare content:
- If the project file is **identical to a previous upstream version** (no project-specific edits) → replace with new upstream version
- If the project file has **project-specific additions or modifications** → show a side-by-side diff to the user and ask:
  - `(U)` Use upstream version (overwrite)
  - `(P)` Keep project version (skip)
  - `(M)` Manual merge — open diff for user to resolve

Default to `(P)` if the user does not respond, to avoid data loss.

### Files that are always overwritten (no merge)

- `.claude/rules/*.md` — template rules are authoritative
- `.claude/agents/*.md` — template agent configs are authoritative
- `.claude/WORKFLOW.md` — template workflow is authoritative

These files should not contain project-specific content. If a project needs custom rules, it should create separate files (e.g., `.claude/rules/project-specific.md`).

## Steps

Stop immediately on any failure. Report the cause before proceeding.

**Execution model:** Claude performs read-only analysis (Steps 1–4). All file-modifying operations (Steps 5–7) are output as shell script blocks for the user to paste into their terminal. Claude never directly executes `cp`, `rm`, or file-write commands.

### 1. Resolve TEMPLATE_ROOT

Follow the priority order in Source Resolution above. Report which source was used.

### 2. Check working tree

Output this command for the user to run and confirm clean before proceeding:

```bash
git -C "$PROJECT_ROOT" status --short
```

If the user reports uncommitted changes, stop:

```
Uncommitted changes detected. Commit or stash before syncing.
```

### 3. Compute diff

Use the Read tool and `find`/`diff -q` via Bash (read-only) to compare each upstream file against the project. Classify each file as NEW, CHANGED, CHANGED (nouse), or PROJECT-ONLY.

For CHANGED files, read both versions and apply Merge Rules to determine the merged content — do not write yet.

If no changes found:
```
Already up to date. No changes detected.
```
Stop.

### 4. Report and confirm

```
Files to update:
  NEW:            .claude/rules/new-rule.md
  CHANGED:        .claude/rules/coding-guidelines.md
                  .claude/hooks/check-commit-convention.sh
  CHANGED (nouse): .claude/skills.nouse/tdd/SKILL.md  ← disabled by project, updating nouse copy

Project-only files (preserved, not deleted):
  PROJECT-ONLY: .claude/skills/my-custom-skill/SKILL.md

Proceed? (Y/N)
```

N → exit.

### 5. Generate and output copy script

After confirmation, generate a single shell script block covering all updates. The user pastes it into their terminal to execute.

**Script structure:**

```bash
TEMPLATE_ROOT="<resolved-path>"
PROJECT_ROOT="<target-path>"

# NEW and always-overwrite files
mkdir -p "$PROJECT_ROOT/.claude/rules"
cp "$TEMPLATE_ROOT/.claude/rules/new-rule.md" "$PROJECT_ROOT/.claude/rules/new-rule.md"
# ... one cp line per file ...

# CHANGED (nouse) files — target skills.nouse/
cp "$TEMPLATE_ROOT/.claude/skills/tdd/SKILL.md" "$PROJECT_ROOT/.claude/skills.nouse/tdd/SKILL.md"

# .mcp.json and .pre-commit-config.yaml (if applicable)
cp "$TEMPLATE_ROOT/.mcp.json" "$PROJECT_ROOT/.mcp.json"
cp "$TEMPLATE_ROOT/.pre-commit-config.yaml" "$PROJECT_ROOT/.pre-commit-config.yaml"

echo "Done. Run: git -C \"$PROJECT_ROOT\" status --short"
```

**Rules for script generation:**

- Skip `settings.local.json` — never include it
- For CHANGED JSON/YAML files that require merging: instead of `cp`, write the merged content to a temp file and use that as the source, OR instruct the user to apply the merge manually (show the diff)
- For CHANGED text files where the user chose `(P)` — omit from script entirely
- Add `mkdir -p` before each `cp` to ensure directories exist
- One `cp` per line — no loops, no wildcards — so each line is auditable

For CHANGED files requiring manual merge, output a separate section:

```
Manual merge required for:
  .claude/skills/my-skill/SKILL.md
  → diff shown below. Edit the file manually after running the script.
  [show unified diff here]
```

### 6. Cleanup (temp clone only)

If a temp clone was created in Step 1, append to the script:

```bash
rm -rf "$TMPDIR"
```

### 7. Verify and next action

After the user runs the script, ask them to paste the output. Then output:

```bash
git -C "$PROJECT_ROOT" diff --stat
git -C "$PROJECT_ROOT" status --short
```

If `.pre-commit-config.yaml` changed:

```
pre-commit config updated.
Re-install: pre-commit install --hook-type commit-msg
```

### 8. Next action

```
Update complete. Changes are unstaged.

A) Review diffs file by file
B) Stage and commit with [MAINTENANCE] prefix
C) Discard all changes (git checkout -- . inside PROJECT_ROOT)
```

Wait for user choice before proceeding.

Related Skills

template-proposal-review

13
from tae0y/python-project-template

Review proposal files in localdocs/localdocs/proposals/ and decide whether to apply them to the upstream python-project-template repository. Use when evaluating proposals generated by template-upstream, deciding which ones to accept or reject, and applying accepted ones to the template repo. Triggers on: "proposal 검토", "제안 검토", "template에 반영할지", "proposals 리뷰", "upstream 반영 결정".

template-broadcast

13
from tae0y/python-project-template

Apply template-downstream to all registered downstream projects in bulk, one project at a time. Use when you want to push the latest .claude/, .mcp.json, or .pre-commit-config.yaml to every project at once. Triggers on: "일괄 배포", "전체 프로젝트에 내려보내기", "모든 프로젝트 업데이트", "broadcast template", "bulk sync".

template-upstream

13
from tae0y/python-project-template

IMPORTANT: This skill must be run in the template repo context, not in a downstream project. Propose changes from the current project back to the upstream python-project-template repository by generating a structured proposal file in proposals/. Use when a pattern, rule, hook, skill, or config in this project is good enough to share with the template. Triggers on: "템플릿에 반영", "upstream 제안", "template에 올리고 싶어", "이 패턴 템플릿에 추가", "proposal 만들어줘".

worklog

13
from tae0y/python-project-template

Update worklog files by moving tasks between todo/doing/done states. Use when recording task progress, starting new work, or marking tasks complete. Requires explicit arguments: worklog [done|doing|todo] [description].

tdd

13
from tae0y/python-project-template

Test-Driven Development workflow. Use for ALL code changes - features, bug fixes, refactoring. TDD is non-negotiable.

sparks-create

13
from tae0y/python-project-template

Apply the 13 thinking tools from "Sparks of Genius" (생각의 탄생) to reframe any problem through creative, cross-disciplinary lenses. Use when conventional analysis falls short, when you need a fresh creative angle, or when the problem spans multiple domains.

skill-creator

13
from tae0y/python-project-template

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

rethink-unblock

13
from tae0y/python-project-template

Break out of a stuck approach by reframing a technical problem through structured thinking frameworks. Use when blocked, going in circles, or when a fresh perspective is needed on architecture, design, or debugging.

refactoring

13
from tae0y/python-project-template

Refactoring assessment and patterns. Use after tests pass (GREEN phase) to assess improvement opportunities.

python-mcp-expert

13
from tae0y/python-project-template

Expert assistant for developing Model Context Protocol (MCP) servers in Python. Use when creating, debugging, or optimizing MCP servers with FastMCP, tools, resources, and prompts.

python-conventions

13
from tae0y/python-project-template

Python coding conventions and guidelines including PEP 8, type hints, docstrings, and testing standards. Automatically applied when working with Python files.

prd

13
from tae0y/python-project-template

Generate high-quality Product Requirements Documents (PRDs) for software systems and AI-powered features. Includes executive summaries, user stories, technical specifications, and risk analysis.