一键导入
spec-import
Import raw source material into a structurally normalized IDD `.specs/` structure.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Import raw source material into a structurally normalized IDD `.specs/` structure.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Check whether implementation behavior matches durable product intent in `.idd/intent/`.
Implement behavior from current `.idd/intent/` product intent and verify the code against the relevant specification.
Update `.idd/intent/` product intent from confirmed implementation behavior.
Diagnose `.idd/intent/` product intent structure and recommend reorganizations without editing files.
Clarify real product intent before changing `.idd/intent/`, using focused customer-development questions and simplification options without editing product intent, planning implementation, or writing code.
Update current `.idd/intent/` product intent from a user-requested behavior change, preferring existing specs over new specs.
| name | spec-import |
| description | Import raw source material into a structurally normalized IDD `.specs/` structure. |
Use this skill to import raw specification material into a normalized IDD
.specs/ structure.
Formula:
spec-import = import + mandatory normalization + lint gate
Use it when old .worklog content, GitHub Spec Kit folders, issue/task docs,
ADRs, research notes, implementation notes, or other sources must become a
coherent current product specification set.
Import is a migration of meaning, not a mechanical conversion from old files to new files. Source files are evidence. They are not the desired target structure.
Import is not complete until the generated .specs tree is mechanically
consistent.
For successful apply-safe import, the expected final state is:
.specs/archive;.specs;.specs/INDEX.md;.specs/INDEX.md exist;Related, Replaces, Supersedes, Depends on, and similar
references point to existing current documents;spec-lint would return no errors.Warnings may remain only for genuinely semantic ambiguity. Mechanical errors must be fixed before finishing the import.
mode: apply-safe
autoNormalize: true
conflictMode: report-only
allowNewSpecs: true
Supported modes:
mode: propose | apply-safe
autoNormalize: true
conflictMode: report-only
allowNewSpecs: true
apply-safe may apply structural changes that preserve product meaning. It must
not resolve product conflicts or invent new product decisions.
Current specs describe target product state, not the history of work.
A spec answers:
If the implementation is deleted but the specs remain, can the product be rebuilt?
Therefore current specs may contain:
Current specs must not contain:
Task, refactor, cleanup, progress, and status notes are not current product specs unless a fragment defines durable product behavior.
Do not preserve source file boundaries by default. Source files are evidence, not the desired target structure. The target structure must follow durable product intent areas.
Before writing files, build a normalized target structure and look for:
Typical product areas include:
This is not a fixed enum. Prefer areas that match the actual product.
.specs/README.md, .specs/INDEX.md, and existing current specs when
they exist..specs/INDEX.md from actual current numbered documents.spec-lint and fix mechanical errors before finishing.Identify the source methodology and conventions before importing. Look for README or index files, templates, lifecycle markers, document types, generated files, task sections, ADRs, spikes, research, and implementation sections.
Use source-specific conventions as hints only. Classify each document and section by whether it expresses durable product intent.
For GitHub Spec Kit / Spec Driven Development-like sources:
spec.md may contain durable product intent.plan.md usually contains implementation approach; import only
product-level constraints.tasks.md is process by default and should not become current intent.research.md may become ADRs or spikes.data-model.md may contain durable domain contracts.contracts/ may contain durable API or integration contracts.quickstart.md is usually guidance, not normative intent, unless it defines
acceptance behavior.Create an import inventory before writing target specs.
For each source, track:
source path
detected type
detected lifecycle/status
main product area
import action
reason
target document
review notes
Possible import actions:
import-current
convert-to-adr
convert-to-spike
extract-fragments
skip-process-only
skip-generated
delete-obsolete
delete-duplicate
needs-review
Classify sections and paragraphs, not only files.
Fragment categories:
durable-current-intent
durable-obsolete-intent
architecture-rationale
uncertainty-or-research-question
acceptance-or-verification-rule
user-visible-behavior
domain-contract
product-defining-technical-constraint
implementation-note
temporary-status
task-step
backlog-item
chat-history
generated-output
test-output
file-list
source-wrapper
Import durable intent. Drop process noise.
Do not import obsolete or process-only source material into an archive. Skip or delete source material that has no current product intent. Preserve old versions only through Git history.
Never create .specs/archive.
Never move obsolete imported documents into .specs/archive.
Never preserve skipped, obsolete, duplicate, process-only, task-like, or
historical source files as archived specs.
Git history is the archive.
Before writing final documents, build a source-to-target mapping for every imported, skipped, merged, deleted, absorbed, or converted source document.
Track at least:
source id/path
source title
source detected type
action
target document if any
absorbed-by document if any
reason
reference rewrite rule
Possible actions:
import-current
convert-to-adr
convert-to-spike
extract-fragments
merge-into-existing
absorb-into-new
skip-process-only
skip-generated
delete-obsolete
delete-duplicate
needs-review
Rules:
.specs.A conflict exists when two current or possibly-current fragments define different behavior, constraints, APIs, defaults, compatibility rules, or non-goals.
Example:
Scope says feature X is supported.
Non-goals says feature X must not be implemented.
Do not choose one side silently. Instead:
If the conflict blocks a coherent normative spec, stop and ask for a product decision.
Create target documents by durable product area, not by source file.
Prefer:
Avoid:
Create current specs only for durable current product intent. Create ADRs only for durable decision records. Create spikes only for active unresolved research.
Imported current documents must use current IDD document shapes. Do not preserve legacy section layout when the document becomes current normative intent.
Minimum shape for Spec:
# 0000 - Title
Type: Spec
Status: Current
## Context
## Scope / Behavior
## Non-goals
## Acceptance criteria
## Source history
Minimum shape for ADR:
# 0000 - Title
Type: ADR
Status: Accepted | Proposed | Deprecated | Superseded
## Context
## Decision
## Consequences
## Related specs
## Source history
Minimum shape for Spike:
# 0000 - Title
Type: Spike
Status: Open | Resolved
## Question
## Findings
## Result / Recommendation
## Follow-up
If a spike already has Result or Recommendation and is no longer active
research, import must choose one of these outcomes:
After writing documents, scan all current specs, ADRs, and spikes for numeric references.
For each reference:
Do not finish with a relation such as:
Related: 0026
when 0026 does not exist.
It is valid to rewrite the relation when the source remap proves the target:
Related: 0027
It is also valid to preserve traceability as non-normative history:
Source history: extracted from legacy .worklog/0026.
Source history is not a normative relation.
Regenerate .specs/INDEX.md from actual current numbered documents after
import. Never leave placeholder index content. Never rely on the source index as
the final target index.
Minimum structure:
# Specs Index
| ID | Type | Status | Title | Summary |
|----|------|--------|-------|---------|
| 0001 | Spec | Current | ... | ... |
| 0002 | ADR | Accepted | ... | ... |
Rules:
.specs/ must be listed;.specs/README.md, .specs/INDEX.md, and relevant existing current
specs..specs only when persistent output is explicitly needed.Before finishing:
.specs/archive if it exists..specs..specs/INDEX.md.spec-lint.Do not create .specs/import-report.md.
Import reports are process output, not product intent. They must not be stored
inside .specs.
Prefer returning the import report in the assistant response. If a persistent
report is explicitly needed, write it outside .specs, for example:
.intent-driven-development/import-report.md;docs/import-report.md.The report must not recommend creating .specs/archive or link to
.specs/archive/....
Include:
The report is not normative product intent.
Before finishing, check:
.specs/INDEX.md is regenerated from actual current numbered documents..specs..specs/archive directory exists.spec-lint would return no errors.Input:
Old `.worklog` contains:
- one large MVP document;
- separate notes about viewer/editor encoding;
- cleanup task about removing unused fields;
- conflicting copy behavior about Append.
Expected import behavior:
.specs/INDEX.md..worklog with broken historical referencesInput:
.worklog contains numbered documents;Related / Replaces links to documents that
are not imported;Expected import behavior:
.specs/archive;.specs/import-report.md;.specs/INDEX.md;spec-lint errors.Input:
feature-x/
- spec.md
- plan.md
- tasks.md
- research.md
- contracts/api.yaml
Expected import behavior:
spec.md;contracts/api.yaml;research.md into ADR material;tasks.md as process;plan.md only for product-defining constraints.Do not use this skill for:
.specs structure without import;.specs/;Use spec-audit for broad structural diagnostics without edits. Use
spec-normalize-current only for later maintenance of an existing .specs
tree, not as a required manual cleanup after import.