Skip to content

feat(targets): add Kiro IDE support#1741

Merged
danielmeppiel merged 11 commits into
mainfrom
danielmeppiel/702-kiro-target
Jun 11, 2026
Merged

feat(targets): add Kiro IDE support#1741
danielmeppiel merged 11 commits into
mainfrom
danielmeppiel/702-kiro-target

Conversation

@danielmeppiel

@danielmeppiel danielmeppiel commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

feat(targets): add Kiro IDE support

TL;DR

This PR adds Kiro IDE as a first-class APM target with steering, skills, hooks, and MCP support in the documented .kiro/ layout. It implements the board-ratified design for issue #702 and keeps the Kiro CLI divergence out of v1 scope.

Note

Credit to @TibRib for the Kiro steering, skills, MCP, hooks, and user-scope format details in #702. Please validate the generated layout and co-author/follow up if the Kiro IDE behavior needs adjustment.

Closes #702.

Problem (WHY)

  • Kiro users could not select target: kiro, so APM could not act as the shared packaging layer for teams adopting Kiro alongside existing tools.
  • Kiro steering is not plain Markdown; it needs inclusion: always or inclusion: fileMatch frontmatter, so copying .instructions.md verbatim would miss the native loading semantics.
  • Kiro hooks are individual JSON files under .kiro/hooks/, not a merged config file, so the existing merge-only target shapes did not match the documented Kiro IDE layout.
  • [!] MCP secrets must remain runtime-resolved where the target supports placeholders; the Kiro adapter preserves ${VAR} rather than baking local env values into mcp.json.

Why this matters: the target model should let APM add a concrete harness through a bounded registry + transform path, matching Agent Skills' advice that "agents pattern-match well against concrete structures" and PROSE's rule that "Grounding outputs in deterministic tool execution transforms probabilistic generation into verifiable action."

Approach (WHAT)

# Fix (and why)
1 Register kiro as a stable target with .kiro/steering/, .kiro/skills/, and .kiro/hooks/ primitives.
2 Add a kiro_steering instruction transform that maps APM applyTo: globs to Kiro fileMatchPattern and defaults unscoped files to always.
3 Add a Kiro MCP adapter for .kiro/settings/mcp.json and ~/.kiro/settings/mcp.json, preserving ${VAR} runtime placeholders.
4 Add Kiro hook expansion that emits one JSON file per hook action and rewrites bundled script paths under .kiro/hooks/<pkg>/.
5 Update docs, guide-skill reference material, changelog, target detection, policy scan dirs, and registry-completeness tests.

Implementation (HOW)

Area What changed
Target registry and detection integration/targets.py, core/apm_yml.py, core/target_detection.py, compilation/agents_compiler.py, and policy scan dirs now know kiro, including auto-detect from .kiro/, compile routing to AGENTS.md, and user-scope metadata.
Steering transform instruction_integrator.py adds kiro_steering, a rule-format transform that strips APM frontmatter, emits Kiro inclusion frontmatter, and keeps source bodies intact after link resolution.
Hook deployment hook_integrator.py routes Kiro to kiro_hook_integrator.py, which converts APM/Copilot/Claude hook shapes into Kiro when/then JSON files and copies referenced scripts.
MCP adapter adapters/client/kiro.py, factory.py, and mcp_integrator*.py add project/user-scope Kiro config writes, stale cleanup, runtime detection, remote URL+headers support, and stdio command/args/env support.
Tests tests/unit/test_kiro_mcp.py, tests/unit/integration/test_kiro_target.py, and registry/detection updates cover Kiro profile shape, steering conversion, hook expansion, user scope, stale cleanup, and MCP schema.
Docs Target matrix, IDE integration, CLI references, primitive authoring docs, MCP docs, APM guide skill docs, and changelog document the Kiro layout and v1 scope fence.

Diagrams

Legend: the diagram shows how target: kiro now flows from manifest selection into the four Kiro-specific deployment surfaces.

flowchart LR
    subgraph Manifest[Manifest]
        T[target kiro]
        M[mcp deps]
    end
    subgraph Registry[Target registry]
        P[TargetProfile kiro]:::new
    end
    subgraph Deploy[Deploy]
        S[steering transform]:::new
        K[skills copy]:::new
        H[hook file expansion]:::new
        C[mcp settings adapter]:::new
    end
    T --> P
    M --> C
    P --> S
    P --> K
    P --> H
    classDef new stroke-dasharray: 5 5;
Loading

Trade-offs

  • Kiro IDE only. Chose the documented Kiro IDE layout; rejected Kiro CLI support in this PR because JohnLudlow called out config divergence and the board explicitly deferred it.
  • New hook helper module. Chose kiro_hook_integrator.py; rejected growing hook_integrator.py further because the CI file-length guard is a hard gate.
  • Native Kiro skills path. Chose .kiro/skills/; rejected cross-target .agents/skills/ for Kiro because @TibRib confirmed Kiro follows the Agent Skills SKILL.md layout under .kiro/skills/.
  • Runtime env placeholders. Chose ${VAR} preservation for Kiro MCP; rejected install-time resolution to avoid writing local secrets to disk.

Benefits

  1. apm install --target kiro can now deploy instructions, skills, hooks, and MCP servers into a Kiro workspace.
  2. target: kiro and .kiro/ auto-detection work through the same target-resolution path as existing harnesses.
  3. Kiro steering files get native inclusion frontmatter instead of APM-only applyTo: metadata.
  4. Kiro hook packages produce auditable one-file-per-hook JSON plus copied scripts.
  5. Kiro MCP config supports both project and user scope without plaintext env substitution for ${VAR} secrets.

