Karvey Import — convert Kiro / gstack specs into Karvey
Purpose
Bring pre-existing specifications from Kiro (cc-sdd) or gstack into the Karvey docs/spec/ structure, so they can continue through the Karvey pipeline. This is a cross-cutting support skill (cross-cutting layer): it does NOT advance spec.json:phase of any change — it materializes the imported documents and leaves the change at the phase its content supports.
It is idempotent and non-destructive: it never deletes the source (.kiro/, gstack docs); it only creates/updates files under docs/spec/. Generated artifacts follow the project's language (per spec.json language).
Mode selection
--from kiro → import from a Kiro .kiro/ directory.
--from gstack → import from gstack artifacts (design docs, specs, plans).
- If
--from is omitted, detect: if a .kiro/ directory exists → kiro; otherwise ask the user which source to use.
Step 1 — Ensure project config
Read docs/spec/project.json (see karvey/rules/project-config.md). If it does not exist, create it (or run /karvey-init's project-config step): ask/infer git_platform, cloud, iac_tool, knowledge_sync, targets, repos (min 1), spec_repo, branch_flow. For Kiro, pre-fill targets/stack from .kiro/steering/tech.md if present.
Step 2A — Import from Kiro (--from kiro)
Kiro layout (source):
.kiro/
├── steering/{product.md, tech.md, structure.md, ...} ← project-level context
└── specs/{feature-name}/
├── spec.json ← kiro metadata + approvals
├── requirements.md ← EARS requirements
├── design.md ← technical design
└── tasks.md ← implementation tasks
For each .kiro/specs/{feature-name}/:
change-id: use {feature-name} (or --change-id). Make it URL-safe; prefix with add|fix|update if it improves clarity. Avoid collisions in docs/spec/changes/.
Create docs/spec/changes/{change-id}/.
Map files into Karvey:
| Kiro source |
→ Karvey target |
Notes |
requirements.md (EARS) |
requirements.md |
Compatible. Add a Traces to PRD: line per requirement (point to the PRD section once the PRD exists). |
design.md |
architecture.md |
Map onto Karvey's architecture template. Sections Karvey requires but Kiro lacks (Cloud Infrastructure, edge cases, trust boundaries, test-coverage plan, diagrams) are added as > TODO (karvey-architecture): ... placeholders, NOT invented. |
tasks.md |
tasks.md |
Keep tasks; re-label to E{n}.F{n}.T{n} [layer] if feasible, otherwise keep and note. |
steering/product.md |
feeds prd.md |
Problem, goals, users. |
steering/tech.md |
feeds project.json (stack/targets) + architecture context |
|
Generate prd.md (Kiro has no formal PRD): synthesize from steering/product.md + the intent of requirements.md into Karvey's PRD structure (executive summary, problem & context, goals & success metrics, user stories, scope/out-of-scope, stakeholders, constraints, acceptance criteria). Mark inferred parts as > inferred from Kiro — review.
Generate spec.json: change_id, capability (infer or ask), goal (from product/requirements; ask if unclear), language, management, security_tier (ask; default per project), phase and approvals set to the furthest phase the imported content supports (e.g. if requirements+design+tasks exist → phase: "tasks", with requirements/architecture/tasks marked generated; approvals left approved:false so the user re-validates each gate). Map Kiro approvals where present.
spec-delta.md / living specs: create a spec-delta.md stub for karvey-archive to merge later.
Report per feature: what mapped cleanly vs. what needs review (the TODO placeholders).
Step 2B — Import from gstack (--from gstack)
gstack does not persist a fixed on-disk spec layout, so this mode is heuristic and confirmation-driven.
Discover candidate artifacts (ask the user to confirm/point if ambiguous):
- Design docs / "10-star" or office-hours outputs, CEO/eng review plans.
/spec outputs (executable specs, backlog-ready).
- Plan files (e.g.
PLAN.md, docs/plan*, *.spec.md, design notes).
Map onto Karvey:
| gstack artifact |
→ Karvey target |
| office-hours / CEO review / 10-star doc |
prd.md (vision + problem + goals) |
/spec executable spec |
requirements.md (convert to EARS; mark non-EARS items) |
| eng-review plan / architecture notes |
architecture.md (+ TODO placeholders for missing Karvey sections) |
| task/backlog list |
tasks.md |
| design-system notes |
design-spec.md |
Generate prd.md, spec.json and (if missing) project.json as in the Kiro flow. Set phase/approvals to the furthest phase the mapped content supports; leave approvals approved:false for re-validation.
Because mapping is heuristic, always present the proposed file map to the user for confirmation before writing.
Step 3 — Knowledge sync
After writing, run the sync step per karvey/rules/knowledge-sync.md (Obsidian if available; otherwise /graphify docs/spec/ --update).
Step 4 — Output
Report, per imported change:
✅ Imported {change-id} from {kiro|gstack}
Created: prd.md, requirements.md, architecture.md, tasks.md, spec.json
Resume phase: {phase} (all gates require re-approval)
⚠️ Needs review: {list of TODO placeholders / non-EARS items}
Next step: /karvey {change-id} → see status and continue the pipeline
Safety
- Never delete or modify the source (
.kiro/, gstack docs) — read-only on the origin.
- Do not invent content Karvey requires but the source lacks — use clearly marked
> TODO placeholders so the user fills them via the proper phase.
- All gates are imported as not approved, so the user re-validates requirements/architecture/etc. through Karvey.
- Generated artifacts follow the project's language (
spec.json language), never forced to English.
Part of the Karvey™ Method — © HainTech, by Mauricio Quezada Ibáñez · Apache 2.0 · see karvey/LICENSE and karvey/TRADEMARK.md.
1---2name: karvey-import3description: Convert existing specs from Kiro (cc-sdd) or gstack into the Karvey method's `docs/spec/` structure. Maps requirements/design/tasks into Karvey's prd.md, requirements.md, architecture.md, tasks.md + spec.json/project.json. Cross-cutting support skill — does NOT advance any change's phase. Triggers include "karvey import", "import kiro", "kiro to karvey", "migrate kiro", "migrar kiro", "convertir kiro", "import gstack", "gstack to karvey", "migrate gstack", "convertir gstack", "convert specs", "importar specs".4---56# Karvey Import — convert Kiro / gstack specs into Karvey78## Purpose910Bring pre-existing specifications from **Kiro** (cc-sdd) or **gstack** into the Karvey `docs/spec/` structure, so they can continue through the Karvey pipeline. This is a **cross-cutting support skill** (cross-cutting layer): it does **NOT** advance `spec.json:phase` of any change — it materializes the imported documents and leaves the change at the phase its content supports.1112It is **idempotent and non-destructive**: it never deletes the source (`.kiro/`, gstack docs); it only creates/updates files under `docs/spec/`. Generated artifacts follow the project's language (per `spec.json` `language`).1314## Mode selection1516- `--from kiro` → import from a Kiro `.kiro/` directory.17- `--from gstack` → import from gstack artifacts (design docs, specs, plans).18- If `--from` is omitted, detect: if a `.kiro/` directory exists → kiro; otherwise ask the user which source to use.1920---2122## Step 1 — Ensure project config2324Read `docs/spec/project.json` (see `karvey/rules/project-config.md`). If it does not exist, create it (or run `/karvey-init`'s project-config step): ask/infer `git_platform`, `cloud`, `iac_tool`, `knowledge_sync`, `targets`, `repos` (min 1), `spec_repo`, `branch_flow`. For Kiro, pre-fill `targets`/stack from `.kiro/steering/tech.md` if present.2526---2728## Step 2A — Import from Kiro (`--from kiro`)2930Kiro layout (source):31```32.kiro/33├── steering/{product.md, tech.md, structure.md, ...} ← project-level context34└── specs/{feature-name}/35 ├── spec.json ← kiro metadata + approvals36 ├── requirements.md ← EARS requirements37 ├── design.md ← technical design38 └── tasks.md ← implementation tasks39```4041For **each** `.kiro/specs/{feature-name}/`:42431. **change-id**: use `{feature-name}` (or `--change-id`). Make it URL-safe; prefix with `add|fix|update` if it improves clarity. Avoid collisions in `docs/spec/changes/`.442. **Create** `docs/spec/changes/{change-id}/`.453. **Map files** into Karvey:4647 | Kiro source | → Karvey target | Notes |48 |-------------|-----------------|-------|49 | `requirements.md` (EARS) | `requirements.md` | Compatible. Add a `Traces to PRD:` line per requirement (point to the PRD section once the PRD exists). |50 | `design.md` | `architecture.md` | Map onto Karvey's architecture template. Sections Karvey requires but Kiro lacks (**Cloud Infrastructure**, edge cases, trust boundaries, test-coverage plan, diagrams) are added as `> TODO (karvey-architecture): ...` placeholders, NOT invented. |51 | `tasks.md` | `tasks.md` | Keep tasks; re-label to `E{n}.F{n}.T{n} [layer]` if feasible, otherwise keep and note. |52 | `steering/product.md` | feeds `prd.md` | Problem, goals, users. |53 | `steering/tech.md` | feeds `project.json` (stack/targets) + architecture context | |54554. **Generate `prd.md`** (Kiro has no formal PRD): synthesize from `steering/product.md` + the intent of `requirements.md` into Karvey's PRD structure (executive summary, problem & context, goals & success metrics, user stories, scope/out-of-scope, stakeholders, constraints, acceptance criteria). Mark inferred parts as `> inferred from Kiro — review`.565. **Generate `spec.json`**: `change_id`, `capability` (infer or ask), `goal` (from product/requirements; ask if unclear), `language`, `management`, `security_tier` (ask; default per project), `phase` and `approvals` set to the **furthest phase the imported content supports** (e.g. if requirements+design+tasks exist → `phase: "tasks"`, with `requirements/architecture/tasks` marked generated; approvals left `approved:false` so the user re-validates each gate). Map Kiro `approvals` where present.576. **spec-delta.md / living specs**: create a `spec-delta.md` stub for `karvey-archive` to merge later.587. Report per feature: what mapped cleanly vs. what needs review (the TODO placeholders).5960---6162## Step 2B — Import from gstack (`--from gstack`)6364gstack does **not** persist a fixed on-disk spec layout, so this mode is **heuristic and confirmation-driven**.65661. **Discover** candidate artifacts (ask the user to confirm/point if ambiguous):67 - Design docs / "10-star" or office-hours outputs, CEO/eng review plans.68 - `/spec` outputs (executable specs, backlog-ready).69 - Plan files (e.g. `PLAN.md`, `docs/plan*`, `*.spec.md`, design notes).702. **Map** onto Karvey:7172 | gstack artifact | → Karvey target |73 |-----------------|-----------------|74 | office-hours / CEO review / 10-star doc | `prd.md` (vision + problem + goals) |75 | `/spec` executable spec | `requirements.md` (convert to EARS; mark non-EARS items) |76 | eng-review plan / architecture notes | `architecture.md` (+ TODO placeholders for missing Karvey sections) |77 | task/backlog list | `tasks.md` |78 | design-system notes | `design-spec.md` |793. **Generate `prd.md`**, `spec.json` and (if missing) `project.json` as in the Kiro flow. Set `phase`/`approvals` to the furthest phase the mapped content supports; leave approvals `approved:false` for re-validation.804. Because mapping is heuristic, **always present the proposed file map to the user for confirmation before writing**.8182---8384## Step 3 — Knowledge sync8586After writing, run the sync step per `karvey/rules/knowledge-sync.md` (Obsidian if available; otherwise `/graphify docs/spec/ --update`).8788## Step 4 — Output8990Report, per imported change:91```92✅ Imported {change-id} from {kiro|gstack}93 Created: prd.md, requirements.md, architecture.md, tasks.md, spec.json94 Resume phase: {phase} (all gates require re-approval)95 ⚠️ Needs review: {list of TODO placeholders / non-EARS items}9697Next step: /karvey {change-id} → see status and continue the pipeline98```99100## Safety101102- **Never delete or modify the source** (`.kiro/`, gstack docs) — read-only on the origin.103- **Do not invent** content Karvey requires but the source lacks — use clearly marked `> TODO` placeholders so the user fills them via the proper phase.104- All gates are imported as **not approved**, so the user re-validates requirements/architecture/etc. through Karvey.105- Generated artifacts follow the project's language (`spec.json` `language`), never forced to English.106107---108*Part of the Karvey™ Method — © HainTech, by Mauricio Quezada Ibáñez · Apache 2.0 · see `karvey/LICENSE` and `karvey/TRADEMARK.md`.*