Skip to content

Commit e9c8a60

Browse files
jpicklykclaude
andcommitted
docs: document trait system as orchestration signals in CLAUDE.md
Traits are composable orchestration signals, not merely note requirements. This clarification prevents repeated misframing during architectural analysis (e.g., issue #117 Q3) by documenting all three dimensions: note gates, guidance text, and skill routing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 38ef21b commit e9c8a60

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

CLAUDE.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,31 @@ interfaces/mcp/
6060

6161
**Entry point:** `current/src/main/kotlin/io/github/jpicklyk/mcptask/current/CurrentMain.kt`
6262

63+
## Trait System (Orchestration Signals)
64+
65+
Traits are **composable orchestration signals** declared in `.taskorchestrator/config.yaml` under the `traits:` key. They are NOT merely note requirements. Each trait carries three dimensions:
66+
67+
1. **Note requirements** -- notes with `key`, `role`, `required` that merge into an item's resolved schema and enforce gates
68+
2. **Guidance** -- `guidance` text on each note telling agents HOW to fill it (context, constraints, structure)
69+
3. **Skill routing** -- optional `skill` pointer (e.g., `skill: "migration-review"`) that routes evaluation to a specialized skill
70+
71+
**Resolution flow:** `ToolExecutionContext.resolveSchema(item)` merges trait notes from two sources:
72+
- `defaultTraits` on the schema type definition (always applied to items of that type)
73+
- Per-item `traits` from the item's `properties` JSON bag (applied via `PropertiesHelper.extractTraits()`)
74+
75+
Base schema note keys win on duplicates; first-trait-in-order wins for duplicate trait keys.
76+
77+
**Example:** An item typed `feature-task` with trait `needs-migration-review` gets the base `feature-task` notes PLUS the `migration-assessment` note (queue phase, required, with `migration-review` skill pointer and guidance about SQLite table recreation patterns). The orchestrator sees this merged schema via `get_context(itemId=...)` and routes accordingly -- dispatching a migration-specialized agent or invoking the migration-review skill.
78+
79+
**Key files:**
80+
81+
| What | Path |
82+
|------|------|
83+
| Trait definitions | `.taskorchestrator/config.yaml` -> `traits:` section |
84+
| Schema resolution + trait merging | `current/.../application/tools/ToolExecutionContext.kt` -> `resolveSchema()`, `mergeTraits()` |
85+
| Properties helper | `current/.../application/tools/PropertiesHelper.kt` -> `extractTraits()`, `mergeTraits()` |
86+
| Domain models | `WorkItemSchema.kt` (`defaultTraits`), `NoteSchemaEntry.kt` (`skill`, `guidance`) |
87+
6388
## Tight Coupling Areas
6489

6590
### ToolExecutionContext

0 commit comments

Comments
 (0)