Sprint planner

From sunholo-data/ailang · View interactive version

Sprint planner is an AI agent skill from the GitHub repository sunholo-data/ailang. Analyze design docs, calculate velocity from recent work, and create realistic sprint plans with day-by-day breakdowns. Use when user asks to "plan sprint", "create sprint plan", or wants to estimate development timeline.

How to use this skill

Skill file

AILANG Sprint Planner

Create comprehensive, data-driven sprint plans by analyzing design documentation, current implementation status, and recent velocity.

Current State

Use the data above first. Only re-run these commands manually if the injected context is empty or you need to refresh after making changes.

Quick Start

Most common usage:

# User says: "Plan the next sprint based on v0.4.0 roadmap"
# This skill will:
# 1. Read design doc (design_docs/planned/v0.4-roadmap.md)
# 2. Analyze CHANGELOG for recent velocity
# 3. Review current implementation status
# 4. Propose realistic milestones with LOC estimates
# 5. Create day-by-day task breakdown

When to Use This Skill

Invoke this skill when:

Coordinator Integration

When invoked by the AILANG Coordinator (detected by GitHub issue reference in the prompt), you MUST output these markers at the end of your response:

SPRINT_PLAN_PATH: design_docs/planned/vX_Y/sprint-plan-name.md
SPRINT_JSON_PATH: .ailang/state/sprints/sprint_ID.json

Why? The coordinator uses these markers to:

  1. Read the sprint plan content for GitHub comments
  2. Track artifacts across pipeline stages
  3. Provide visibility to humans reviewing the issue

Example completion:

## Sprint Plan Created

I've created the sprint plan with 3 milestones...

**SPRINT_PLAN_PATH**: `design_docs/planned/v0_6_3/m-feature-sprint-plan.md`
**SPRINT_JSON_PATH**: `.ailang/state/sprints/sprint_M-FEATURE.json`

Documentation URLs

When planning sprints that involve adding error messages, help text, or documentation links:

Website: https://ailang.sunholo.com/

Documentation Source: The website documentation lives in this repo at docs/

Common Documentation Paths:

Full URL Example:

https://ailang.sunholo.com/docs/reference/language-syntax

Best Practices:

Role in Long-Running Agent Pattern

sprint-planner acts as the "Initializer" agent in the two-phase pattern from Anthropic's long-running agent article:

This separation enables multi-session continuity - sprints can span days or weeks with Claude resuming work from where it left off.

Available Scripts

`scripts/analyze_velocity.sh [days]`

Analyze recent development velocity from CHANGELOG and git commits.

Usage:

# Analyze last 7 days (default)
.claude/skills/sprint-planner/scripts/analyze_velocity.sh

# Analyze last 14 days
.claude/skills/sprint-planner/scripts/analyze_velocity.sh 14

Output:

Analyzing velocity for last 7 days...

=== Recent CHANGELOG Entries ===
Total: ~1,200 LOC
Total: ~800 LOC

=== Recent Commits (last 7 days) ===
abc1234 Complete M-DX1.5: Migrate all builtins
def5678 Add Type Builder DSL

=== Files Changed (last 7 days) ===
15 files changed, 1200 insertions(+), 300 deletions(-)

=== Velocity Summary ===
Based on CHANGELOG entries and git history, estimate:
- Average LOC/day from recent milestones
- Typical milestone duration
- Current development pace

`scripts/create_sprint_json.sh <sprint_id> <sprint_plan_md> [design_doc_md]`

NEW: Create structured JSON progress file for multi-session sprint execution.

Usage:

# Create JSON progress file from sprint plan
.claude/skills/sprint-planner/scripts/create_sprint_json.sh \
  "M-S1" \
  "design_docs/planned/v0_4_0/m-s1-sprint-plan.md" \
  "design_docs/planned/v0_4_0/m-s1-parser-improvements.md"

What it does:

Output:

File Organization:

Sprint JSON files are stored in .ailang/state/sprints/ to keep the state directory organized.

Integration with sprint-executor:

After creating the JSON file, sprint-executor can:

Sprint Planning Workflow

CRITICAL: Always end by handing off to sprint-executor after user approval!

0. Check the Registry (Mandatory Reuse Gate)

Search the registry before planning any package-like capability, and record a depend / contribute / none decision per milestone in registry_reuse; placeholders block handoff. Procedure: resources/registry_reuse_gate.md.

