project-initialization
Skill299 starsChanged 11 days agoMITView on GitHub
Initializes a project from the standard dual-runtime template, preserves existing files, configures Git hooks, and creates or connects a private GitHub repository: main and dev for software projects, main only for skills workspaces. Use whenever a new project is started or an existing folder needs the dual-runtime scaffold and Git setup.
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 2 are distinctive, and 8 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.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 32
Use the request and existing project context.
- Very specific: line 36
If the current directory contains anything other than .git, move all such entries into the first available directory named old, old2, old3, …
- Very specific: line 52
If OLD_DIR is non-empty, add its exact root-relative directory (for example /old2/) to the new root .gitignore.
- Very specific: line 56
Before staging, set Default branch in the copied CLAUDE.md to dev for software or main for a skills workspace.
- Very specific: line 70
Create the first initialization commit.
- Distinctive: line 72
If generation reports a conflict or validation error, the commit stops.
- Very specific: line 80
If origin already exists, show its URL and ask whether it is the intended repository.
- Very specific: line 83
If origin does not exist, ask for the GitHub repository name unless already supplied.
- Very specific: line 92
Ask explicitly before pushing main.
- Very specific: line 106
Do not review or merge files from old* during initialization.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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
Project Initialization
Initialize the project in the current working directory. Existing project files are preserved in
an old* directory for later review; do not merge them into the new scaffold during this workflow.
Dual-Runtime Project Generation
The bundled template contains Claude project sources under .claude/**. Its Git hooks use the
installed ~/.claude/scripts/codex-sync-git-guard.py: pre-commit generates and stages AGENTS.md,
.agents/skills/**, and .codex/agents/** after the sources are staged; pre-push checks for drift.
Host-local .codex/.sync/** is ignored. A reported conflict or validation error stops the action.
1. Check the Current Directory
Work only in the current directory. If it is already a Git repository with uncommitted changes,
ask whether to commit them first, continue while preserving them in old*, or stop. Do not proceed
until the user chooses.
Resolve the directory of this loaded project-initialization skill and set INIT_SKILL_DIR to that
absolute path. Verify that its assets/new-project/ directory exists before moving project files.
Determine whether this is a software project (main + dev) or a skills workspace (main only).
Use the request and existing project context; ask if the type is unclear.
2. Preserve Existing Files and Apply the Template
If the current directory contains anything other than .git, move all such entries into the first
available directory named old, old2, old3, and so on. Do not move .git.
OLD_DIR=""
if find . -mindepth 1 -maxdepth 1 ! -name '.git' -print -quit | grep -q .; then
OLD_DIR="old"
N=2
while [ -e "$OLD_DIR" ]; do OLD_DIR="old${N}"; ((N++)); done
mkdir "$OLD_DIR"
find . -mindepth 1 -maxdepth 1 ! -name '.git' ! -name "$OLD_DIR" -exec mv -- {} "$OLD_DIR/" \;
fi
cp -rp "$INIT_SKILL_DIR/assets/new-project/." .If OLD_DIR is non-empty, add its exact root-relative directory (for example /old2/) to the
new root .gitignore. Keep the archive local and untracked so Git hooks do not treat its saved
Claude configuration as another active project. Do not stage the archive.
Before staging, set Default branch in the copied CLAUDE.md to dev for software or main
for a skills workspace. For a skills workspace, also replace Branch Structure in
.claude/skills/project-knowledge/references/patterns.md with a single main branch for active
work and remove the merge-to-dev and merge-to-main testing requirements.
3. Initialize Git and Hooks
Initialize Git with main as the primary branch when needed. For an existing repository, preserve
its history and make the current primary branch main. Then:
- Make
.githooks/pre-commitand.githooks/pre-pushexecutable. - Set
git config core.hooksPath .githooks. - Stage the scaffold and tracked deletions caused by the move. Keep the ignored
old*archive untracked. - Create the first initialization commit. The pre-commit hook generates and stages
AGENTS.mdalongside.agents/skills/**and.codex/agents/**;.gitignoreexcludes.codex/.sync/**. If generation reports a conflict or validation error, the commit stops. If the repository already has history, create a normal initialization commit instead of rewriting existing commits.
4. Connect GitHub and Create Branches
GitHub is required for this workflow. Verify that gh is installed and authenticated.
- If
originalready exists, show its URL and ask whether it is the intended repository. Stop on a mismatch rather than replacing the remote. Confirm throughghthat the repository is private; if it is public, stop and ask whether to make it private or use another repository. - If
origindoes not exist, ask for the GitHub repository name unless already supplied. The supplied name authorizes creating the private repository. Create it withgh repo create {name} --private --source=. --remote=origin.
For software projects, before any push inspect whether a local or remote dev branch already
exists. If neither exists, create dev from main. If either exists, show its relationship to
main and ask whether to reuse it; never reset or recreate an existing dev, and stop if local
and remote histories conflict. For a skills workspace, use main without creating dev.
Ask explicitly before pushing main. After approval, push main; for software also push the
created or approved dev and leave dev checked out. For a skills workspace, leave main checked
out. Read the canonical repository URL through gh.
5. Report the Result
Report:
- the GitHub URL;
- the created or reused branches:
mainanddevfor software,mainfor a skills workspace; - the preserved local, Git-ignored
old*directory, or that the directory was initially empty; - the active branch:
devfor software ormainfor a skills workspace; - the next step: create the initial Project Knowledge with
documentation-writing.
Do not review or merge files from old* during initialization.
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- LOUSANPANG/agent-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/skill-master/references/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- code-reviewingSkill
- code-writingSkill
- documentation-writingSkill
- infrastructure-setupSkill
- layout-reviewingSkill
- layout-writingSkill
- methodologySkill
- project-initializationSkill
- prompt-masterSkill
- security-auditorSkill
- skill-masterSkill
- test-masterSkill
- user-spec-planningSkill
- code-reviewingSkill
- code-writingSkill
- documentation-writingSkill
- infrastructure-setupSkill
- layout-reviewingSkill
- layout-writingSkill
- methodologySkill
- prompt-masterSkill
- security-auditorSkill
- skill-masterSkill
- test-masterSkill
- user-spec-planningSkill
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.

