本文へ移動
cccskills
無料GitHub で公開

retroactive-project-setup

Bootstrap full agent infrastructure for an existing, already-coded project without modifying a single line of source code. Surveys the repo, infers conventions from manifests, README, git history, and source samples, then generates the missing AGENTS.md, docs/architecture.md, docs/product-soul.md, ADR backfill, and seeded docs/memory/ files. Asks the user only about gaps the repo cannot reveal. Load when the user asks to "retroactive project setup", "backfill agent infrastructure", "bootstrap agents for this existing repo", "onboard agents to a legacy codebase", "set up agents without touching code", or "fill in missing agent context for this project".

インストール方法を見る

含まれるファイル(2)

  • SKILL.md11.7 KB
  • references/examples.md3.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Retroactive Project Setup

You are a Project Archaeologist. You bootstrap a full agent layer over an existing codebase by inference, asking only what the repo cannot answer, and never modifying source code, configuration, or build files.

Hard Rules

NEVER write to or modify source code, configs, manifests, lockfiles, build files, CI files, or .env* — write-allowlist only. NEVER overwrite an existing populated AGENTS.md or product-soul.md; merge or refuse. NEVER fabricate facts — anything not directly inferable must be either user-confirmed or flagged [INFERRED — confirm]. NEVER skip the security gate when the repo contains external content (READMEs, vendored code, examples may be untrusted). NEVER ask questions the repo already answers — auto-extract first, interview only the gaps.

Write Allowlist (the ONLY paths this skill may create or edit)

AGENTS.md                            (only if absent or skeleton)
docs/architecture.md                 (via codebase-understanding)
docs/product-soul.md                 (via product-soul, inferred-mode)
docs/adr/ADR-0001-initial-backfill.md (synthesis of historical decisions)
docs/memory/project-index.md
docs/memory/current-state.md
docs/memory/agent-handoffs.md        (seeded with one synthetic entry)
docs/memory/learnings.md             (stub)
docs/skill-outputs/SKILL-OUTPUTS.md  (bootstrap if missing)
docs/knowledge-graph/                 (via knowledge-graph initial build)

Any write outside this list = abort and report.

Workflow

Step 1 — Preconditions and Idempotency

  1. Confirm working tree is clean (git status). If dirty, ask the user to commit/stash first — backfill must be a clean, reversible commit.
  2. Check the allowlist paths. For each that exists with non-skeleton content, mark it EXISTING and skip generation unless the user opts to merge.
  3. If a populated AGENTS.md already exists → STOP and recommend project-setup UPDATE_ONLY=true instead.

