murmur8 3.5.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 +239 -0
- package/.blueprint/agents/AGENT_DEVELOPER_CODEY.md +308 -0
- package/.blueprint/agents/AGENT_SPECIFICATION_ALEX.md +183 -0
- package/.blueprint/agents/AGENT_TESTER_NIGEL.md +159 -0
- package/.blueprint/agents/GUARDRAILS.md +83 -0
- package/.blueprint/agents/TEAM_MANIFESTO.md +91 -0
- package/.blueprint/features/.gitkeep +0 -0
- package/.blueprint/features/feature_adaptive-retry/FEATURE_SPEC.md +239 -0
- package/.blueprint/features/feature_adaptive-retry/IMPLEMENTATION_PLAN.md +48 -0
- package/.blueprint/features/feature_adaptive-retry/story-prompt-modification.md +85 -0
- package/.blueprint/features/feature_adaptive-retry/story-retry-config.md +89 -0
- package/.blueprint/features/feature_adaptive-retry/story-should-retry.md +98 -0
- package/.blueprint/features/feature_adaptive-retry/story-strategy-recommendation.md +85 -0
- package/.blueprint/features/feature_agent-guardrails/FEATURE_SPEC.md +328 -0
- package/.blueprint/features/feature_agent-guardrails/IMPLEMENTATION_PLAN.md +90 -0
- package/.blueprint/features/feature_agent-guardrails/story-citation-requirements.md +50 -0
- package/.blueprint/features/feature_agent-guardrails/story-confidentiality.md +50 -0
- package/.blueprint/features/feature_agent-guardrails/story-escalation-protocol.md +55 -0
- package/.blueprint/features/feature_agent-guardrails/story-source-restrictions.md +50 -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_feedback-loop/FEATURE_SPEC.md +347 -0
- package/.blueprint/features/feature_feedback-loop/IMPLEMENTATION_PLAN.md +71 -0
- package/.blueprint/features/feature_feedback-loop/story-feedback-collection.md +63 -0
- package/.blueprint/features/feature_feedback-loop/story-feedback-config.md +61 -0
- package/.blueprint/features/feature_feedback-loop/story-feedback-insights.md +63 -0
- package/.blueprint/features/feature_feedback-loop/story-quality-gates.md +57 -0
- package/.blueprint/features/feature_interactive-alex/FEATURE_SPEC.md +263 -0
- package/.blueprint/features/feature_interactive-alex/IMPLEMENTATION_PLAN.md +69 -0
- package/.blueprint/features/feature_interactive-alex/handoff-alex.md +19 -0
- package/.blueprint/features/feature_interactive-alex/handoff-cass.md +21 -0
- package/.blueprint/features/feature_interactive-alex/handoff-nigel.md +19 -0
- package/.blueprint/features/feature_interactive-alex/story-flag-routing.md +54 -0
- package/.blueprint/features/feature_interactive-alex/story-iterative-drafting.md +65 -0
- package/.blueprint/features/feature_interactive-alex/story-pipeline-integration.md +66 -0
- package/.blueprint/features/feature_interactive-alex/story-session-lifecycle.md +75 -0
- package/.blueprint/features/feature_interactive-alex/story-system-spec-creation.md +57 -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_parallel-abort/FEATURE_SPEC.md +117 -0
- package/.blueprint/features/feature_parallel-confirm/FEATURE_SPEC.md +90 -0
- package/.blueprint/features/feature_parallel-features/FEATURE_SPEC.md +291 -0
- package/.blueprint/features/feature_parallel-features/IMPLEMENTATION_PLAN.md +73 -0
- package/.blueprint/features/feature_parallel-lock/FEATURE_SPEC.md +119 -0
- package/.blueprint/features/feature_parallel-logging/FEATURE_SPEC.md +105 -0
- package/.blueprint/features/feature_parallel-preflight/FEATURE_SPEC.md +141 -0
- package/.blueprint/features/feature_pipeline-history/FEATURE_SPEC.md +239 -0
- package/.blueprint/features/feature_pipeline-history/IMPLEMENTATION_PLAN.md +71 -0
- package/.blueprint/features/feature_pipeline-history/story-clear-history.md +73 -0
- package/.blueprint/features/feature_pipeline-history/story-display-history.md +75 -0
- package/.blueprint/features/feature_pipeline-history/story-record-execution.md +76 -0
- package/.blueprint/features/feature_pipeline-history/story-show-statistics.md +85 -0
- package/.blueprint/features/feature_pipeline-insights/FEATURE_SPEC.md +288 -0
- package/.blueprint/features/feature_pipeline-insights/IMPLEMENTATION_PLAN.md +65 -0
- package/.blueprint/features/feature_pipeline-insights/story-anomaly-detection.md +71 -0
- package/.blueprint/features/feature_pipeline-insights/story-bottleneck-analysis.md +75 -0
- package/.blueprint/features/feature_pipeline-insights/story-failure-patterns.md +75 -0
- package/.blueprint/features/feature_pipeline-insights/story-json-output.md +75 -0
- package/.blueprint/features/feature_pipeline-insights/story-trend-analysis.md +78 -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/features/feature_validate-command/FEATURE_SPEC.md +209 -0
- package/.blueprint/features/feature_validate-command/IMPLEMENTATION_PLAN.md +59 -0
- package/.blueprint/features/feature_validate-command/story-failure-output.md +61 -0
- package/.blueprint/features/feature_validate-command/story-node-version-check.md +52 -0
- package/.blueprint/features/feature_validate-command/story-run-validation.md +59 -0
- package/.blueprint/features/feature_validate-command/story-success-output.md +50 -0
- package/.blueprint/prompts/TEMPLATE.md +65 -0
- package/.blueprint/prompts/alex-runtime.md +49 -0
- package/.blueprint/prompts/cass-runtime.md +46 -0
- package/.blueprint/prompts/codey-implement-runtime.md +52 -0
- package/.blueprint/prompts/codey-plan-runtime.md +47 -0
- package/.blueprint/prompts/nigel-runtime.md +47 -0
- package/.blueprint/system_specification/.gitkeep +0 -0
- package/.blueprint/system_specification/SYSTEM_SPEC.md +248 -0
- package/.blueprint/templates/FEATURE_SPEC.md +125 -0
- package/.blueprint/templates/STORY_TEMPLATE.md +96 -0
- package/.blueprint/templates/SYSTEM_SPEC.md +128 -0
- package/.blueprint/templates/TEST_TEMPLATE.md +76 -0
- package/.blueprint/ways_of_working/DEVELOPMENT_RITUAL.md +178 -0
- package/.business_context/README.md +27 -0
- package/LICENSE +21 -0
- package/README.md +564 -0
- package/SKILL.md +840 -0
- package/bin/cli.js +388 -0
- package/package.json +36 -0
- package/src/business-context.js +91 -0
- package/src/classifier.js +173 -0
- package/src/feedback.js +201 -0
- package/src/handoff.js +148 -0
- package/src/history.js +306 -0
- package/src/index.js +170 -0
- package/src/init.js +139 -0
- package/src/insights.js +504 -0
- package/src/interactive.js +338 -0
- package/src/orchestrator.js +217 -0
- package/src/parallel.js +1544 -0
- package/src/retry.js +274 -0
- package/src/stack.js +320 -0
- 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
- package/src/update.js +112 -0
- package/src/validate.js +172 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# User Story: Iterative Spec Drafting
|
|
2
|
+
|
|
3
|
+
## Story
|
|
4
|
+
|
|
5
|
+
**As a** developer in an interactive session,
|
|
6
|
+
**I want** Alex to gather context, ask targeted questions, and draft spec sections incrementally,
|
|
7
|
+
**so that** the resulting specification accurately captures my intent with minimal revision cycles.
|
|
8
|
+
|
|
9
|
+
## Acceptance Criteria
|
|
10
|
+
|
|
11
|
+
### AC-1: Context Gathering Phase
|
|
12
|
+
|
|
13
|
+
**Given** an interactive session has started
|
|
14
|
+
**When** the user provides their initial feature description
|
|
15
|
+
**Then** Alex acknowledges understanding by summarizing the core intent
|
|
16
|
+
**And** Alex identifies 2-4 information gaps relative to the FEATURE_SPEC template
|
|
17
|
+
|
|
18
|
+
### AC-2: Clarifying Questions
|
|
19
|
+
|
|
20
|
+
**Given** Alex has identified information gaps
|
|
21
|
+
**When** Alex asks clarifying questions
|
|
22
|
+
**Then** questions are presented in a single batch (2-4 questions)
|
|
23
|
+
**And** questions are specific and actionable (not open-ended)
|
|
24
|
+
**And** Alex waits for user responses before proceeding
|
|
25
|
+
|
|
26
|
+
### AC-3: Section-by-Section Drafting
|
|
27
|
+
|
|
28
|
+
**Given** Alex has gathered sufficient context
|
|
29
|
+
**When** Alex drafts spec sections
|
|
30
|
+
**Then** sections are drafted incrementally (Intent first, then Scope, then Actors, etc.)
|
|
31
|
+
**And** after each section, Alex presents the draft
|
|
32
|
+
**And** Alex asks: "Does this capture your intent? Any changes?"
|
|
33
|
+
|
|
34
|
+
### AC-4: Revision Handling
|
|
35
|
+
|
|
36
|
+
**Given** Alex has presented a draft section
|
|
37
|
+
**And** the user requests changes via `/change <feedback>`
|
|
38
|
+
**When** Alex revises the section
|
|
39
|
+
**Then** Alex incorporates the specific feedback
|
|
40
|
+
**And** Alex presents the revised draft
|
|
41
|
+
**And** Alex asks for approval again
|
|
42
|
+
|
|
43
|
+
### AC-5: Progress Indication
|
|
44
|
+
|
|
45
|
+
**Given** an interactive session is active
|
|
46
|
+
**When** Alex transitions between sections
|
|
47
|
+
**Then** Alex indicates which sections are complete
|
|
48
|
+
**And** Alex indicates which sections remain
|
|
49
|
+
|
|
50
|
+
### AC-6: Concise Responses
|
|
51
|
+
|
|
52
|
+
**Given** Alex is drafting or responding in the session
|
|
53
|
+
**When** Alex produces conversational output
|
|
54
|
+
**Then** each response is under 200 words
|
|
55
|
+
**And** focus is on actionable content, not filler
|
|
56
|
+
|
|
57
|
+
## Out of Scope
|
|
58
|
+
|
|
59
|
+
- Full-spec-at-once drafting mode
|
|
60
|
+
- Configurable question count (fixed at 2-4)
|
|
61
|
+
- Template customization during session
|
|
62
|
+
|
|
63
|
+
## References
|
|
64
|
+
|
|
65
|
+
- Feature Spec: `.blueprint/features/feature_interactive-alex/FEATURE_SPEC.md` (Section 4.3)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# User Story: Pipeline Integration
|
|
2
|
+
|
|
3
|
+
## Story
|
|
4
|
+
|
|
5
|
+
**As a** developer completing an interactive session,
|
|
6
|
+
**I want** the interactive mode to integrate seamlessly with the existing pipeline infrastructure,
|
|
7
|
+
**so that** downstream agents receive proper handoffs and the pipeline can resume or record history as expected.
|
|
8
|
+
|
|
9
|
+
## Acceptance Criteria
|
|
10
|
+
|
|
11
|
+
### AC-1: Spec File Output
|
|
12
|
+
|
|
13
|
+
**Given** an interactive session completes successfully (via `/approve` on final section or `/done`)
|
|
14
|
+
**When** Alex finalizes the spec
|
|
15
|
+
**Then** FEATURE_SPEC.md is written to `{FEAT_DIR}/FEATURE_SPEC.md`
|
|
16
|
+
**And** the file includes all completed sections
|
|
17
|
+
**And** skipped sections are marked as "TBD"
|
|
18
|
+
**And** the file includes a note: "Created via interactive session"
|
|
19
|
+
|
|
20
|
+
### AC-2: Handoff Artifact
|
|
21
|
+
|
|
22
|
+
**Given** an interactive session completes successfully
|
|
23
|
+
**When** Alex writes the spec file
|
|
24
|
+
**Then** Alex also produces `handoff-alex.md` in the feature directory
|
|
25
|
+
**And** the handoff includes key decisions, files created, and open questions
|
|
26
|
+
|
|
27
|
+
### AC-3: Queue Update
|
|
28
|
+
|
|
29
|
+
**Given** an interactive session completes successfully
|
|
30
|
+
**When** the pipeline continues
|
|
31
|
+
**Then** the queue is updated with the feature moving from `alexQueue` to `cassQueue`
|
|
32
|
+
**And** `current.stage` reflects "cass" (or the next applicable stage)
|
|
33
|
+
|
|
34
|
+
### AC-4: History Recording
|
|
35
|
+
|
|
36
|
+
**Given** an interactive session completes (success or abort)
|
|
37
|
+
**When** history is recorded (unless `--no-history` flag present)
|
|
38
|
+
**Then** the `pipeline-history.json` entry includes `mode: "interactive"`
|
|
39
|
+
**And** the entry includes question count, revision count, and session duration
|
|
40
|
+
|
|
41
|
+
### AC-5: Pause After Alex
|
|
42
|
+
|
|
43
|
+
**Given** an interactive session completes successfully
|
|
44
|
+
**And** `--pause-after=alex` flag was provided
|
|
45
|
+
**When** Alex finishes
|
|
46
|
+
**Then** the pipeline pauses before spawning Cass
|
|
47
|
+
**And** user can review the spec before continuing
|
|
48
|
+
|
|
49
|
+
### AC-6: Continue to Downstream Agents
|
|
50
|
+
|
|
51
|
+
**Given** an interactive session completes successfully
|
|
52
|
+
**And** `--pause-after=alex` flag was NOT provided
|
|
53
|
+
**When** Alex finishes
|
|
54
|
+
**Then** the pipeline continues automatically
|
|
55
|
+
**And** Cass is spawned with the produced FEATURE_SPEC.md as input
|
|
56
|
+
|
|
57
|
+
## Out of Scope
|
|
58
|
+
|
|
59
|
+
- Changes to Cass, Nigel, or Codey agent behaviour
|
|
60
|
+
- Parallel pipeline execution
|
|
61
|
+
- Multi-feature batch processing
|
|
62
|
+
|
|
63
|
+
## References
|
|
64
|
+
|
|
65
|
+
- Feature Spec: `.blueprint/features/feature_interactive-alex/FEATURE_SPEC.md` (Section 6)
|
|
66
|
+
- System Spec: `.blueprint/system_specification/SYSTEM_SPEC.md` (Sections 6-7)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# User Story: Interactive Session Lifecycle
|
|
2
|
+
|
|
3
|
+
## Story
|
|
4
|
+
|
|
5
|
+
**As a** developer entering interactive mode,
|
|
6
|
+
**I want** a clear session lifecycle with explicit commands for controlling the conversation,
|
|
7
|
+
**so that** I can navigate the spec creation process efficiently and exit gracefully when needed.
|
|
8
|
+
|
|
9
|
+
## Acceptance Criteria
|
|
10
|
+
|
|
11
|
+
### AC-1: Session Initialization
|
|
12
|
+
|
|
13
|
+
**Given** interactive mode is activated (explicit flag or auto-detect)
|
|
14
|
+
**When** the session starts
|
|
15
|
+
**Then** Alex reads system spec (if exists), business context, and feature template
|
|
16
|
+
**And** Alex presents an opening prompt: "Describe the feature you want to build. What problem does it solve and for whom?"
|
|
17
|
+
|
|
18
|
+
### AC-2: Approve Command
|
|
19
|
+
|
|
20
|
+
**Given** an interactive session is active
|
|
21
|
+
**And** Alex has presented a draft section
|
|
22
|
+
**When** the user responds with `/approve` or `yes`
|
|
23
|
+
**Then** the current section is marked complete
|
|
24
|
+
**And** Alex proceeds to the next section
|
|
25
|
+
|
|
26
|
+
### AC-3: Change Command
|
|
27
|
+
|
|
28
|
+
**Given** an interactive session is active
|
|
29
|
+
**And** Alex has presented a draft section
|
|
30
|
+
**When** the user responds with `/change <feedback>`
|
|
31
|
+
**Then** Alex revises the current section based on the feedback
|
|
32
|
+
**And** Alex presents the revised draft for approval
|
|
33
|
+
|
|
34
|
+
### AC-4: Skip Command
|
|
35
|
+
|
|
36
|
+
**Given** an interactive session is active
|
|
37
|
+
**And** Alex has presented a draft section
|
|
38
|
+
**When** the user responds with `/skip`
|
|
39
|
+
**Then** the current section is marked as "TBD" in the spec
|
|
40
|
+
**And** Alex proceeds to the next section
|
|
41
|
+
|
|
42
|
+
### AC-5: Restart Command
|
|
43
|
+
|
|
44
|
+
**Given** an interactive session is active
|
|
45
|
+
**And** Alex is working on a section
|
|
46
|
+
**When** the user responds with `/restart`
|
|
47
|
+
**Then** Alex discards the current section draft
|
|
48
|
+
**And** Alex starts the section from scratch with fresh questions
|
|
49
|
+
|
|
50
|
+
### AC-6: Abort Command
|
|
51
|
+
|
|
52
|
+
**Given** an interactive session is active
|
|
53
|
+
**When** the user responds with `/abort`
|
|
54
|
+
**Then** the session terminates immediately
|
|
55
|
+
**And** no spec file is written to disk
|
|
56
|
+
**And** the pipeline exits without proceeding to downstream agents
|
|
57
|
+
|
|
58
|
+
### AC-7: Done Command
|
|
59
|
+
|
|
60
|
+
**Given** an interactive session is active
|
|
61
|
+
**And** at least Intent, Scope, and Actors sections are complete or skipped
|
|
62
|
+
**When** the user responds with `/done`
|
|
63
|
+
**Then** Alex finalizes the spec with completed sections
|
|
64
|
+
**And** skipped sections are marked as "TBD"
|
|
65
|
+
**And** the spec file is written to disk
|
|
66
|
+
|
|
67
|
+
## Out of Scope
|
|
68
|
+
|
|
69
|
+
- Session persistence between interrupted sessions
|
|
70
|
+
- Timeout handling (session continues until user acts)
|
|
71
|
+
- Multi-user concurrent sessions
|
|
72
|
+
|
|
73
|
+
## References
|
|
74
|
+
|
|
75
|
+
- Feature Spec: `.blueprint/features/feature_interactive-alex/FEATURE_SPEC.md` (Section 4.4)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# User Story: Interactive System Spec Creation
|
|
2
|
+
|
|
3
|
+
## Story
|
|
4
|
+
|
|
5
|
+
**As a** developer initializing a new project without a system specification,
|
|
6
|
+
**I want** Alex to guide me through creating a SYSTEM_SPEC.md interactively,
|
|
7
|
+
**so that** I establish the project's boundaries and constraints before creating feature specs.
|
|
8
|
+
|
|
9
|
+
## Acceptance Criteria
|
|
10
|
+
|
|
11
|
+
### AC-1: System Spec Auto-Detection
|
|
12
|
+
|
|
13
|
+
**Given** a user invokes `/implement-feature "my-feature"`
|
|
14
|
+
**And** `.blueprint/system_specification/SYSTEM_SPEC.md` does not exist
|
|
15
|
+
**When** the pipeline checks prerequisites
|
|
16
|
+
**Then** interactive mode activates for system spec creation (not feature spec)
|
|
17
|
+
|
|
18
|
+
### AC-2: System Spec Session Flow
|
|
19
|
+
|
|
20
|
+
**Given** interactive system spec mode is active
|
|
21
|
+
**When** Alex starts the session
|
|
22
|
+
**Then** Alex asks about: purpose, actors, system boundaries, and governing rules
|
|
23
|
+
**And** Alex drafts SYSTEM_SPEC.md sections incrementally
|
|
24
|
+
**And** the same session commands apply (`/approve`, `/change`, `/skip`, `/restart`, `/abort`, `/done`)
|
|
25
|
+
|
|
26
|
+
### AC-3: System Spec Output Location
|
|
27
|
+
|
|
28
|
+
**Given** an interactive system spec session completes successfully
|
|
29
|
+
**When** Alex writes the spec
|
|
30
|
+
**Then** the file is written to `.blueprint/system_specification/SYSTEM_SPEC.md`
|
|
31
|
+
**And** the file follows the SYSTEM_SPEC template structure
|
|
32
|
+
|
|
33
|
+
### AC-4: Pipeline Gate Satisfied
|
|
34
|
+
|
|
35
|
+
**Given** SYSTEM_SPEC.md is created via interactive session
|
|
36
|
+
**When** the user re-invokes `/implement-feature "my-feature"`
|
|
37
|
+
**Then** the system spec gate passes
|
|
38
|
+
**And** the pipeline proceeds to feature spec creation (interactive or autonomous)
|
|
39
|
+
|
|
40
|
+
### AC-5: System Spec Before Feature Spec
|
|
41
|
+
|
|
42
|
+
**Given** a user invokes `/implement-feature "my-feature" --interactive`
|
|
43
|
+
**And** SYSTEM_SPEC.md does not exist
|
|
44
|
+
**When** the pipeline routing logic runs
|
|
45
|
+
**Then** system spec interactive session runs first
|
|
46
|
+
**And** only after system spec is complete does feature spec interactive session begin
|
|
47
|
+
|
|
48
|
+
## Out of Scope
|
|
49
|
+
|
|
50
|
+
- Updating existing SYSTEM_SPEC.md interactively (only creation)
|
|
51
|
+
- Skipping system spec gate entirely
|
|
52
|
+
- System spec versioning or change tracking
|
|
53
|
+
|
|
54
|
+
## References
|
|
55
|
+
|
|
56
|
+
- Feature Spec: `.blueprint/features/feature_interactive-alex/FEATURE_SPEC.md` (Section 4.1, Open Question 2)
|
|
57
|
+
- System Spec: `.blueprint/system_specification/SYSTEM_SPEC.md` (Section 7 - System spec gate)
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Feature Specification — Lazy Business Context Loading
|
|
2
|
+
|
|
3
|
+
## 1. Feature Intent
|
|
4
|
+
**Why this feature exists.**
|
|
5
|
+
|
|
6
|
+
- Currently all agents are told to read `.business_context/*` directory
|
|
7
|
+
- Many features don't require business context
|
|
8
|
+
- Reading unnecessary files wastes tokens and processing time
|
|
9
|
+
- Lazy loading reads business context only when the feature spec references it
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 2. Scope
|
|
14
|
+
### In Scope
|
|
15
|
+
- Detect whether feature spec cites `.business_context/` files
|
|
16
|
+
- Include business context in agent prompt only if referenced
|
|
17
|
+
- Provide mechanism for agents to request business context if needed mid-task
|
|
18
|
+
|
|
19
|
+
### Out of Scope
|
|
20
|
+
- Changing business context structure
|
|
21
|
+
- Removing business context capability
|
|
22
|
+
- Automatic business context summarization
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 3. Actors Involved
|
|
27
|
+
|
|
28
|
+
| Actor | Business Context Usage |
|
|
29
|
+
|-------|----------------------|
|
|
30
|
+
| Alex | Primary consumer — grounds feature specs in domain context |
|
|
31
|
+
| Cass | Secondary — references for domain terminology |
|
|
32
|
+
| Nigel | Rare — may need for domain-specific test data |
|
|
33
|
+
| Codey | Rare — may need for domain-specific implementation |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 4. Behaviour Overview
|
|
38
|
+
|
|
39
|
+
**Happy path (context needed):**
|
|
40
|
+
1. Feature spec contains citation: "Per business_context/domain.md: ..."
|
|
41
|
+
2. Pipeline detects citation during setup
|
|
42
|
+
3. Agent prompt includes: "Business Context: .business_context/"
|
|
43
|
+
4. Agent reads and applies business context
|
|
44
|
+
|
|
45
|
+
**Happy path (context not needed):**
|
|
46
|
+
1. Feature spec has no business context citations
|
|
47
|
+
2. Pipeline skips business context directive
|
|
48
|
+
3. Agent prompt omits business context reference
|
|
49
|
+
4. Tokens saved
|
|
50
|
+
|
|
51
|
+
**Detection logic:**
|
|
52
|
+
```javascript
|
|
53
|
+
const featureSpecContent = readFile(FEAT_SPEC);
|
|
54
|
+
const needsBusinessContext = featureSpecContent.includes('.business_context')
|
|
55
|
+
|| featureSpecContent.includes('business_context/');
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Key outcomes:**
|
|
59
|
+
- Variable token savings (depends on business context size)
|
|
60
|
+
- Faster processing for simple features
|
|
61
|
+
- Business context still available when needed
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 5. State & Lifecycle Interactions
|
|
66
|
+
|
|
67
|
+
- No persistent state changes
|
|
68
|
+
- Detection happens at pipeline setup (Step 5)
|
|
69
|
+
- Flag stored in queue: `current.needsBusinessContext: boolean`
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 6. Rules & Decision Logic
|
|
74
|
+
|
|
75
|
+
| Rule | Description |
|
|
76
|
+
|------|-------------|
|
|
77
|
+
| Citation detection | Scan feature spec for business_context references |
|
|
78
|
+
| Default to exclude | If no citation found, don't include business context |
|
|
79
|
+
| Alex exception | Alex always has access (creates feature specs from business context) |
|
|
80
|
+
| Explicit include | `--include-business-context` flag overrides detection |
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 7. Dependencies
|
|
85
|
+
|
|
86
|
+
- SKILL.md updated with conditional business context inclusion
|
|
87
|
+
- Pipeline setup (Step 5) performs detection
|
|
88
|
+
- Queue stores detection result for downstream agents
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 8. Non-Functional Considerations
|
|
93
|
+
|
|
94
|
+
- **Performance:** Token savings proportional to business context size
|
|
95
|
+
- **Correctness:** Risk of missing needed context if detection fails
|
|
96
|
+
- **Flexibility:** Override flag provides escape hatch
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 9. Assumptions & Open Questions
|
|
101
|
+
|
|
102
|
+
**Assumptions:**
|
|
103
|
+
- Feature specs reliably cite business context when it's used
|
|
104
|
+
- Detection can be simple string matching
|
|
105
|
+
- Alex stage always needs business context access
|
|
106
|
+
|
|
107
|
+
**Open Questions:**
|
|
108
|
+
- Should detection be more sophisticated (AST parsing)?
|
|
109
|
+
- What if an agent needs business context mid-task but it wasn't loaded?
|
|
110
|
+
- Should there be a "request context" mechanism for agents?
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 10. Impact on System Specification
|
|
115
|
+
|
|
116
|
+
- Reinforces efficiency goals
|
|
117
|
+
- Adds conditional loading pattern to pipeline
|
|
118
|
+
- No contradiction with system spec
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## 11. Handover to BA (Cass)
|
|
123
|
+
|
|
124
|
+
**Story themes:**
|
|
125
|
+
- Implement business context citation detection
|
|
126
|
+
- Update pipeline setup to conditionally include context
|
|
127
|
+
- Add override flag for explicit inclusion
|
|
128
|
+
- Ensure Alex always has business context access
|
|
129
|
+
|
|
130
|
+
**Expected story boundaries:**
|
|
131
|
+
- One story for detection logic
|
|
132
|
+
- One story for pipeline integration
|
|
133
|
+
- One story for override flag
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## 12. Change Log (Feature-Level)
|
|
138
|
+
| Date | Change | Reason | Raised By |
|
|
139
|
+
|-----|------|--------|-----------|
|
|
140
|
+
| 2026-02-25 | Initial spec | Token efficiency improvement | Claude |
|
|
@@ -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.
|