Project Setup
Create or refresh project instruction files from verified repository facts.
This skill curates existing content; it does not blindly replace hand-authored
instructions.
Safety Rules
- Read existing
AGENTS.md, CLAUDE.md, GEMINI.md, and .claude/rules/
before writing.
- Preserve unmanaged content and GitNexus-managed blocks.
- Do not run destructive commands, migrations, seeders, live tests, or network
calls as discovery.
- Use safe probes only: manifest reads,
--help, --version,
pytest --co, cargo test --no-run, go test -list, or equivalent
non-mutating checks.
- Create physical backups before writing.
- Never run this skill concurrently from multiple agents against the same repo.
- Treat rollback as an explicit user-requested operation.
Modes
| Mode |
Behavior |
| default |
Merge with existing content and refresh stale managed sections. |
--dry-run |
Explore and show proposed diffs; write nothing. |
--force |
Regenerate managed sections while preserving unmanaged content. |
--codex |
Include Codex-compatible project instructions where appropriate. |
--no-memorymaster |
Skip MemoryMaster context. |
--rollback |
Restore from setup-created backups only after user confirmation. |
Fast Flow
- Detect whether a
<!-- project-setup:YYYY-MM-DD --> marker already exists.
- Back up existing instruction files into
docs/backups/.
- Read existing instructions fully and classify content:
- stack, commands, tests, and verification as managed
- architecture, boundaries, deployment, security, and team notes as
preserved unmanaged content unless clearly stale
- Explore manifests, top-level structure, test/lint/build config, CI, and
safe command availability.
- Query MemoryMaster unless update mode or
--no-memorymaster is active.
- Derive project scope once, then preserve it on later reruns.
- Write or preview:
AGENTS.md as canonical cross-provider instructions
CLAUDE.md as Claude-specific pointer to AGENTS.md
- optional
GEMINI.md / .gemini/settings.json
- optional scoped
.claude/rules/ only when evidence supports them
- Verify generated files exist, managed markers are present, and no preserved
content was silently dropped.
References
Load references/full-process.md when you need the full legacy template,
section mapping table, example generated blocks, or intelligence-layer details.
Output
PROJECT SETUP SUMMARY
Mode: <default|dry-run|force|rollback>
Files changed: <paths>
Backups: <paths>
Verified facts:
- <commands/manifests checked>
Skipped:
- <unsafe or unavailable checks>
Open questions:
- <none or questions>
1---2name: project-setup3description: Generate or refresh project AGENTS.md, CLAUDE.md, and optional GEMINI.md from real codebase evidence. Use when agent instructions are missing, stale, or need provider alignment.4metadata:5 argument-hint: "[--force] [--dry-run] [--rollback] [--codex] [--no-memorymaster]"6---78# Project Setup910Create or refresh project instruction files from verified repository facts.11This skill curates existing content; it does not blindly replace hand-authored12instructions.1314## Safety Rules1516- Read existing `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, and `.claude/rules/`17 before writing.18- Preserve unmanaged content and GitNexus-managed blocks.19- Do not run destructive commands, migrations, seeders, live tests, or network20 calls as discovery.21- Use safe probes only: manifest reads, `--help`, `--version`,22 `pytest --co`, `cargo test --no-run`, `go test -list`, or equivalent23 non-mutating checks.24- Create physical backups before writing.25- Never run this skill concurrently from multiple agents against the same repo.26- Treat rollback as an explicit user-requested operation.2728## Modes2930| Mode | Behavior |31| --- | --- |32| default | Merge with existing content and refresh stale managed sections. |33| `--dry-run` | Explore and show proposed diffs; write nothing. |34| `--force` | Regenerate managed sections while preserving unmanaged content. |35| `--codex` | Include Codex-compatible project instructions where appropriate. |36| `--no-memorymaster` | Skip MemoryMaster context. |37| `--rollback` | Restore from setup-created backups only after user confirmation. |3839## Fast Flow40411. Detect whether a `<!-- project-setup:YYYY-MM-DD -->` marker already exists.422. Back up existing instruction files into `docs/backups/`.433. Read existing instructions fully and classify content:44 - stack, commands, tests, and verification as managed45 - architecture, boundaries, deployment, security, and team notes as46 preserved unmanaged content unless clearly stale474. Explore manifests, top-level structure, test/lint/build config, CI, and48 safe command availability.495. Query MemoryMaster unless update mode or `--no-memorymaster` is active.506. Derive project scope once, then preserve it on later reruns.517. Write or preview:52 - `AGENTS.md` as canonical cross-provider instructions53 - `CLAUDE.md` as Claude-specific pointer to `AGENTS.md`54 - optional `GEMINI.md` / `.gemini/settings.json`55 - optional scoped `.claude/rules/` only when evidence supports them568. Verify generated files exist, managed markers are present, and no preserved57 content was silently dropped.5859## References6061Load `references/full-process.md` when you need the full legacy template,62section mapping table, example generated blocks, or intelligence-layer details.6364## Output6566```text67PROJECT SETUP SUMMARY68Mode: <default|dry-run|force|rollback>69Files changed: <paths>70Backups: <paths>71Verified facts:72 - <commands/manifests checked>73Skipped:74 - <unsafe or unavailable checks>75Open questions:76 - <none or questions>77```