learnship 2.0.10 → 2.1.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.
Files changed (79) hide show
  1. package/.claude-plugin/plugin.json +2 -2
  2. package/.cursor-plugin/plugin.json +2 -2
  3. package/README.md +59 -14
  4. package/SKILL.md +24 -2
  5. package/agents/learnship-doc-writer.md +63 -0
  6. package/agents/learnship-security-auditor.md +67 -0
  7. package/bin/install.js +9 -4
  8. package/commands/learnship/discuss-phase.md +1 -1
  9. package/commands/learnship/docs-update.md +22 -0
  10. package/commands/learnship/execute-phase.md +2 -6
  11. package/commands/learnship/extract-learnings.md +22 -0
  12. package/commands/learnship/forensics.md +21 -0
  13. package/commands/learnship/help.md +2 -1
  14. package/commands/learnship/ideate.md +1 -1
  15. package/commands/learnship/milestone-summary.md +22 -0
  16. package/commands/learnship/note.md +22 -0
  17. package/commands/learnship/plan-phase.md +0 -1
  18. package/commands/learnship/quick.md +1 -5
  19. package/commands/learnship/secure-phase.md +23 -0
  20. package/commands/learnship/session-report.md +21 -0
  21. package/commands/learnship/undo.md +22 -0
  22. package/commands/learnship/verify-work.md +1 -1
  23. package/cursor-rules/learnship.mdc +12 -2
  24. package/gemini-extension.json +2 -2
  25. package/hooks/session-start +12 -1
  26. package/learnship/agents/doc-writer.md +63 -0
  27. package/learnship/agents/security-auditor.md +67 -0
  28. package/learnship/references/common-bug-patterns.md +92 -0
  29. package/learnship/references/context-budget.md +49 -0
  30. package/learnship/references/domain-probes.md +133 -0
  31. package/learnship/references/gates.md +72 -0
  32. package/learnship/references/planning-config.md +99 -9
  33. package/learnship/references/thinking-models.md +61 -0
  34. package/learnship/references/universal-anti-patterns.md +51 -0
  35. package/learnship/templates/agents.md +20 -6
  36. package/learnship/templates/context.md +207 -32
  37. package/learnship/templates/discussion-log.md +49 -0
  38. package/learnship/templates/security.md +61 -0
  39. package/learnship/templates/ui-spec.md +107 -0
  40. package/learnship/workflows/complete-milestone.md +4 -5
  41. package/learnship/workflows/compound.md +2 -0
  42. package/learnship/workflows/debug.md +2 -0
  43. package/learnship/workflows/discuss-phase.md +73 -15
  44. package/learnship/workflows/docs-update.md +144 -0
  45. package/learnship/workflows/execute-phase.md +42 -7
  46. package/learnship/workflows/extract-learnings.md +161 -0
  47. package/learnship/workflows/forensics.md +118 -0
  48. package/learnship/workflows/help.md +20 -2
  49. package/learnship/workflows/ideate.md +63 -4
  50. package/learnship/workflows/ls.md +1 -1
  51. package/learnship/workflows/milestone-summary.md +150 -0
  52. package/learnship/workflows/new-project.md +68 -4
  53. package/learnship/workflows/next.md +1 -1
  54. package/learnship/workflows/note.md +110 -0
  55. package/learnship/workflows/pause-work.md +2 -0
  56. package/learnship/workflows/plan-phase.md +17 -2
  57. package/learnship/workflows/quick.md +28 -8
  58. package/learnship/workflows/review.md +1 -0
  59. package/learnship/workflows/secure-phase.md +147 -0
  60. package/learnship/workflows/session-report.md +133 -0
  61. package/learnship/workflows/settings.md +40 -46
  62. package/learnship/workflows/ship.md +2 -0
  63. package/learnship/workflows/undo.md +151 -0
  64. package/learnship/workflows/verify-work.md +36 -4
  65. package/package.json +1 -1
  66. package/references/common-bug-patterns.md +92 -0
  67. package/references/context-budget.md +49 -0
  68. package/references/domain-probes.md +133 -0
  69. package/references/gates.md +72 -0
  70. package/references/planning-config.md +139 -0
  71. package/references/solution-schema.md +159 -0
  72. package/references/thinking-models.md +61 -0
  73. package/references/universal-anti-patterns.md +51 -0
  74. package/templates/agents.md +80 -7
  75. package/templates/config.json +28 -3
  76. package/templates/context.md +207 -32
  77. package/templates/discussion-log.md +49 -0
  78. package/templates/security.md +61 -0
  79. package/templates/ui-spec.md +107 -0
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: learnship:session-report
3
+ description: Generate a post-session summary with work performed, outcomes, and estimated resource usage
4
+ allowed-tools:
5
+ - Read
6
+ - Bash
7
+ - Write
8
+ ---
9
+
10
+ <execution_context>
11
+ @~/.claude/workflows/session-report.md
12
+ </execution_context>
13
+
14
+ <context>
15
+ Arguments: $ARGUMENTS
16
+ </context>
17
+
18
+ <process>
19
+ Execute the learnship session-report workflow end-to-end.
20
+ Preserve all workflow gates, validations, checkpoints, and routing.
21
+ </process>
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: learnship:undo
3
+ description: Safe git revert for phase or plan commits — preserves history, checks dependencies
4
+ argument-hint: "--last N | --phase NN | --plan NN-MM"
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Write
9
+ ---
10
+
11
+ <execution_context>
12
+ @~/.claude/workflows/undo.md
13
+ </execution_context>
14
+
15
+ <context>
16
+ Arguments: $ARGUMENTS
17
+ </context>
18
+
19
+ <process>
20
+ Execute the learnship undo workflow end-to-end.
21
+ Preserve all workflow gates, validations, checkpoints, and routing.
22
+ </process>
@@ -6,7 +6,7 @@ allowed-tools:
6
6
  - Read
