project-init
Project scaffolding — creates CLAUDE.md, documentation/, datarim/ for new or existing projects. Loaded by /dr-init when project intent is detected.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Project scaffolding — creates CLAUDE.md, documentation/, datarim/ for new or existing projects. Loaded by /dr-init when project intent is detected.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Schema and migration semantics for /dr-doctor — thin one-liner contract, 6-pass migration, data-loss safety, conflict resolution. Loaded by self-heal.
Core Datarim rules. Load this entry first, then only the fragment needed for paths, storage, numbering, backlog, routing, or archive behavior.
Post-QA hardening — detects task type (code, docs, research, legal, content, infra) and applies the matching verification checklist before archiving.
Testing pyramid, frameworks, mocking. Load first; then the fragment for the active gate (live smoke, silent failure, bats, legacy triage).
Preserve Datarim task continuity while orchestrated Claude Code or Codex sessions compact or clear context at deterministic pressure thresholds.
Immutability contract for all pipeline stages: artefact freeze, V-AC parity, non-code parity, anti-tautological rule, and return-to-source transition.
| name | project-init |
| description | Project scaffolding — creates CLAUDE.md, documentation/, datarim/ for new or existing projects. Loaded by /dr-init when project intent is detected. |
| current_aal | 1 |
| target_aal | 2 |
Loaded by:
/dr-init(Step 0, when project intent detected) Purpose: Create a standardized project structure with CLAUDE.md, documentation, and Datarim workflow state.
/dr-init loads this skill when the user's input contains project creation signals:
/dr-init create project "Name"If none of these signals are present, /dr-init follows the standard task flow.
Ask the user (if not already provided in the prompt):
$HOME/.claude/skills/tech-stack/SKILL.md § Stack Selection Decision Tree)If the user provided enough context in the initial prompt, extract these values without asking. Only ask for what is missing.
<name>/ in current directory (kebab-case)Projects/<Name>/code/)Verify the target exists or create it.
Load $HOME/.claude/skills/tech-stack/SKILL.md and match the project type to the required stack. This determines:
.gitignore contentsIf the project type is unclear, ask the user. If the project is documentation/research-only, skip tech stack detection.
Create the following structure following the Diátaxis Documentation Taxonomy Mandate (skills/diataxis-docs/SKILL.md). Idempotency rule: check if each file/directory exists before creating. If it exists, skip it and report "skipped: already exists". Never overwrite existing files.
<project-root>/
├── CLAUDE.md # From template: $HOME/.claude/templates/project-claude-md.md
├── .gitignore # Standard for detected stack
│
├── documentation/ # Diátaxis 4-category split (mandate per skills/diataxis-docs/SKILL.md)
│ ├── tutorials/ # Learning-oriented (newcomer end-to-end)
│ │ └── README.md # From template: $HOME/.claude/templates/documentation-diataxis/tutorials/README.md
│ ├── how-to/ # Problem-solving (task recipes)
│ │ ├── README.md # From template: $HOME/.claude/templates/documentation-diataxis/how-to/README.md
│ │ ├── testing.md # Legacy stub mapped to how-to per Diátaxis
│ │ ├── deployment.md # Legacy stub mapped to how-to
│ │ └── gotchas.md # Legacy stub mapped to how-to
│ ├── reference/ # Information-oriented (lookup, catalogue)
│ │ ├── README.md # From template: $HOME/.claude/templates/documentation-diataxis/reference/README.md
│ │ └── architecture.md # Legacy stub mapped to reference (system map)
│ └── explanation/ # Understanding-oriented (background, why)
│ └── README.md # From template: $HOME/.claude/templates/documentation-diataxis/explanation/README.md
│
├── documentation/ephemeral/ # Transient working material (may be gitignored or committed per preference)
│ ├── plans/ # Implementation plans
│ ├── research/ # Research notes
│ └── reviews/ # QA reports and reviews
│
├── datarim/ # Workflow state (created via standard /dr-init logic)
│ ├── backlog.md # From template: $HOME/.claude/templates/backlog-template.md
│ ├── activeContext.md # Active task tracking
│ └── tasks.md # Task details
│
└── documentation/ # Long-term archives (committed to git)
└── archive/ # Completed task archives
Some projects have a secret core — a proprietary algorithm, encoding scheme, compression mechanism, or private model weights that must NOT appear on any public surface. For these, the scaffold must be mechanism-free from the first commit, and the secrecy gate must be emitted at scaffold time, not bolted on after a leak is caught.
Detect the secrecy signal. Enter secrecy-aware mode when the operator brief carries EITHER:
secrecy: <domain> annotation (e.g. secrecy: algorithm), ORsecret core, secret algorithm, proprietary algorithm, encoding scheme, compression mechanism, mechanism must stay secret (and their equivalents in the brief's language).If neither is present, skip this step — the scaffold is unchanged (byte-identical to the non-secret path).
In secrecy-aware mode:
documentation/reference/architecture.md from the secrecy-aware variant in ${DATARIM_RUNTIME:-$HOME/.claude}/templates/project-docs-stubs.md: its Overview / Components / Data Flow / Security Model bodies carry [REDACTED — see CLAUDE.md § Secrecy] instead of a "describe the system" TODO.documentation/{tutorials,how-to,reference,explanation}/) or any README* with the secret mechanism's lexicon. The secret lives only in the private code and, if needed, in documentation/ephemeral/ (excluded from the public surface). This is the direct root-cause fix for the scaffold-leak pattern (precedent: a QA blocker on an earlier secrecy-bearing project — the scaffold committed the full mechanism into documentation/reference/architecture.md before secrecy was codified).## Secrecy block from the template (the <!-- SECRECY-BLOCK … --> section) — the secrecy declaration plus the README-tolerant grep gate — so the gate exists at scaffold time, not as a post-hoc fix.Read ${DATARIM_RUNTIME:-$HOME/.claude}/templates/project-claude-md.md and replace placeholders:
| Placeholder | Source |
|---|---|
__PROJECT_NAME__ | From user input (Step 1) |
__ONE_LINE_DESCRIPTION__ | From user input (Step 1) |
__DATE__ | Current date (YYYY-MM-DD) |
__TECH_STACK__ | From tech-stack.md detection (Step 3) |
__BUILD_COMMANDS__ | From tech-stack.md detection (Step 3) |
__GITIGNORE_PATTERNS__ | From tech-stack.md detection (Step 3) |
Diátaxis taxonomy in CLAUDE.md. When the project's CLAUDE.md is generated, include a one-liner reference to documentation/{tutorials,how-to,reference,explanation}/ so that future contributors discover the mandate from the project root, not only from Datarim framework docs.
For placeholders the agent cannot fill (components, terminology, gotchas), leave them as [TODO: ...] markers for the user.
Secrecy block (secrecy-aware mode only). If Step 4.5 detected a secrecy signal, keep the template's conditional ## Secrecy block (marked <!-- SECRECY-BLOCK … -->) and fill its project-specific mechanism terms into the grep gate. Otherwise drop the block entirely — a non-secret project gets no Secrecy section.
.git/ does not exist in the target directory: run git init.gitignore was created: ensure datarim/ is listedOutput a summary:
Project scaffolded: <project-name>
Location: <target-path>
Stack: <detected-stack or "none (documentation project)">
Created (Diátaxis 4-category split per skills/diataxis-docs/SKILL.md):
✓ CLAUDE.md
✓ documentation/tutorials/README.md (learning-oriented)
✓ documentation/how-to/README.md (problem-solving)
✓ documentation/how-to/testing.md (legacy stub mapped to how-to)
✓ documentation/how-to/deployment.md (legacy stub mapped to how-to)
✓ documentation/how-to/gotchas.md (legacy stub mapped to how-to)
✓ documentation/reference/README.md (information-oriented)
✓ documentation/reference/architecture.md (legacy stub mapped to reference — system map)
✓ documentation/explanation/README.md (understanding-oriented)
✓ documentation/ephemeral/{plans,research,reviews}/
✓ datarim/ (workflow state)
✓ documentation/archive/
✓ .gitignore
Skipped (already existed):
- <list of skipped files, if any>
Next steps:
1. Review and customize CLAUDE.md — fill in [TODO] placeholders
2. Review .gitignore
3. git add -A && git commit -m "scaffold: initial project structure"
4. /dr-init <first task description> — start your first task
When run in an existing project (that already has some files):
This allows updating old projects to the new structure incrementally.
--dry-run or --force flags (future enhancement)README* — mechanism-bearing reference stubs are [REDACTED] (see Step 4.5)