Validation

uv run --extra dev pytest tests/unit/test_kiro_mcp.py tests/unit/integration/test_kiro_target.py -q:

.................                                                                                                [100%]
20 passed in 1.01s

uv run --extra dev pytest tests/unit -q:

<unit suite completed with exit code 0>

uv run --extra dev ruff check src/ tests/ && uv run --extra dev ruff format --check src/ tests/ && uv run --extra dev python -m pylint --disable=all --enable=R0801 --min-similarity-lines=10 --fail-on=R0801 src/apm_cli/ && bash scripts/lint-auth-signals.sh:

All checks passed!
1241 files already formatted

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

[*] Rule A: get_bearer_provider boundary (any reference)
[*] Rule B: git ls-remote auth-delegated annotation
[+] auth-signal lint clean

source guard equivalents:

source guards clean

Scenario Evidence

# Scenario (user promise) Principle(s) Test(s) proving it Type
1 Select Kiro and get the documented .kiro/ primitive layout Portability by manifest, Multi-harness support tests/unit/integration/test_kiro_target.py::test_kiro_target_profile_matches_ratified_layout unit
2 Scoped APM instructions become Kiro steering files that load on matching files Portability by manifest, DevX tests/unit/integration/test_kiro_target.py::test_kiro_steering_maps_apply_to_to_file_match unit
3 A hook package installs as one Kiro JSON file per hook action with restricted hook-file permissions Multi-harness support, DevX, Secure by default tests/unit/integration/test_kiro_target.py::test_kiro_hooks_expand_each_apm_hook_to_individual_json unit
4 Kiro MCP config preserves runtime env placeholders and supports project/user scope Secure by default, Multi-harness support tests/unit/test_kiro_mcp.py::test_remote_config_uses_kiro_url_headers_and_tool_extensions
tests/unit/test_kiro_mcp.py::test_user_scope_writes_without_existing_kiro_dir
unit
5 Unsupported Kiro MCP remote transports fail with a clear error DevX tests/unit/test_kiro_mcp.py::test_remote_unsupported_transport_raises_for_kiro unit

How to test

  • Create a project with .kiro/, add an .apm/instructions/*.instructions.md file with applyTo: "src/**/*.py", run apm install --target kiro, and confirm .kiro/steering/<name>.md has inclusion: fileMatch.
  • Add a skill bundle under .apm/skills/demo/SKILL.md, run apm install --target kiro, and confirm .kiro/skills/demo/SKILL.md exists unchanged.
  • Add a hook JSON under .apm/hooks/, run apm install --target kiro, and confirm .kiro/hooks/ contains individual Kiro when/then files.
  • Add an MCP dependency with headers: {Authorization: "Bearer ${KIRO_TOKEN}"}, run apm install --target kiro --only mcp, and confirm .kiro/settings/mcp.json keeps ${KIRO_TOKEN}.
  • Run apm install --target kiro --global and confirm user-scope output lands under ~/.kiro/.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

danielmeppiel and others added 2 commits June 11, 2026 00:42
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 10, 2026 22:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Kiro IDE as a first-class APM target across the target registry, instruction (steering) transforms, hook integration, MCP adapter + runtime detection, plus tests and documentation updates to reflect the .kiro/ layout.

Changes:

  • Register target: kiro and wire detection/validation paths so .kiro/ is discoverable and selectable.
  • Implement Kiro-specific integrations: instruction -> steering transform (kiro_steering), hook expansion to one JSON per action, and MCP config adapter for .kiro/settings/mcp.json / ~/.kiro/settings/mcp.json with ${VAR} preservation.
  • Add unit/integration tests and broaden docs/guide references + changelog to include Kiro.
