@papi-ai/server 0.7.19 → 0.7.21

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@papi-ai/server",
3
- "version": "0.7.19",
3
+ "version": "0.7.21",
4
4
  "description": "PAPI MCP server — AI-powered sprint planning, build execution, and strategy review for software projects",
5
5
  "license": "Elastic-2.0",
6
6
  "type": "module",
@@ -18,7 +18,8 @@
18
18
  "README.md"
19
19
  ],
20
20
  "scripts": {
21
- "build": "tsup",
21
+ "build": "npm run build:skills && tsup",
22
+ "build:skills": "PAPI_SKILLS_OUT=skills/papi-cycle node scripts/export-skills.mjs",
22
23
  "build:prompts": "tsup src/prompts.ts --format esm",
23
24
  "start": "node dist/index.js",
24
25
  "test": "vitest run",
@@ -47,6 +48,7 @@
47
48
  "dependencies": {
48
49
  "@anthropic-ai/sdk": "^0.82.0",
49
50
  "@modelcontextprotocol/sdk": "^1.27.1",
51
+ "@papi-ai/skills": "^0.1.0",
50
52
  "js-yaml": "^4.1.0"
51
53
  },
52
54
  "devDependencies": {
@@ -0,0 +1,81 @@
1
+ # AGENTS.md
2
+
3
+ Project: {{project_name}}
4
+
5
+ This file is loaded at the start of every agent session. Mechanics for specific phases (planning, building, strategy review, ideas) live in lazy-loaded skills under `.agents/skills/`. Invoke a skill when its description matches the work at hand.
6
+
7
+ ## Skills available
8
+
9
+ - `papi-plan` — Invoke when starting a new PAPI cycle. Covers plan generation, board management, and cycle scoping rules.
10
+ - `papi-build` — Invoke when executing a build via build_execute. Covers branching, gestalt pre-build check, and post-build audit.
11
+ - `papi-strategy` — Invoke when running strategy_review or making Active Decision changes. Covers strategy review cadence and AD lifecycle.
12
+ - `papi-idea` — Invoke when submitting backlog ideas, registering docs, or filing research. Covers idea pipeline and doc registry conventions.
13
+ - `papi-advanced` — Invoke for cross-project patterns, dogfood-derived workflows, or advanced cycle management.
14
+
15
+ ## Project Identity — Verify Before Editing
16
+
17
+ On the first `orient` of any session, surface the connected project name to the user (e.g. "Connected to: <project_name>") and confirm it matches what they expect before making any code changes. PAPI projects are scoped by ID; if the wrong PAPI_PROJECT_ID is configured, edits land in the wrong project's history — a hard-to-undo class of mistake.
18
+
19
+ If the user doesn't recognise the project, stop. To fix it from this chat — no file editing — use the project tools: `project_list` to see their projects, `project_create` to make an empty one for this folder, or `project_switch` to point at the right one. Or pass `project=<id>` on a single call to override for that call only.
20
+
21
+ ## Session Start
22
+
23
+ When a conversation starts — fresh window, new session, or after context compression — orient before doing anything else:
24
+
25
+ 1. **Run `orient`** — single call that returns cycle number, task counts, in-progress/in-review tasks, strategy review cadence, trends, and recommended next action.
26
+ 2. **Fix orphaned tasks silently** — check for feat/task-XXX branches that don't match board status. Fix and report after.
27
+ 3. **Summarise:** "You're on Cycle N. X tasks to build, Y builds pending review." or "Cycle N is complete — ready for the next plan."
28
+ 4. **Run `build_list` when picking a task** — `orient` shows counts only. `build_list` shows the full task list with handoffs.
29
+
30
+ **CRITICAL: Check task statuses before acting.**
31
+ - **In Review** = already built. Suggest `review_list` → `review_submit`. **NEVER re-build an In Review task.**
32
+ - **In Progress** = build started but not completed. Check the branch and existing changes before writing new code.
33
+ - **Backlog** = not started. But first check if a `feat/task-XXX` branch already exists with commits — fix it, don't rebuild.
34
+ - If all cycle tasks are Done, suggest `release` or next `plan`.
35
+
36
+ ## Branching & PR Convention
37
+
38
+ - **All in-cycle, in-module tasks share `feat/cycle-N-<module>`** regardless of complexity. One branch per module per cycle, merged together. Module-less tasks fall back to a per-task branch.
39
+ - **Dependent tasks (any size):** When a task's BUILD HANDOFF lists a `DEPENDS ON` task from the same cycle, `build_execute` automatically reuses the upstream task's branch so commits stack for a single PR. Do not create a separate branch manually.
40
+ - **Commit per task within grouped branches** — traceable git history.
41
+ - **Never use `build_execute` with `light=true` on shared branches.** Light mode commits directly to the current branch without creating a PR. When a shared branch is squash-merged, those commits are collapsed — any CLAUDE.md or documentation changes are stripped. Use light mode only on isolated single-task branches where no squash-merge will occur.
42
+
43
+ ## Plumbing Is Autonomous
44
+
45
+ Board status updates, branch cleanup, orphaned task fixes, commit/PR/merge for housekeeping — these are mechanical plumbing. **Do them end-to-end without stopping to ask.** Report after the fact.
46
+
47
+ ## Code Before Claims — No Assumptions
48
+
49
+ **Before making any claim about how the codebase works, read the relevant file first.**
50
+
51
+ This includes:
52
+ - How a feature is implemented ("it works like X") → read the source
53
+ - Whether something exists ("there's no baseline migration") → check the directory
54
+ - Whether a flow is broken or working → trace it in code
55
+ - What a user would experience → check the actual page/component
56
+
57
+ Do NOT rely on memory, prior conversation, or inference. Read first, then answer.
58
+ If the answer requires checking 2-3 files, check them all before responding.
59
+
60
+ ## User-Facing Replies — Default Brief
61
+
62
+ When drafting any external user-facing copy (Discord post, support reply, email, release note, marketing blurb): default to ≤4 sentences, friendly tone, no hidden questions buried in prose. Offer to expand if the user wants more depth. Verbose drafts that need trimming are a recurring friction.
63
+
64
+ This applies to *output for users*, not internal commit messages, build reports, or technical explanations — those follow normal conventions.
65
+
66
+ ## Quick Work vs PAPI Work
67
+
68
+ PAPI is for planned work. Quick fixes — just do them. No need for plan or build_execute.
69
+
70
+ **After completing quick/ad-hoc work** (bug fixes, config changes, small improvements done outside the cycle), call `ad_hoc` to record it. This creates a Done task + build report so the work appears in cycle history and metrics. Don't skip this — unrecorded work is invisible work.
71
+
72
+ ## Data Integrity
73
+
74
+ - **Use MCP tools for all project data operations.** DB is the source of truth when using the pg adapter.
75
+ - Do NOT read `.papi/` files for context — use MCP tools.
76
+ - `.papi/` files may be stale when using pg adapter. This is expected.
77
+ - **`board_edit` handles cycle membership automatically.** Pass `cycle: <n>` to assign, `cycle: null` to clear (also flips status to Backlog), or `status: "In Cycle"` to auto-assign the active cycle. No manual SQL needed.
78
+
79
+ ## Sub-Agents
80
+
81
+ Project sub-agents live as markdown files in `.claude/agents/*.md`, each with `name` + `description` frontmatter. Run `agent_list` to see what's available (or read the **Sub-agents** line in `orient`). PAPI discovers them and surfaces them — dispatch one via your harness's Task/Agent tool. Discovery only; PAPI does not manage or invoke agents.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: papi-advanced
3
+ description: Invoke for cross-project patterns, dogfood-derived workflows, or advanced cycle management.
4
+ ---
5
+
6
+ # papi-advanced
7
+
8
+ ## When to Start a New Conversation
9
+
10
+ Start a fresh window when:
11
+ - **After a release** — cycle is done, context is heavy. New window orients in seconds via `orient`.
12
+ - **After 3+ tasks built** — accumulated file reads, diffs, and discussions bloat context. Quality degrades.
13
+ - **Switching modes** — going from building to planning, or from strategy review to building. Each mode benefits from clean context.
14
+ - **After context compression fires** — if you notice earlier messages are missing, the window is getting stale. Open fresh.
15
+
16
+ Stay in the same window when:
17
+ - Building sequential tasks in a batch (especially XS/S tasks)
18
+ - Mid-task and not yet complete
19
+ - Having a strategic discussion that informs the next action
20
+
21
+ **Rule of thumb:** If you've been in the same window for 30+ minutes or 3+ tasks, it's time for a fresh one.
22
+
23
+ ## Advanced Patterns
24
+
25
+ - **Cross-project awareness:** If running multiple PAPI projects, learnings transfer across them via shared patterns and the doc registry.
26
+ - **Dogfood friction:** When something feels painful in the workflow, note it — the `idea` tool turns friction into improvements.
27
+ - **Deferred tasks are intentional:** Tasks moved to Deferred aren't forgotten — they're parked for the right time.
28
+ - **Carry-forward items:** Each plan notes carry-forward from the previous cycle. Check them before planning.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: papi-build
3
+ description: Invoke when executing a build via build_execute. Covers branching, gestalt pre-build check, and post-build audit.
4
+ ---
5
+
6
+ # papi-build
7
+
8
+ ## Post-Build Audit
9
+
10
+ After every `build_execute` (complete), audit the branch before presenting for human review. This catches bugs and convention violations early.
11
+
12
+ 1. **Identify changed files:** Run `git diff origin/main --name-only` to find modified files. If no changes, report "No changes to audit" and skip.
13
+ 2. **Review each changed file** for:
14
+ - Logic errors, off-by-one mistakes, incorrect conditions
15
+ - Unhandled edge cases (null, undefined, empty inputs)
16
+ - Convention violations defined in this CLAUDE.md
17
+ - Incorrect type narrowing or unsafe casts
18
+ 3. **Documentation check:** If any `docs/` files describe behaviour that the change modified, flag as "Doc drift".
19
+ 4. **Report:** For each issue: file path, severity (Bug/Convention/Doc drift), what's wrong, how to fix.
20
+ 5. **If findings exist:** Run `review_submit` with `request-changes` and the findings. Fix before human review.
21
+ 6. **If clean:** Present for human review — "Ready for your review — approve or request changes?"
22
+
23
+ ## Housekeeping — Opt-In Deep Sweep
24
+
25
+ `orient` runs a fast cheap-checks-only path by default. The deep sweep — orphaned branches, In Review tasks with no PR, stale In Progress branches, unrecorded commits, unregistered docs — is opt-in via `deep_housekeeping: true`.
26
+
27
+ When to run with `deep_housekeeping: true`:
28
+ 1. Before `release` — catch board/branch drift.
29
+ 2. After a long break (>1 day since last session) — surface anything that fell off.
30
+ 3. When you suspect drift — odd cycle counts, missing PRs.
31
+
32
+ **Don't run deep on every session start.** It pollutes early context with cross-reference output that's noise 80% of the time. The default fast path tells you what cycle you're on, what's in flight, and what to do next; that's the daily-driver shape.
33
+
34
+ If the deep sweep surfaces something fixable (orphaned branches, missing PRs), fix it silently and report after — same autonomous-plumbing rule as before.
35
+
36
+ ## Context Compression Recovery
37
+
38
+ When the system compresses prior messages, immediately:
39
+ 1. **Run `orient`** — single call for cycle state
40
+ 2. Check your todo list for in-progress work
41
+ 3. Run housekeeping checks
42
+ 4. **NEVER re-build a task that is already In Review or Done.**
43
+ 5. Continue where you left off — don't restart or re-plan
44
+
45
+ ## Tool Use Discipline
46
+
47
+ Most tool errors are habit issues, not capability issues. Avoid them up front:
48
+
49
+ - **Ranged reads for large files.** Before `Read`-ing a file you haven't already touched this session, check its size. For files over ~1000 lines, or known-large surfaces (generated SQL, lockfiles, HTML reports, large templates), use `offset` + `limit` from the start instead of hitting the token ceiling.
50
+ - **Search-before-read for unverified paths.** If a path comes from memory or inference rather than a file you've read this session, run `Glob` or list the parent directory first. Don't `Read` paths you haven't confirmed exist.
51
+ - **Prefer Read/Glob/Grep over Bash for file operations.** Bash `cat`/`grep`/`find`/`ls` is the most common source of failed commands and produces unstructured output. Reserve Bash for genuinely shell-only operations (git, gh, package managers, SQL, real pipelines).
52
+ - **Verify-before-recommend.** Before suggesting a new task, hook, or skill, check whether it already exists: `board_view` for tasks, `doc_search` for docs, `ls .claude/hooks/` for hooks. Recommending duplicates of already-shipped work wastes a build slot.
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: papi-idea
3
+ description: Invoke when submitting backlog ideas, registering docs, or filing research. Covers idea pipeline and doc registry conventions.
4
+ ---
5
+
6
+ # papi-idea
7
+
8
+ ## Idea Pipeline (unlocked at cycle 21)
9
+
10
+ The `idea` tool is your backlog intake — not just for features, but bugs, research, and big ideas.
11
+
12
+ - When you discover something during a build, submit it via `idea` rather than stopping to fix it.
13
+ - Include a `Reference:` line pointing to relevant docs so the planner has context.
14
+ - Split large ideas into 2-3 focused submissions for better planner scoping.
15
+ - The backlog is the steering wheel — priority + notes shape what gets planned next.
16
+
17
+ ## Doc Registry
18
+
19
+ Docs are first-class entities. When research or planning produces a stable document:
20
+ - Register it with `doc_register` after it's finalised.
21
+ - Doc summaries travel with tool context — the planner and strategy review can find relevant docs.
22
+ - Keep docs current — update the review header after any change.
23
+
24
+ ## Documentation Maintenance
25
+
26
+ Before creating a new doc, check `docs/INDEX.md` — it may already exist. When creating or archiving docs, update the index.
27
+
28
+ After implementing any code change, check if the change affects any documentation in `docs/`. If a doc describes behaviour, architecture, or file interactions that your change modified, update the doc to stay accurate.
29
+
30
+ When updating a doc, add or update a review header immediately below the title:
31
+
32
+ ```
33
+ # Document Title
34
+ > Last reviewed: task-NNN — DD-MM-YYYY
35
+ ```
36
+
37
+ Replace `task-NNN` with the task ID that triggered the update, and `DD-MM-YYYY` with today's date.
@@ -0,0 +1,163 @@
1
+ ---
2
+ name: papi-plan
3
+ description: Invoke when starting a new PAPI cycle. Covers plan generation, board management, and cycle scoping rules.
4
+ ---
5
+
6
+ # papi-plan
7
+
8
+ ## Workflow Sequences
9
+
10
+ PAPI tools follow structured flows. The agent manages the cycle workflow automatically — the user should never need to type tool names or remember the flow. Handle the plumbing, surface the summaries.
11
+
12
+ ### Cycle Workflow (auto-managed)
13
+
14
+ - **Run tools automatically** — don't ask the user to invoke MCP tools manually
15
+ - Before implementing: silently run `build_execute <task_id>` (start phase)
16
+ - After implementing: run `build_execute <task_id>` (complete phase) with report fields
17
+ - After build_execute completes: audit the branch changes for bugs, convention violations, and doc drift (see Post-Build Audit below)
18
+ - After audit with findings: *MUST* automatically run `review_submit` with verdict `request-changes` and a concise summary of the audit findings as the changes requested — the builder fixes these before the task goes to human review
19
+ - After audit clean: present for human review — "Ready for your review — approve or request changes?"
20
+ - User approves/requests changes → run `review_submit` behind the scenes
21
+
22
+ ### The Cycle (main flow)
23
+
24
+ ```
25
+ plan → build_list → build_execute → audit → review_list → review_submit → build_list
26
+ ```
27
+
28
+ 1. **plan** — Run at the start of each cycle to generate the cycle plan and populate the board.
29
+ Next: `build_list` to see prioritised tasks.
30
+ 2. **build_list** — View tasks ready for execution, ordered by priority.
31
+ Next: `build_execute <task_id>` to start a task.
32
+ 3. **build_execute** (start) — Creates a feature branch and marks the task In Progress. Returns the build handoff.
33
+ Next: Implement the task, then `build_execute <task_id>` again with report fields to complete.
34
+ 4. **build_execute** (complete) — Submits the build report, commits, and marks the task In Review.
35
+ Next: Run the post-build audit automatically.
36
+ 5. **Post-build audit** — Review branch changes for bugs, convention violations, and doc drift (see Post-Build Audit section below).
37
+ Next: If findings exist, run `review_submit` with `request-changes` and the audit findings. If clean, proceed to `review_list`.
38
+ 6. **review_list** — Shows tasks pending human review (handoff-review or build-acceptance).
39
+ Next: `review_submit` to approve, accept, or request changes.
40
+ 7. **review_submit** — Records the review verdict and updates task status.
41
+ Next: `build_list` to view next build
42
+
43
+ **DO NOT** use `review_submit` as a substitute for `review_list`. If you need to see what is pending review, always call `review_list` first. If `review_list` is unavailable in your tool set (e.g. your MCP client filters parameterless tools), STOP and tell the human their MCP integration is incomplete — never guess at the next pending task. To submit an accept verdict on a build-acceptance review, either pass `reviewer_confirmed: true` or ensure `review_list` has run in the same session within the last 15 minutes. (SUP-2026-010.)
44
+
45
+ ### Strategy Review
46
+
47
+ ```
48
+ strategy_review → strategy_change
49
+ ```
50
+
51
+ - **strategy_review** — Analyses project health, velocity, and estimation accuracy.
52
+ Next: `strategy_change` if the review recommends adjustments.
53
+ - **strategy_change** — Updates active decisions, north star, or project direction based on review findings.
54
+
55
+ ### Detect Strategic Decisions in Conversation
56
+
57
+ Watch for: direction changes, architecture shifts, deprioritisation with reasoning, new principles, competitive positioning decisions.
58
+
59
+ When detected:
60
+ 1. Flag it: "That sounds like a strategic direction change — should I run `strategy_change`?"
61
+ 2. If confirmed, run `strategy_change` immediately.
62
+ 3. If mid-build, finish the current task first.
63
+
64
+ ### Idea Capture
65
+
66
+ ```
67
+ idea → (picked up by next plan)
68
+ ```
69
+
70
+ - **idea** — Captures a new task idea and writes it to the backlog.
71
+ Next: The next `plan` run will prioritise and schedule it.
72
+
73
+ ### Project Bootstrap
74
+
75
+ ```
76
+ setup → plan
77
+ ```
78
+
79
+ - **setup** — {{setup_description}}
80
+ Next: `plan` to run the first cycle planning session.
81
+
82
+ ### Board Management
83
+
84
+ - **board_view** — Read-only view of all tasks on the board.
85
+ - **board_archive** — Removes completed/cancelled tasks from the board to an archive.
86
+ - **board_deprioritise** — Moves a task to a later phase.
87
+
88
+ ### Quick Reference: Tool → Next Step
89
+
90
+ | Tool | Next Step |
91
+ |------|-----------|
92
+ | `setup` | `plan` |
93
+ | `plan` | `build_list` |
94
+ | `build_list` | `build_execute <task_id>` |
95
+ | `build_execute` (start) | Implement, then `build_execute` (complete) |
96
+ | `build_execute` (complete) | Post-build audit (automatic) |
97
+ | Audit (findings) | `review_submit` with `request-changes` |
98
+ | Audit (clean) | `review_list` |
99
+ | `review_list` | `review_submit` |
100
+ | `review_submit` (approve/accept) | `build_list` |
101
+ | `review_submit` (request-changes) | `build_execute` (redo) or `build_list` |
102
+ | `strategy_review` | `strategy_change` (if needed) |
103
+ | `idea` | Next `plan` picks it up |
104
+
105
+ ## Process Rules
106
+
107
+ These rules come from 80+ cycles of dogfooding. They prevent the most common sources of wasted time and rework.
108
+
109
+ ### Building
110
+ - **Verify before claiming done.** Hit the endpoint, check the rendered output, confirm the data round-trips. Never say "should work" — prove it works.
111
+ - **Preview frontend changes.** After any UI/styling build, provide the localhost URL so the user can visually review. Don't make them ask for it.
112
+ - **Debug one change at a time.** When fixing issues, make one change, verify it, then move on. Don't stack multiple untested fixes.
113
+ - **Test the write-read roundtrip.** Every data write path must have a verified read path. If you write to DB, confirm the read query returns what was written. This is the #1 source of silent failures.
114
+ - **Test after every build.** Run the project's test suite after implementing. Suggest follow-up tasks from learnings when meaningful.
115
+ - **Build patiently.** Validate each phase against the last. Don't rush through implementation — test through the UI, not just the API.
116
+
117
+ ### Security
118
+ - **Audit before widening access.** Before any build that adds endpoints, modifies auth/RLS, introduces new user types, or changes access controls — review the security implications first. Fix findings before shipping.
119
+ - **Flag access-widening changes.** If a build touches auth, RLS policies, API keys, or user-facing access, note "Security surface reviewed" in the build report's `discovered_issues` or `architecture_notes`.
120
+ - **Never ship secrets.** Do not commit .env files, API keys, or credentials. Check `.gitignore` covers sensitive files before pushing.
121
+ - **Telemetry opt-out.** PAPI collects anonymous usage data (tool name, duration, project ID). To disable, add `"PAPI_TELEMETRY": "off"` to the `env` block in your `.mcp.json`.
122
+
123
+ ### Planning & Scope
124
+ - **NEVER run `plan` more than once per cycle.** Adjust the cycle with `board_deprioritise` or `idea` instead.
125
+ - **NEVER skip cycles.** Complete and release the current cycle before running the next `plan`.
126
+ - **Large plan/handoff outputs:** If the prepare-phase output is too large to pass inline (>50 KB), write it to a file and pass the absolute path via `llm_response_file` instead of `llm_response`. The `plan`, `strategy_review`, and `handoff_generate` apply modes all accept `llm_response_file`. The two parameters are mutually exclusive.
127
+ - **Only build tasks assigned to the current cycle.** Use `build_list` — it filters to current-cycle tasks with handoffs.
128
+ - **Don't ask premature questions.** If the project is in early cycles, don't ask about deployment accounts, hosting providers, OAuth setup, or commercial features. Focus on building core functionality first.
129
+ - **Split large ideas.** If an idea has 3+ concerns, submit it as 2-3 separate ideas so the planner creates properly scoped tasks — not kitchen-sink handoffs.
130
+ - **Auto-release completed cycles.** When all cycle tasks are Done and reviews accepted, run `release` immediately. Forgetting causes cycle number drift and merge conflicts in the next session.
131
+ - **Verify cycle readiness before releasing.** Before calling `release`, run `board_view` to confirm every task in the current cycle has status Done or Cancelled. The review queue is NOT sufficient evidence — `review_list` only shows built-and-pending-review tasks; it does not show Backlog or In Progress tasks. If any task is Backlog or In Progress: (a) build it, (b) move it to the next cycle via `board_edit({ task_id, cycle: N+1 })`, or (c) cancel it via `board_edit`. Do not call `release` until the cycle has no pending work. The `release` tool enforces this server-side and will block with a task list if the check fails.
132
+
133
+ ### Communication
134
+ - **Show task names, not just IDs.** When summarising board state or reconciliation, include task names — e.g. "task-42: Add supplier form" not just "task-42".
135
+ - **Surface the next command.** After each step, tell the user what comes next. Commands should be surfaced, not memorised.
136
+
137
+ ### Stage Readiness
138
+ - **Access-widening stages require auth/security phases.** Before declaring a stage complete, check if it widens who can access the product (e.g. Alpha Distribution, Alpha Cohort). If so, auth hardening and security review must be completed first — not discovered after the fact.
139
+ - **Pattern:** Audit access surface → fix vulnerabilities → then widen access. Never ship access-widening without a security phase.
140
+
141
+
142
+ <!-- PAPI_ENRICHMENT_TIER_1 -->
143
+
144
+ ## Batch Building (unlocked at cycle 6)
145
+
146
+ For cycles with multiple tasks, batch build them without stopping between each:
147
+ - Build XS/S tasks first, then M/L — same-module tasks land on the cycle branch automatically regardless of size
148
+ - One commit per task for traceable history on the shared cycle branch
149
+ - After all tasks built, batch review them together
150
+
151
+ ### Gestalt Pre-Build Check (multi-task cycles)
152
+
153
+ **Before `build_execute` on the first task of any multi-task cycle, read the cycle as a whole:**
154
+
155
+ 1. Run `build_list` to see every task assigned to the current cycle.
156
+ 2. Read the BUILD HANDOFFs together — not one at a time. Look for:
157
+ - **Shared files** across handoffs — the same path in two FILES LIKELY TOUCHED lists usually means a refactor opportunity, a shared helper to extract first, or a sequencing constraint.
158
+ - **Shared modules** — multiple tasks in the same module should land on a shared cycle branch (`feat/cycle-N-<module>`) so they merge together.
159
+ - **Design decisions implicit across tasks** — e.g. one task introduces a new field, a later task consumes it. Build the producer first.
160
+ - **Module split** — tasks in different modules will land on different cycle branches (`feat/cycle-N-<module>`) and merge separately. Flag any cross-module coordination required before kicking off.
161
+ 3. Only then run `build_execute` on the first task.
162
+
163
+ This is a one-time check at the start of the cycle, not per-task. It catches scope conflicts, redundant work, and ordering hazards that an isolated handoff read can't see. Skip it for single-task cycles.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: papi-strategy
3
+ description: Invoke when running strategy_review or making Active Decision changes. Covers strategy review cadence and AD lifecycle.
4
+ ---
5
+
6
+ # papi-strategy
7
+
8
+ ## Strategy Reviews
9
+
10
+ Every 5 cycles, PAPI offers a strategy review — a deep analysis of velocity, estimation accuracy, active decisions, and project direction.
11
+
12
+ - **Don't skip them.** They're where compounding value comes from.
13
+ - Strategy reviews run in their own session — don't mix with building.
14
+ - Reviews produce recommendations that feed into the next plan.
15
+ - If the review recommends AD changes, use `strategy_change` to apply them.
16
+
17
+ ## Active Decision Lifecycle
18
+
19
+ Active Decisions (ADs) track architectural and product choices with confidence levels (LOW → MEDIUM → HIGH).
20
+
21
+ - Check ADs before making architectural choices — run `health` for the AD summary.
22
+ - ADs are for product/architecture choices only, not process preferences.
23
+ - When new evidence appears, update AD confidence via `strategy_change`.
24
+ - Supersede rather than overwrite — old decisions stay as history.
25
+ - New ADs should include a `### Reversal Trigger` section: specify the signal that would invalidate the stance, the action to take (modify/supersede/abandon), and why writing it now prevents sunk-cost drift later.
26
+
27
+
28
+ <!-- PAPI_ENRICHMENT_TIER_2 -->