1. Read and Analyze Design Document

Input: Path to design doc (e.g., design_docs/planned/v0.4-roadmap.md)

What to extract:

2. Review Current Implementation Status

Check these sources:

3. Analyze Recent Velocity

Use the velocity script:

.claude/skills/sprint-planner/scripts/analyze_velocity.sh

Calculate:

4. Identify Remaining Work

List incomplete milestones with:

5. Propose Sprint Plan

Use the template:

See CODE0

Include:

5.1. AILANG Syntax Gate (mandatory when any milestone writes `.ail` code)

Before finalizing a plan that creates or edits .ail code:

  1. Load the current teaching prompt with ailang prompt (or MCP prompt_get

when the ailang-docs MCP is wired). Recording a version alone is not loading syntax.

  1. Record AILANG prompt version loaded: <version> in the plan, using

ailang prompt --version-active to obtain the active CLI version.

  1. For every showcase/demo module, record three checklist rows: contracts

(requires/ensures, verifiable with ailang verify), effects (a named

effect row such as ! {IO}), and inline tests (tests [(in, out)] or a

property block). Each row must say include with planned signature detail,

or skip: <one-line reason>.

6. Present for Feedback

Show user:

Be ready to revise based on user priorities or constraints.

7. Finalize and Document

Once approved:

# Create sprint plan document (markdown - human-readable)
# Naming: M-<type><number>.md (M-P1 for parser, M-T1 for types, etc.)

Include in sprint plan:

NEW: Create JSON progress file (machine-readable):

# Create structured progress file for multi-session execution
.claude/skills/sprint-planner/scripts/create_sprint_json.sh \
  "<sprint-id>" \
  "design_docs/planned/vX_Y/<sprint-id>-plan.md" \
  "design_docs/planned/vX_Y/<feature>-design.md"

8. MANDATORY: Populate JSON with Real Milestones

The script creates a TEMPLATE - you MUST populate it with real data!

The create_sprint_json.sh script generates placeholder content. Before handing off to sprint-executor, you MUST edit the JSON file to include actual milestones.

Required edits to .ailang/state/sprints/sprint_<id>.json:

  1. Replace placeholder features array with real milestones:

```json

"features": [

{

"id": "M1_ACTUAL_NAME",

"description": "Real description from your sprint plan",

"estimated_loc": 150,

"dependencies": [],

"acceptance_criteria": [

"Actual criterion from sprint plan",

"Another real criterion"

],

"passes": null,

"started": null,

"completed": null,

"notes": null

}

]

```

  1. Update velocity estimates to match your sprint plan:

```json

"velocity": {

"target_loc_per_day": 150,

"estimated_total_loc": 670,

"estimated_days": 4

}

```

Validation checklist before handoff:

sprint-executor will REJECT the sprint if placeholders remain!

8.1. Link GitHub Issues (Automatic via ailang messages)

The script automatically discovers related GitHub issues using ailang messages integration.

The create_sprint_json.sh script automatically:

  1. Syncs GitHub issues via ailang messages import-github
  2. Extracts message IDs from the design doc's "Bug Report" field (pattern: msg_YYYYMMDD_HHMMSS_hash)
  3. Queries local messages for issues matching design doc keywords
  4. Extracts explicit #123 references from the design doc
  5. Adds github_issues: [...] to the sprint JSON

Why link GitHub issues?

Important: "refs" vs "Fixes"

Deduplication: ailang messages import-github checks existing issues by number before importing. Issues are never duplicated.

Manual linking (if auto-extraction misses issues):

# Add GitHub issues to sprint JSON
jq '.github_issues = [17, 42]' .ailang/state/sprints/sprint_<id>.json > tmp && mv tmp .ailang/state/sprints/sprint_<id>.json

Example JSON with linked issues:

{
  "sprint_id": "M-BUG-FIX",
  "github_issues": [17, 42],
  "features": [...]
}

Workflow with GitHub integration:

  1. External project sends bug report: ailang messages send user "Bug: ..." --type bug --github
  2. GitHub issue #17 is created and linked to message
  3. Design doc references message ID: **Bug Report**: msg_20251210_..._abc123
  4. create_sprint_json.sh extracts message ID, looks up issue #17, adds to JSON
  5. Sprint-executor includes refs #17 in milestone commits (links, no close)
  6. Final sprint commit uses Fixes #17 to auto-close issue on merge