Show a summary per file
File Description
tests/unit/test_kiro_mcp.py New unit tests for Kiro MCP adapter behavior (paths, placeholder preservation, stale cleanup).
tests/unit/integration/test_targets_registry_completeness.py Ensures Kiro adapter is included in registry completeness assertions.
tests/unit/integration/test_kiro_target.py New integration-style unit tests for Kiro target profile, steering transform, and hook expansion behavior.
tests/unit/integration/test_data_driven_dispatch.py Adds instructions_kiro bucket to dispatch/partition parity coverage.
tests/unit/core/test_target_resolution_v2.py Adds .kiro/ as a filesystem signal for target resolution.
tests/unit/core/test_target_detection.py Adds explicit + auto-detect test coverage for --target kiro and .kiro/ detection.
tests/unit/core/test_scope.py Adds kiro to known targets and asserts user-scope support metadata.
src/apm_cli/policy/policy_checks.py Includes .kiro in policy script-scan directory list.
src/apm_cli/integration/targets.py Adds kiro TargetProfile + adds kiro_steering to the transforming rule-format set.
src/apm_cli/integration/mcp_integrator.py Adds Kiro stale MCP cleanup, runtime detection from scripts, and updates supported runtime messaging.
src/apm_cli/integration/mcp_integrator_install.py Adds Kiro runtime discovery (including user-scope behavior) and threads user_scope into runtime discovery.
src/apm_cli/integration/kiro_hook_integrator.py New module implementing Kiro hook expansion (one-file-per-action) and script copying.
src/apm_cli/integration/instruction_integrator.py Adds kiro_steering converter and avoids broad legacy-delete behavior for .kiro/steering/.
src/apm_cli/integration/hook_integrator.py Adds Kiro hook event mapping + routes kiro to the new Kiro hook integrator; updates script rewrite rules.
src/apm_cli/factory.py Registers kiro client adapter in ClientFactory.
src/apm_cli/core/target_detection.py Adds kiro throughout explicit/config/auto-detect + canonical target sets and descriptions.
src/apm_cli/core/apm_yml.py Allows kiro as a valid manifest target.
src/apm_cli/compilation/agents_compiler.py Includes kiro in agent compilation target set.
src/apm_cli/adapters/client/kiro.py New Kiro MCP client adapter implementing project/user-scope config writes and placeholder-preserving formatting.
packages/apm-guide/.apm/skills/apm-usage/package-authoring.md Documents Kiro-specific hook filename suffix handling and target lists.
packages/apm-guide/.apm/skills/apm-usage/dependencies.md Documents ${VAR} placeholder handling for Kiro MCP.
packages/apm-guide/.apm/skills/apm-usage/commands.md Updates CLI reference text to mention kiro target and global MCP behavior.
docs/src/content/docs/troubleshooting/compile-zero-output-warning.md Adds .kiro/ as a canonical signal in troubleshooting guidance.
docs/src/content/docs/reference/targets-matrix.md Adds Kiro to matrix + documents Kiro target details and conventions.
docs/src/content/docs/reference/manifest-schema.md Adds kiro to allowed targets and documents MCP placeholder behavior including Kiro.
docs/src/content/docs/reference/cli/update.md Adds kiro to apm update --target documentation.
docs/src/content/docs/reference/cli/uninstall.md Adds .kiro/ to uninstall scope description.
docs/src/content/docs/reference/cli/targets.md Adds Kiro to apm targets output examples and detection table.
docs/src/content/docs/reference/cli/install.md Adds kiro to install target list and global MCP runtime description.
docs/src/content/docs/reference/cli/init.md Adds kiro to apm init --target valid values.
docs/src/content/docs/reference/cli/deps.md Adds kiro to apm deps update --target valid values.
docs/src/content/docs/reference/cli/compile.md Adds kiro to compile docs and target lists.
docs/src/content/docs/producer/compile.md Updates producer docs to include Kiro in compile reach and output mapping.
docs/src/content/docs/producer/author-primitives/skills.md Documents .kiro/skills/<name>/SKILL.md as a target-native skill path.
docs/src/content/docs/producer/author-primitives/instructions-and-agents.md Documents Kiro instruction/steering transform behavior and limitations.
docs/src/content/docs/producer/author-primitives/hooks-and-commands.md Documents Kiro hook token + output location (needs a small filename-pattern fix).
docs/src/content/docs/integrations/ide-tool-integration.md Adds Kiro to IDE integration guide and describes .kiro/ deployment surfaces.
docs/src/content/docs/getting-started/first-package.md Adds .kiro/ to target auto-detection examples.
docs/src/content/docs/enterprise/security.md Adds .kiro/ to allowed deploy-prefix documentation.
docs/src/content/docs/enterprise/policy-reference.md Adds kiro to policy target allowlist docs.
docs/src/content/docs/consumer/run-scripts.md Adds kiro to example runtime CLIs referenced in scripts.
docs/src/content/docs/consumer/install-packages.md Adds .kiro/ to install integration directory list and idempotency note.
docs/src/content/docs/consumer/install-mcp-servers.md Documents Kiro MCP config locations and -g routing behavior.
docs/src/content/docs/concepts/what-is-apm.md Adds .kiro/ to the “compiled output lives in…” harness list.
docs/src/content/docs/concepts/primitives-and-targets.md Adds Kiro to target list + expands compatibility matrix to include Kiro column.
docs/src/content/docs/concepts/lifecycle.md Adds .kiro/ to lifecycle auto-detect signals list.
docs/src/content/docs/concepts/glossary.md Adds kiro to glossary description of targets.
CHANGELOG.md Adds an Unreleased entry for Kiro target support (needs PR-number formatting update).

Copilot's findings

  • Files reviewed: 48/48 changed files
  • Comments generated: 2