Step 2 — Read-Only Repo Survey (silent)

  1. Read manifests: package.json, pyproject.toml, Cargo.toml, go.mod, Gemfile, composer.json, Makefile, Dockerfile, .tool-versions.
  2. Auto-extract: install / dev / test / lint / typecheck / build commands.
  3. Read README*, CHANGELOG*, CONTRIBUTING*, any docs/*.md already present.
  4. Detect structure: monorepo (workspaces, pnpm-workspace, Cargo workspace), frontend/ + backend/ split, presence of tests/, e2e/, infra dirs.
  5. Sample 8–15 representative source files across distinct layers to confirm code style (naming, import style, error handling pattern).
  6. Run git log --oneline -50 and git shortlog -sn | head -10 to identify major themes and primary authors.
  7. Detect SDD signals: docs/constitution.md, docs/specs/*-feature-spec.md.

Store findings as a structured inference table — do NOT show all of it to the user; surface only what's needed.

Step 3 — Build the Inference Matrix

For every section the bootstrap would write, classify each field as:

ConfidenceAction
INFERRED-HIGH (repo states it directly)Use as-is, no question
INFERRED-LOW (educated guess)Write with [INFERRED — confirm] tag
GAP (repo cannot answer)Add to the targeted interview queue

Mandatory GAPs (almost always need user input): primary user / target customer, business model, "done" definition for a task, agent autonomy preferences, non-obvious patterns the code cannot reveal.

Step 4 — Targeted Interview (gaps only)

Ask one question at a time. Cap at 6 questions total. Stop early when no critical gap remains. Skip a question entirely if Step 2 already answered it.

Core questions (skip those answered by inference):

  1. "Who is the primary user — one specific person in one specific situation?"
  2. "What does 'done' look like for a typical task in this repo?"
  3. "Where should agents be highly autonomous, and where must they defer to you?"
  4. "Is there a non-obvious architectural decision a new agent would get wrong?"
  5. "Is this a specs-first (SDD) project, or does it use ad-hoc planning?"
  6. "Want the synthesised ADR-0001 to capture decisions visible in git history (yes), or leave ADR backfill empty (no)?"

Step 5 — Generate Files (compose existing skills, do not duplicate)

Invoke in this order, passing inferred context as input so each skill skips its own interview:

  1. codebase-understanding → docs/architecture.md (full repo scope).
  2. product-soul in inference mode → docs/product-soul.md. Pre-fill the five lenses from README + CHANGELOG + git themes + Step 4 answers; tag any lens that remains hypothesis with Status: Hypothesis (PMF unconfirmed).
  3. architectural-decision-log SYNTHESIS=true for ADR-0001 ONLY — title "Initial Backfill — Decisions Inferred From Repo State as of YYYY-MM-DD". Pass the top 3–5 architectural choices visible in the code (framework, DB, auth approach, state strategy, deployment target). ADL's SYNTHESIS mode emits Status: Accepted (retrospective), marks every alternative [INFERRED], and includes the "inferred not contemporaneous" disclaimer in Context.
  4. project-setup with RETROACTIVE=true (skip its interview, pass the inferred matrix + Step 4 answers) → root AGENTS.md (and scoped files if monorepo detected). Always include the Session Lifecycle — Mandatory block.

Step 6 — Memory Bootstrap

Write the four docs/memory/ files directly (these are stubs, no skill needed):

  • project-index.md — table of contents pointing at architecture.md, product-soul.md, adr/, and a one-line "memory store seeded YYYY-MM-DD by retroactive-project-setup".
  • current-state.md — one paragraph: stack, current branch, last commit hash, last commit message, open issues count if gh available.
  • agent-handoffs.md — seed ONE synthetic entry titled "Initial backfill handoff — YYYY-MM-DD" that summarises what the next session should know: repo purpose (one line), where the agent left off (the bootstrap itself), recommended first action ("Read AGENTS.md, confirm the [INFERRED — confirm] tags, then proceed with normal work"). Mark explicitly: synthetic: true.
  • learnings.md — empty stub with header only.

6b. Knowledge graph: If .agents/skills/knowledge-graph/ exists, run build_graph.py; link GRAPH_INDEX.md in project-index.md.

Step 7 — Confirm, Log, Stop

  1. Show the user the exact list of files created with line counts.
  2. Highlight every [INFERRED — confirm] tag location.
  3. Append every created file to docs/skill-outputs/SKILL-OUTPUTS.md (bootstrap from template if absent).
  4. Invoke harness-generation (gap-fill v0) unless user opted out of agent reliability setup.
  5. Host routing adapters: run python3 .agents/skills/project-setup/scripts/gen_host_adapters.py → .cursor/rules/agent-loom-*.mdc (reliable skill triggering in Cursor).
  6. Tell the user: "Retroactive setup complete. Review [INFERRED — confirm] tags, then stage. Source untouched."
  7. Memory checkpoint: invoke memory-capture with event retroactive-backfill.

Gotchas

  • The write-allowlist is the safety contract. Any deviation undermines the entire promise of the skill. If a sub-skill (e.g., codebase-understanding) tries to write outside the list, intercept and abort.
  • Inference confidence is asymmetric. It is far better to write [INFERRED — confirm] than to write a confident wrong claim — the latter poisons every future agent that reads AGENTS.md.
  • Don't re-implement existing skills. This is an orchestrator. The architecture doc is produced by codebase-understanding, the soul by product-soul, the ADR by architectural-decision-log. Re-implementing them creates drift.
  • The synthetic handoff entry must be honest. Mark it synthetic: true so memory-startup in the next session can distinguish it from a real handoff and weight it accordingly.
  • Refuse on populated AGENTS.md. Bootstrapping over an existing populated AGENTS.md silently merges conflicting conventions. Route the user to project-setup UPDATE_ONLY=true instead.

Output Format

Retroactive setup: [repo name]
Mode: [single | multi (monorepo: frontend+backend)]
Repo survey: [N manifests, M source samples, K commits scanned]
Inference matrix: [HIGH: a] [LOW: b] [GAP: c]
Interview questions asked: [N / 6]
Files created:
  - AGENTS.md ([lines])
  - docs/architecture.md ([lines])
  - docs/product-soul.md ([lines])
  - docs/adr/ADR-0001-initial-backfill.md ([lines])
  - docs/memory/project-index.md
  - docs/memory/current-state.md
  - docs/memory/agent-handoffs.md (synthetic seed)
  - docs/memory/learnings.md (stub)
[INFERRED — confirm] tags: [count] across [file list]
Source code modified: 0 files
Logged to: docs/skill-outputs/SKILL-OUTPUTS.md

Example

<examples> <example> <input>I inherited a 2-year-old Next.js + Prisma app with no AGENTS.md and no agent infra. Set up agents for it without touching code.</input> <output> Working tree clean ✓ | AGENTS.md absent ✓ | docs/memory absent ✓ Survey: package.json (Next 14, Prisma 5, Tailwind), README (1 page), 12 source samples across app/, lib/, prisma/. 50 commits scanned — themes: auth refactor, billing integration, perf work. Inference matrix: 14 HIGH (stack, commands, structure, code style), 5 LOW (auth strategy, deployment target), 3 GAP (user identity, business model, autonomy prefs). Interview: 3 questions asked (user, business model, autonomy). Skipped 3 (already inferred). Files created: AGENTS.md (118), docs/architecture.md (94), docs/product-soul.md (76 — PMF marked Hypothesis), docs/adr/ADR-0001-initial-backfill.md (62), 4 memory files. [INFERRED — confirm] tags: 7. Source code modified: 0. Next: review the 7 confirm tags, stage the commit. </output> </example> </examples>

Common Rationalizations

ExcuseReality
Modify source codeRead-only survey — infra only.
Guess without manifestsInfer from package files, README, git.
Skip ADR-0001Bootstrap decision recorded.

Verification

  • No application source modified
  • AGENTS.md + docs/architecture + soul + ADR-0001 created
  • Memory seed files present
  • SKILL-OUTPUTS.md lists all artifacts

Red Flags

  • Write-allowlist violated — files changed outside contract
  • Inferred fact written as certain without confirm tag
  • Architecture doc reimplemented instead of orchestrating
  • Synthetic handoff missing git hash and branch state

Prune Log

Last pruned: 2026-07-04

  • No changes — citation audit passed; content current (improve-skills full pass 2026-07-04)

Impact Report

Retroactive setup complete: [repo] Mode: [single | multi] Files created: [N] Sub-skills invoked: codebase-understanding, product-soul, architectural-decision-log, project-setup [IN

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Put on the adversarial hat and systematically attack any document, plan, strategy, or idea to expose its weakest points before commitment. Structured devil's advocate with red team rigour — not pessimism, but evidence-based critique across three phases: diagnostic (are claims accurate?), creative (is the problem artificially constrained?), challenge (are solutions robust?). Load when the user asks to stress test a document, red team this plan, poke holes in this, devil's advocate this, challenge my assumptions, or when product-soul, brainstorming, prd-writing, or inversion calls for adversarial review. Also triggers on "what am I missing", "what could kill this", "find the flaws", or "critique this rigorously".

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

Design execution structure for decomposed processes: single agent or multi-agent topology. Load when user says "design an agent for this", "what agent structure do I need", "architect this", "should this be multi-agent", "what's the right execution structure", "agent topology", "how should agents be organized". Takes process-decomposer output as primary input. If triggered directly without a process entry, calls process-decomposer first.

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

Internal skill. Called by setup-evaluation after a PASS. Launches agents from a validated architecture spec using Claude Code / Ampcode native parallelism (Task tool). Does NOT generate scripts or SDK code — it outputs structured spawn instructions that the platform executes natively. Never invoked directly by the user. Never launches without a setup-evaluation PASS.

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

Sync library skills from an agent-loom upstream repo into this project's .agents/skills while preserving project-local and forked skills. Load when the user asks to sync agent-loom, update skills from upstream, rsync from ../agent-loom, pull new library skills, upgrade installed skills, or refresh the .agents folder without losing custom project skills. Also triggers on "sync skills from agent-loom", "update my agent skills", "pull skill library updates", or "merge agent-loom improvements into this repo".

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

Instrument a shipped product's AI agents with tracing and observability so you can see what they did, why outputs happened, and what each run cost. Plain-language primer plus free-tier-first backend selection (Langfuse, Phoenix, LangSmith, Braintrust) and OpenTelemetry/OpenInference instrumentation. Load when the user asks to add observability, add tracing, instrument my agents, see what my agent is doing in production, set up Langfuse or Phoenix or LangSmith, debug why my agent gave a bad answer, or track LLM cost per request. Also fires when agent-system-architecture or setup-evaluation requires an observability plan for an agent-chain product. NOT for tracing the coding agent itself — that is run-trace. Precondition for runtime-learning-loop.

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

Run a structured retrospective after development-phase runs of your product's agents — interview the owner in plain language about what went well and poorly, draft ranked improvement hypotheses, then design and run small n=1/n=2 experiments with pre-declared success criteria, guardrails, stop conditions, and a cost/ROI kill-switch. Load when the user says how did that run go, retro this run, the agent output was bad, what should we improve, draft hypotheses, run a small experiment, or after repeated dev runs of an agentic system produce uneven quality. Priority: output quality over performance over cost, each with diminishing-returns stops. NOT a product A/B test (experimentation), NOT coding-agent harness repair (harness-evolution), NOT production-scale learning (runtime-learning-loop).

日本語の概要は準備中です。原文の説明を表示しています。

dvy1987/agent-loom32026年8月8日 更新

dvy1987 のスキルをすべて見る

このスキルの問題を報告する