---
id: T-103
name: Harden fw init for external project use
description: >
  Collection of medium-severity gaps in fw init that degrade external project experience.
  Items to fix: (1) No .gitignore for .context/working/ — volatile files (tool-counter,
  focus.yaml, session.yaml, tier0-approval) get committed on first git add. Fix: create
  .context/working/.gitignore with * or add to project .gitignore. (2) Template naming
  inconsistency — CLAUDE.md references zzz-default.md but init copies default.md.
  Fix: copy all .md from templates/ or rename consistently. (3) Missing assumptions.yaml
  — fw assumption commands write to it but init doesnt create it. Fix: add to init
  alongside patterns/decisions/learnings. (4) Missing .context/scans/ directory —
  resume.sh and context init read from it. Fix: mkdir -p in init. (5) Write/Edit blocked
  immediately after init — .context/working/ exists but no focus.yaml stub, so check-active-task.sh
  blocks with confusing error. Fix: create stub focus.yaml with current_task: null
  or add clear error message. (6) Git hook installation errors silently swallowed
  (2>/dev/null). Fix: remove blanket stderr suppression. (7) Watchtower hardcoded
  to cd FRAMEWORK_ROOT — fails in external projects. Fix: guard with PROJECT_ROOT
  != FRAMEWORK_ROOT check. (8) Hardcoded FRAMEWORK_ROOT paths in settings.json — document
  brittleness or add runtime resolution. (9) .framework.yaml missing metadata (project_name,
  initialized_at, provider). DEPENDS ON: T-101 (hook fix should land first). PARALLEL
  WITH: T-102. Files: lib/init.sh, agents/context/lib/init.sh, agents/context/check-active-task.sh.
status: work-completed
workflow_type: build
owner: agent
tags: [fw-init, hardening, external-project]
related_tasks: []
created: 2026-02-17T08:53:40Z
last_update: '2026-06-11T22:23:38Z'
date_finished:
bvp_scores_proposed:
  - ts: '2026-06-11T22:23:38Z'
    estimator: bvp-estimator-v1-heuristic
    scores:
      D1: 0
      D2: 0
      D3: 0
      D4: 0
      F-RECALL: 0
      F-ORCH: 0
      F3: 0
      F1: 0
      F2: 0
    rationale: D1=0 (no-signal); D2=0 (no-signal); D3=0 (no-signal); D4=0 
      (no-signal); F-RECALL=0 (no-signal); F-ORCH=0 (no-signal); F3=0 
      (no-signal); F1=0 (no-signal); F2=0 (no-signal)
    rubric_sha: e4a00f38e801
---

# T-103: Harden fw init for external project use

## Context

[Link to design docs, specs, or predecessor tasks]

## Updates

### 2026-02-17T09:13:00Z — work-completed [claude-code]
- **Action:** Implemented all 9 hardening items:
  1. Added .context/working/.gitignore for volatile files (tool-counter, session.yaml, focus.yaml, etc.)
  2. Template copying now uses glob (copies ALL .md from templates/, not hardcoded names)
  3. Added assumptions.yaml creation alongside patterns/decisions/learnings/practices
  4. Added .context/scans/ directory creation
  5. focus.yaml stub — already handled by check-active-task.sh (allows with note when missing)
  6. Removed blanket 2>/dev/null from git hook installation (errors now visible)
  7. Watchtower context init guarded with PROJECT_ROOT == FRAMEWORK_ROOT check
  8. Hardcoded FRAMEWORK_ROOT — covered by T-101 (PROJECT_ROOT fix)
  9. .framework.yaml now includes project_name, provider, initialized_at metadata
- **Output:** Verified with `fw init /tmp/test-proj --provider claude` — all items present
- **Context:** 4 files modified: lib/init.sh, agents/context/lib/init.sh

### 2026-02-17T08:53:40Z — task-created [task-create-agent]
- **Action:** Created task via task-create agent
- **Output:** /opt/999-Agentic-Engineering-Framework/.tasks/active/T-103-harden-fw-init-for-external-project-use.md
- **Context:** Initial task creation

## Reviewer Verdict (v1.5)

- **Scan ID:** R-923050b2
- **Timestamp:** 2026-06-02T14:54:45Z
- **Catalogue:** v1.3-seed
- **Overall:** PASS
- **Needs Human:** no
- **Findings:** none
