Skip to content

feat(takt): map the output-contracts facet via takt.facet override - #1812

Merged
dyoshikawa merged 2 commits into
mainfrom
resolve-scrap-issue-1786-takt-output-contracts
Jun 10, 2026
Merged

feat(takt): map the output-contracts facet via takt.facet override#1812
dyoshikawa merged 2 commits into
mainfrom
resolve-scrap-issue-1786-takt-output-contracts

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Background

Takt has five facet categories — personas, policies, instructions, knowledge, and output-contracts — but rulesync mapped only four. The output-contracts facet (output structure / report templates) had no rulesync surface. Confirmed against upstream:

  • Takt's faceted-prompting docs list output-contracts as a real facet under .takt/facets/output-contracts/, used to define output structure independently of agent behavior, and it supports {extends:...} inheritance (same as instructions, policies, knowledge).

output-contracts does not correspond to a generic rulesync feature (the four existing facets each map 1:1 to rules/commands/subagents/skills), so this adds a Takt-specific opt-in as the issue suggested.

Changes

  • Add a takt.facet override on the rules feature. A rule with takt: { facet: output-contracts } is emitted to .takt/facets/output-contracts/<stem>.md instead of the default .takt/facets/policies/<stem>.md.
  • facet is restricted (via a zod enum) to policies | output-contracts — the writable, non-persona facets that don't overlap another feature. instructions, personas, and knowledge stay owned by the commands, subagents, and skills features and are intentionally not selectable.
  • Composes cleanly with takt.name (stem rename) and takt.extends ({extends:...} directive, which output-contracts supports).
  • Generate-side authoring control. Like takt.name and takt.extends, the facet selection is not reconstructed on import — Takt facet files are plain Markdown with no frontmatter, and Takt import is already unsupported by design (documented in docs/tools/takt.md). This keeps the change consistent with the existing Takt surface rather than introducing an asymmetric round-trip or a policies/output-contracts filename collision within the single rules feature.
  • Tests: unit tests in takt-rule.test.ts (facet redirect, default, composition with name+extends) and an e2e generate case in e2e-takt.spec.ts.
  • Docs: docs/reference/file-formats.md (frontmatter example), docs/tools/takt.md (mapping table, knobs, examples), and the synced skills/rulesync/ copy.

pnpm cicheck passes locally (6197 tests).

Closes #1786

🤖 Generated with Claude Code

cm-dyoshikawa and others added 2 commits June 9, 2026 23:13
Takt has five facet categories but rulesync mapped only four; the
output-contracts facet (output structure / report templates) had no rulesync
surface. output-contracts does not correspond to a generic rulesync feature, so
add a Takt-specific opt-in: a takt.facet override on the rules feature.

- A rule with takt: { facet: output-contracts } is emitted to
  .takt/facets/output-contracts/ instead of the default .takt/facets/policies/
- facet is restricted to policies | output-contracts (the writable non-persona
  facets that overlap with no other feature); instructions/personas/knowledge
  stay owned by commands/subagents/skills
- Composes with takt.name and takt.extends (output-contracts supports
  {extends:...} inheritance per Takt docs)
- Like takt.name/takt.extends, facet is a generate-side authoring control:
  Takt facet files carry no frontmatter, so import does not reconstruct it
  (consistent with Takt's existing import-unsupported design)
- Unit tests, an e2e generate case, and docs (file-formats.md, tools/takt.md)

Closes #1786

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Address low-severity review findings on PR #1812:
- Expand the TaktRule JSDoc to state explicitly that import only scans the
  default policies facet and files under output-contracts/ are not imported
- Remove the unnecessary Record<string, unknown> casts in the new facet tests
  now that takt.facet is a typed frontmatter field

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dyoshikawa
dyoshikawa merged commit 5b9cf7d into main Jun 10, 2026
8 checks passed
@dyoshikawa

Copy link
Copy Markdown
Owner Author

@dyoshikawa Thank you!

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.

Follow up Takt upstream updates: map the output-contracts facet

2 participants