orchestr8 2.6.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.blueprint/agents/AGENT_BA_CASS.md +2 -112
- package/.blueprint/agents/AGENT_DEVELOPER_CODEY.md +1 -40
- package/.blueprint/agents/AGENT_SPECIFICATION_ALEX.md +1 -40
- package/.blueprint/agents/AGENT_TESTER_NIGEL.md +3 -51
- package/.blueprint/agents/GUARDRAILS.md +42 -0
- package/.blueprint/features/feature_compressed-feedback/FEATURE_SPEC.md +136 -0
- package/.blueprint/features/feature_compressed-feedback/IMPLEMENTATION_PLAN.md +40 -0
- package/.blueprint/features/feature_lazy-business-context/FEATURE_SPEC.md +140 -0
- package/.blueprint/features/feature_lazy-business-context/IMPLEMENTATION_PLAN.md +54 -0
- package/.blueprint/features/feature_model-native-features/FEATURE_SPEC.md +174 -0
- package/.blueprint/features/feature_model-native-features/IMPLEMENTATION_PLAN.md +45 -0
- package/.blueprint/features/feature_shared-guardrails/FEATURE_SPEC.md +119 -0
- package/.blueprint/features/feature_shared-guardrails/IMPLEMENTATION_PLAN.md +34 -0
- package/.blueprint/features/feature_shared-guardrails/story-extract-guardrails.md +60 -0
- package/.blueprint/features/feature_shared-guardrails/story-update-init-commands.md +63 -0
- package/.blueprint/features/feature_slim-agent-prompts/FEATURE_SPEC.md +145 -0
- package/.blueprint/features/feature_slim-agent-prompts/IMPLEMENTATION_PLAN.md +87 -0
- package/.blueprint/features/feature_slim-agent-prompts/story-create-runtime-prompt-template.md +59 -0
- package/.blueprint/features/feature_slim-agent-prompts/story-create-slim-agent-prompts.md +65 -0
- package/.blueprint/features/feature_slim-agent-prompts/story-skill-integration.md +53 -0
- package/.blueprint/features/feature_smart-story-routing/FEATURE_SPEC.md +147 -0
- package/.blueprint/features/feature_smart-story-routing/IMPLEMENTATION_PLAN.md +73 -0
- package/.blueprint/features/feature_template-extraction/FEATURE_SPEC.md +134 -0
- package/.blueprint/features/feature_template-extraction/IMPLEMENTATION_PLAN.md +46 -0
- package/.blueprint/features/feature_upstream-summaries/FEATURE_SPEC.md +150 -0
- package/.blueprint/features/feature_upstream-summaries/IMPLEMENTATION_PLAN.md +70 -0
- package/.blueprint/prompts/TEMPLATE.md +65 -0
- package/.blueprint/prompts/alex-runtime.md +48 -0
- package/.blueprint/prompts/cass-runtime.md +45 -0
- package/.blueprint/prompts/codey-implement-runtime.md +50 -0
- package/.blueprint/prompts/codey-plan-runtime.md +46 -0
- package/.blueprint/prompts/nigel-runtime.md +46 -0
- package/.blueprint/templates/STORY_TEMPLATE.md +96 -0
- package/.blueprint/templates/TEST_TEMPLATE.md +76 -0
- package/README.md +94 -18
- package/SKILL.md +180 -80
- package/package.json +2 -2
- package/src/business-context.js +91 -0
- package/src/classifier.js +173 -0
- package/src/feedback.js +47 -17
- package/src/handoff.js +148 -0
- package/src/index.js +51 -1
- package/src/tools/index.js +27 -0
- package/src/tools/prompts.js +45 -0
- package/src/tools/schemas.js +38 -0
- package/src/tools/validation.js +83 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Implementation Plan - Lazy Business Context Loading
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Implement lazy loading of business context by adding a detection function that scans feature specs for `.business_context` or `business_context/` references. Update the orchestrator to store the detection result in the queue and modify SKILL.md agent prompts to conditionally include the business context directive based on agent name (Alex always gets it) and detection/override flag state.
|
|
6
|
+
|
|
7
|
+
## Files to Create/Modify
|
|
8
|
+
|
|
9
|
+
| Path | Action | Purpose |
|
|
10
|
+
|------|--------|---------|
|
|
11
|
+
| `src/business-context.js` | Create | Detection logic and context inclusion functions |
|
|
12
|
+
| `src/orchestrator.js` | Modify | Integrate detection during queue initialization |
|
|
13
|
+
| `SKILL.md` | Modify | Update agent prompts with conditional business context |
|
|
14
|
+
| `bin/cli.js` | Modify | Add `--include-business-context` flag parsing |
|
|
15
|
+
|
|
16
|
+
## Implementation Steps
|
|
17
|
+
|
|
18
|
+
1. **Create `src/business-context.js` module**
|
|
19
|
+
- Export `needsBusinessContext(featureSpecContent)` - returns boolean based on string matching
|
|
20
|
+
- Export `parseIncludeBusinessContextFlag(args)` - returns boolean for flag presence
|
|
21
|
+
- Export `shouldIncludeBusinessContext(agentName, detected, overrideFlag)` - determines if agent gets context
|
|
22
|
+
- Export `generateBusinessContextDirective(includeContext)` - returns directive string or empty
|
|
23
|
+
- Tests covered: T-DL-1 through T-DL-5, T-OF-1, T-AE-1 through T-AE-5, T-CI-1, T-CI-2
|
|
24
|
+
|
|
25
|
+
2. **Update `src/orchestrator.js` queue structure**
|
|
26
|
+
- Modify `setCurrent()` to accept optional `needsBusinessContext` parameter
|
|
27
|
+
- Add field to `current` object: `needsBusinessContext: boolean`
|
|
28
|
+
- Tests covered: T-CI-3, T-CI-4
|
|
29
|
+
|
|
30
|
+
3. **Update `bin/cli.js` argument parsing**
|
|
31
|
+
- Add `--include-business-context` to recognized flags
|
|
32
|
+
- Pass flag value to orchestrator when initializing queue
|
|
33
|
+
- Tests covered: T-OF-1, T-OF-4
|
|
34
|
+
|
|
35
|
+
4. **Integrate detection in pipeline setup (Step 5)**
|
|
36
|
+
- Read feature spec content when initializing queue
|
|
37
|
+
- Call `needsBusinessContext()` on content
|
|
38
|
+
- Apply override flag if present
|
|
39
|
+
- Store result in queue `current.needsBusinessContext`
|
|
40
|
+
- Tests covered: T-INT-1, T-INT-2, T-INT-3
|
|
41
|
+
|
|
42
|
+
5. **Update SKILL.md agent prompts conditionally**
|
|
43
|
+
- Add conditional note in Step 6 (Alex): "Business Context: .business_context/" always included
|
|
44
|
+
- Add conditional note in Steps 7-10: "Business Context: .business_context/" only if `needsBusinessContext: true`
|
|
45
|
+
- Document new `--include-business-context` flag in Invocation section
|
|
46
|
+
- Tests covered: T-CI-1, T-CI-2, T-AE-1 through T-AE-3
|
|
47
|
+
|
|
48
|
+
6. **Add exports to `src/index.js`**
|
|
49
|
+
- Export business-context module functions for external use
|
|
50
|
+
|
|
51
|
+
## Risks/Questions
|
|
52
|
+
|
|
53
|
+
- **Risk**: Feature specs that need business context but don't explicitly cite it will miss context. Mitigation: The `--include-business-context` override flag provides escape hatch.
|
|
54
|
+
- **Question**: Should detection log when it skips business context for debugging? Recommend: Add optional verbose logging but default to silent.
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Feature Specification — Model Native Features
|
|
2
|
+
|
|
3
|
+
## 1. Feature Intent
|
|
4
|
+
**Why this feature exists.**
|
|
5
|
+
|
|
6
|
+
- Claude and other LLMs have native features that are more token-efficient than text equivalents
|
|
7
|
+
- System prompts are processed differently than user messages (potentially lower cost)
|
|
8
|
+
- Tool use provides structured outputs without parsing overhead
|
|
9
|
+
- Leveraging these features can significantly reduce token usage and improve reliability
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 2. Scope
|
|
14
|
+
### In Scope
|
|
15
|
+
- Use system prompts for static agent context (specs, guardrails)
|
|
16
|
+
- Use tool definitions for structured outputs (feedback, handoff summaries)
|
|
17
|
+
- Investigate prompt caching for repeated context
|
|
18
|
+
- Document model-specific optimizations
|
|
19
|
+
|
|
20
|
+
### Out of Scope
|
|
21
|
+
- Changing pipeline logic
|
|
22
|
+
- Supporting multiple LLM providers (Claude-focused initially)
|
|
23
|
+
- Real-time model switching
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 3. Actors Involved
|
|
28
|
+
|
|
29
|
+
| Actor | Native Feature Usage |
|
|
30
|
+
|-------|---------------------|
|
|
31
|
+
| All Agents | System prompt for static context |
|
|
32
|
+
| All Agents | Tool use for structured outputs |
|
|
33
|
+
| Pipeline | Prompt caching for repeated context |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 4. Behaviour Overview
|
|
38
|
+
|
|
39
|
+
### System Prompts for Static Context
|
|
40
|
+
|
|
41
|
+
**Current approach:**
|
|
42
|
+
```
|
|
43
|
+
User: You are Alex, the System Specification Agent.
|
|
44
|
+
Read your full specification from: .blueprint/agents/AGENT_SPECIFICATION_ALEX.md
|
|
45
|
+
...
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Native approach:**
|
|
49
|
+
```
|
|
50
|
+
System: [Agent spec content loaded here - potentially cached/cheaper]
|
|
51
|
+
User: Create a feature specification for "user-auth".
|
|
52
|
+
Inputs: ...
|
|
53
|
+
Outputs: ...
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Tool Use for Structured Outputs
|
|
57
|
+
|
|
58
|
+
**Current approach:**
|
|
59
|
+
```
|
|
60
|
+
Output your feedback as:
|
|
61
|
+
FEEDBACK: { "rating": N, "issues": [...], "recommendation": "..." }
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Native approach:**
|
|
65
|
+
```javascript
|
|
66
|
+
tools: [{
|
|
67
|
+
name: "submit_feedback",
|
|
68
|
+
description: "Submit quality rating for prior stage",
|
|
69
|
+
input_schema: {
|
|
70
|
+
type: "object",
|
|
71
|
+
properties: {
|
|
72
|
+
rating: { type: "number", minimum: 1, maximum: 5 },
|
|
73
|
+
issues: { type: "array", items: { type: "string" } },
|
|
74
|
+
recommendation: { enum: ["proceed", "pause", "revise"] }
|
|
75
|
+
},
|
|
76
|
+
required: ["rating", "issues", "recommendation"]
|
|
77
|
+
}
|
|
78
|
+
}]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Prompt Caching
|
|
82
|
+
|
|
83
|
+
- Cache static content (agent specs, guardrails, templates)
|
|
84
|
+
- Reduce repeated token transmission
|
|
85
|
+
- Leverage Claude's prompt caching feature when available
|
|
86
|
+
|
|
87
|
+
**Key outcomes:**
|
|
88
|
+
- Reduced token costs for static content
|
|
89
|
+
- More reliable structured outputs (no parsing errors)
|
|
90
|
+
- Faster responses with cached prompts
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 5. State & Lifecycle Interactions
|
|
95
|
+
|
|
96
|
+
- No pipeline state changes
|
|
97
|
+
- Tool responses integrated into existing feedback flow
|
|
98
|
+
- Caching is transparent to pipeline logic
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 6. Rules & Decision Logic
|
|
103
|
+
|
|
104
|
+
| Rule | Description |
|
|
105
|
+
|------|-------------|
|
|
106
|
+
| System prompt for static | Agent specs, guardrails go in system prompt |
|
|
107
|
+
| User prompt for dynamic | Task-specific instructions in user message |
|
|
108
|
+
| Tools for structure | Any JSON output should use tool definitions |
|
|
109
|
+
| Cache when possible | Repeated context should leverage caching |
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 7. Dependencies
|
|
114
|
+
|
|
115
|
+
- Claude API access with system prompt support
|
|
116
|
+
- Tool use capability in Task tool
|
|
117
|
+
- Prompt caching feature (if available)
|
|
118
|
+
- SKILL.md restructured for system/user prompt split
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## 8. Non-Functional Considerations
|
|
123
|
+
|
|
124
|
+
- **Performance:** Significant token reduction (system prompts may be cached/cheaper)
|
|
125
|
+
- **Reliability:** Tool use eliminates JSON parsing errors
|
|
126
|
+
- **Complexity:** Requires understanding model-specific features
|
|
127
|
+
- **Portability:** Optimizations may be Claude-specific
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 9. Assumptions & Open Questions
|
|
132
|
+
|
|
133
|
+
**Assumptions:**
|
|
134
|
+
- Task tool can be configured to use system prompts
|
|
135
|
+
- Tool definitions can be passed to sub-agents
|
|
136
|
+
- Prompt caching provides meaningful savings
|
|
137
|
+
|
|
138
|
+
**Open Questions:**
|
|
139
|
+
- How does Task tool handle system prompts currently?
|
|
140
|
+
- What's the actual cost difference for system vs user tokens?
|
|
141
|
+
- Is prompt caching available and how is it triggered?
|
|
142
|
+
- Should we abstract these features for multi-model support later?
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 10. Impact on System Specification
|
|
147
|
+
|
|
148
|
+
- Adds model-specific optimization layer
|
|
149
|
+
- May need to document Claude-specific features in system spec
|
|
150
|
+
- Consider portability implications if multi-model support is planned
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 11. Handover to BA (Cass)
|
|
155
|
+
|
|
156
|
+
**Story themes:**
|
|
157
|
+
- Investigate system prompt support in Task tool
|
|
158
|
+
- Restructure SKILL.md for system/user prompt split
|
|
159
|
+
- Define tool schemas for structured outputs (feedback, handoff)
|
|
160
|
+
- Implement tool-based feedback collection
|
|
161
|
+
- Investigate and document prompt caching
|
|
162
|
+
|
|
163
|
+
**Expected story boundaries:**
|
|
164
|
+
- One story for system prompt investigation and implementation
|
|
165
|
+
- One story for tool schema definitions
|
|
166
|
+
- One story for feedback tool integration
|
|
167
|
+
- One story for prompt caching investigation
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## 12. Change Log (Feature-Level)
|
|
172
|
+
| Date | Change | Reason | Raised By |
|
|
173
|
+
|-----|------|--------|-----------|
|
|
174
|
+
| 2026-02-25 | Initial spec | Token efficiency improvement | Claude |
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Implementation Plan - Model Native Features
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
This feature extracts model-native constructs (tool schemas, prompt structure helpers) into reusable modules to improve token efficiency and output reliability. The implementation focuses on creating exportable tool schema definitions and prompt builder utilities that can be integrated into the pipeline's existing feedback and handoff systems.
|
|
6
|
+
|
|
7
|
+
## Files to Create/Modify
|
|
8
|
+
|
|
9
|
+
| Path | Action | Purpose |
|
|
10
|
+
|------|--------|---------|
|
|
11
|
+
| `src/tools/schemas.js` | Create | Define tool schemas for feedback and handoff |
|
|
12
|
+
| `src/tools/validation.js` | Create | Tool input validation utilities |
|
|
13
|
+
| `src/tools/prompts.js` | Create | System/user prompt structure builders |
|
|
14
|
+
| `src/tools/index.js` | Create | Module exports |
|
|
15
|
+
| `src/feedback.js` | Modify | Use schema validation from tools module |
|
|
16
|
+
| `src/handoff.js` | Modify | Add handoff tool schema support |
|
|
17
|
+
| `test/feature_model-native-features.test.js` | Modify | Import from implementation modules |
|
|
18
|
+
|
|
19
|
+
## Implementation Steps
|
|
20
|
+
|
|
21
|
+
1. **Create `src/tools/schemas.js`** - Define `FEEDBACK_TOOL_SCHEMA` and `HANDOFF_TOOL_SCHEMA` as exportable constants matching the test definitions. Include name, description, and input_schema with all property constraints.
|
|
22
|
+
|
|
23
|
+
2. **Create `src/tools/validation.js`** - Implement `validateToolInput(schema, input)` function that validates inputs against schema constraints (type checking, bounds, enums, required fields). Return `{ valid, errors }` format.
|
|
24
|
+
|
|
25
|
+
3. **Create `src/tools/prompts.js`** - Implement `buildPromptMessages(staticContent, dynamicContent)` returning array with system and user messages. Include `cache_control: { type: 'ephemeral' }` on system prompt. Add `identifyCacheableContent(content)` helper.
|
|
26
|
+
|
|
27
|
+
4. **Create `src/tools/index.js`** - Export all schemas, validation, and prompt utilities from single entry point.
|
|
28
|
+
|
|
29
|
+
5. **Update `src/feedback.js`** - Replace inline validation logic with imported `validateToolInput` using `FEEDBACK_TOOL_SCHEMA`. Maintain backward compatibility with existing `parseFeedbackFromOutput` function.
|
|
30
|
+
|
|
31
|
+
6. **Update `src/handoff.js`** - Add `validateHandoffToolInput` function using `HANDOFF_TOOL_SCHEMA`. Keep existing markdown-based validation for backward compatibility.
|
|
32
|
+
|
|
33
|
+
7. **Update tests** - Modify test file to import schemas and validation from `src/tools/` instead of inline definitions. Ensure all 12 test cases pass.
|
|
34
|
+
|
|
35
|
+
8. **Add module to main exports** - Update `src/index.js` to export tools module for external use.
|
|
36
|
+
|
|
37
|
+
9. **Run full test suite** - Verify all tests pass with `node --test`.
|
|
38
|
+
|
|
39
|
+
10. **Document usage** - Add brief note to SKILL.md about tool schema availability (optional, if time permits).
|
|
40
|
+
|
|
41
|
+
## Risks/Questions
|
|
42
|
+
|
|
43
|
+
- **Task tool system prompt support**: The feature spec notes uncertainty about how Task tool handles system prompts. Implementation focuses on schemas/utilities first; actual Task tool integration may require separate investigation.
|
|
44
|
+
- **Prompt caching availability**: Claude's prompt caching feature availability is undetermined. The `cache_control` structure is included but actual caching benefits depend on API support.
|
|
45
|
+
- **Backward compatibility**: Both feedback.js and handoff.js must maintain existing text-based parsing alongside new tool validation to avoid breaking current pipeline.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Feature Specification — Shared Guardrails
|
|
2
|
+
|
|
3
|
+
## 1. Feature Intent
|
|
4
|
+
**Why this feature exists.**
|
|
5
|
+
|
|
6
|
+
- The same guardrails section (~45 lines, ~400 tokens) is duplicated verbatim in all 4 agent specification files
|
|
7
|
+
- This wastes ~1,200 tokens per pipeline run (4 agents reading identical content)
|
|
8
|
+
- Extracting to a shared file reduces token usage and ensures consistency when guardrails are updated
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 2. Scope
|
|
13
|
+
### In Scope
|
|
14
|
+
- Extract guardrails section to `.blueprint/agents/GUARDRAILS.md`
|
|
15
|
+
- Update all agent specs to reference the shared file
|
|
16
|
+
- Ensure agents still read and apply guardrails
|
|
17
|
+
|
|
18
|
+
### Out of Scope
|
|
19
|
+
- Changing the content of guardrails
|
|
20
|
+
- Agent-specific guardrail variations (all agents use same guardrails currently)
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 3. Actors Involved
|
|
25
|
+
|
|
26
|
+
| Actor | Can Do | Cannot Do |
|
|
27
|
+
|-------|--------|-----------|
|
|
28
|
+
| Alex | Read shared guardrails, apply to outputs | Modify guardrails |
|
|
29
|
+
| Cass | Read shared guardrails, apply to outputs | Modify guardrails |
|
|
30
|
+
| Nigel | Read shared guardrails, apply to outputs | Modify guardrails |
|
|
31
|
+
| Codey | Read shared guardrails, apply to outputs | Modify guardrails |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 4. Behaviour Overview
|
|
36
|
+
|
|
37
|
+
**Happy path:**
|
|
38
|
+
1. Pipeline invokes agent (e.g., Alex)
|
|
39
|
+
2. Agent reads slim spec file which references `GUARDRAILS.md`
|
|
40
|
+
3. Agent reads `GUARDRAILS.md` once
|
|
41
|
+
4. Agent applies guardrails to all outputs
|
|
42
|
+
|
|
43
|
+
**Key outcomes:**
|
|
44
|
+
- Identical guardrail enforcement as before
|
|
45
|
+
- ~1,200 fewer tokens per pipeline run
|
|
46
|
+
- Single source of truth for guardrail updates
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 5. State & Lifecycle Interactions
|
|
51
|
+
|
|
52
|
+
- No state changes — this is a structural refactor
|
|
53
|
+
- Agent behaviour is unchanged
|
|
54
|
+
- Pipeline flow is unchanged
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 6. Rules & Decision Logic
|
|
59
|
+
|
|
60
|
+
| Rule | Description |
|
|
61
|
+
|------|-------------|
|
|
62
|
+
| Single source | All agents reference the same `GUARDRAILS.md` file |
|
|
63
|
+
| Read once | Each agent reads guardrails once per invocation |
|
|
64
|
+
| No override | Agent specs cannot override shared guardrails |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 7. Dependencies
|
|
69
|
+
|
|
70
|
+
- All 4 agent specification files must be updated
|
|
71
|
+
- SKILL.md agent prompts may need adjustment if they reference guardrails directly
|
|
72
|
+
- `src/init.js` and `src/update.js` must handle the new file during init/update
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 8. Non-Functional Considerations
|
|
77
|
+
|
|
78
|
+
- **Performance:** Reduces token usage by ~1,200 per run
|
|
79
|
+
- **Maintainability:** Single file to update when guardrails change
|
|
80
|
+
- **Consistency:** Eliminates risk of guardrails drifting between agents
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 9. Assumptions & Open Questions
|
|
85
|
+
|
|
86
|
+
**Assumptions:**
|
|
87
|
+
- All agents will continue to use identical guardrails
|
|
88
|
+
- Agents can follow file references (read file X when spec says "see file X")
|
|
89
|
+
|
|
90
|
+
**Open Questions:**
|
|
91
|
+
- Should agent prompts explicitly include guardrails content, or trust agents to read the reference?
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## 10. Impact on System Specification
|
|
96
|
+
|
|
97
|
+
- Reinforces existing system assumptions (guardrails apply to all agents)
|
|
98
|
+
- No contradiction with system spec
|
|
99
|
+
- No system spec change required
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 11. Handover to BA (Cass)
|
|
104
|
+
|
|
105
|
+
**Story themes:**
|
|
106
|
+
- Extract guardrails to shared file
|
|
107
|
+
- Update agent specs to reference shared file
|
|
108
|
+
- Update init/update commands to handle new file
|
|
109
|
+
|
|
110
|
+
**Expected story boundaries:**
|
|
111
|
+
- One story for file extraction and agent spec updates
|
|
112
|
+
- One story for init/update command changes
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## 12. Change Log (Feature-Level)
|
|
117
|
+
| Date | Change | Reason | Raised By |
|
|
118
|
+
|-----|------|--------|-----------|
|
|
119
|
+
| 2026-02-25 | Initial spec | Token efficiency improvement | Claude |
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Implementation Plan — Shared Guardrails
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Extract the duplicated ~45-line guardrails section from all 4 agent specifications into a new `.blueprint/agents/GUARDRAILS.md` file, then update each agent spec to reference the shared file instead of containing inline guardrails. No code changes required in init.js or update.js since they already copy the entire `agents/` directory.
|
|
6
|
+
|
|
7
|
+
## Files to Create/Modify
|
|
8
|
+
|
|
9
|
+
| Path | Action | Purpose |
|
|
10
|
+
|------|--------|---------|
|
|
11
|
+
| `.blueprint/agents/GUARDRAILS.md` | Create | New shared guardrails file containing extracted content |
|
|
12
|
+
| `.blueprint/agents/AGENT_SPECIFICATION_ALEX.md` | Modify | Remove inline guardrails, add reference to GUARDRAILS.md |
|
|
13
|
+
| `.blueprint/agents/AGENT_BA_CASS.md` | Modify | Remove inline guardrails, add reference to GUARDRAILS.md |
|
|
14
|
+
| `.blueprint/agents/AGENT_TESTER_NIGEL.md` | Modify | Remove inline guardrails, add reference to GUARDRAILS.md |
|
|
15
|
+
| `.blueprint/agents/AGENT_DEVELOPER_CODEY.md` | Modify | Remove inline guardrails, add reference to GUARDRAILS.md |
|
|
16
|
+
|
|
17
|
+
## Implementation Steps
|
|
18
|
+
|
|
19
|
+
1. **Create GUARDRAILS.md** - Extract the guardrails section (lines 169-210 from AGENT_SPECIFICATION_ALEX.md) into new file at `.blueprint/agents/GUARDRAILS.md`. Content includes: Allowed Sources, Prohibited Sources, Citation Requirements, Assumptions vs Facts, Confidentiality, Escalation Protocol.
|
|
20
|
+
|
|
21
|
+
2. **Update AGENT_SPECIFICATION_ALEX.md** - Remove the inline `## Guardrails` section (lines 169-210). Add reference: `## Guardrails\n\nRead and apply the shared guardrails from: `.blueprint/agents/GUARDRAILS.md``
|
|
22
|
+
|
|
23
|
+
3. **Update AGENT_BA_CASS.md** - Remove inline guardrails section (lines 383-425). Add same reference format.
|
|
24
|
+
|
|
25
|
+
4. **Update AGENT_TESTER_NIGEL.md** - Remove inline guardrails section (lines 174-216). Add same reference format.
|
|
26
|
+
|
|
27
|
+
5. **Update AGENT_DEVELOPER_CODEY.md** - Remove inline guardrails section (lines 426-468). Add same reference format.
|
|
28
|
+
|
|
29
|
+
6. **Run tests** - Execute `node --test test/feature_shared-guardrails.test.js` to verify all ACs pass.
|
|
30
|
+
|
|
31
|
+
## Risks/Questions
|
|
32
|
+
|
|
33
|
+
- ASSUMPTION: Claude agents can follow file references and will read GUARDRAILS.md when instructed. Per story-extract-guardrails.md:Notes, this is a documented assumption.
|
|
34
|
+
- No code changes needed in src/init.js or src/update.js since `agents/` is already in the UPDATABLE array (per story-update-init-commands.md:Notes).
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Story — Extract Guardrails to Shared File
|
|
2
|
+
|
|
3
|
+
## User story
|
|
4
|
+
As a framework maintainer, I want to extract the duplicated guardrails section from all agent specification files into a single shared GUARDRAILS.md file so that guardrails are maintained in one place and token usage is reduced.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Context / scope
|
|
9
|
+
- Affects all 4 agent specifications (Alex, Cass, Nigel, Codey)
|
|
10
|
+
- Guardrails section is currently ~45 lines / ~400 tokens per agent
|
|
11
|
+
- New file location: `.blueprint/agents/GUARDRAILS.md`
|
|
12
|
+
- This is a structural refactor; agent behaviour remains unchanged
|
|
13
|
+
|
|
14
|
+
Per FEATURE_SPEC.md:Section 1: "The same guardrails section (~45 lines, ~400 tokens) is duplicated verbatim in all 4 agent specification files"
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Acceptance criteria
|
|
19
|
+
|
|
20
|
+
**AC-1 — Shared guardrails file exists**
|
|
21
|
+
- Given the `.blueprint/agents/` directory,
|
|
22
|
+
- When the shared guardrails feature is implemented,
|
|
23
|
+
- Then a new file `GUARDRAILS.md` exists at `.blueprint/agents/GUARDRAILS.md`
|
|
24
|
+
- And it contains the complete guardrails content (Allowed Sources, Prohibited Sources, Citation Requirements, Assumptions vs Facts, Confidentiality, Escalation Protocol sections).
|
|
25
|
+
|
|
26
|
+
**AC-2 — Agent specs reference shared file**
|
|
27
|
+
- Given each agent specification file (AGENT_SPECIFICATION_ALEX.md, AGENT_BA_CASS.md, AGENT_TESTER_NIGEL.md, AGENT_DEVELOPER_CODEY.md),
|
|
28
|
+
- When the shared guardrails feature is implemented,
|
|
29
|
+
- Then the inline guardrails section is removed from each file
|
|
30
|
+
- And each file contains a reference to read `.blueprint/agents/GUARDRAILS.md`.
|
|
31
|
+
|
|
32
|
+
**AC-3 — Guardrails content is identical**
|
|
33
|
+
- Given the new `GUARDRAILS.md` file,
|
|
34
|
+
- When comparing its content to the original inline guardrails,
|
|
35
|
+
- Then the content is identical (no additions, removals, or modifications to guardrail rules).
|
|
36
|
+
|
|
37
|
+
**AC-4 — Agent specs remain functional**
|
|
38
|
+
- Given an agent (e.g., Alex) reads its specification file,
|
|
39
|
+
- When the specification references `GUARDRAILS.md`,
|
|
40
|
+
- Then the agent can locate and read the shared guardrails file
|
|
41
|
+
- And the agent applies all guardrails to its outputs.
|
|
42
|
+
|
|
43
|
+
**AC-5 — No duplicate guardrails remain**
|
|
44
|
+
- Given all 4 agent specification files,
|
|
45
|
+
- When searching for guardrails sections,
|
|
46
|
+
- Then no file contains inline guardrails content (only the reference to the shared file).
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Out of scope
|
|
51
|
+
- Modifying the content of guardrails (per FEATURE_SPEC.md:Section 2)
|
|
52
|
+
- Agent-specific guardrail variations
|
|
53
|
+
- Changes to init/update commands (covered in separate story)
|
|
54
|
+
- Modifying agent prompts in SKILL.md
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Notes
|
|
59
|
+
- Per FEATURE_SPEC.md:Section 6, agents cannot override shared guardrails
|
|
60
|
+
- Per FEATURE_SPEC.md:Section 9, ASSUMPTION: Agents can follow file references (read file X when spec says "see file X")
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Story — Update Init/Update Commands for Shared Guardrails
|
|
2
|
+
|
|
3
|
+
## User story
|
|
4
|
+
As a user installing or updating orchestr8, I want the init and update commands to correctly handle the new GUARDRAILS.md file so that the shared guardrails are properly distributed to target projects.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Context / scope
|
|
9
|
+
- Affects `src/init.js` (initialization command)
|
|
10
|
+
- Affects `src/update.js` (update command)
|
|
11
|
+
- New file `.blueprint/agents/GUARDRAILS.md` must be included in both operations
|
|
12
|
+
- Existing behaviour for other files remains unchanged
|
|
13
|
+
|
|
14
|
+
Per FEATURE_SPEC.md:Section 7: "src/init.js and src/update.js must handle the new file during init/update"
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Acceptance criteria
|
|
19
|
+
|
|
20
|
+
**AC-1 — Init copies GUARDRAILS.md**
|
|
21
|
+
- Given a user runs `orchestr8 init` in a new project,
|
|
22
|
+
- When the `.blueprint/agents/` directory is copied,
|
|
23
|
+
- Then the `GUARDRAILS.md` file is included in the copied content
|
|
24
|
+
- And the file is placed at `.blueprint/agents/GUARDRAILS.md` in the target project.
|
|
25
|
+
|
|
26
|
+
**AC-2 — Update replaces GUARDRAILS.md**
|
|
27
|
+
- Given a user runs `orchestr8 update` in an existing project,
|
|
28
|
+
- When the `.blueprint/agents/` directory is updated,
|
|
29
|
+
- Then the `GUARDRAILS.md` file is replaced with the latest version from the package
|
|
30
|
+
- And the file is placed at `.blueprint/agents/GUARDRAILS.md` in the target project.
|
|
31
|
+
|
|
32
|
+
**AC-3 — Update preserves user content directories**
|
|
33
|
+
- Given a user runs `orchestr8 update`,
|
|
34
|
+
- When the update process completes,
|
|
35
|
+
- Then `features/` and `system_specification/` directories remain untouched
|
|
36
|
+
- And only `agents/`, `templates/`, and `ways_of_working/` are replaced.
|
|
37
|
+
|
|
38
|
+
**AC-4 — Agent specs with references are copied**
|
|
39
|
+
- Given the agent specification files now reference `GUARDRAILS.md`,
|
|
40
|
+
- When init or update copies the agent specs,
|
|
41
|
+
- Then all agent specs (AGENT_*.md) are copied with their guardrails references intact
|
|
42
|
+
- And no orphaned guardrails references exist (GUARDRAILS.md is always present when agent specs reference it).
|
|
43
|
+
|
|
44
|
+
**AC-5 — Backward compatibility**
|
|
45
|
+
- Given an existing project with old agent specs (containing inline guardrails),
|
|
46
|
+
- When a user runs `orchestr8 update`,
|
|
47
|
+
- Then the old agent specs are replaced with new specs referencing GUARDRAILS.md
|
|
48
|
+
- And the new GUARDRAILS.md file is added to the project.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Out of scope
|
|
53
|
+
- Changes to the guardrails content itself
|
|
54
|
+
- Changes to SKILL.md agent prompts
|
|
55
|
+
- Changes to queue management or pipeline flow
|
|
56
|
+
- User content migration (users do not have custom guardrails)
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Notes
|
|
61
|
+
- Per SYSTEM_SPEC.md:Section 8, the update command replaces framework directories while preserving user content
|
|
62
|
+
- The `agents/` directory is listed in UPDATABLE array in `src/update.js`, so GUARDRAILS.md will be handled automatically once it exists in the source
|
|
63
|
+
- No code changes are expected in init.js or update.js since they copy entire directories; the change is purely in the source assets
|