9. ALWAYS Hand Off to sprint-executor

CRITICAL: After creating an approved sprint plan, ALWAYS hand off to sprint-executor immediately.

This is the standard workflow:

  1. sprint-planner (this skill): Creates plan + JSON progress file
  2. sprint-executor (implementation agent): Executes the plan with TDD

Send handoff message:

ailang agent send sprint-executor '{
  "type": "plan_ready",
  "correlation_id": "sprint_<sprint-id>_<date>",
  "sprint_id": "<sprint-id>",
  "plan_path": "design_docs/planned/vX_Y/<sprint-id>-plan.md",
  "progress_path": ".ailang/state/sprints/sprint_<id>.json",
  "estimated_duration": "X days (Y hours)",
  "milestones": [
    {"id": "M1", "name": "...", "estimated_hours": X},
    {"id": "M2", "name": "...", "estimated_hours": Y}
  ],
  "discovery": "Key findings from analysis",
  "total_loc_estimate": N,
  "risk_level": "low|medium|high"
}'

Why this workflow?

Optional: Commit before handoff:

git add design_docs/YYYYMMDD/M-<milestone>.md
git add .ailang/state/sprints/sprint_<id>.json
git commit -m "Add M-<milestone> sprint plan with JSON progress tracking"

Analysis Framework

Design Doc Analysis Checklist

Implementation Analysis Checklist

Gap Analysis Checklist

Resources

Sprint Plan Template

See CODE0 for complete sprint plan structure.

Best Practices

1. Be Conservative with Estimates

2. Prioritize Ruthlessly

3. Make Tasks Concrete

4. Consider Technical Debt

5. Plan for Testing

6. Document Assumptions

7. Verify Design Doc Has Systemic Analysis

Before planning a sprint for a bug fix, verify the design doc addresses systemic issues.

The design-doc-creator skill includes guidance for auditing related code paths before writing a design doc. If the design doc only fixes the reported symptom without checking for similar gaps, send it back for revision.

Quick check: Does the design doc mention:

If not: Ask user to revise design doc before planning sprint.

See design-doc-creator skill for full systemic analysis checklist.

Output Format

See CODE0 for full template.

Key sections:

Progressive Disclosure

This skill loads information progressively:

  1. Always loaded: This SKILL.md file (YAML frontmatter + workflow)
  2. Execute as needed: Scripts in scripts/ (velocity analysis)
  3. Load on demand: resources/sprint_plan_template.md (template)

Scripts execute without loading into context window, saving tokens.

Coordinator Integration (v0.6.2+)

The sprint-planner skill integrates with the AILANG Coordinator for automated workflows.

Autonomous Workflow

When configured in ~/.ailang/config.yaml, the sprint-planner agent:

  1. Receives handoff messages from design-doc-creator
  2. Creates sprint plans from design docs
  3. Hands off to sprint-executor on completion
coordinator:
  agents:
    - id: sprint-planner
      inbox: sprint-planner
      workspace: /path/to/ailang
      capabilities: [research, docs, planning]
      trigger_on_complete: [sprint-executor]
      auto_approve_handoffs: false
      session_continuity: true

Handoff message formats and how to send tasks: resources/coordinator.md. Merging a coordinator/task-* sprint-plan PR approves it and starts sprint-executor, which writes code (the cloud daemon fires the handoff on merge).

Handoff Message to sprint-executor

On completion, sprint-planner sends:

{
  "type": "plan_ready",
  "correlation_id": "sprint_M-CACHE_20251231",
  "sprint_id": "M-CACHE",
  "plan_path": "design_docs/planned/v0_6_3/m-cache-sprint-plan.md",
  "progress_path": ".ailang/state/sprints/sprint_M-CACHE.json",
  "session_id": "claude-session-xyz",
  "estimated_duration": "3 days",
  "total_loc_estimate": 650,
  "registry_reuse": [{"milestone":"M1", "package":"sunholo/example", "action":"depend", "reason":"Capability already exists"}],
  "risk_level": "medium"
}

Human-in-the-Loop

With auto_approve_handoffs: false:

  1. Sprint plan is created in worktree
  2. JSON progress file is created
  3. Approval request shows sprint plan in dashboard
  4. Human reviews plan feasibility
  5. Approve → Merges to main, triggers sprint-executor
  6. Reject → Worktree preserved, plan can be revised

Session Continuity

With session_continuity: true:

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.