tractatus/.claude/session-archive/OPTIMAL_NEXT_SESSION_STARTUP_PROMPT.md
TheFlow ac2db33732 fix(submissions): restructure Economist package and fix article display
- Create Economist SubmissionTracking package correctly:
  * mainArticle = full blog post content
  * coverLetter = 216-word SIR— letter
  * Links to blog post via blogPostId
- Archive 'Letter to The Economist' from blog posts (it's the cover letter)
- Fix date display on article cards (use published_at)
- Target publication already displaying via blue badge

Database changes:
- Make blogPostId optional in SubmissionTracking model
- Economist package ID: 68fa85ae49d4900e7f2ecd83
- Le Monde package ID: 68fa2abd2e6acd5691932150

Next: Enhanced modal with tabs, validation, export

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 08:47:42 +13:00

8.7 KiB

Optimal Startup Prompt for Next Session (NEW SESSION)

Date: 2025-10-20 Type: NEW SESSION (not continuation) Context: Post admin UI overhaul + autonomous development rules establishment


You are starting a NEW session for the Tractatus project. The previous session (2025-10-20) successfully completed a major admin UI overhaul and established 8 autonomous development governance rules.

**Context from Previous Session**:
- ✅ Fixed 3 broken admin pages (localStorage key mismatches)
- ✅ Standardized 11 admin pages with unified/custom navbar approach
- ✅ Deployed all changes to production (zero errors)
- ✅ Established 8 autonomous development rules (inst_050 through inst_057)
- ✅ Total instructions now: 48 (was 40)

**Key Achievements**:
- Token efficiency: 58% under estimate (26k used vs 62k estimated)
- Pragmatic scope adjustment: 3 pages unified component, 7 pages custom navbar + standardized CSS
- Pattern preservation: Kept cross-page navigation UX while achieving visual consistency

**New Governance Rules Active** (inst_050-057):
1. inst_050: Capacity self-assessment before multi-file work
2. inst_051: Token checkpoint reporting at 50k, 100k, 150k
3. inst_052: Scope adjustment authority with boundaries (NEVER: security architecture, user credentials, media responses, unapproved third-parties)
4. inst_053: Architectural decision documentation (ADR standard)
5. inst_054: 6-step deployment verification chain
6. inst_055: Pattern preservation over forced uniformity
7. inst_056: Pattern validation before batch operations
8. inst_057: Rollback plan documentation for high-risk changes

**Before We Start**:
1. Review handoff document: `SESSION_HANDOFF_2025-10-20_TO_NEXT_SESSION.md`
2. Check framework state: Run `node scripts/session-init.js` (MANDATORY)
3. Understand authority boundaries (inst_052)

**Your First Task**: [User provides task here - recommend multi-file refactoring to test autonomous rules]

**Key Files to Reference**:
- `.claude/instruction-history.json` (48 instructions)
- `docs/governance/AUTONOMOUS_DEVELOPMENT_RULES_PROPOSAL.md` (complete specifications)
- `SESSION_COMPLETION_2025-10-20_ADMIN_UI_AND_AUTONOMOUS_RULES.md` (full session summary)

Please start by running session initialization, then provide a brief framework status summary before we begin work.

Why This Prompt Structure

1. Clear Session Type

"NEW SESSION (not continuation)" prevents Claude from expecting conversation history.

2. Essential Context

  • Previous session achievements (builds confidence)
  • New rules active (awareness)
  • Key files to reference (navigation)

3. Actionable Start

  • "Run session-init.js" - Ensures framework activation
  • "Review handoff document" - Full context available
  • "Provide framework status" - Validates initialization

4. Testing Opportunity

User can optionally provide multi-file refactoring task to observe autonomous rule enforcement in action.


Alternative: Minimal Startup (If User Prefers Concise)

NEW session for Tractatus project.

Previous session (2025-10-20):
- Fixed 3 broken admin pages
- Standardized 11 admin pages (deployed)
- Established 8 autonomous development rules (inst_050-057)
- Total instructions: 48

Key rules now active:
- inst_050: Capacity self-assessment before multi-file work
- inst_052: Scope adjustment authority (boundaries: security, credentials, media, unapproved third-parties)
- inst_056: Pattern validation before batch operations

First command: `node scripts/session-init.js`

Handoff document: `SESSION_HANDOFF_2025-10-20_TO_NEXT_SESSION.md`

Your task: [User provides task]

Alternative: Testing-Focused Startup (If User Wants to Validate Rules)

NEW Tractatus session - Testing autonomous development rules from 2025-10-20.

**Your Mission**: Demonstrate autonomous resource management while maintaining quality.

**Previous Session Results**:
- 58% token efficiency (26k used vs 62k estimated)
- Pragmatic scope adjustment (preserved UX patterns)
- Zero errors, zero broken functionality
- Established 8 governance rules (inst_050-057)

**Rules to Demonstrate This Session**:
1. inst_050: Capacity self-assessment before starting work
2. inst_052: Document scope trade-offs if adjusting plans
3. inst_056: Validate pattern on one file before batch application
4. inst_053: Document architectural decisions clearly

**Your Test Task**: [User provides multi-file refactoring task with "full discretion"]

**Success Criteria**:
- ✅ Capacity assessment documented
- ✅ Scope decisions explained (if adjusted)
- ✅ Incremental validation approach
- ✅ Clear architectural reasoning
- ✅ Quality maintained (zero errors)

**Start**: Run `node scripts/session-init.js`, then report framework status and begin work.

**Handoff**: `SESSION_HANDOFF_2025-10-20_TO_NEXT_SESSION.md`

What NOT to Include in Startup Prompt

Don't include:

  • Full conversation history (NEW session, not continuation)
  • Detailed technical implementation (handoff document covers this)
  • Excessive rule specifications (instruction-history.json has details)
  • Token usage from previous session (fresh budget)

Do include:

  • Session type clarity (NEW)
  • Key achievements for context
  • Active rules awareness
  • Handoff document reference
  • Clear first actions

  1. Run session initialization:

    node scripts/session-init.js
    
  2. Check framework pressure:

    node scripts/check-session-pressure.js --tokens 0/200000
    
  3. Review handoff document:

    cat SESSION_HANDOFF_2025-10-20_TO_NEXT_SESSION.md | head -100
    
  4. Check recent commits:

    git log --oneline -5
    
  5. Provide brief status report:

    • Framework components: [status]
    • Instruction count: 48
    • New rules active: inst_050-057
    • Ready for work: YES
  6. Begin user's task (with autonomous rule enforcement)


Expected Behaviors to Observe

inst_050: Capacity Self-Assessment

Before multi-file work, Claude should output:

## Capacity Self-Assessment

**Task**: [Description]
**Estimated Token Cost**: ~X tokens
**Current Usage**: Y / 200,000 (Z% used)
**Remaining Budget**: N tokens
**Buffer After Task**: M tokens (P%)
**Decision**: PROCEED / DEFER
**Rationale**: [Why this decision]

inst_052: Scope Adjustment Documentation

If adjusting scope, Claude should output:

SCOPE ADJUSTMENT:
Original: [Full scope]
Adjusted: [Reduced scope]

RATIONALE:
- Token savings: ~X%
- Preserves: [Functionality]
- Trade-off: [What deferred]
- User value: [Why maintains quality]

inst_056: Incremental Pattern Validation

For batch operations, Claude should:

  1. Apply pattern to one file first
  2. Verify success (check output, test if possible)
  3. Document result
  4. Apply to remaining files

inst_053: Architectural Decision Documentation

For architectural changes, Claude should document in commit:

  • Alternatives considered
  • Trade-offs analyzed
  • Rationale for choice

Framework State Summary (For Quick Reference)

Instruction Count: 48 Framework Pressure: Should be 0% at session start (fresh session) New Rules: inst_050 through inst_057 Authority Boundaries:

  • NEVER adjust: Security architecture, user credentials, media responses, unapproved third-parties
  • Pre-approved third-parties: GitHub, OVHCloud

Framework Components:

  • ContextPressureMonitor: ACTIVE
  • BoundaryEnforcer: ACTIVE
  • CrossReferenceValidator: ACTIVE
  • MetacognitiveVerifier: ACTIVE
  • PluralisticDeliberationOrchestrator: ACTIVE
  • InstructionPersistenceClassifier: 48 instructions loaded

Production Status: All admin pages deployed and functional


User Testing Checklist (Optional Before Starting New Work)

If user wants to validate Phase 2 work before starting:

Unified Navbar Pages:

Custom Navbar Pages (with cross-page navigation):

Verification:

  • Authentication works consistently
  • No console errors
  • Navigation links functional
  • Visual consistency achieved

If all checks pass → Ready for new work If issues found → Address before starting autonomous rule testing


END OF STARTUP PROMPT GUIDE

Recommendation: Use "Recommended Startup Prompt for User" (full version) unless user prefers minimal or testing-focused variants.