feat(takt): map the output-contracts facet via takt.facet override - #1812
Merged
Conversation
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>
Owner
Author
|
@dyoshikawa Thank you! |
This was referenced Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Takt has five facet categories —
personas,policies,instructions,knowledge, andoutput-contracts— but rulesync mapped only four. Theoutput-contractsfacet (output structure / report templates) had no rulesync surface. Confirmed against upstream:output-contractsas a real facet under.takt/facets/output-contracts/, used to define output structure independently of agent behavior, and it supports{extends:...}inheritance (same asinstructions,policies,knowledge).output-contractsdoes 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
takt.facetoverride on the rules feature. A rule withtakt: { facet: output-contracts }is emitted to.takt/facets/output-contracts/<stem>.mdinstead of the default.takt/facets/policies/<stem>.md.facetis restricted (via a zod enum) topolicies | output-contracts— the writable, non-persona facets that don't overlap another feature.instructions,personas, andknowledgestay owned by the commands, subagents, and skills features and are intentionally not selectable.takt.name(stem rename) andtakt.extends({extends:...}directive, whichoutput-contractssupports).takt.nameandtakt.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 indocs/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.takt-rule.test.ts(facet redirect, default, composition with name+extends) and an e2e generate case ine2e-takt.spec.ts.docs/reference/file-formats.md(frontmatter example),docs/tools/takt.md(mapping table, knobs, examples), and the syncedskills/rulesync/copy.pnpm cicheckpasses locally (6197 tests).Closes #1786
🤖 Generated with Claude Code