| gemini | `.gemini/settings.json` | merged |
| codex | `.codex/hooks.json` | merged |
| windsurf | `.windsurf/hooks.json` | merged |
| kiro | `.kiro/hooks/<pkg>-<event>.json` | one file per hook |
Comment thread CHANGELOG.md Outdated
Comment on lines +12 to +13
- Kiro IDE is now a first-class install target: APM deploys steering, skills,
hooks, and MCP config to the documented `.kiro/` layout. (closes #702)
Folds copilot-pull-request-reviewer follow-ups: correct Kiro hook filename pattern in docs, changelog PR number.

Refs #702

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_now

Adds Kiro IDE as a first-class APM target (steering, skills, hooks, MCP) via the registry + transform path; CI green, scope met, no blocking findings.

cc @danielmeppiel @sergio-sisternes-epam -- a fresh advisory pass is ready for your review.

This PR lands the board-ratified Kiro IDE target cleanly. It threads kiro through the established TargetProfile registry, reuses skill_standard verbatim for .kiro/skills/, adds a kiro_steering transform that maps applyTo: globs to inclusion: fileMatch (defaulting unscoped files to inclusion: always), expands hooks to one when/then JSON per action under .kiro/hooks/, and ships a KiroClientAdapter for .kiro/settings/mcp.json + ~/.kiro/settings/mcp.json. The panel signals converge strongly: the architecture follows the existing per-target pattern with no new abstraction debt, the security surface is tight (path containment on every write, 0o600 on the MCP config, ${VAR} preserved rather than materialized), and the test + docs coverage is comprehensive. Both inline nits Copilot raised (hook-filename pattern in hooks-and-commands.md, changelog PR-number suffix) are already correct in the current revision -- no outstanding doc drift.

The v1 scope fence (documented Kiro IDE layout only; Kiro CLI divergence deferred) is explicit in code comments, docs, and the PR body, so there is nothing to re-litigate. This is a textbook additive target: low blast radius, opt-in at project scope (writes are gated on an existing .kiro/), and nothing existing changes behavior.

Aligned with: Portable by manifest -- target: kiro resolves through the same explicit/apm.yml/auto-detect path as every other harness. Multi-harness, multi-host -- a new editor target widens APM's reach without forking the integrator core. Secure by default -- MCP secrets stay as runtime ${VAR} placeholders, config is written 0o600, and all file writes pass through ensure_path_within.

Growth signal. A new IDE target is a fresh adoption surface for the Kiro community, and the PR credits @TibRib for the layout details from #702 -- worth amplifying in the next release note to convert a community-sourced spec into a visible contributor win.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 1 Registry + transform pattern followed exactly; hook helper correctly extracted to respect the file-length guard.
CLI Logging Expert 0 0 1 ASCII status symbols and _rich_* helpers used consistently; one broad-except swallows root cause to debug-only.
DevX UX Expert 0 0 0 Target selection/detection wired end to end; project-scope opt-in gate avoids clobbering non-Kiro workspaces.
Supply Chain Security 0 0 0 Path containment on every write, 0o600 config, ${VAR} never materialized -- negative secret-leak assertions present.
OSS Growth Hacker 0 0 0 New IDE target + community credit (@TibRib) is a clean adoption + contributor signal.
Test Coverage Expert 0 0 1 Profile/steering/hooks/MCP/scope/stale all covered with evidence; minor gaps on perms + omission paths.
Auth Expert 0 0 0 MCP header/env ${VAR} path confirmed to carry no materialized token into written config.
Doc Writer 0 0 0 Target row, compatibility matrix, and dedicated guide section all present and accurate.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Top follow-ups

  1. [Test Coverage Expert] Add an assertion that .kiro/settings/mcp.json is written 0o600 and that autoApprove/disabledTools are omitted when the registry omits them -- locks the secure-perms and carry-only-if-present contracts so a future refactor cannot silently regress them.
  2. [Python Architect] Consider a thin protocol or documented seam for the kiro_hook_integrator -> HookIntegrator private-method reach-ins (_rewrite_hooks_data, _get_package_name, check_collision) -- keeps the extracted module's coupling intentional rather than incidental.
  3. [CLI Logging Expert] configure_mcp_server's broad except Exception logs the cause only at debug while surfacing a generic error -- fine for now, but a verbose-tier hint would speed Kiro MCP triage.

Architecture

classDiagram
    class TargetProfile {
        +name
        +root_dir
        +primitives
        +user_supported
        +compile_family
    }
    class PrimitiveMapping {
        +subdir
        +extension
        +format_id
        +output_compare
    }
    class CopilotClientAdapter
    class KiroClientAdapter {
        +supports_user_scope
        +mcp_servers_key
        +get_config_path()
        +update_config()
        +_format_server_config()
    }
    class InstructionIntegrator {
        +_convert_to_kiro_steering()
    }
    class KiroHookIntegrator {
        +integrate_kiro_hooks()
    }
    TargetProfile o-- PrimitiveMapping
    CopilotClientAdapter <|-- KiroClientAdapter
    TargetProfile ..> InstructionIntegrator
    TargetProfile ..> KiroHookIntegrator
    class KiroClientAdapter:::new
    class KiroHookIntegrator:::new
Loading
flowchart TD
    M[apm.yml target kiro] --> R[TargetProfile kiro]
    R --> S[kiro_steering transform]
    R --> K[skills copy skill_standard]
    R --> H[kiro hook expansion]
    D[mcp deps] --> C[KiroClientAdapter]
    S --> O1[.kiro/steering/*.md]
    K --> O2[.kiro/skills/name/SKILL.md]
    H --> O3[.kiro/hooks/*.json]
    C --> O4[.kiro/settings/mcp.json + ~/.kiro/settings/mcp.json]
Loading

Recommendation

Ship now. CI is green, the board-approved scope is fully delivered, and the panel found no blocking or recommended-severity issues -- only three minor polish nits, none of which gate merge. The highest-signal follow-up to track post-merge is the test-coverage hardening (assert 0o600 perms + field-omission), which can land as a fast follow. The human maintainer performs the protected-branch merge.


Full per-persona findings

Python Architect

  • [nit] Module-level functions in kiro_hook_integrator.py reach into HookIntegrator privates (_rewrite_hooks_data, _get_package_name, check_collision, try_adopt_identical) by receiving integrator as a positional arg at src/apm_cli/integration/kiro_hook_integrator.py.
    This matches the established integrator pattern and was a deliberate extraction to stay under the source-length guard, so it is acceptable; documenting the seam (or a small protocol) would make the coupling intentional rather than incidental. The TargetProfile/PrimitiveMapping registry entry and the kiro_steering addition to RULE_FORMATS are exactly on-pattern.

CLI Logging Expert

  • [nit] configure_mcp_server wraps the body in except Exception and emits a generic _rich_error, logging the actual cause only at logger.debug at src/apm_cli/adapters/client/kiro.py.
    Consistent with the Copilot adapter it subclasses, and ASCII status symbols / _rich_success / _rich_error are used correctly throughout. A verbose-tier cause hint would speed triage but is not required.

DevX UX Expert

No findings. Target selection is wired through explicit --target kiro, the apm.yml targets: field, and .kiro/ auto-detection, with a clear get_target_description string. Project-scope writes are gated on an existing .kiro/ directory, so APM never creates Kiro output in a workspace that has not opted in -- the right default for a new harness.

Supply Chain Security

No findings. Every generated path passes through ensure_path_within (hook docs and copied scripts), the MCP config is written then os.chmod(..., 0o600), and ${VAR} placeholders are preserved rather than resolved to host values. Tests assert literal secrets never appear in the serialized config ("literal-secret" not in json.dumps(config)), closing the credential-materialization risk for both remote headers and stdio env.

OSS Growth Hacker

No findings. A new first-class IDE target is a direct adoption surface, and crediting @TibRib for the #702 layout spec converts community input into a visible contributor win. Recommend surfacing Kiro support in the release announcement.

Test Coverage Expert

  • [nit] No assertion that .kiro/settings/mcp.json is written with 0o600 permissions, and no test that autoApprove/disabledTools are omitted when the registry does not supply them at tests/unit/test_kiro_mcp.py.
    Coverage is otherwise comprehensive: test_kiro_target_profile_matches_ratified_layout, test_kiro_steering_maps_apply_to_to_file_match, test_kiro_steering_defaults_unscoped_instructions_to_always, test_kiro_hooks_expand_each_apm_hook_to_individual_json, test_kiro_hooks_skip_when_project_has_no_kiro_dir, plus remote/stdio/user-scope/stale/disabled MCP cases. The gaps are polish, not silent-drift risk.

Auth Expert

No findings. Activated because the diff touches MCP header/env ${VAR} handling (adapters/client/kiro.py, mcp_integrator_install.py). Confirmed no token is materialized into written config: remote headers and stdio env keep ${VAR} placeholders, the config file is 0o600, and negative assertions in test_kiro_mcp.py prove host secrets do not reach disk. No auth.py/token_manager.py/host-selection surfaces were touched.

Doc Writer

No findings. The new target ships its required docs: a row in the targets matrix and the primitive compatibility matrix (reference/targets-matrix.md, concepts/primitives-and-targets.md), a dedicated ## kiro reference section with file conventions and the v1 scope fence, and a Kiro IDE guide block in integrations/ide-tool-integration.md. Both Copilot inline nits (hook filename pattern, changelog (#1741) suffix) are already correct in the current revision.

Performance Expert -- inactive

Inactive: this is an additive target transform. The diff touches no deps/**, cache/**, install/phases/**, install/pipeline.py, install/resolve.py, or transport code, and claims no perf win.

This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_with_followups

Kiro IDE joins as a first-class APM target, extending multi-harness reach with steering, skills, hooks, and MCP support in the .kiro/ layout.

cc @sergio-sisternes-epam -- a fresh advisory pass is ready for your review.

All eight panelists converge on the same signal: this is a clean, bounded target addition that follows established patterns. No high-severity findings were raised. The supply-chain-security expert flags the autoApprove passthrough as a widened surface, but explicitly notes it is not a Kiro-specific regression because it mirrors existing adapter behavior. The doc-writer raises a single recommended-tier factual verification: whether Kiro natively reads root AGENTS.md. That is worth confirming, but low-risk because the code already materializes .kiro/steering/ as the primary delivery path. The test-coverage expert identifies a missing regression trap for the unsupported-transport ValueError; that is a real DevX gap and should be closed soon, but the failure path exists and matches sibling adapters.

Strategically, this PR strengthens APM's positioning as the multi-harness package manager that tracks the IDE ecosystem faster than incumbents. Adding Kiro support early, while the IDE is still establishing its community, earns first-mover credibility and validates the target abstraction layer that PRD and MANIFESTO commit to.

The scope fence, Kiro IDE v1 only with CLI divergence deferred, is a sound product call. It keeps the PR reviewable and avoids speculative surface area.

Aligned with: portable by manifest: Kiro primitives materialize from the same apm.yml manifest; secure by default: MCP config uses 0o600, containment, and slug sanitization while autoApprove remains cross-adapter debt; multi-harness support: Kiro proves the target abstraction extends without architectural churn; OSS community driven: @TibRib supplied production-grade target details; pragmatic as npm: apm install --target kiro uses the familiar target flow.

Growth signal. Kiro is a launch-beat opportunity. APM can position itself as the fastest-moving multi-harness package manager by announcing Kiro support while the IDE is still gaining adoption. Credit to @TibRib in release comms reinforces the contributor flywheel.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 3 Clean subclass addition; no architectural faults. Three optional nits on duplication and typing.
CLI Logging Expert 0 0 1 CLI logging patterns are consistent; hook display delegates through payloads. One minor error message could name the MCP server key.
DevX UX Expert 0 0 2 Target UX is coherent; unsupported-transport error wording is clear and actionable.
Supply Chain Security Expert 0 1 1 Kiro adapter follows established security patterns: path containment, 0o600 perms, slug sanitization. autoApprove passthrough is a cross-adapter hardening opportunity.
OSS Growth Hacker 0 0 2 Kiro as a first-class target strengthens the multi-harness story; no conversion regressions found.
Auth Expert 0 0 1 No auth regression: runtime env placeholders are preserved, config is chmod 0o600, and no token bypass was introduced.
Doc Writer 0 1 2 Kiro docs are mostly accurate and follow the target pattern; one AGENTS.md-read claim needs verification plus minor wording polish.
Test Coverage Expert 0 1 0 Kiro happy paths are covered; missing unit regression test for unsupported remote transport ValueError in KiroClientAdapter.
Performance Expert 0 0 2 No hot-path regression; adds O(1) stat calls to detection and bounded per-action file writes to materialization.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Top 5 follow-ups

  1. [Test Coverage Expert] Add unit test for unsupported remote transport ValueError in KiroClientAdapter -- Missing regression trap on a user-facing error path. The evidence block confirms no test exists; adding one prevents silent message-shape drift.
  2. [Supply Chain Security Expert] Track cross-adapter policy follow-up for autoApprove passthrough -- Each new target widens the surface for registry-supplied autoApprove to pre-approve tool invocations without policy consent. A single follow-up issue covering all adapters is the right scope.
  3. [Doc Writer] Verify or soften the claim that Kiro reads root AGENTS.md -- Code delivers via .kiro/steering/; the AGENTS.md claim is unverified against Kiro docs and could mislead producers into expecting dual consumption.
  4. [OSS Growth Hacker] Reframe CHANGELOG entry to lead with user benefit: apm install --target kiro -- CHANGELOG is the primary signal for users scanning releases; foregrounding the command they run improves conversion from skimmer to adopter.
  5. [Supply Chain Security Expert] Consider chmod 0o600 on .kiro/hooks/*.json files -- Hook files may contain runCommand strings; tighter permissions reduce local tampering risk on shared workstations, matching the MCP config hardening.

Architecture

classDiagram
    direction LR
    class MCPClientAdapter {
      <<Abstract>>
      +get_config_path() str
      +get_current_config() dict
      +update_config(updates) bool
      +configure_mcp_server(...) bool
    }
    class CopilotClientAdapter {
      <<ConcreteAdapter>>
      +_format_server_config(...) dict
      +_supports_runtime_env_substitution bool
    }
    class KiroClientAdapter {
      <<ConcreteAdapter>>
      +get_config_path() str
      +get_current_config() dict
      +update_config(updates) bool
      +configure_mcp_server(...) bool
      +_format_server_config(...) dict
    }
    class TargetProfile {
      <<ValueObject>>
      +name str
      +root_dir str
      +primitives dict
    }
    class HookIntegrator {
      +integrate_hooks_for_target(...) HookIntegrationResult
    }
    class InstructionIntegrator {
      +_convert_to_kiro_steering(content) str
    }
    MCPClientAdapter <|-- CopilotClientAdapter
    CopilotClientAdapter <|-- KiroClientAdapter
    HookIntegrator ..> TargetProfile : reads
    InstructionIntegrator ..> TargetProfile : transforms
    class KiroClientAdapter:::touched
    class TargetProfile:::touched
    class HookIntegrator:::touched
    class InstructionIntegrator:::touched
    classDef touched fill:#fff3b0,stroke:#d47600
Loading
flowchart TD
    A[apm install target kiro] --> B[TargetProfile kiro]
    B --> C[InstructionIntegrator]
    B --> D[skill_standard copy]
    B --> E[kiro_hook_integrator]
    B --> F[KiroClientAdapter]
    C --> G[.kiro/steering/*.md]
    D --> H[.kiro/skills/*/SKILL.md]
    E --> I[.kiro/hooks/*.json]
    F --> J[.kiro/settings/mcp.json]
    F --> K[~/.kiro/settings/mcp.json]
Loading

Recommendation

Merge as-is. The PR is architecturally sound, security-consistent, well-tested on happy paths, and strategically valuable. The recommended follow-ups, especially the unsupported-transport unit test and cross-adapter autoApprove policy issue, should be tracked as immediate post-merge work but do not represent regressions or user-facing risk that should hold this contribution.


Full per-persona findings

Python Architect

  • [nit] KiroClientAdapter duplicates CopilotClientAdapter logic for update_config, get_current_config, and configure_mcp_server at src/apm_cli/adapters/client/kiro.py:44
    KiroClientAdapter overrides JSON-read/write/merge logic already present in its parent. The only delta is path behavior, the opt-in gate, and os.chmod. Extracting the common merge loop into the base class with a post-write hook would reduce drift, but this is a minor DRY nit at current scope.
    Suggested: Consider a future _post_write_hook(path) for chmod while sharing the read-merge-write cycle.
  • [nit] Kiro steering repeats the existing lazy yaml import pattern at src/apm_cli/integration/instruction_integrator.py:629
    _convert_to_kiro_steering imports yaml inside the method, matching nearby rule converters. This is acceptable but worth keeping consistent if these transforms are later extracted.
  • [nit] configure_mcp_server parameters are untyped at src/apm_cli/adapters/client/kiro.py:180
    The public adapter method omits type annotations for its parameters. The base signature is currently loose too, so this is style debt rather than a PR correctness issue.
    Suggested: If the adapter surface is tightened later, align the Kiro override with the base method's typed signature.

CLI Logging Expert

  • [nit] Catch-all Kiro MCP error message does not name the config_key that failed at src/apm_cli/adapters/client/kiro.py:219
    When configure_mcp_server catches an exception it logs details at debug but prints a generic user-facing error. Naming the config_key would help users identify the failing server without verbose logs.
    Suggested: Change to include config_key, e.g. Failed to configure MCP server '<config_key>' for Kiro.

DevX UX Expert

  • [nit] Supported-runtime warning list may grow unwieldy as runtimes are added at src/apm_cli/integration/mcp_integrator.py:942
    The supported runtimes warning list grows with each target and may wrap poorly as the ecosystem expands. Current size is acceptable.
    Suggested: Consider deriving the runtime list dynamically or sorting it if it grows further.
  • [nit] Targets matrix is becoming harder to scan as columns grow at docs/src/content/docs/reference/targets-matrix.md:31
    The Kiro row is accurate, but the matrix now has enough columns that visual scanability is showing existing documentation debt rather than a Kiro-specific problem.

Supply Chain Security Expert

  • [recommended] autoApprove passthrough from registry data lacks policy-layer gating at src/apm_cli/adapters/client/kiro.py:97
    Registry-supplied autoApprove arrays are written directly into Kiro MCP config. This matches other adapters and is not a Kiro-specific regression, but adding a target widens the surface for a malicious package to pre-approve tool invocations.
    Suggested: Track a cross-adapter policy follow-up that warns, strips, or denies autoApprove unless enterprise policy explicitly permits it.
  • [nit] Hook JSON files use default umask permissions at src/apm_cli/integration/kiro_hook_integrator.py:152
    mcp.json is chmod 0o600, but .kiro/hooks/*.json is written with Path.write_text default permissions. Hooks may contain runCommand strings, so tighter permissions would reduce local tampering risk on shared workstations.

OSS Growth Hacker

  • [nit] CHANGELOG entry could lead with user benefit at CHANGELOG.md
    The entry currently emphasizes implementation shape. A user-scannable entry should foreground that Kiro users can now run apm install --target kiro.
    Suggested: Reframe as: Kiro IDE is now a first-class target - apm install --target kiro deploys skills, hooks, and MCP servers into .kiro/.
  • [nit] IDE integration page Kiro section has no link to Kiro itself at docs/src/content/docs/integrations/ide-tool-integration.md
    Kiro is newer than Claude/Cursor/Copilot. A single link helps readers unfamiliar with the IDE orient quickly.
    Suggested: Link the first Kiro mention to https://kiro.dev.

Auth Expert

  • [nit] Header mapping accepts values without explicit string coercion at src/apm_cli/adapters/client/kiro.py:81
    _header_mapping returns header values as provided. Current call sites pass strings, but explicit coercion or documentation would make the boundary clearer if registry data ever carries non-string values.
    Suggested: Consider coercing header values with str(value) or documenting that registry headers must already be strings.

Doc Writer

  • [recommended] Verify the 'Kiro reads root AGENTS.md' claim; the real delivery path is .kiro/steering/ at docs/src/content/docs/producer/compile.md:354
    producer/compile.md lists Kiro among harnesses that read AGENTS.md, while code confirms Kiro instructions are delivered through .kiro/steering/<name>.md. AGENTS.md is produced because compile_family='agents' as a cross-harness fallback, but no test or cited Kiro reference proves Kiro consumes root AGENTS.md.
    Suggested: Confirm against Kiro docs. If unconfirmed, soften prose to name .kiro/steering/ as Kiro's instruction surface and describe AGENTS.md as the cross-harness fallback.
  • [nit] ide-tool-integration says one JSON file per hook; code emits one file per hook action at docs/src/content/docs/integrations/ide-tool-integration.md:252
    kiro_hook_integrator emits one file per action, and hooks-and-commands.md correctly says per hook action. The integration page should use the same phrasing.
    Suggested: Change to one JSON file per hook action.
  • [nit] Kiro CLI scope caveat repeats across multiple pages at docs/src/content/docs/reference/targets-matrix.md:615
    The v1 IDE-only boundary appears in several pages. targets-matrix should be the authoritative target reference, with other pages linking rather than repeating.
    Suggested: Keep the full caveat in targets-matrix and cross-reference it elsewhere.

Test Coverage Expert

  • [recommended] No regression-trap test for unsupported remote transport ValueError raised by KiroClientAdapter at tests/unit/test_kiro_mcp.py
    KiroClientAdapter raises ValueError for unsupported remote transports. That user-facing failure path should have a unit test to preserve the error message shape. Grep of tests/unit/test_kiro_mcp.py found no existing test for this branch.
    Suggested: Add test_remote_unsupported_transport_raises_for_kiro asserting ValueError with Unsupported remote transport in the message.
    Proof (missing at): tests/unit/test_kiro_mcp.py::test_remote_unsupported_transport_raises_for_kiro -- proves: User gets a clear ValueError when configuring Kiro with an unsupported remote transport. [devx]
    with pytest.raises(ValueError, match='Unsupported remote transport'):

Performance Expert

  • [nit] Per-action file materialization produces N filesystem writes vs one merged JSON at src/apm_cli/integration/kiro_hook_integrator.py:153
    Kiro's native one-JSON-per-hook-action model means K hook actions produce K writes under .kiro/hooks/. Typical packages are small and this matches Kiro's documented layout, so it is not a concern today.
  • [nit] Adoption check reads full file content before comparing at src/apm_cli/integration/kiro_hook_integrator.py:153
    The adoption check reads the target file via read_text before comparing with rendered JSON. For these small hook files this is effectively free; a size-first guard would only matter if hook docs became much larger.

This panel is advisory. It does not block merge. Re-apply the panel-review label after addressing feedback to re-run.

danielmeppiel and others added 7 commits June 11, 2026 15:42
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fold remaining apm-review-panel follow-ups for the Kiro target: write the
.kiro MCP config and per-hook docs via atomic_write_text with 0o600 (no
torn-write window), list `kiro` in `apm compile --target` and `apm install
--runtime`/global-scope help, and note .kiro in the lifecycle compile doc.
Adds focused regression tests for AGENTS.md kiro fallback and the install
help surface.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_now

Kiro IDE is now a first-class APM target: one manifest can deploy steering, skills, hooks, and MCP config into the documented .kiro/ layout while preserving the Kiro CLI divergence as a follow-up.

cc @sergio-sisternes-epam -- a fresh advisory pass is ready for your review.

The fresh current-head panel converged after the shepherded folds. The target wiring follows the established registry, adapter, and integrator patterns; the security/auth surface preserves ${VAR} placeholders and clamps config/hook JSON files to 0o600; DevX/docs now list kiro consistently in compile/install help, global MCP docs, target matrices, and the APM guide skill; and the test suite now covers the Kiro help surface, user-scope runtime discovery, MCP file permissions, and both runCommand and askAgent hook conversion paths.

Aligned with: portable by manifest: target: kiro and .kiro/ detection now use the same target-resolution path as existing harnesses; secure by default: MCP credentials stay as runtime placeholders and config/hook JSON writes are restricted; multi-harness support: Kiro joins the existing IDE target matrix without changing other targets; OSS community driven: @TibRib is credited for the ratified layout details and invited to validate.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 0 Kiro uses the established adapter strategy plus extracted hook-integrator module; no architectural concerns.
CLI Logging Expert 0 0 0 Help text and runtime messages are aligned; no new CLI output anti-patterns.
DevX UX Expert 0 0 0 Kiro is discoverable through help, docs, target detection, and user-scope MCP behavior.
Supply Chain Security Expert 0 0 0 Path containment, atomic writes, 0o600, and placeholder preservation are in place.
OSS Growth Hacker 0 0 0 README/docs/changelog surfaces credit the contributor and make Kiro visible to adopters.
Auth Expert 0 0 0 No credential leakage path; env placeholders are preserved for runtime resolution.
Doc Writer 0 0 0 Docs match the implementation and the v1 Kiro IDE scope fence.
Test Coverage Expert 0 0 0 Kiro detection, steering, hooks, MCP, permissions, help text, and user-scope flows are regression-trapped.
Performance Expert 0 0 0 No meaningful install hot-path regression; new work is bounded local integration I/O.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Architecture

classDiagram
    direction LR
    class MCPClientAdapter {
      <<Strategy>>
      +get_config_path() str
      +update_config(config_updates) bool
      +configure_mcp_server(...) bool
    }
    class CopilotClientAdapter {
      <<TemplateMethod>>
      +_format_server_config(...) dict
      +_resolve_environment_variables(...) dict
    }
    class KiroClientAdapter {
      <<ConcreteStrategy>>
      +get_config_path() str
      +get_current_config() dict
      +update_config(config_updates) bool
      +_format_server_config(...) dict
    }
    class HookIntegrator {
      <<Delegation>>
      +integrate_hooks_for_target(...) HookIntegrationResult
    }
    class KiroHookIntegrator {
      <<Module>>
      +integrate_kiro_hooks(...)
      +_kiro_then_from_action(...) dict
    }
    MCPClientAdapter <|-- CopilotClientAdapter
    CopilotClientAdapter <|-- KiroClientAdapter
    HookIntegrator ..> KiroHookIntegrator : delegates Kiro
Loading
flowchart TD
    A["target: kiro"] --> B["TargetProfile .kiro"]
    B --> C["steering transform"]
    B --> D["skills copy"]
    B --> E["hook JSON expansion"]
    B --> F["Kiro MCP adapter"]
    C --> G[".kiro/steering/*.md"]
    D --> H[".kiro/skills/*/SKILL.md"]
    E --> I[".kiro/hooks/*.json 0o600"]
    F --> J[".kiro/settings/mcp.json 0o600"]
Loading

Recommendation

Ship now. The prior follow-ups were folded into this PR, local lint and Kiro regression suites are green, and the fresh panel found no remaining in-scope items. Human merge remains the final gate.


Full per-persona findings

Python Architect

No findings.

CLI Logging Expert

No findings.

DevX UX Expert

No findings.

Supply Chain Security Expert

No findings.

OSS Growth Hacker

No findings.

Auth Expert

No findings.

Doc Writer

No findings.

Test Coverage Expert

No findings.

Performance Expert

No findings.

This panel is advisory. It does not block merge. Re-apply the panel-review label after addressing feedback to re-run.

@danielmeppiel danielmeppiel merged commit 23f2faf into main Jun 11, 2026
9 checks passed
@danielmeppiel danielmeppiel deleted the danielmeppiel/702-kiro-target branch June 11, 2026 15:39
@TibRib

TibRib commented Jun 12, 2026

Copy link
Copy Markdown

Thank you for adding Kiro support!
After updating to 0.20 and attempting the initial APM setup, we however see no mentions of it yet:

> apm init my-app
[...]

Select targets for this project:
  1. [ ] copilot
  2. [ ] claude
  3. [ ] cursor
  4. [ ] opencode
  5. [ ] codex
  6. [ ] gemini
  7. [ ] windsurf
  (no signals detected)

Might be an issue as I do see kiro in most of the cli files...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Kiro Support

3 participants