跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

factory-init

Use when onboarding a brownfield repo onto ADLC end-to-end, or running the recurring PDR↔ADR↔ChDR↔code alignment sweep (--refresh).

tikalk · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add tikalk/adlc-team-skills --skill factory-init

技能说明


name: factory-init description: Use when onboarding a brownfield repo onto ADLC end-to-end, or running the recurring PDR↔ADR↔ChDR↔code alignment sweep (--refresh). disable-model-invocation: true

factory-init

What this skill does

factory-init orchestrates the unified brownfield bootstrap: one command that reverse-engineers an existing codebase onto all three project-memory layers and measures how well they align with the code.

It coordinates the leaf lifecycle skills directly — product-init, product-clarify, product-implement, product-analyze, architect-init, architect-clarify, architect-implement, architect-analyze, change-init, change-clarify, change-publish — never the peer orchestrators factory-product / factory-architect / factory-learn.

Its own final step, the sweep, is the only cross-layer analysis in the factory: it builds the coverage matrix (.adlc/coverage/coverage.md) — a feature-area pivot plus the four traceability relations PDR↔ADR, PDR↔code, ADR↔code, ChDR↔code — and diffs it against the previous sweep to detect drift.

It operates as a Kind-A DAG orchestrator in alignment with the shared executor engine contract in factory-mission/references/executor.md.

Scope boundary: project-local memory only (PDR, ADR, ChDR + code). Team context directives (CDR / team-init) are NOT bootstrapped here — they publish to the external team-ai-directives repo and are owned by factory-learn. The sweep's final output includes a prose recommendation to run factory-learn / /team-init for reusable patterns spotted during bootstrap.


When to use

  • You adopt ADLC on an existing repo (code exists, no/partial PDRs, ADRs, ChDRs) and want the full bootstrap in one run.
  • You want a recurring cross-layer alignment audit (--refresh): which decisions are undocumented, which code is undecreed, where product and architecture disagree.

When NOT to use:

  • Greenfield / empty project → run factory-product and factory-architect (specify routes) instead.
  • Single-layer work → factory-product / factory-architect / factory-learn directly.
  • CDR / team-directives contribution → factory-learn.
  • Feature implementation → factory-mission.

Route Classification

ConditionRoute
Code exists, no memory recordsBootstrap (full pipeline)
.adlc/coverage/coverage.md exists, or --refreshRefresh (sweep only)
Partial stateBootstrap with per-layer skip (below)
No codeHalt: greenfield — use factory-product / factory-architect specify routes

Per-layer skip — each track classifies independently; a layer whose memory AND compiled artifact both exist skips its init/implement and runs only its analyze:

LayerSkip init/implement whenAlways runs
productdocs/adlc/memory/pdr/ (legacy .adlc/memory/pdr/ fallback — either non-empty) AND docs/adlc/product/PRD.md existsproduct-analyze
architecturedocs/adlc/memory/adr/ (legacy .adlc/memory/adr/ fallback — either non-empty) AND docs/adlc/architect/AD.md existsarchitect-analyze
changedocs/adlc/memory/chdr/ (legacy .adlc/memory/chdr/ fallback — either non-empty) AND docs/adlc/memory/chdr.md exists(ChDRs feed the sweep directly)

Lifecycle DAG & Step Resolution

factory-init implements a fixed named-skill DAG (fixed step resolution). Tracks run sequentially — each track completes before the next starts. Rationale: the human gets one coherent review session per domain; architect-clarify reads the accepted PDR decisions as context (architecture serves product); the sweep receives the most mature inputs.

Bootstrap Route (12 steps, 3 clarify gates + final matrix review)

#StepSkillPhaseoutput_type
1product-initproduct-initgeneratedraft (.adlc/drafts/pdr/)
2product-clarify⭐product-clarifyclarifydecision
3product-implementproduct-implementbuildartifact-ref (docs/adlc/product/PRD.md)
4architect-initarchitect-initgeneratedraft (.adlc/drafts/adr/)
5architect-clarify⭐architect-clarify (reads accepted PDR list)clarifydecision
6architect-implementarchitect-implementbuildartifact-ref (docs/adlc/architect/AD.md)
7change-initchange-initgeneratedraft (.adlc/drafts/chdr/)
8change-clarify⭐change-clarifyclarifydecision
9change-publishchange-publishbuildartifact-ref (docs/adlc/memory/chdr/)
10product-analyzeproduct-analyzeanalyzefindings
11architect-analyzearchitect-analyzeanalyzefindings
12sweepinline (this skill, §The Sweep Step)analyzefindings (.adlc/coverage/coverage.md + history)

Refresh Route (1 step + loop)

#StepPhaseoutput_type
1sweep (rescan + rebuild + drift diff)analyzefindings

Correction Loops

  • product-analyze / architect-analyze CRITICAL/HIGH → route back to their own track's clarify⭐ (executor default, bounded by max_corrections, default 2).
  • sweep CRITICAL/HIGH findings route by layer tag : every finding carries [layer: product|architecture|change|cross] and routes to the matching track's clarify (product-clarify / architect-clarify / change-clarify). cross findings route to the track owning the cited record; ambiguous → halt for the human (hybrid gate). Bounded by max_corrections.

The Sweep Step (inline composite step)

The sweep is executed by this orchestrator (step skill: factory-init, prompt = this section), not by a leaf skill.

Inputs (all read-only)

| Source | Yields | |--| | product-init + architect-init setup scripts (re-run; idempotent JSON scanners) | sub-systems, feature-areas, tech stack | | docs/adlc/memory/{pdr,adr,chdr}/ (legacy `.adlc/

阅读完整来源 ↗