Skip to content

feat(cli): emit rules in Kilo flat builds #868

Description

@blafourcade

Problem

Kilo flat support was delivered by #744 and PR #745, but buildKiloFlatContract() still marks plugin rules/ as unsupported. A framework archive produced by aidd framework build --target kilo --flat therefore omits canonical plugin Rules even though Kilo can load Markdown Rules referenced from kilo.json[c].instructions.

This is separate from #914, which owns direct Kilo-native generation inside a host project. This issue owns flat archive distribution.

Scope

  • Materialize canonical all-files plugin Rules, meaning Rules without paths, as collision-free, plugin-namespaced Markdown under the Kilo Rules location resolved by the Kilo profile.
  • Merge the generated Rule references into the instructions array of the resolved Kilo project configuration.
  • Preserve every pre-existing instructions value and its relative order. Generated entries are appended in deterministic order.
  • Keep repeated builds idempotent: generated files and instruction entries remain stable and are never duplicated.
  • Preserve Rule content and rewrite relative links for the materialized location.
  • Reject a canonical Rule containing paths with an explicit build error that identifies the Rule and its unsupported scope. Never silently drop its scope or broaden it into an all-files Rule.
  • Cover JSON and JSONC configuration, existing instructions, multiple plugins, repeated builds, an unsupported path-scoped Rule, and a flat archive installed into a clean project.

Configuration preservation is semantic: existing values and instruction ordering are preserved, but JSONC comments and formatting may be reserialized.

Acceptance criteria

  • An all-files plugin Rule is emitted under the Kilo Rules location and referenced from the resolved kilo.json[c].instructions.
  • Existing user-owned instructions values remain unchanged and in the same relative order.
  • Generated instruction entries use deterministic, collision-free paths and follow the existing user-owned entries.
  • Rebuilding creates neither duplicate Rule files nor duplicate instruction entries.
  • A Rule containing paths fails the build with a diagnostic naming the Rule and its unsupported scope; it is not emitted or referenced.
  • Relative links in an emitted Rule still resolve after materialization.
  • A supported Kilo runtime discovers and applies the generated all-files Rule from a clean installed archive.

Relations

References

Out of scope

Activity

  1. moved this from Ideation to Todo in AIDD Roadmapon Sep 14, 2026
  2. changed the title [-]feat(cli): emit rules and commands in Kilo flat builds[/-] [+]feat(cli): emit rules in Kilo flat builds[/+] on Sep 14, 2026
  3. blafourcade commented on Sep 14, 2026

    @blafourcade
    ContributorAuthor

    Current Kilo documentation supports the rules target in this issue: Markdown rules referenced from kilo.json[c].instructions. It does not document .kilo/commands as a native Markdown command surface.

    The command half of this issue is therefore speculative. We should not emit an artifact Kilo does not promise to discover, so this issue is being narrowed to Kilo rules only.

    If a product need for Kilo commands is confirmed later, it must be specified separately against Kilo's JavaScript or TypeScript plugin API. This issue remains blocked by #744, which owns the Kilo CLI profile and integration contract.

  4. blafourcade commented on Sep 14, 2026

    @blafourcade
    ContributorAuthor

    Correction: Kilo does document Markdown workflows under .kilo/commands/. The earlier statement that this is not a native command surface was incorrect.

    #868 remains limited to Rules. Its concrete job is to materialize namespaced rule files and merge their AIDD-owned references into the resolved kilo.json[c] instructions array, preserving user-owned entries and JSONC configuration.

    Kilo command distribution remains a separate flat-build capability to scope after #744. It is not excluded because the host lacks support.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    Priority

    None yet

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions