@lsctech/polaris 0.3.22 → 0.3.24

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 (147) hide show
  1. package/dist/cli/adopt-assets.js +13 -0
  2. package/dist/cli/adopt-genesis.js +85 -4
  3. package/dist/cli/adopt-instructions.js +3 -3
  4. package/dist/cli/adopt-report.js +15 -1
  5. package/dist/cli/adopt-rules.js +44 -8
  6. package/dist/cli/adopt-workspace.js +2 -2
  7. package/dist/cli/adoption-inventory.js +5 -2
  8. package/dist/cli/init.js +5 -4
  9. package/dist/config/provider-detect.js +19 -2
  10. package/dist/workspace/.polaris/skills/ROUTING.md +4 -0
  11. package/dist/workspace/.polaris/skills/closeout-librarian/POLARIS.md +9 -8
  12. package/dist/workspace/.polaris/skills/docs-ingest/SKILL.md +2 -2
  13. package/dist/workspace/.polaris/skills/docs-ingest/chain.md +1 -1
  14. package/dist/workspace/.polaris/skills/docs-ingest/steps/04-place-and-link.md +5 -5
  15. package/dist/workspace/.polaris/skills/docs-ingest/steps/05-finalize-ingest.md +1 -1
  16. package/dist/workspace/.polaris/skills/docs-promote/SKILL.md +6 -6
  17. package/dist/workspace/.polaris/skills/docs-promote/chain.md +5 -5
  18. package/dist/workspace/.polaris/skills/docs-promote/steps/04-conflict-surface.md +1 -1
  19. package/dist/workspace/.polaris/skills/docs-promote/steps/06-execute-promote-deprecate.md +3 -3
  20. package/dist/workspace/{workspace/.polaris → .polaris}/skills/docs-review/SKILL.md +1 -1
  21. package/dist/workspace/{workspace/.polaris → .polaris}/skills/docs-triage/SKILL.md +1 -1
  22. package/dist/workspace/{workspace/.polaris → .polaris}/skills/docs-triage/chain.md +1 -1
  23. package/dist/workspace/.polaris/skills/polaris-analyze/SKILL.md +1 -1
  24. package/dist/workspace/.polaris/skills/polaris-analyze/chain.md +2 -2
  25. package/dist/workspace/.polaris/skills/polaris-analyze/issue-reconciliation.md +1 -1
  26. package/dist/workspace/.polaris/skills/polaris-analyze/linked-skills/repo-analysis.md +3 -4
  27. package/dist/workspace/.polaris/skills/polaris-analyze/steps/02-map-affected-code.md +2 -2
  28. package/dist/workspace/.polaris/skills/polaris-catalog/SKILL.md +5 -5
  29. package/dist/workspace/.polaris/skills/polaris-catalog/chain.md +3 -3
  30. package/dist/workspace/.polaris/skills/polaris-catalog/steps/04-classify-and-place.md +3 -3
  31. package/dist/workspace/.polaris/skills/polaris-reconcile/SKILL.md +2 -2
  32. package/dist/workspace/.polaris/skills/polaris-run/SKILL.md +2 -2
  33. package/dist/workspace/.polaris/skills/polaris-run/chain.md +17 -17
  34. package/dist/workspace/.polaris/skills/polaris-run/linked-skills/repo-analysis.md +3 -4
  35. package/dist/workspace/.polaris/skills/polaris-run/steps/01-orient-cluster.md +3 -3
  36. package/dist/workspace/.polaris/skills/polaris-run/steps/03-select-child.md +1 -1
  37. package/dist/workspace/.polaris/skills/polaris-run/steps/06-commit-and-update-linear.md +2 -2
  38. package/dist/workspace/.polaris/skills/polaris-run/steps/07-decide-continuation.md +3 -3
  39. package/dist/workspace/.polaris/skills/polaris-run/steps/08-closeout-librarian.md +1 -1
  40. package/dist/workspace/.polaris/skills/polaris-run/steps/08-final-delivery.md +2 -2
  41. package/dist/workspace/.polaris/skills/polaris-run/steps/09-final-delivery.md +1 -1
  42. package/dist/workspace/.polaris/skills/polaris-tools/README.md +1 -1
  43. package/dist/workspace/.polaris/skills/polaris-tools/SKILL.md +1 -1
  44. package/dist/workspace/POLARIS_RULES.md +169 -0
  45. package/package.json +3 -2
  46. package/dist/workspace/workspace/.polaris/roles/analyst.md +0 -38
  47. package/dist/workspace/workspace/.polaris/roles/closeout-librarian.md +0 -122
  48. package/dist/workspace/workspace/.polaris/roles/cognition-librarian.md +0 -37
  49. package/dist/workspace/workspace/.polaris/roles/finalizer.md +0 -45
  50. package/dist/workspace/workspace/.polaris/roles/foreman.md +0 -165
  51. package/dist/workspace/workspace/.polaris/roles/librarian.md +0 -74
  52. package/dist/workspace/workspace/.polaris/roles/worker.md +0 -119
  53. package/dist/workspace/workspace/.polaris/session-type +0 -1
  54. package/dist/workspace/workspace/.polaris/skills/ROUTING.md +0 -113
  55. package/dist/workspace/workspace/.polaris/skills/caveman/SKILL.md +0 -74
  56. package/dist/workspace/workspace/.polaris/skills/caveman-compress/scripts/compress.py +0 -272
  57. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/POLARIS.md +0 -46
  58. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/SKILL.md +0 -59
  59. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/chain.md +0 -116
  60. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/01-load-cluster-context.md +0 -78
  61. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/02-drift-reconciliation.md +0 -157
  62. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/03-reconcile-polaris-md.md +0 -93
  63. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/04-reconcile-summary-md.md +0 -106
  64. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/05-doc-ingestion.md +0 -114
  65. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/06-link-validation.md +0 -128
  66. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/07-yaml-linking.md +0 -95
  67. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/08-librarian-commit.md +0 -119
  68. package/dist/workspace/workspace/.polaris/skills/closeout-librarian/steps/09-sealed-result.md +0 -118
  69. package/dist/workspace/workspace/.polaris/skills/docs-ingest/SKILL.md +0 -68
  70. package/dist/workspace/workspace/.polaris/skills/docs-ingest/chain.json +0 -23
  71. package/dist/workspace/workspace/.polaris/skills/docs-ingest/chain.md +0 -149
  72. package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/01-orient-ingest.md +0 -85
  73. package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/02-classify-batch.md +0 -87
  74. package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/03-conflict-check.md +0 -66
  75. package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/04-place-and-link.md +0 -77
  76. package/dist/workspace/workspace/.polaris/skills/docs-ingest/steps/05-finalize-ingest.md +0 -49
  77. package/dist/workspace/workspace/.polaris/skills/docs-promote/SKILL.md +0 -79
  78. package/dist/workspace/workspace/.polaris/skills/docs-promote/chain.json +0 -25
  79. package/dist/workspace/workspace/.polaris/skills/docs-promote/chain.md +0 -80
  80. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/01-orient-promote.md +0 -53
  81. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/02-review-candidates.md +0 -51
  82. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/03-read-linked-code.md +0 -50
  83. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/04-conflict-surface.md +0 -65
  84. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/05-await-approval.md +0 -61
  85. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/06-execute-promote-deprecate.md +0 -65
  86. package/dist/workspace/workspace/.polaris/skills/docs-promote/steps/07-finalize-promote.md +0 -44
  87. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/SKILL.md +0 -94
  88. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/chain.json +0 -20
  89. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/chain.md +0 -105
  90. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/issue-reconciliation.md +0 -149
  91. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/issue-template.md +0 -133
  92. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/linked-skills/repo-analysis.md +0 -55
  93. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/01-fetch-and-orient.md +0 -79
  94. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/02-map-affected-code.md +0 -58
  95. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/03-assess-issue.md +0 -58
  96. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/04-blocker-check.md +0 -60
  97. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/05-create-cluster-plan.md +0 -197
  98. package/dist/workspace/workspace/.polaris/skills/polaris-analyze/steps/06-final-report.md +0 -60
  99. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/SKILL.md +0 -91
  100. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/chain.json +0 -22
  101. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/chain.md +0 -85
  102. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/01-orient-catalog.md +0 -92
  103. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/02-reconcile-polaris-md.md +0 -33
  104. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/03-reconcile-summary-md.md +0 -70
  105. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/04-classify-and-place.md +0 -117
  106. package/dist/workspace/workspace/.polaris/skills/polaris-catalog/steps/05-catalog-commit.md +0 -94
  107. package/dist/workspace/workspace/.polaris/skills/polaris-medic/SKILL.md +0 -52
  108. package/dist/workspace/workspace/.polaris/skills/polaris-medic/chain.md +0 -111
  109. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/01-orient-medic.md +0 -75
  110. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/02-diagnose.md +0 -79
  111. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/03-repair.md +0 -64
  112. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/04-validate.md +0 -66
  113. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/05-create-chart.md +0 -85
  114. package/dist/workspace/workspace/.polaris/skills/polaris-medic/steps/06-closeout.md +0 -86
  115. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/SKILL.md +0 -75
  116. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/chain.json +0 -20
  117. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/chain.md +0 -67
  118. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/01-orient-reconcile.md +0 -82
  119. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/02-reconcile-polaris-md.md +0 -95
  120. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/03-reconcile-summary-md.md +0 -108
  121. package/dist/workspace/workspace/.polaris/skills/polaris-reconcile/steps/04-reconcile-commit.md +0 -88
  122. package/dist/workspace/workspace/.polaris/skills/polaris-run/SKILL.md +0 -135
  123. package/dist/workspace/workspace/.polaris/skills/polaris-run/chain.json +0 -19
  124. package/dist/workspace/workspace/.polaris/skills/polaris-run/chain.md +0 -298
  125. package/dist/workspace/workspace/.polaris/skills/polaris-run/execution-adapter.md +0 -34
  126. package/dist/workspace/workspace/.polaris/skills/polaris-run/linked-skills/repo-analysis.md +0 -58
  127. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/01-orient-cluster.md +0 -96
  128. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/02-prepare-branch.md +0 -53
  129. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/03-select-child.md +0 -63
  130. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/04-execute-child.md +0 -75
  131. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/05-validate-child.md +0 -57
  132. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/06-commit-and-update-linear.md +0 -74
  133. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/07-decide-continuation.md +0 -89
  134. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/08-closeout-librarian.md +0 -146
  135. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/08-final-delivery.md +0 -91
  136. package/dist/workspace/workspace/.polaris/skills/polaris-run/steps/09-final-delivery.md +0 -104
  137. package/dist/workspace/workspace/.polaris/skills/polaris-tools/README.md +0 -63
  138. package/dist/workspace/workspace/.polaris/skills/polaris-tools/SKILL.md +0 -94
  139. package/dist/workspace/workspace/.polaris/skills/polaris-tools/tools.js +0 -191
  140. package/dist/workspace/workspace/smartdocs/architecture/.gitkeep +0 -0
  141. package/dist/workspace/workspace/smartdocs/audits/.gitkeep +0 -0
  142. package/dist/workspace/workspace/smartdocs/decisions/.gitkeep +0 -0
  143. package/dist/workspace/workspace/smartdocs/doctrine/active/.gitkeep +0 -0
  144. package/dist/workspace/workspace/smartdocs/runtime/.gitkeep +0 -0
  145. package/dist/workspace/workspace/smartdocs/specs/active/.gitkeep +0 -0
  146. package/dist/workspace/workspace/smartdocs/specs/archive/.gitkeep +0 -0
  147. /package/dist/workspace/{workspace/.polaris → .polaris}/skills/docs-review/chain.md +0 -0
@@ -1,65 +0,0 @@
1
- ---
2
- name: docs-promote-step-04-conflict-surface
3
- description: Run the CLI conflict gate for each candidate and capture the full report. Do not promote yet.
4
- ---
5
-
6
- # Step 04 — Conflict surface
7
-
8
- ## Purpose
9
-
10
- Surface every conflict before asking for approval. The agent must not approve anything it has not checked. This step is read-only — no files are moved.
11
-
12
- ## Actions
13
-
14
- ### For raw specs (`route: spec-promote`)
15
-
16
- Run the dry gate for each:
17
-
18
- ```bash
19
- npm run polaris -- doctrine spec-promote <path>
20
- ```
21
-
22
- Capture the full stdout. This is the conflict report. Do **not** pass `--approve`.
23
-
24
- ### For doctrine candidates (`route: doctrine-governance`)
25
-
26
- Check front-matter for all required governance fields:
27
- - `doc-type`
28
- - `confidence`
29
- - `recommended-action`
30
- - `overlap-analysis`
31
-
32
- If any field is missing or `recommended-action` is not `promote`: mark as `needs-governance-update`. Do not proceed to promotion for this candidate.
33
-
34
- ### For active docs targeted for deprecation
35
-
36
- Confirm the doc's `linkedMapArea` code is gone or marked superseded (from step 03 findings). If relevance is `current`: flag as `deprecation-contested` — surface to user before acting.
37
-
38
- ### After all candidates checked
39
-
40
- Emit `docs-promote-conflict-report` telemetry for each candidate with their conflict status.
41
-
42
- ## Scope
43
-
44
- ```yaml
45
- allowed_files:
46
- - smartdocs/raw/ (read only)
47
- - smartdocs/doctrine/candidate/ (read only)
48
- - smartdocs/doctrine/active/ (read only)
49
- - smartdocs/specs/active/ (read only)
50
- - .taskchain_artifacts/docs-promote/current-state.json
51
- stop_rules:
52
- - CLI command exits non-zero unexpectedly (capture output; do not halt batch — record error per candidate)
53
- ```
54
-
55
- ## Artifact update
56
-
57
- Update `current-state.json`:
58
- - `current_step_id: 04-conflict-surface`
59
- - Per candidate: `conflict_report: "<captured stdout>"`, `governance_status: ok|needs-governance-update`, `deprecation_status: ok|deprecation-contested`
60
-
61
- Emit `step-complete` for `04-conflict-surface`.
62
-
63
- ## Next step
64
-
65
- 05-await-approval
@@ -1,61 +0,0 @@
1
- ---
2
- name: docs-promote-step-05-await-approval
3
- description: Present the full conflict report and linked-code findings to the user. Hard stop — do not advance without explicit approval.
4
- ---
5
-
6
- # Step 05 — Await approval
7
-
8
- ## Purpose
9
-
10
- The user must see everything before anything is promoted. This step never auto-advances.
11
-
12
- ## Actions
13
-
14
- 1. **Present the summary table**:
15
-
16
- ```text
17
- | File | Type | Linked Area | Relevance | Conflicts | Governance | Recommended Action |
18
- ```
19
-
20
- Fill every column from state. Use `—` only when genuinely unknown.
21
-
22
- 2. **Print the full conflict report** for any candidate that has one. Never compress or summarize conflict output.
23
-
24
- 3. **Print governance validation failures** in full for any `needs-governance-update` candidates.
25
-
26
- 4. **State the recommended action** for each candidate:
27
- - `promote` — no conflicts, governance ok, code is current
28
- - `promote-with-override` — conflicts detected; user may approve with understanding
29
- - `hold` — governance incomplete; needs update before promotion
30
- - `deprecate` — code area gone or superseded
31
- - `skip` — unlinked or contested; needs human judgment
32
-
33
- 5. **Stop and wait.** Do not call any CLI command. Do not write any files. Do not advance to step 06.
34
-
35
- 6. When the user responds: record their decision per candidate in state as `approved`, `rejected`, or `deferred`. Then advance to step 06.
36
-
37
- ## Hard rule
38
-
39
- **Never call `--approve` in this step. Never move files in this step.**
40
-
41
- ## Scope
42
-
43
- ```yaml
44
- allowed_files:
45
- - .taskchain_artifacts/docs-promote/current-state.json (read then write after user responds)
46
- stop_rules:
47
- - do not advance without user confirmation
48
- ```
49
-
50
- ## Artifact update
51
-
52
- After user responds, update `current-state.json`:
53
- - `current_step_id: 05-await-approval`
54
- - Per candidate: `decision: approved|rejected|deferred`
55
-
56
- Emit `docs-promote-approved` or `docs-promote-rejected` telemetry per candidate.
57
- Emit `step-complete` for `05-await-approval`.
58
-
59
- ## Next step
60
-
61
- 06-execute-promote-deprecate
@@ -1,65 +0,0 @@
1
- ---
2
- name: docs-promote-step-06-execute-promote-deprecate
3
- description: Execute the approved promote and deprecate CLI commands one at a time. Halt on any failure.
4
- ---
5
-
6
- # Step 06 — Execute promote / deprecate
7
-
8
- ## Purpose
9
-
10
- Fire the CLI commands for every candidate the user approved. One command at a time. Record the result after each before continuing.
11
-
12
- ## Actions
13
-
14
- For each candidate with `decision: approved`:
15
-
16
- ### Spec promotion
17
- ```bash
18
- npm run polaris -- doctrine spec-promote <path> --approve
19
- ```
20
-
21
- ### Doctrine candidate promotion
22
- ```bash
23
- npm run polaris -- doctrine promote <path>
24
- ```
25
-
26
- ### Active doctrine deprecation
27
- ```bash
28
- npm run polaris -- doctrine deprecate <path>
29
- ```
30
-
31
- After each command:
32
- - Record `promoted_to` or `deprecated_to` path in state
33
- - Emit `docs-promoted` telemetry with `file` and result path
34
-
35
- If a command exits non-zero:
36
- - **Halt immediately.** Do not attempt any remaining commands.
37
- - Record the error in state under `execution_error`.
38
- - Report the failure in full. Wait for user instruction.
39
-
40
- Candidates with `decision: rejected` or `deferred`: skip. Record in state as `skipped`.
41
-
42
- ## Scope
43
-
44
- ```yaml
45
- allowed_files:
46
- - smartdocs/raw/ (write — files will be moved by CLI)
47
- - smartdocs/doctrine/candidate/ (write — files will be moved by CLI)
48
- - smartdocs/doctrine/active/ (write — files will be moved by CLI)
49
- - smartdocs/specs/active/ (write — files will be moved by CLI)
50
- - .taskchain_artifacts/docs-promote/current-state.json
51
- stop_rules:
52
- - any CLI command exits non-zero → halt immediately
53
- ```
54
-
55
- ## Artifact update
56
-
57
- Update `current-state.json` after each command:
58
- - `current_step_id: 06-execute-promote-deprecate`
59
- - Per candidate: `promoted_to|deprecated_to|skipped`, `execution_error` if applicable
60
-
61
- Emit `step-complete` for `06-execute-promote-deprecate` only after all approved candidates are processed (or halted).
62
-
63
- ## Next step
64
-
65
- 07-finalize-promote
@@ -1,44 +0,0 @@
1
- ---
2
- name: docs-promote-step-07-finalize-promote
3
- description: Emit completion telemetry, mark the run complete, and print the promotion summary.
4
- ---
5
-
6
- # Step 07 — Finalize promote
7
-
8
- ## Purpose
9
-
10
- Close out the session cleanly. Emit telemetry. Write final state. Report.
11
-
12
- ## Actions
13
-
14
- 1. **Emit `docs-promote-complete` telemetry**.
15
-
16
- 2. **Update `current-state.json`**:
17
- - `status: complete`
18
- - `current_step_id: 07-finalize-promote`
19
- - `completed_at: <ISO timestamp>`
20
-
21
- 3. **Print promotion summary**:
22
-
23
- ```text
24
- **docs-promote complete**
25
- Promoted: <file> → <destination> (one line per promoted file)
26
- Deprecated: <file> → <destination> (one line per deprecated file)
27
- Held: <file> — <reason> (one line per held/deferred file)
28
- Errors: none | <detail>
29
- ```
30
-
31
- ## Completion rule
32
-
33
- Do not report complete until `current-state.json` has `status: complete`.
34
-
35
- ## Scope
36
-
37
- ```yaml
38
- allowed_files:
39
- - .taskchain_artifacts/docs-promote/current-state.json
40
- ```
41
-
42
- ## Artifact update
43
-
44
- Emit `step-complete` for `07-finalize-promote` and `docs-promote-complete` to telemetry JSONL.
@@ -1,94 +0,0 @@
1
- ---
2
- name: polaris-analyze
3
- description: Audit one Polaris issue against the actual repo using a configured repo-analysis provider (if available) and targeted inspection, then produce an ordered execution plan and cluster artifacts. Analysis and planning only — no code changes, no implementation execution.
4
- role: analyst
5
- role_file: .polaris/roles/analyst.md
6
- ---
7
-
8
- ## Command entrypoints
9
-
10
- This skill is the target for the following user commands:
11
-
12
- - `polaris-analyze <POL-###>`
13
- - `run polaris-analyze on issue <POL-###>`
14
- - `run polaris-analyze on <POL-###>`
15
-
16
- When any of these commands are issued, load this skill packet **first** before any other action.
17
- Bind the named issue exactly as specified. See `.polaris/skills/ROUTING.md` for the full routing
18
- protocol.
19
-
20
- ---
21
-
22
- ## Polaris Skill Bootloader
23
-
24
- **Before proceeding, you must obtain a skill packet from the Polaris runtime.**
25
-
26
- Run the following command:
27
-
28
- ```
29
- npm run polaris -- skill packet analyze
30
- ```
31
-
32
- - Do not begin work until a packet is returned.
33
- - Treat the packet as your authoritative instruction source.
34
- - The packet defines your active role, authority boundaries, prohibited actions, deliverables, and stop conditions.
35
- - If no packet is produced, stop and report: **Polaris could not authorize this run.**
36
-
37
- ---
38
-
39
- # polaris-analyze
40
-
41
- Use this skill when the user asks to analyze or break down a Polaris issue before execution.
42
-
43
- ## Related doctrine
44
-
45
- See `docs/Polaris/spec/polaris-implementation-plan.md` for the Polaris architecture reference.
46
-
47
- ## Canonical issue template
48
-
49
- All implementation issues (IMPLEMENT parents and children) must use the 8-section canonical format.
50
- See `.polaris/skills/polaris-analyze/issue-template.md` for the full template.
51
-
52
- Key rules:
53
- - Use `## Scope` exactly — no variants ("Implementation scope", "Expected code areas", etc.).
54
- - If scope is unknown: write `- TBD — BLOCKED: scope missing` under `## Scope` and mark the issue Blocked in Linear.
55
- - Both IMPLEMENT parents and child issues require a full body — no title-only stubs.
56
- - Every child must have `## Scope` and `## Validation` or the dispatch preflight gate will halt execution.
57
-
58
- ## When to use
59
-
60
- - "Analyze POL-XXX before running it"
61
- - "Break down POL-XXX into child issues"
62
- - "Is POL-XXX ready to execute?"
63
- - "Plan the execution clusters for POL-XXX"
64
-
65
- ## How to execute
66
-
67
- 1. Read `chain.md` — it defines the step order and traversal rules.
68
- 2. Read `.taskchain_artifacts/polaris-analyze/current-state.json` — it contains any resumable state.
69
- 3. Execute steps in the order `chain.md` defines. Do not skip steps.
70
- 4. After every completed step, update `.taskchain_artifacts/polaris-analyze/current-state.json` before advancing.
71
-
72
- ## Hard rules — what analyze may do
73
-
74
- - Inspect repo files and architecture
75
- - Query the configured repo-analysis provider for code intelligence (if available; falls back to polaris map query + ripgrep)
76
- - Summarize findings and assess feasibility
77
- - Create implementation plans and specs (in `docs/`)
78
- - Create or update tracker child issues (Linear)
79
- - Generate local cluster artifacts (`.polaris/clusters/<id>/clusters.json`)
80
- - Update tracker comments and status
81
- - Close the analysis issue when complete
82
-
83
- ## Hard rules — what analyze must NOT do
84
-
85
- - Implement production or runtime code
86
- - Mutate source files (`src/`, tests, config)
87
- - Execute implementation loops
88
- - Open implementation PRs
89
- - Continue automatically into polaris-run execution
90
- - Call `polaris loop continue` or `polaris finalize`
91
-
92
- **Analyze shapes work. Run executes work.**
93
-
94
- If implementation execution is attempted during an analyze session: halt immediately and report the boundary violation.
@@ -1,20 +0,0 @@
1
- {
2
- "name": "polaris-analyze-chain",
3
- "steps": [
4
- "01-fetch-and-orient",
5
- "02-map-affected-code",
6
- "03-assess-issue",
7
- "04-blocker-check",
8
- "05-create-cluster-plan",
9
- "06-final-report"
10
- ],
11
- "terminal_steps": ["06-final-report"],
12
- "scope": "analyze-only",
13
- "forbidden_actions": [
14
- "src file mutations",
15
- "polaris loop continue",
16
- "polaris finalize",
17
- "git push",
18
- "pr creation"
19
- ]
20
- }
@@ -1,105 +0,0 @@
1
- ---
2
- name: polaris-analyze-chain
3
- description: Route map for polaris-analyze — step order, stop conditions, analyze-only boundary enforcement, and artifact requirements.
4
- ---
5
-
6
- # polaris-analyze chain
7
-
8
- ## Authority
9
-
10
- **Polaris runtime state is authoritative. Chat reasoning is not authoritative.**
11
-
12
- Query runtime state before acting. Do not infer analysis scope or prior progress from conversation context.
13
-
14
- ## CLI
15
-
16
- Always use the repo-local Polaris CLI:
17
-
18
- ```
19
- npm run polaris -- <command>
20
- ```
21
-
22
- Never assume a globally linked `polaris` command exists.
23
-
24
- ## Step traversal order
25
-
26
- ```text
27
- 01-fetch-and-orient ← parallel: Linear fetch + repo-analysis provider check + run-start telemetry
28
- 02-map-affected-code ← targeted repo-analysis inspection (provider or fallback)
29
- 03-assess-issue ← outcome classification
30
- 04-blocker-check ← STOP if blocked or non-executable
31
- 05-create-cluster-plan ← create tracker children + local clusters.json
32
- 06-final-report ← terminal step
33
- ```
34
-
35
- ## Stop conditions
36
-
37
- **Step 04 (blocker check):**
38
- Stop immediately if the issue is blocked or assessment outcome is not `needs-cluster-plan`. Do not advance to step 05.
39
-
40
- **Any step:**
41
- Stop if:
42
- - Implementation execution is attempted (scope violation — halt and report).
43
- - Canonical doctrine conflict cannot be resolved without user input.
44
- - HIGH or CRITICAL risk identified by repo-analysis provider without a clear resolution path.
45
- - Parent issue is already Done or Cancelled.
46
-
47
- ## Analyze-only boundary
48
-
49
- polaris-analyze is a read-and-plan skill. It never executes implementation work.
50
-
51
- The boundary is enforced by this skill — not by the Polaris runtime — because analyze sessions do not call `polaris loop continue`.
52
-
53
- If a step produces source code changes, halts on a `src/` file edit, or attempts to push or PR: that is a scope violation. Halt immediately, report the violation, and do not continue.
54
-
55
- ## Run ID format
56
-
57
- Format: `polaris-analyze-<slug>-<date>-<seq>`
58
- - `<slug>`: 2–4 lowercase hyphenated words from the issue title. No Linear IDs.
59
- - `<date>`: `YYYY-MM-DD`
60
- - `<seq>`: zero-padded sequential number per day (`001`, `002`, …)
61
-
62
- Example: `polaris-analyze-local-instructions-2026-05-23-001`
63
-
64
- ## Telemetry
65
-
66
- Telemetry file: `.taskchain_artifacts/polaris-analyze/runs/<run-id>/telemetry.jsonl` (append-only).
67
-
68
- | Event | Emitted by | Step |
69
- |---|---|---|
70
- | `run-start` | agent | 01 — before any Linear access |
71
- | `step-complete` | agent | end of every step |
72
- | `loop-aborted` | `npm run polaris -- loop abort` | any blocker halt |
73
-
74
- Required fields on every event: `event`, `run_id`, `timestamp`.
75
-
76
- ## Artifact authority
77
-
78
- `.taskchain_artifacts/polaris-analyze/current-state.json` is the sole authoritative live state surface.
79
-
80
- - Update after every completed step before advancing.
81
- - If the update fails: stop and report the persistence failure.
82
-
83
- ## Linked-skill invocation boundaries
84
-
85
- | Skill | Allowed steps | Condition |
86
- |---|---|---|
87
- | repo-analysis | 01, 02 | targeted lookup only; conditional on provider availability |
88
-
89
- After each completed step, emit a checkpoint:
90
-
91
- ```text
92
- **[step-name]** done | blocked | needs-input
93
- Changed: <Linear issues / docs created or updated> or none
94
- Validated: <checks passed> or none
95
- Blockers: none | <explicit blocker>
96
- ```
97
-
98
- ### Never compressed
99
-
100
- Always write in full:
101
- - Child issue bodies and cluster plans (generated planning artifacts)
102
- - Blocker reports and unblock conditions
103
- - Doctrine conflict findings
104
- - HIGH or CRITICAL repo-analysis provider risk findings
105
- - Final report (step 06)
@@ -1,149 +0,0 @@
1
- ---
2
- name: polaris-issue-reconciliation
3
- description: Workflow for reconciling existing Linear issues into the canonical Polaris format. Use when existing implementation issues are missing required sections or use non-canonical section names.
4
- ---
5
-
6
- # Polaris Issue Reconciliation Workflow
7
-
8
- Use this workflow to bring existing Linear implementation issues into the canonical 8-section format
9
- defined in `issue-template.md`. This is not a `polaris-analyze` run — it is a manual or
10
- scripted reconciliation pass.
11
-
12
- ## When to use
13
-
14
- - An existing IMPLEMENT parent or child issue is blocking a `polaris-run` execution.
15
- - `polaris-run` reported `preflight-scope-missing` or `preflight-body-missing`.
16
- - An issue uses non-canonical headers ("Implementation scope", "Expected code areas", etc.).
17
- - An issue has no body at all (title-only stub).
18
- - You want to prepare a set of existing issues before starting a new `polaris-run`.
19
-
20
- ---
21
-
22
- ## Reconciliation rules
23
-
24
- ### Preserve original meaning
25
-
26
- Do not change what an issue is asking for. Only restructure the body into the canonical format.
27
- If you are uncertain whether a passage belongs under one header vs. another, preserve it verbatim
28
- and note the ambiguity in a comment.
29
-
30
- ### Scope
31
-
32
- - If scope is explicitly stated anywhere in the body (paths, globs, named files, module names),
33
- move that content into `## Scope` as a bullet list.
34
- - If scope can be clearly inferred from the objective or goal, write the inferred paths and
35
- note that they were inferred: `- src/loop/** (inferred from objective)`.
36
- - If scope is genuinely not determinable from the existing body, write:
37
- ```markdown
38
- ## Scope
39
- - TBD — BLOCKED: scope missing
40
- ```
41
- Then mark the issue as **Blocked** in Linear. Do not guess or invent paths.
42
-
43
- ### Acceptance Criteria and Validation
44
-
45
- - If acceptance criteria exist under any heading, move them to `## Acceptance Criteria`.
46
- - If validation commands exist (e.g. `npm test`, CI commands), move them to `## Validation`.
47
- - If no validation commands exist, write the standard minimum:
48
- ```markdown
49
- ## Validation
50
- - npm run build
51
- - npm test
52
- ```
53
-
54
- ### Links
55
-
56
- - Preserve all links to related issues, PRs, and clusters.
57
- - Move them to `## Context` if they explain why the issue exists.
58
- - Move them to `## Ordering` if they express a dependency.
59
-
60
- ### Non-goals / Out of scope
61
-
62
- - If the original issue has "Out of scope" or "Non-goals" content, move it to `## Non-goals`.
63
-
64
- ### Do not mark ready if TBD/BLOCKED remains
65
-
66
- If any section still contains `TBD — BLOCKED` after reconciliation, do not change the issue
67
- status to Ready or In Progress. The issue must remain Blocked until scope (or other TBD content)
68
- is resolved by a human.
69
-
70
- ---
71
-
72
- ## Step-by-step reconciliation prompt
73
-
74
- Use this prompt with a capable AI assistant to reconcile a single issue.
75
- Replace `<ISSUE_BODY>` and `<ISSUE_TITLE>` with the actual content.
76
-
77
- ```text
78
- You are reconciling a Polaris Linear issue into the canonical 8-section format.
79
-
80
- Issue title: <ISSUE_TITLE>
81
- Current body:
82
- ---
83
- <ISSUE_BODY>
84
- ---
85
-
86
- Produce a rewritten body using exactly these sections in this order:
87
- ## Objective
88
- ## Context
89
- ## Goal
90
- ## Scope
91
- ## Acceptance Criteria
92
- ## Validation
93
- ## Ordering
94
- ## Non-goals
95
-
96
- Rules:
97
- 1. Preserve original meaning. Do not change what the issue asks for.
98
- 2. Do not invent scope. If scope is stated or clearly inferable, use it.
99
- If not, write:
100
- ## Scope
101
- - TBD — BLOCKED: scope missing
102
- 3. Preserve all links to related issues, PRs, or clusters.
103
- 4. If acceptance criteria exist anywhere, move them under ## Acceptance Criteria.
104
- 5. If validation commands exist, move them under ## Validation.
105
- If none exist, add:
106
- ## Validation
107
- - npm run build
108
- - npm test
109
- 6. Do not mark the issue ready if any section still says TBD — BLOCKED.
110
- 7. Output only the rewritten body (no commentary).
111
- ```
112
-
113
- ---
114
-
115
- ## Batch reconciliation guidance
116
-
117
- For a set of issues before a `polaris-run`:
118
-
119
- 1. **Identify affected issues**: Run `polaris-run` in dry-run mode or check `clusters.json`
120
- for child issue IDs with missing/empty bodies.
121
-
122
- 2. **Fetch current bodies**: For each issue ID, use the Linear MCP tool or CLI to fetch
123
- the current title and body.
124
-
125
- 3. **Reconcile one at a time**: Apply the reconciliation prompt above to each issue.
126
- Review the output before updating Linear.
127
-
128
- 4. **Update Linear**: Use the Linear MCP `save_issue` tool to update the body of each issue.
129
- Do not change issue status unless explicitly reconciling a TBD-BLOCKED scope.
130
-
131
- 5. **Mark TBD-BLOCKED issues as Blocked**: For any issue where scope is TBD, update the
132
- Linear status to Blocked and add a comment explaining what is needed to unblock.
133
-
134
- 6. **Re-run preflight**: After reconciling, re-run `polaris-run` (or the preflight check)
135
- to confirm all issues are now packet-actionable.
136
-
137
- ---
138
-
139
- ## Verification after reconciliation
140
-
141
- After updating issue bodies, verify the reconciled issues are packet-actionable:
142
-
143
- ```bash
144
- # Dry-run a polaris-run to check all preflight gates pass
145
- npm run polaris -- loop dispatch --dry-run <cluster-id>
146
- ```
147
-
148
- All children should pass body and scope preflight gates. If any fail,
149
- the output will identify which issue and which section is still missing.