7
7
  - Bash
8
8
  - Write
9
- - AskUserQuestion
9
+ - Task
10
10
  ---
11
11
 
12
12
  <execution_context>
@@ -79,9 +79,17 @@ Suggest the appropriate workflow slash command when relevant:
79
79
  | `/review` | Code ready for review — multi-persona quality check |
80
80
  | `/challenge` | About to commit to a milestone or big feature — stress-test the scope |
81
81
  | `/ship` | Tests pass, code reviewed — ship it (test → lint → commit → push → PR) |
82
- | `/ideate` | Looking for what to build next — codebase-grounded idea generation |
82
+ | `/ideate` | Looking for what to build next — codebase-grounded idea generation (add `--explore` for Socratic mode) |
83
83
  | `/guard` | Working on sensitive files — enable safety mode with destructive command warnings |
84
84
  | `/sync-docs` | After code changes — detect stale documentation |
85
+ | `/forensics` | Something went wrong — post-mortem investigation (read-only) |
86
+ | `/undo` | Need to revert commits safely — preserves git history |
87
+ | `/note [text]` | Quick idea capture — zero friction, no questions |
88
+ | `/session-report` | End of session — generate summary for stakeholders |
89
+ | `/secure-phase [N]` | After execution — per-phase STRIDE security verification |
90
+ | `/docs-update` | Generate or update project documentation |
91
+ | `/extract-learnings [N]` | After phase completion — structured learning extraction |
92
+ | `/milestone-summary` | Generate comprehensive milestone summary for team onboarding |
85
93
 
86
94
  ## Planning Artifacts
87
95
 
@@ -91,7 +99,9 @@ All project state lives in `.planning/`. Key files:
91
99
  - `.planning/PROJECT.md` — Vision, requirements, key decisions
92
100
  - `.planning/ROADMAP.md` — Phase-by-phase delivery plan
93
101
  - `.planning/STATE.md` — Current position, decisions, blockers
94
- - `.planning/phases/[N]-[slug]/` — Per-phase artifacts
102
+ - `.planning/phases/[N]-[slug]/` — Per-phase artifacts (CONTEXT, RESEARCH, PLANs, SUMMARYs, UAT, VERIFICATION, SECURITY, LEARNINGS)
103
+ - `.planning/notes/` — Quick notes captured via `/note`
104
+ - `.planning/reports/` — Session reports and forensic reports
95
105
 
96
106
  Always read `STATE.md` and `ROADMAP.md` before any planning or execution operation.
97
107
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "learnship",
3
- "version": "2.0.10",
4
- "description": "Agentic engineering done right — 49 structured workflows, persistent memory across sessions, integrated learning partner, and impeccable UI design system.",
3
+ "version": "2.1.0",
4
+ "description": "Agentic engineering done right — 57 structured workflows, persistent memory across sessions, integrated learning partner, and impeccable UI design system.",
5
5
  "author": "Favio Vazquez",
6
6
  "homepage": "https://faviovazquez.github.io/learnship/",
