Skip to content

feat(zcode): add ZCode as supported tool#1209

Open
fyeeme wants to merge 6 commits into
Fission-AI:mainfrom
fyeeme:feat/zcode-support
Open

feat(zcode): add ZCode as supported tool#1209
fyeeme wants to merge 6 commits into
Fission-AI:mainfrom
fyeeme:feat/zcode-support

Conversation

@fyeeme

@fyeeme fyeeme commented Jun 14, 2026

Copy link
Copy Markdown

Register ZCode in the AI tools registry and provide a command adapter so openspec init --tools zcode generates per-project artifacts under a single .zcode/ root (no split across .agents + .zcode):

  • Skills: .zcode/skills/openspec-*/SKILL.md (ZCode-native discovery path, highest priority among project-level skill roots)
  • Commands: .zcode/commands/opsx/.md (Claude-compatible frontmatter)

Both .zcode/skills and .agents/skills are valid ZCode discovery roots (verified from ZCode source: skillRootsForBase registers them in pairs); we use .zcode to keep all artifacts under one directory.

ZCode auto-detection triggers on .zcode or .agents at the project root.

Verification:

  • pnpm build passes (TypeScript compiles clean)
  • pnpm lint passes (no new warnings)
  • pnpm test: 1661 tests pass (no regressions)
  • E2E: openspec init --tools zcode --profile core produces 5 skills + 5 commands, all under .zcode/ (no .agents created)

Summary by CodeRabbit

  • New Features
    • Added ZCode as a supported tool integration and enabled it via tool configuration.
    • Auto-detect ZCode projects when a .zcode directory is present.
    • Generate ZCode command output under .zcode/commands/opsx/ (including YAML frontmatter), with proper escaping/quoting behavior.
  • Documentation
    • Updated supported tools documentation to list ZCode and its tool ID.
  • Tests
    • Expanded test coverage for ZCode detection and init/update command & skill generation.

Register ZCode in the AI tools registry and provide a command adapter
so `openspec init --tools zcode` generates per-project artifacts under
a single .zcode/ root (no split across .agents + .zcode):

- Skills: .zcode/skills/openspec-*/SKILL.md (ZCode-native discovery path,
  highest priority among project-level skill roots)
- Commands: .zcode/commands/opsx/<id>.md (Claude-compatible frontmatter)

Both .zcode/skills and .agents/skills are valid ZCode discovery roots
(verified from ZCode source: skillRootsForBase registers them in pairs);
we use .zcode to keep all artifacts under one directory.

ZCode auto-detection triggers on .zcode or .agents at the project root.

Verification:
- pnpm build passes (TypeScript compiles clean)
- pnpm lint passes (no new warnings)
- pnpm test: 1661 tests pass (no regressions)
- E2E: `openspec init --tools zcode --profile core` produces
  5 skills + 5 commands, all under .zcode/ (no .agents created)
@fyeeme fyeeme requested a review from TabishB as a code owner June 14, 2026 05:54
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 43f4c633-7846-4afe-b56b-2aec47ab72ef

📥 Commits

Reviewing files that changed from the base of the PR and between ea1ec4f and 5f0c6db.

📒 Files selected for processing (4)
  • docs/supported-tools.md
  • src/core/command-generation/registry.ts
  • src/core/config.ts
  • test/core/available-tools.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/core/config.ts
  • docs/supported-tools.md
  • test/core/available-tools.test.ts

📝 Walkthrough

Walkthrough

Adds ZCode as a supported AI tool with a command adapter that generates YAML-frontmatter command files, registry and configuration wiring, documentation updates, tool-detection coverage, and initialization/update workflow tests.

Changes

ZCode Tool Integration

Layer / File(s) Summary
ZCode adapter implementation with YAML escaping
src/core/command-generation/adapters/zcode.ts, test/core/command-generation/adapters.test.ts
Implements YAML escaping, tag-array formatting, .zcode/commands/opsx/<id>.md paths, and command frontmatter rendering. Tests cover formatting and escaping edge cases.
Configuration, registry, and tool detection
src/core/config.ts, src/core/command-generation/registry.ts, test/core/command-generation/registry.test.ts, test/core/available-tools.test.ts
Adds ZCode configuration, registers zcodeAdapter, and tests registry lookups and .zcode-based detection alongside .agents behavior.
Documentation and workflow validation
docs/supported-tools.md, test/core/init.test.ts, test/core/update.test.ts
Documents ZCode paths and tool IDs, and tests initialization and update generation under .zcode without creating .agents.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: tabishb, jjxyxsjr, xianzhetm

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding ZCode as a supported tool.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@alfred-openspec alfred-openspec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the scoped ZCode support. The adapter/config shape looks plausible and a local smoke generated the expected .zcode/skills/... plus .zcode/commands/opsx/*.md files, but this adds a new supported tool without focused regression coverage.

Please add tests that lock down the ZCode contract before merge: adapter path/frontmatter escaping, registry presence, .zcode + .agents auto-detection semantics, and init/update generation staying under .zcode without creating .agents. The existing broad tests pass, but they do not protect the new adapter path/detection behavior.

young added 4 commits June 15, 2026 01:00
ZCode's detectionPaths included '.agents', a generic directory used by
many agent frameworks. A bare '.agents' at the project root caused
false-positive ZCode detection (mirroring the Copilot bare-.github
problem the codebase already guards against).

Drop the detectionPaths override so ZCode is detected solely via its
strongly-identifying skillsDir '.zcode'. Add tests locking the new
contract: a bare '.agents' must not trigger detection, and '.agents'
co-located with '.zcode' must not suppress real detection.
Add focused coverage for the ZCode command adapter that the existing
broad tests did not protect:

- getFilePath lands under .zcode/commands/opsx/<id>.md and never
  references .agents
- formatFile emits name/description/category/tags frontmatter
- YAML escaping across all branches: colons/quotes/newlines (quoted
  values), special chars in name/category, per-tag quoting, plus the
  previously uncovered backslash-doubling and leading/trailing
  whitespace branches
Verify the ZCode adapter is registered in CommandAdapterRegistry so
openspec init/update can resolve it via get/getAll/has. The existing
registry tests only sampled a few tools, so a future refactor that
drops the zcode registration would have passed silently.
End-to-end coverage that init and update generate ZCode skills and
commands under .zcode/ and never create a .agents directory. The
adapter path/detection unit tests alone cannot catch a generation-time
regression that writes outside .zcode, so this asserts the contract on
disk for both entry points.
@fyeeme

fyeeme commented Jun 14, 2026

Copy link
Copy Markdown
Author

Unit tests have been added and all passed. The configuration of the zcode directory has also been fixed. @alfred-openspec

@alfred-openspec alfred-openspec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the quick cleanup. I rechecked the updated head: detection is now scoped to .zcode, the new adapter/registry/init/update coverage is in place, and the focused local tests passed. The remaining YAML helper dedupe is already tracked separately in #1204/#1205, so I do not think it should block this adapter.

# Conflicts:
#	docs/supported-tools.md
#	test/core/available-tools.test.ts
#	test/core/command-generation/adapters.test.ts
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.

3 participants