ai-fob 1.2.0 → 1.2.1

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.
@@ -113,7 +113,7 @@ Used during resume detection to verify step outputs are genuine and complete (no
113
113
  You (the main agent) handle this step directly.
114
114
 
115
115
  1. **Validate inputs**: Parse ARGUMENTS_RAW into HL_PLAN_PATH (first arg) and PHASE_NUMBER (second arg). If either is missing, error with: `Usage: /build-phase-V2 [path to HL plan] [phase number]`. Verify HL_PLAN_PATH exists and is a `.md` file. Read its YAML frontmatter and verify PHASE_NUMBER is an integer within the range of the `phases:` count. If out of range, error with: `Phase {N} is out of range. This plan has {count} phases (1-{count}).`
116
- 2. **Derive variables**: Extract SPEC_DIR (parent directory of HL_PLAN_PATH), SPEC_DIR_BASENAME (basename of SPEC_DIR), TASK_NAME (from frontmatter `task:` field), PHASE_NAME (from `### Phase {N}: {Name}` header in the plan body), PHASE_NAME_KEBAB (kebab-case of PHASE_NAME), PHASE_DIR (`{SPEC_DIR}/phase{N}_{PHASE_NAME_KEBAB}/`).
116
+ 2. **Derive variables**: Extract SPEC_DIR (parent directory of HL_PLAN_PATH), SPEC_DIR_BASENAME (basename of SPEC_DIR), TASK_NAME (from frontmatter `task:` field), PHASE_NAME (from `### Phase {N}: {Name}` header in the plan body), PHASE_NAME_KEBAB (kebab-case of PHASE_NAME), PHASE_DIR (`{SPEC_DIR}/phase{N}_{PHASE_NAME_KEBAB}/`), REFERENCE_DOCUMENTS (from frontmatter `reference-documents:` field -- a list of file paths, or empty list if the field is absent).
117
117
 
118
118
  3. **Resume detection**: Determine if this phase was previously started and can be resumed.
119
119
 
@@ -230,6 +230,7 @@ You (the main agent) handle this step directly.
230
230
  Success Criteria: {count} defined
231
231
  Prior Phase Reports: {count read} | N/A (Phase 1)
232
232
  Skills Detected: {list or "None"}
233
+ Reference Documents: {count from REFERENCE_DOCUMENTS, or "None"}
233
234
  Resume Status: {Fresh run | Resuming from Step {RESUME_FROM} - {step name}}
234
235
  Pre-phase SHA: {PRE_PHASE_SHA | N/A (git unavailable)}
235
236
  ```
@@ -273,6 +274,12 @@ Run MARK_STEP_START(1).
273
274
  ## Detailed Specifications
274
275
  {Section 8 from HL plan, if present. If not present, omit this entire section.}
275
276
 
277
+ ## Reference Documents
278
+ {If REFERENCE_DOCUMENTS is non-empty, list each path. If empty, omit this entire section.}
279
+ The following documents were provided by the user as detailed reference material for this task. Read each document IN FULL using the Read tool before proceeding with your task. These contain detailed specifications, schemas, and implementation context that the plan must follow.
280
+ {For each path in REFERENCE_DOCUMENTS:}
281
+ - {path}
282
+
276
283
  ## Prior Phase Context
277
284
  {PRIOR_PHASE_CONTEXT if N > 1, otherwise "N/A -- this is Phase 1"}
278
285
  {If N > 1: "IMPORTANT: Explore the actual codebase state, not the HL plan's assumptions. Prior phases may have deviated from the plan."}
@@ -369,6 +376,12 @@ After research is complete, spawn the architect agent to create the implementati
369
376
  {Section 8 from HL plan, if present. If not present, omit this entire section.}
370
377
  {If present: "IMPORTANT: These are user-provided specifications. The implementation plan MUST conform to these specifications exactly. Do not simplify, generalize, or omit any detail from these specifications."}
371
378
 
379
+ ## Reference Documents
380
+ {If REFERENCE_DOCUMENTS is non-empty, list each path. If empty, omit this entire section.}
381
+ The following documents were provided by the user as detailed reference material for this task. Read each document IN FULL using the Read tool before proceeding with your task. These contain detailed specifications, schemas, and implementation context that the implementation plan MUST conform to.
382
+ {For each path in REFERENCE_DOCUMENTS:}
383
+ - {path}
384
+
372
385
  ## Prior Phase Context
373
386
  {PRIOR_PHASE_CONTEXT if N > 1, otherwise "N/A -- this is Phase 1"}
374
387
  {If N > 1: "IMPORTANT: Base your plan on the ACTUAL state described in prior phase reports, not the HL plan's original assumptions. Prior phases may have deviated from the plan."}
@@ -569,6 +582,11 @@ Read the plan at: {PHASE_DIR}/plan_V1.md
569
582
  ### Detailed Specifications
570
583
  {Section 8 from HL plan, if present. If not present: "None provided."}
571
584
 
585
+ ### Reference Documents
586
+ {If REFERENCE_DOCUMENTS is non-empty, list each path. If empty: "None provided."}
587
+ {For each path in REFERENCE_DOCUMENTS:}
588
+ - {path}
589
+
572
590
  ### Prior Phase Context
573
591
  {PRIOR_PHASE_CONTEXT if N > 1, otherwise "N/A -- this is Phase 1"}
574
592
 
@@ -646,6 +664,12 @@ Success Criteria:
646
664
  {Section 8 from HL plan, if present. If not present, omit this entire section.}
647
665
  {If present: "IMPORTANT: These are user-provided specifications. The implementation plan MUST conform to these specifications exactly. Do not simplify, generalize, or omit any detail from these specifications."}
648
666
 
667
+ ## Reference Documents
668
+ {If REFERENCE_DOCUMENTS is non-empty, list each path. If empty, omit this entire section.}
669
+ The following documents were provided by the user as detailed reference material for this task. Read each document IN FULL using the Read tool before proceeding with your task. These contain detailed specifications, schemas, and implementation context that the implementation plan MUST conform to.
670
+ {For each path in REFERENCE_DOCUMENTS:}
671
+ - {path}
672
+
649
673
  ## Prior Phase Context
650
674
  {PRIOR_PHASE_CONTEXT if N > 1, otherwise "N/A -- this is Phase 1"}
651
675
  {If N > 1: "IMPORTANT: Base your plan on the ACTUAL state described in prior phase reports, not the HL plan's original assumptions. Prior phases may have deviated from the plan."}
@@ -31,9 +31,14 @@ If the file exists AND its frontmatter contains `type: feature-document`:
31
31
  - Set FEATURE_DOC_CONTENT = the full content of the file
32
32
  - Extract from frontmatter: FEATURE_NAME (from `feature` field), SOURCE_REPO (from `source-repo` field), ANALYSIS_DEPTH (from `analysis-depth` field), DOC_DATE (from `date` field)
33
33
  - Set TASK_DESCRIPTION = "Reimplement: {FEATURE_NAME}" (derived from the document)
34
+ - Set REFERENCE_DOCUMENTS = [FEATURE_DOC_PATH]
34
35
 
35
36
  If the file does NOT exist, OR the file exists but its frontmatter does NOT contain `type: feature-document`:
36
37
  - Set IS_RE_ENGINEERING = false
38
+ - If the file DOES exist (but is not a feature document):
39
+ - Set REFERENCE_DOCUMENTS = [TASK_DESCRIPTION] (store the file path)
40
+ - If the file does NOT exist:
41
+ - Set REFERENCE_DOCUMENTS = [] (empty list)
37
42
  - Leave TASK_DESCRIPTION as-is (the user's original input)
38
43
  - Proceed with the existing workflow unchanged
39
44
 
@@ -104,6 +109,7 @@ The user provided a feature document from a reverse-engineering analysis. Use it
104
109
  - Should the scope be narrower or broader than the original feature?
105
110
  - Are there integration points in this codebase that affect the approach?
106
111
  - Are there detailed specifications (database schemas, API requirements, business rules, data structures) that the plan must incorporate? Capture any provided specifications verbatim.
112
+ - **Reference document collection**: Throughout this conversation, if the user mentions or provides paths to additional documents (brainstorm docs, design docs, specification docs, or any other reference files), attempt to read each path using the Read tool. If the file exists, append its path to REFERENCE_DOCUMENTS. Confirm to the user: "Added {path} to reference documents." At the end of Phase 1, present the full REFERENCE_DOCUMENTS list to the user for confirmation.
107
113
 
108
114
  8. Summarize the complete understanding (task description, category, user stories, anti-stories, phase breakdown with success criteria, and detailed specifications if any) and get explicit user confirmation.
109
115
 
@@ -120,6 +126,7 @@ The user provided a feature document from a reverse-engineering analysis. Use it
120
126
  - What success looks like
121
127
  - Any constraints (timeline, tech stack, performance)
122
128
  - **Detailed specifications**: If the user provides detailed technical requirements (database schemas, API specifications, business rules, data structures, validation rules, or other concrete specifications), capture them verbatim. These are REQUIREMENTS, not implementation details -- they must be preserved through the entire planning process and appear in the final plan.
129
+ - **Reference document collection**: Throughout this conversation, if the user mentions or provides paths to additional documents (brainstorm docs, design docs, specification docs, or any other reference files), attempt to read each path using the Read tool. If the file exists, append its path to REFERENCE_DOCUMENTS. Confirm to the user: "Added {path} to reference documents." At the end of Phase 1, present the full REFERENCE_DOCUMENTS list to the user for confirmation.
123
130
  5. Collaboratively define **user stories** at the feature level -- the positive outcomes users should experience.
124
131
  - Format: "As a [role], I can [action], so that [benefit]"
125
132
  - Each story should describe a concrete, testable outcome from the user's perspective
@@ -337,12 +344,18 @@ Once the plan passes validation, save it using FOB-state-context patterns:
337
344
  date: {current date}
338
345
  plan-type: phased
339
346
  phases: {count}
347
+ reference-documents:
348
+ - {path1}
349
+ - {path2}
340
350
  ---
341
351
  ```
342
- If IS_RE_ENGINEERING is true, add this field to the frontmatter (after `phases`):
352
+ The `reference-documents` field lists all paths from REFERENCE_DOCUMENTS. If REFERENCE_DOCUMENTS is empty, omit the `reference-documents` field entirely.
353
+
354
+ If IS_RE_ENGINEERING is true, ALSO add this field to the frontmatter (after `reference-documents`):
343
355
  ```
344
356
  source-feature-doc: {FEATURE_DOC_PATH}
345
357
  ```
358
+ This preserves backward compatibility. The feature doc path appears in BOTH `reference-documents` and `source-feature-doc`.
346
359
  - Followed by the eight-section plan content
347
360
  - If IS_RE_ENGINEERING is true, add a note at the end of the "Task Overview" section (section 1 of the plan):
348
361
  "This plan is based on a reverse-engineered feature document: `{FEATURE_DOC_PATH}` (source repo: {SOURCE_REPO}, analysis depth: {ANALYSIS_DEPTH})."
package/manifest.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.0",
2
+ "version": "1.2.1",
3
3
  "presets": {
4
4
  "coding": {
5
5
  "description": "Research-driven coding workflow",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-fob",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Deploy research-driven AI coding assistant assets (skills, agents, commands) into your projects",
5
5
  "bin": {
6
6
  "ai-fob": "bin/install.js"