7
7
  "repository": "https://github.com/FavioVazquez/learnship",
@@ -28,7 +28,18 @@ escape_for_json() {
28
28
 
29
29
  skill_escaped=$(escape_for_json "$skill_content")
30
30
 
31
- session_context="<learnship>\nYou are working in a project that uses learnship an agentic engineering system.\n\n${skill_escaped}\n</learnship>"
31
+ # Try to inject last-session context from STATE.md if it exists in the current project
32
+ state_context=""
33
+ if [ -f ".planning/STATE.md" ]; then
34
+ # Extract the last few lines for session continuity (last activity, current phase, blockers)
35
+ last_activity=$(grep -i "last activity\|current phase\|blockers\|status" ".planning/STATE.md" 2>/dev/null | head -5 || echo "")
36
+ if [ -n "$last_activity" ]; then
37
+ state_escaped=$(escape_for_json "$last_activity")
38
+ state_context="\\n\\n<session_context>\\nProject state summary (from .planning/STATE.md):\\n${state_escaped}\\n</session_context>"
39
+ fi
40
+ fi
41
+
42
+ session_context="<learnship>\nYou are working in a project that uses learnship — an agentic engineering system.\n\n${skill_escaped}${state_context}\n</learnship>"
32
43
 
33
44
  # Cursor sets CURSOR_PLUGIN_ROOT; Claude Code sets CLAUDE_PLUGIN_ROOT.
34
45
  # Emit the field each platform expects to avoid double-injection.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: learnship-doc-writer
3
+ description: Writes and updates project documentation files — grounded in the live codebase, verifies factual claims. Spawned by docs-update workflow.
4
+ tools: Read, Write, Edit, Bash, Glob, Grep
5
+ color: cyan
6
+ ---
7
+
8
+ <role>
9
+ You are a learnship doc-writer. You write and update project documentation files that are grounded in the actual codebase — every claim must be verifiable.
10
+
11
+ Spawned by `docs-update` when parallelization is enabled.
12
+
13
+ Your job: Write a single documentation file (README, ARCHITECTURE, etc.) that accurately describes the current state of the project.
14
+
15
+ **CRITICAL: Mandatory Initial Read**
16
+ If the prompt contains a `<files_to_read>` block, you MUST use the Read tool to load every file listed there before performing any other actions.
17
+ </role>
18
+
19
+ <project_context>
20
+ Before writing, load project context:
21
+
22
+ 1. Read `./AGENTS.md`, `./CLAUDE.md`, or `./GEMINI.md` (whichever exists) for project conventions
23
+ 2. Read `.planning/STATE.md` for current phase and decisions
24
+ 3. Read `.planning/PROJECT.md` for project vision and scope
25
+ </project_context>
26
+
27
+ <writing_principles>
28
+
29
+ ## Core Rules
30
+
31
+ 1. **Ground every claim in the codebase.** Don't write "the API supports pagination" unless you can verify pagination code exists. Read the source before documenting it.
32
+ 2. **Verify file paths.** Every file path mentioned in the doc must exist on disk. Run `ls` to check.
33
+ 3. **Verify commands.** Every command shown in a doc should work. If you can't run it, mark it with a note.
34
+ 4. **Preserve existing voice.** When updating an existing doc, match the author's writing style. Don't rewrite sections that are still accurate.
35
+ 5. **Be specific, not generic.** "Run `npm start` to start the dev server on port 3000" beats "Start the development server."
36
+
37
+ ## Doc Types
38
+
39
+ | Type | Purpose | Key Sections |
40
+ |------|---------|-------------|
41
+ | README | First thing a new person reads | What, why, quickstart, structure |
42
+ | ARCHITECTURE | System design overview | Components, data flow, key decisions |
43
+ | GETTING-STARTED | Setup from zero to running | Prerequisites, install, first run |
44
+ | DEVELOPMENT | Day-to-day dev workflow | Commands, conventions, debugging |
45
+ | TESTING | How to write and run tests | Framework, patterns, running |
46
+ | CONFIGURATION | All config options | Schema, defaults, examples |
47
+ | API | Endpoint reference | Routes, params, responses |
48
+ | CONTRIBUTING | How to contribute | Process, standards, PR template |
49
+ | DEPLOYMENT | How to deploy | Environments, commands, CI/CD |
50
+
51
+ ## Verification
52
+
53
+ After writing each doc, verify:
54
+ ```bash
55
+ # Check all file references exist
56
+ grep -oE '`[a-zA-Z0-9_./-]+\.[a-z]+`' [doc] | tr -d '`' | while read f; do
57
+ [ -f "$f" ] || echo "MISSING: $f"
58
+ done
59
+ ```
60
+
61
+ If any file reference is broken, fix the doc before committing.
62
+
63
+ </writing_principles>
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: learnship-security-auditor
3
+ description: Verifies threat mitigation coverage for a phase — reads PLAN.md threat data, analyzes codebase for security concerns, classifies threats. Read-only — does not modify source code.
4
+ tools: Read, Bash, Glob, Grep
5
+ color: red
6
+ ---
7
+
8
+ <role>
9
+ You are a learnship security auditor. You verify that security threats identified during planning have been properly mitigated in the implementation.
10
+
11
+ Spawned by `secure-phase` when parallelization is enabled.
12
+
13
+ Your job: Analyze the codebase for security concerns, classify threats using STRIDE, and produce a SECURITY.md report.
14
+
15
+ **CRITICAL: Mandatory Initial Read**
16
+ If the prompt contains a `<files_to_read>` block, you MUST use the Read tool to load every file listed there before performing any other actions.
17
+
18
+ **You are READ-ONLY.** Do not modify source code. Only write the SECURITY.md report file.
19
+ </role>
20
+
21
+ <project_context>
22
+ Before auditing, load project context:
23
+
24
+ 1. Read `./AGENTS.md`, `./CLAUDE.md`, or `./GEMINI.md` (whichever exists) for project conventions
25
+ 2. Read `.planning/STATE.md` for current phase and decisions
26
+ 3. Read `.planning/config.json` for security enforcement settings
27
+ </project_context>
28
+
29
+ <audit_methodology>
30
+
31
+ ## STRIDE Categories
32
+
33
+ | Category | Question | Examples |
34
+ |----------|----------|----------|
35
+ | **S**poofing | Can someone pretend to be someone else? | Auth bypass, session hijacking |
36
+ | **T**ampering | Can someone modify data they shouldn't? | SQL injection, CSRF, file manipulation |
37
+ | **R**epudiation | Can actions be denied after the fact? | Missing audit logs, unsigned transactions |
38
+ | **I**nfo Disclosure | Can sensitive data leak? | Exposed secrets, verbose errors, PII in logs |
39
+ | **D**enial of Service | Can the system be made unavailable? | Unbounded queries, resource exhaustion |
40
+ | **E**levation of Privilege | Can someone gain unauthorized access? | Missing authz checks, insecure defaults |
41
+
42
+ ## What to Check
43
+
44
+ For each file modified in this phase:
45
+
46
+ 1. **Input validation** — Are user inputs validated before processing?
47
+ 2. **Authentication** — Are auth checks present on protected routes?
48
+ 3. **Authorization** — Are permission checks granular enough?
49
+ 4. **Data handling** — Are secrets, PII, and tokens handled safely?
50
+ 5. **Error handling** — Do errors leak implementation details?
51
+ 6. **Dependencies** — Are there known vulnerabilities in new dependencies?
52
+
53
+ ## Threat Classification
54
+
55
+ For each identified concern:
56
+ - **CLOSED** — mitigation found in code, OR accepted risk documented, OR transferred to third-party
57
+ - **OPEN** — none of the above
58
+
59
+ ## Output Format
60
+
61
+ Write the SECURITY.md file using the template at `@./templates/security.md`. Fill in:
62
+ - Trust boundaries from the analysis
63
+ - Complete threat register with STRIDE categories
64
+ - Status for each threat (open/closed)
65
+ - Evidence for closed threats
66
+
67
+ </audit_methodology>
@@ -0,0 +1,92 @@
1
+ <common_bug_patterns>
2
+
3
+ Patterns for detecting common bugs in AI-generated code. Used by the verifier agent and verify-work workflow to catch issues that pass basic existence checks but fail in practice.
4
+
5
+ ---
6
+
7
+ ## Stub Detection
8
+
9
+ These patterns indicate placeholder code regardless of file type:
10
+
11
+ ### Comment-based stubs
12
+ ```bash
13
+ grep -E "(TODO|FIXME|XXX|HACK|PLACEHOLDER)" "$file"
14
+ grep -E "implement|add later|coming soon|will be" "$file" -i
15
+ grep -E "// \.\.\.|/\* \.\.\. \*/|# \.\.\." "$file"
16
+ ```
17
+
18
+ ### Placeholder text in output
19
+ ```bash
20
+ grep -E "placeholder|lorem ipsum|coming soon|under construction" "$file" -i
21
+ grep -E "sample|example|test data|dummy" "$file" -i
22
+ ```
23
+
24
+ ### Empty or trivial implementations
25
+ ```bash
26
+ grep -E "return null|return undefined|return \{\}|return \[\]" "$file"
27
+ grep -E "pass$|\.\.\.|\bnothing\b" "$file"
28
+ grep -E "console\.(log|warn|error).*only" "$file"
29
+ ```
30
+
31
+ ### Hardcoded values where dynamic expected
32
+ ```bash
33
+ grep -E "id.*=.*['\"].*['\"]" "$file"
34
+ grep -E "count.*=.*\d+|length.*=.*\d+" "$file"
35
+ ```
36
+
37
+ ---
38
+
39
+ ## Wiring Gaps
40
+
41
+ Code exists but isn't connected to the rest of the system:
42
+
43
+ ### Unregistered routes
44
+ - Route handler file exists but not imported in the router/app entry
45
+ - API endpoint defined but not added to the route table
46
+
47
+ ### Unused exports
48
+ - Component exported but never imported anywhere
49
+ - Utility function exported but no consumers
50
+
51
+ ### Missing environment variables
52
+ - Code references `process.env.X` but `.env.example` doesn't list it
53
+ - Config reads a key that's not in the defaults
54
+
55
+ ### Broken imports
56
+ - Import path doesn't match actual file location (case sensitivity on Linux)
57
+ - Circular dependency that works in dev but fails in production build
58
+
59
+ ---
60
+
61
+ ## State Drift
62
+
63
+ State management issues that cause subtle bugs:
64
+
65
+ ### Stale state references
66
+ - React component reads state that was updated in a different render cycle
67
+ - Cache not invalidated after mutation
68
+
69
+ ### Race conditions
70
+ - Multiple async operations writing to the same resource
71
+ - Optimistic UI update without rollback on failure
72
+
73
+ ### Schema mismatch
74
+ - Database migration changes column type but API response type not updated
75
+ - Frontend expects field that backend stopped sending
76
+
77
+ ---
78
+
79
+ ## Verification Levels
80
+
81
+ For each artifact, verify at the appropriate level:
82
+
83
+ | Level | Check | Method |
84
+ |-------|-------|--------|
85
+ | 1. Exists | File is present at expected path | `ls [file]` |
86
+ | 2. Substantive | Content is real implementation, not placeholder | Stub detection patterns above |
87
+ | 3. Wired | Connected to the rest of the system | Import/route check |
88
+ | 4. Functional | Actually works when invoked | Run command or manual test |
89
+
90
+ Levels 1-3 can be checked programmatically. Level 4 often requires human verification (verify-work UAT).
91
+
92
+ </common_bug_patterns>
@@ -0,0 +1,49 @@
1
+ <context_budget>
2
+
3
+ Standard rules for keeping orchestrator context lean. Reference this in workflows that spawn subagents or read significant content.
4
+
5
+ ---
6
+
7
+ ## Universal Rules
8
+
9
+ Every workflow that spawns agents or reads significant content must follow these rules:
10
+
11
+ 1. **Never** read agent definition files (`agents/*.md`) — `subagent_type` auto-loads them
12
+ 2. **Never** inline large files into subagent prompts — tell agents to read files from disk instead
13
+ 3. **Read depth scales with context window** — check `context_window` in `.planning/config.json`:
14
+ - At < 500000 tokens (default 200k): read only frontmatter, status fields, or summaries
15
+ - At >= 500000 tokens (1M model): MAY read full subagent output bodies when needed for inline decisions
16
+ 4. **Delegate** heavy work to subagents — the orchestrator routes, it doesn't execute
17
+ 5. **Proactive warning**: If you've already consumed significant context (large file reads, multiple subagent results), warn the user: "Context budget is getting heavy. Consider checkpointing progress."
18
+
19
+ ## Read Depth by Context Window
20
+
21
+ | Context Window | Subagent Output Reading | SUMMARY.md | VERIFICATION.md | PLAN.md (other phases) |
22
+ |---------------|------------------------|------------|-----------------|------------------------|
23
+ | < 500k (200k model) | Frontmatter only | Frontmatter only | Frontmatter only | Current phase only |
24
+ | >= 500k (1M model) | Full body permitted | Full body permitted | Full body permitted | Current phase only |
25
+
26
+ **How to check:** Read `.planning/config.json` and inspect `context_window`. If the field is absent, treat as 200000 (conservative default).
27
+
28
+ ## Context Degradation Tiers
29
+
30
+ Monitor context usage and adjust behavior accordingly:
31
+
32
+ | Tier | Usage | Behavior |
33
+ |------|-------|----------|
34
+ | PEAK | 0-30% | Full operations. Read bodies, spawn multiple agents, inline results. |
35
+ | GOOD | 30-50% | Normal operations. Prefer frontmatter reads, delegate aggressively. |
36
+ | DEGRADING | 50-70% | Economize. Frontmatter-only reads, minimal inlining, warn user about budget. |
37
+ | POOR | 70%+ | Emergency mode. Checkpoint progress immediately. No new reads unless critical. |
38
+
39
+ ## Context Degradation Warning Signs
40
+
41
+ Quality degrades gradually before panic thresholds fire. Watch for these early signals:
42
+
43
+ - **Silent partial completion** — agent claims task is done but implementation is incomplete. Always verify agent output meets the plan's must_haves, not just that files exist.
44
+ - **Increasing vagueness** — agent starts using phrases like "appropriate handling" or "standard patterns" instead of specific code. This indicates context pressure.
45
+ - **Skipped steps** — agent omits protocol steps it would normally follow. If an agent's success criteria has 8 items but it only reports 5, suspect context pressure.
46
+
47
+ When delegating to agents, the orchestrator cannot verify semantic correctness of agent output — only structural completeness. Mitigate with must_haves and spot-check verification.
48
+
49
+ </context_budget>
@@ -0,0 +1,133 @@
1
+ <domain_probes>
2
+
3
+ Domain-aware probing patterns for `/new-project` deep questioning and `/discuss-phase` gray area identification.
4
+
5
+ When the user mentions a technology area, use these probes to ask insightful follow-up questions. Don't run through them as a checklist — pick the 2-3 most relevant based on context. The goal is to surface hidden assumptions and trade-offs the user may not have considered yet.
6
+
7
+ ---
8
+
9
+ ## Authentication
10
+
11
+ | User mentions | Probe with domain knowledge |
12
+ |---|---|
13
+ | "login" or "auth" | OAuth (which providers?), JWT, or session-based? Social login or just email/password? |
14
+ | "users" or "accounts" | MFA required? Password reset flow? Email verification? |
15
+ | "sessions" | Session duration and refresh strategy? Server-side sessions or stateless tokens? |
16
+ | "roles" or "permissions" | RBAC, ABAC, or simple role checks? How many distinct roles? |
17
+ | "API keys" | Key rotation strategy? Scoped permissions per key? Rate limiting per key? |
18
+
19
+ ---
20
+
21
+ ## Real-Time Updates
22
+
23
+ | User mentions | Probe with domain knowledge |
24
+ |---|---|
25
+ | "real-time" or "live updates" | WebSockets, SSE, or polling? What specifically needs to be real-time vs. eventual? |
26
+ | "notifications" | Push notifications (browser/mobile), in-app only, or both? Persistence and read receipts? |
27
+ | "collaboration" or "multiplayer" | Conflict resolution strategy? Operational transforms or CRDTs? Expected concurrent users? |
28
+ | "chat" or "messaging" | Message history and search? Typing indicators? Read receipts? |
29
+ | "streaming" | Reconnection strategy? What happens when the connection drops — queue or discard? |
30
+
31
+ ---
32
+
33
+ ## Dashboard
34
+
35
+ | User mentions | Probe with domain knowledge |
36
+ |---|---|
37
+ | "dashboard" | What data sources feed it? How many distinct views? |
38
+ | "charts" or "graphs" | Interactive or static? Drill-down capability? Export to CSV/PDF? |
39
+ | "metrics" or "KPIs" | Refresh strategy — real-time, periodic polling, or on-demand? Acceptable staleness? |
40
+ | "admin panel" | Role-based visibility? Which actions beyond viewing (edit, delete, approve)? |
41
+ | "mobile" or "responsive" | Simplified mobile view or full parity? Touch interactions for charts? |
42
+
43
+ ---
44
+
45
+ ## API Design
46
+
47
+ | User mentions | Probe with domain knowledge |
48
+ |---|---|
49
+ | "API" | REST, GraphQL, or RPC-style? Internal only or public-facing? |
50
+ | "endpoints" or "routes" | Versioning strategy (URL path, header, query param)? Breaking change policy? |
51
+ | "pagination" | Cursor-based or offset? Expected result set sizes? Stable ordering guarantee? |
52
+ | "rate limiting" | Per-user, per-IP, or per-API-key? Burst allowance? How to communicate limits to clients? |
53
+ | "errors" | Structured error format? Error codes vs. messages? How much detail in production errors? |
54
+
55
+ ---
56
+
57
+ ## Database
58
+
59
+ | User mentions | Probe with domain knowledge |
60
+ |---|---|
61
+ | "database" or "storage" | SQL or NoSQL? What drives the choice — relational integrity, flexibility, scale? |
62
+ | "ORM" or "queries" | ORM (which one?) or raw queries? Query builder as middle ground? |
63
+ | "migrations" | Migration tool? Rollback strategy? How to handle data migrations vs. schema migrations? |
64
+ | "seeding" or "test data" | Seed data for development? Realistic fake data or minimal fixtures? |
65
+ | "scale" or "performance" | Read/write ratio? Read replicas? Connection pooling strategy? |
66
+
67
+ ---
68
+
69
+ ## Search
70
+
71
+ | User mentions | Probe with domain knowledge |
72
+ |---|---|
73
+ | "search" | Full-text or exact match? Dedicated search engine (Elasticsearch, Meilisearch) or database-level? |
74
+ | "filtering" or "facets" | Faceted filtering? How many filter dimensions? Combined filters (AND/OR)? |
75
+ | "autocomplete" or "typeahead" | Debounce strategy? Minimum character threshold? Result ranking? |
76
+ | "indexing" | Index size and update frequency? Real-time indexing or batch? Acceptable index lag? |
77
+
78
+ ---
79
+
80
+ ## File Upload/Storage
81
+
82
+ | User mentions | Probe with domain knowledge |
83
+ |---|---|
84
+ | "upload" or "file upload" | Local filesystem or cloud (S3, GCS, Azure Blob)? Direct upload or through server? |
85
+ | "images" or "media" | Processing pipeline — resize, compress, thumbnail generation? Format conversion? |
86
+ | "size limits" | Max file size? Max total storage per user? What happens when limits are hit? |
87
+ | "documents" or "attachments" | Virus scanning? Preview generation? Versioning of uploaded files? |
88
+
89
+ ---
90
+
91
+ ## Caching
92
+
93
+ | User mentions | Probe with domain knowledge |
94
+ |---|---|
95
+ | "caching" or "performance" | Where to cache — browser, CDN, application layer, database query cache? |
96
+ | "invalidation" | Invalidation strategy — TTL, event-driven, or manual? Cache-aside vs. write-through? |
97
+ | "stale data" | Acceptable staleness window? Stale-while-revalidate pattern? |
98
+
99
+ ---
100
+
101
+ ## Testing
102
+
103
+ | User mentions | Probe with domain knowledge |
104
+ |---|---|
105
+ | "testing" or "tests" | Unit, integration, and E2E balance? Where to invest most testing effort? |
106
+ | "CI" or "pipeline" | Tests in CI? Parallel test execution? Test-on-PR or test-on-push? |
107
+ | "E2E" or "browser testing" | Playwright, Cypress, or other? Headed vs. headless? Visual regression testing? |
108
+
109
+ ---
110
+
111
+ ## Deployment
112
+
113
+ | User mentions | Probe with domain knowledge |
114
+ |---|---|
115
+ | "deploy" or "hosting" | Container, serverless, or traditional VM/VPS? Managed platform (Vercel, Railway) or self-hosted? |
116
+ | "CI/CD" or "pipeline" | GitHub Actions, GitLab CI, or other? Deploy on merge to main or manual trigger? |
117
+ | "environments" | How many environments (dev, staging, prod)? Environment parity strategy? |
118
+ | "rollback" | Rollback strategy? Blue-green, canary, or instant rollback? |
119
+ | "secrets" or "config" | Secret management — env vars, vault, or platform-native? Per-environment config strategy? |
120
+
121
+ ---
122
+
123
+ ## AI/ML Integration
124
+
125
+ | User mentions | Probe with domain knowledge |
126
+ |---|---|
127
+ | "AI" or "LLM" or "model" | Which provider/model? Streaming responses or batch? Fallback strategy? |
128
+ | "embeddings" or "RAG" | Vector store choice? Chunking strategy? Retrieval pipeline? |
129
+ | "fine-tuning" or "training" | Training data pipeline? Evaluation metrics? A/B testing new models? |
130
+ | "prompts" | Prompt versioning? Temperature/parameter management? Cost tracking? |
131
+ | "agents" or "tools" | Tool calling strategy? Human-in-the-loop? Safety guardrails? |
132
+
133
+ </domain_probes>
@@ -0,0 +1,72 @@
1
+ <gates>
2
+
3
+ Canonical gate types used across learnship workflows. Every validation checkpoint maps to one of these four types.
4
+
5
+ ---
6
+
7
+ ## Gate Types
8
+
9
+ ### Pre-flight Gate
10
+ **Purpose:** Validates preconditions before starting an operation.
11
+ **Behavior:** Blocks entry if conditions unmet. No partial work created.
12
+ **Recovery:** Fix the missing precondition, then retry.
13
+ **Examples:**
14
+ - plan-phase checks for REQUIREMENTS.md before planning
15
+ - execute-phase validates PLAN.md exists before execution
16
+ - discuss-phase confirms phase exists in ROADMAP.md
17
+
18
+ ### Revision Gate
19
+ **Purpose:** Evaluates output quality and routes to revision if insufficient.
20
+ **Behavior:** Loops back to producer with specific feedback. Bounded by iteration cap.
21
+ **Recovery:** Producer addresses feedback; checker re-evaluates. The loop also escalates early if issue count does not decrease between consecutive iterations (stall detection). After max iterations, escalates unconditionally.
22
+ **Examples:**
23
+ - Plan-checker reviewing PLAN.md (max 3 iterations)
24
+ - Verifier checking phase deliverables against success criteria
25
+
26
+ ### Escalation Gate
27
+ **Purpose:** Surfaces unresolvable issues to the developer for a decision.
28
+ **Behavior:** Pauses workflow, presents options, waits for human input.
29
+ **Recovery:** Developer chooses action; workflow resumes on selected path.
30
+ **Examples:**
31
+ - Revision loop exhausted after 3 iterations
32
+ - Ambiguous requirement needing clarification
33
+ - Security threat requiring human risk acceptance
34
+
35
+ ### Abort Gate
36
+ **Purpose:** Terminates the operation to prevent damage or waste.
37
+ **Behavior:** Stops immediately, preserves state, reports reason.
38
+ **Recovery:** Developer investigates root cause, fixes, restarts from checkpoint.
39
+ **Examples:**
40
+ - Context window critically low during execution
41
+ - STATE.md in error state
42
+ - Verification finds critical missing deliverables
43
+
44
+ ---
45
+
46
+ ## Gate Matrix
47
+
48
+ | Workflow | Phase | Gate Type | Artifacts Checked | Failure Behavior |
49
+ |----------|-------|-----------|-------------------|------------------|
50
+ | plan-phase | Entry | Pre-flight | REQUIREMENTS.md, ROADMAP.md | Block with missing-file message |
51
+ | plan-phase | Step 6 | Revision | PLAN.md quality | Loop to planner (max 3) |
52
+ | plan-phase | Post-revision | Escalation | Unresolved issues | Surface to developer |
53
+ | execute-phase | Entry | Pre-flight | PLAN.md | Block with missing-plan message |
54
+ | execute-phase | Completion | Revision | SUMMARY.md completeness | Re-run incomplete tasks |
55
+ | verify-work | Entry | Pre-flight | SUMMARY.md | Block with missing-summary |
56
+ | verify-work | Evaluation | Escalation | Failed criteria | Surface gaps to developer |
57
+ | secure-phase | Entry | Pre-flight | SUMMARY.md | Block until phase executed |
58
+ | secure-phase | Threats | Escalation | Open threats | Present to developer for decision |
59
+ | quick | Plan check | Revision | PLAN.md quality | Loop (max 2) |
60
+
61
+ ---
62
+
63
+ ## Applying Gates in Custom Workflows
64
+
65
+ When creating new workflows:
66
+
67
+ 1. **Every workflow needs at least one pre-flight gate** — check that required inputs exist before starting work
68
+ 2. **Any AI-generated output needs a revision gate** — bounded loops prevent infinite regeneration
69
+ 3. **Decisions the AI cannot make need escalation gates** — risk acceptance, ambiguous requirements, conflicting constraints
70
+ 4. **Resource exhaustion needs abort gates** — context budget, time limits, repeated failures
71
+
72
+ </gates>