@sangyaahub/pi-marg 1.0.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.
- package/.mcp.json +12 -0
- package/.omp-plugin/marketplace.json +42 -0
- package/BRAND.md +25 -0
- package/CHANGELOG.md +11 -0
- package/CODE_OF_CONDUCT.md +9 -0
- package/CONTRIBUTING.md +11 -0
- package/LICENSE +21 -0
- package/MODEL-SETUP.md +73 -0
- package/PUBLISHING.md +53 -0
- package/README.md +191 -0
- package/SECURITY.md +11 -0
- package/SUPPORT.md +7 -0
- package/adapters/omp/extensions/approval-guard.ts +43 -0
- package/adapters/omp/extensions/model-router.ts +56 -0
- package/adapters/omp/extensions/runtime-capabilities.ts +24 -0
- package/adapters/pi/extensions/approval-guard.ts +39 -0
- package/adapters/pi/extensions/model-router.ts +61 -0
- package/adapters/pi/extensions/runtime-capabilities.ts +25 -0
- package/adapters/pi/extensions/workflow-bootstrap.ts +7 -0
- package/adapters/pi/prompts/auto-close.md +11 -0
- package/adapters/pi/prompts/auto-commit.md +7 -0
- package/adapters/pi/prompts/auto-models.md +12 -0
- package/adapters/pi/prompts/auto-reset.md +8 -0
- package/adapters/pi/prompts/auto-review.md +11 -0
- package/adapters/pi/prompts/auto-runtime.md +13 -0
- package/adapters/pi/prompts/auto-status.md +17 -0
- package/adapters/pi/prompts/auto.md +12 -0
- package/agents/auto-builder.md +10 -0
- package/agents/auto-business-analyst.md +9 -0
- package/agents/auto-debugger.md +10 -0
- package/agents/auto-intake.md +10 -0
- package/agents/auto-lessons-writer.md +10 -0
- package/agents/auto-qa.md +9 -0
- package/agents/auto-reviewer.md +9 -0
- package/agents/auto-security-reviewer.md +9 -0
- package/agents/auto-strategist.md +10 -0
- package/assets/brand/sangyaa-mark.png +0 -0
- package/assets/pi-marg-banner-source.html +106 -0
- package/assets/pi-marg-banner.png +0 -0
- package/commands/auto-close.md +11 -0
- package/commands/auto-commit.md +7 -0
- package/commands/auto-models.md +12 -0
- package/commands/auto-reset.md +8 -0
- package/commands/auto-review.md +11 -0
- package/commands/auto-runtime.md +13 -0
- package/commands/auto-status.md +17 -0
- package/commands/auto.md +12 -0
- package/core/approval-policy.ts +109 -0
- package/core/model-routing.ts +348 -0
- package/core/runtime-capabilities.ts +77 -0
- package/core/workflow-policy.ts +3 -0
- package/package.json +84 -0
- package/rules/auto-mode.md +32 -0
- package/scripts/check-prerequisites.sh +37 -0
- package/scripts/install.sh +74 -0
- package/scripts/setup-codegraph.sh +62 -0
- package/scripts/validate.sh +75 -0
- package/skills/auto-mode-addons/SKILL.md +15 -0
- package/skills/auto-mode-addons/references/cost-control.md +24 -0
- package/skills/auto-mode-addons/references/hindsight.md +54 -0
- package/skills/auto-mode-addons/references/language-skills.md +54 -0
- package/skills/auto-mode-addons/references/ponytail.md +41 -0
- package/skills/auto-mode-router/SKILL.md +22 -0
- package/skills/auto-mode-router/references/intake-and-state.md +124 -0
- package/skills/auto-mode-router/references/models-and-tools.md +74 -0
- package/skills/auto-mode-router/references/native-omp-runtime.md +88 -0
- package/skills/auto-mode-router/references/native-pi-runtime.md +52 -0
- package/skills/auto-mode-router/references/routing-matrix.md +99 -0
- package/skills/auto-mode-router/references/session-ledger.md +92 -0
- package/skills/codegraph-first/SKILL.md +34 -0
- package/skills/session-lessons/SKILL.md +34 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Pi runtime integration
|
|
2
|
+
|
|
3
|
+
Read this reference only when `auto_runtime_status` reports `runtime: Pi`. The shared A/B/C/D contract remains authoritative; optional OMP conveniences do not become imaginary Pi features.
|
|
4
|
+
|
|
5
|
+
## Execution shape
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
A model → discovery record
|
|
9
|
+
↓ switch model
|
|
10
|
+
C model → independent plan review
|
|
11
|
+
↓ accepted plan
|
|
12
|
+
B model → implementation and tests
|
|
13
|
+
↓ switch model
|
|
14
|
+
D model → independent read-only review
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Pi can perform this sequentially in one session with `auto_model_route`. Parallel work is allowed only when `task` or another compatible subagent extension is actually detected. Do not simulate a swarm in prose.
|
|
18
|
+
|
|
19
|
+
## Models
|
|
20
|
+
|
|
21
|
+
- The Pi adapter uses the session's scoped models when configured; otherwise it uses the authenticated available registry.
|
|
22
|
+
- Activate the saved exact selector before every A/B/C/D stage.
|
|
23
|
+
- If activation fails, stop the stage and ask the user to repair authentication or select another catalog entry.
|
|
24
|
+
- C never edits the plan silently; it returns a verdict and required revisions. D remains read-only.
|
|
25
|
+
|
|
26
|
+
## Code intelligence
|
|
27
|
+
|
|
28
|
+
Upstream Pi provides file and shell primitives; LSP, AST, CodeGraph, browser, debugger, and security tools depend on installed extensions or repository commands.
|
|
29
|
+
|
|
30
|
+
- Use `codegraph_explore` when detected.
|
|
31
|
+
- Otherwise, use an installed CodeGraph CLI through `bash` after `setup-codegraph.sh` has been explicitly applied.
|
|
32
|
+
- If neither exists, use exact repository-native language/compiler tools and label repository-wide impact as not verified.
|
|
33
|
+
- Do not replace architecture analysis with broad grep output.
|
|
34
|
+
|
|
35
|
+
## Review and verification
|
|
36
|
+
|
|
37
|
+
- If a `review` command exists, it may host the C/D contract; otherwise run the selected reviewer model sequentially.
|
|
38
|
+
- Every implementation still runs focused tests and the narrowest broader check protecting affected contracts.
|
|
39
|
+
- Use browser, debugger, or security extensions only when `auto_runtime_status` detects them.
|
|
40
|
+
- Record unavailable surfaces as `not verified`, including the practical consequence.
|
|
41
|
+
|
|
42
|
+
## Context and memory
|
|
43
|
+
|
|
44
|
+
Pi may provide compaction and session branching, but OMP `checkpoint`/`rewind` semantics are not assumed. Keep durable state in the Markdown ledger before compacting.
|
|
45
|
+
|
|
46
|
+
Persistent memory is off unless the tool inventory exposes an approved memory integration such as `recall`/`retain`. Always write `lessons.md` first. Never retain secrets, credentials, client data, personal data, or unvalidated hypotheses.
|
|
47
|
+
|
|
48
|
+
## Commit and sharing
|
|
49
|
+
|
|
50
|
+
- After D passes, offer a local repository-native commit only when the user requests it. Never push with that step.
|
|
51
|
+
- `/share`, `pi share`, GitHub mutations, external Devin session creation, and other publication remain protected `post-web` actions.
|
|
52
|
+
- Pi package extensions execute with local user permissions; the approval guard is not an OS sandbox.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Skill routing matrix
|
|
2
|
+
|
|
3
|
+
Use one row after work type and skill mode are confirmed. Skill names are current preferred entry points; verify discovery before invoking them.
|
|
4
|
+
|
|
5
|
+
Names such as `auto-reviewer` and `auto-security-reviewer` are packaged OMP agents. On Pi, treat them as role contracts and execute them sequentially unless a compatible subagent extension is detected.
|
|
6
|
+
|
|
7
|
+
## A/B/C/D stage sequence
|
|
8
|
+
|
|
9
|
+
Implementation routes insert a verification gate after B and before D. Type 5 and high-risk changes also insert a security gate before lessons. After the required review passes: lessons/memory → optional local commit → separately approved push/merge/publication.
|
|
10
|
+
|
|
11
|
+
| Work type | Initial stages |
|
|
12
|
+
|---|---|
|
|
13
|
+
| 1 | A → C; add B → D only when implementation begins |
|
|
14
|
+
| 2 | A → C → B → verification → D |
|
|
15
|
+
| 3 | A → C → B → verification → D |
|
|
16
|
+
| 4 | A → B → DAP/tests/UI verification → D; add C for a non-trivial plan |
|
|
17
|
+
| 5 | A → C → security review; add B → verification → D → security verification for authorized fixes |
|
|
18
|
+
| 6 | A → C |
|
|
19
|
+
| 7 | A → C |
|
|
20
|
+
|
|
21
|
+
Activate the saved stage model immediately before its stage. A and C must differ; B and D must differ.
|
|
22
|
+
|
|
23
|
+
## 1 — New idea or development from scratch
|
|
24
|
+
|
|
25
|
+
| Spine | Route |
|
|
26
|
+
|---|---|
|
|
27
|
+
| Compound Engineering | `ce-brainstorm`; then `ce-plan` only when the user moves from requirements to implementation |
|
|
28
|
+
| Superpowers | `brainstorming`; then `writing-plans` after design approval |
|
|
29
|
+
| GSD | `gsd-ideate` for exploration, `gsd-spike` for feasibility, or `gsd-project` for a new multi-phase project |
|
|
30
|
+
|
|
31
|
+
Option 4 default: Compound Engineering for broad product framing; Superpowers for a focused design that will become code soon; GSD for a technical spike or a multi-milestone product.
|
|
32
|
+
|
|
33
|
+
## 2 — New feature in an existing repository
|
|
34
|
+
|
|
35
|
+
| Spine | Route |
|
|
36
|
+
|---|---|
|
|
37
|
+
| Compound Engineering | `ce-brainstorm` when requirements are unclear → `ce-plan` → `ce-work` → `ce-code-review` → `session-lessons`/`ce-compound` when warranted |
|
|
38
|
+
| Superpowers | `brainstorming` → `using-git-worktrees` when isolation helps → `writing-plans` → `test-driven-development` → `subagent-driven-development` or `executing-plans` → `requesting-code-review` → `finishing-a-development-branch` |
|
|
39
|
+
| GSD | `gsd-context`/onboard → `gsd-workflow` discuss → plan → execute → verify; `gsd-manage` ship only after approval |
|
|
40
|
+
|
|
41
|
+
Option 4 default: Compound Engineering for one cohesive feature; Superpowers when strict TDD and task-by-task review are the dominant need; GSD for a large feature spanning phases or milestones.
|
|
42
|
+
|
|
43
|
+
## 3 — Improve an existing feature
|
|
44
|
+
|
|
45
|
+
| Spine | Route |
|
|
46
|
+
|---|---|
|
|
47
|
+
| Compound Engineering | `ce-optimize` for a measurable outcome, `ce-polish` for live UX refinement, or `ce-simplify-code` for settled code; finish with `ce-code-review` |
|
|
48
|
+
| Superpowers | `brainstorming` for the desired behavior → `writing-plans` → `test-driven-development` → execution and review skills |
|
|
49
|
+
| GSD | `gsd-context` → `gsd-workflow` for a scoped phase → `gsd-quality` verification/review |
|
|
50
|
+
|
|
51
|
+
Option 4 default: Compound Engineering, because its polish, optimize, and simplify paths are specialized for improvement work.
|
|
52
|
+
|
|
53
|
+
## 4 — Proactive bug discovery or bug fix
|
|
54
|
+
|
|
55
|
+
| Spine | Route |
|
|
56
|
+
|---|---|
|
|
57
|
+
| Compound Engineering | `ce-dogfood` for browser-flow discovery, `ce-code-review` for code-level discovery, then `ce-debug` for root-cause repair and regression evidence |
|
|
58
|
+
| Superpowers | `systematic-debugging` → `test-driven-development` for the regression barrier → `verification-before-completion` → `requesting-code-review` |
|
|
59
|
+
| GSD | `gsd-quality` to route audit/debug/fix work, then `gsd-workflow` plan/execute/verify when the fix is non-trivial |
|
|
60
|
+
|
|
61
|
+
Option 4 default: Compound Engineering for proactive discovery across user flows; Superpowers for a known reproducible defect; GSD for a bug program spanning several components. Do not let a discovery skill and a fix skill create separate competing plans.
|
|
62
|
+
|
|
63
|
+
## 5 — Security review or fixes
|
|
64
|
+
|
|
65
|
+
| Spine | Route |
|
|
66
|
+
|---|---|
|
|
67
|
+
| Compound Engineering | `ce-code-review` plus the read-only `auto-security-reviewer` and repository-native security tools; use `ce-debug` or `ce-work` only after findings are validated |
|
|
68
|
+
| Superpowers | `systematic-debugging` and TDD can implement a validated fix, but Superpowers is not a complete security-audit framework; add `auto-security-reviewer` and scanners |
|
|
69
|
+
| GSD | `gsd-quality` security/audit route → validate findings → plan fixes → execute → verify |
|
|
70
|
+
|
|
71
|
+
Option 4 default: GSD when its security skills are available and compatible. Otherwise use the detected security reviewer plus repository-native scanners, with Compound Engineering owning the plan and fix. For high-risk auth, secrets, money, personal data, or public-contract changes, use an independent second model family for review.
|
|
72
|
+
|
|
73
|
+
## 6 — Thoughts about an existing repository or feature
|
|
74
|
+
|
|
75
|
+
| Spine | Route |
|
|
76
|
+
|---|---|
|
|
77
|
+
| Compound Engineering | `ce-pov` for a decisive assessment, `ce-explain` for teaching, or `ce-ideate` for grounded improvements |
|
|
78
|
+
| Superpowers | `brainstorming` when the question should end in a proposed design; otherwise answer with read-only repository evidence |
|
|
79
|
+
| GSD | `gsd-context` to map facts, then the appropriate read-only context or ideation route |
|
|
80
|
+
|
|
81
|
+
Option 4 default: Compound Engineering for opinion or explanation; GSD for large-repository fact gathering.
|
|
82
|
+
|
|
83
|
+
## 7 — Business, sales, or other non-technical analysis
|
|
84
|
+
|
|
85
|
+
| Spine | Route |
|
|
86
|
+
|---|---|
|
|
87
|
+
| Compound Engineering | `ce-strategy`, `ce-pov`, or `ce-ideate`, depending on whether the output is a strategy, judgment, or option set |
|
|
88
|
+
| Superpowers | No default business/sales spine. Use it only if a specifically relevant installed skill exists. |
|
|
89
|
+
| GSD | No default business/sales spine. Do not force a software phase workflow onto non-technical analysis. |
|
|
90
|
+
|
|
91
|
+
Option 4 default: Compound Engineering or a dedicated business/marketing/sales skill. Use web research when current market facts matter. Any publication, message, CRM write, social post, or external comment requires `post-web` approval.
|
|
92
|
+
|
|
93
|
+
## Spine ownership rules
|
|
94
|
+
|
|
95
|
+
- One family owns task state, plan, and execution checkpoints.
|
|
96
|
+
- A supporting reviewer or scanner from outside the spine is allowed when it creates evidence rather than a second plan.
|
|
97
|
+
- Do not run two brainstorming systems, two planning systems, or two shipping systems for the same task by default.
|
|
98
|
+
- Switching spines is a recorded decision. Preserve the old artifacts, mark them superseded, and name the new authoritative plan.
|
|
99
|
+
- `lfg`, GSD ship commands, and branch-finishing skills do not override approval rules. Push, PR creation/web posting, main push, and PR merge stop at their corresponding gate.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Session ledger
|
|
2
|
+
|
|
3
|
+
Every Auto Mode task keeps durable Markdown records.
|
|
4
|
+
|
|
5
|
+
## Location
|
|
6
|
+
|
|
7
|
+
Default:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
.agent-work/sessions/<YYYY-MM-DD>-<short-task-slug>/
|
|
11
|
+
├── session.md
|
|
12
|
+
├── plan.md
|
|
13
|
+
├── decisions.md
|
|
14
|
+
├── lessons.md # created once at close
|
|
15
|
+
└── evidence/ # only when the repo has no equivalent evidence location
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Follow an existing repository convention when it provides an equivalent location. If the working directory is not writable, ask the user for an artifact directory rather than losing the ledger.
|
|
19
|
+
|
|
20
|
+
## One source of planning truth
|
|
21
|
+
|
|
22
|
+
The selected workflow family's native plan remains authoritative:
|
|
23
|
+
|
|
24
|
+
- Compound Engineering: its generated brainstorm/plan document.
|
|
25
|
+
- Superpowers: its generated design/implementation plan.
|
|
26
|
+
- GSD: `.planning/` state and phase plans.
|
|
27
|
+
- No technical spine: `plan.md` in the neutral session folder.
|
|
28
|
+
|
|
29
|
+
The neutral `plan.md` is an index when a native plan exists. It records the goal, acceptance criteria, current phase, and a link/path to the authoritative plan; it does not duplicate the full plan.
|
|
30
|
+
|
|
31
|
+
## `session.md`
|
|
32
|
+
|
|
33
|
+
Record:
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
# Auto Mode Session
|
|
37
|
+
|
|
38
|
+
- Status: ready | active | blocked | completed | superseded
|
|
39
|
+
- Work context: job-client | personal
|
|
40
|
+
- Branding: client-project-only | existing-project-opt-in
|
|
41
|
+
- Work type: 1..7 — <label>
|
|
42
|
+
- Skill mode: 1..4
|
|
43
|
+
- Primary spine: compound-engineering | superpowers | gsd | none
|
|
44
|
+
- Current phase: intake | analysis | plan | build | verify | review | security | lessons | commit
|
|
45
|
+
- Authoritative plan: <path or none>
|
|
46
|
+
- Stage A model: <exact live selector>
|
|
47
|
+
- Stage B model: <exact live selector or n/a>
|
|
48
|
+
- Stage C model: <exact live selector>
|
|
49
|
+
- Stage D model: <exact live selector or n/a>
|
|
50
|
+
- Model separation: A != C; B != D
|
|
51
|
+
- CodeGraph: n/a | pending | ready | blocked
|
|
52
|
+
- Runtime: advisor=<off|available|on|unavailable>; orchestration=<serial|task|workflowz>; checkpoint=<off|available|used>
|
|
53
|
+
- Add-ons: Ponytail=<setting>; memory=<off|local|hindsight-recall|hindsight-retain>; language skills=<names or none>; cost=<posture>
|
|
54
|
+
- Verification: tests=<state>; DAP=<state>; UI=<browser|desktop|n/a and state>; security=<state>
|
|
55
|
+
- Review verdict: pending | ship | block
|
|
56
|
+
- Collaboration: off | view-approved | write-approved
|
|
57
|
+
- Commit: not-ready | offered | created | skipped
|
|
58
|
+
- Approval policy: ask
|
|
59
|
+
- Lessons: pending | complete
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Append a short evidence index as the work progresses, including unavailable or skipped verification gates and their consequence. Do not store secrets, credentials, private tokens, or unnecessary personal/client data.
|
|
63
|
+
|
|
64
|
+
## `decisions.md`
|
|
65
|
+
|
|
66
|
+
Use stable IDs:
|
|
67
|
+
|
|
68
|
+
```markdown
|
|
69
|
+
## D-001 — <decision>
|
|
70
|
+
|
|
71
|
+
- Status: proposed | confirmed | superseded
|
|
72
|
+
- Reason: <why>
|
|
73
|
+
- Consequence: <what this changes>
|
|
74
|
+
- Source: user | repository | evidence-backed recommendation
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Record material product, architecture, security, scope, model, skill-spine, and approval decisions. Do not fill the file with routine implementation details already obvious from code.
|
|
78
|
+
|
|
79
|
+
## `plan.md`
|
|
80
|
+
|
|
81
|
+
At minimum record:
|
|
82
|
+
|
|
83
|
+
- user-visible goal;
|
|
84
|
+
- acceptance evidence;
|
|
85
|
+
- highest-cost failure modes;
|
|
86
|
+
- ordered phases or link to the authoritative native plan;
|
|
87
|
+
- verification and review gates;
|
|
88
|
+
- protected external actions still requiring approval.
|
|
89
|
+
|
|
90
|
+
## Completion
|
|
91
|
+
|
|
92
|
+
Only set `Status: completed` when acceptance evidence exists and `lessons.md` has `run_count: 1`. A clean Git tree alone is not completion evidence.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codegraph-first
|
|
3
|
+
description: Establish CodeGraph as the architecture, dependency, flow, and impact authority for PiMarg work on an existing repository. Use for work types 2 through 6 before repository-wide claims; initialize and verify the graph, then combine it with any detected LSP/AST tools and precise reads.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CodeGraph First
|
|
7
|
+
|
|
8
|
+
Use CodeGraph as the source-navigation authority for an existing repository.
|
|
9
|
+
|
|
10
|
+
## Bootstrap gate
|
|
11
|
+
|
|
12
|
+
Before searching, reading, explaining, planning against, editing, or reviewing source code:
|
|
13
|
+
|
|
14
|
+
1. Resolve and record the exact Git repository root. Do not guess a repository path.
|
|
15
|
+
2. Check `command -v codegraph`.
|
|
16
|
+
3. If the CLI is missing, pause source-code work and ask to install `@colbymchenry/codegraph`. Do not silently download or globally install it.
|
|
17
|
+
4. If `<repo>/.codegraph/` is missing, run `codegraph init <repo>`. This is the required repo-local initialization for work types 2–6.
|
|
18
|
+
5. Run `codegraph status <repo>` and require a usable index before continuing.
|
|
19
|
+
|
|
20
|
+
On OMP, the package's `.mcp.json` can start `codegraph serve --mcp`; prefer `codegraph_explore`. On Pi, or when MCP is unavailable, use the verified CLI through `bash`. Invoke only subcommands shown by the installed version's help; CodeGraph versions may differ.
|
|
21
|
+
|
|
22
|
+
## Source intelligence rule
|
|
23
|
+
|
|
24
|
+
- Use CodeGraph for architecture, dependency relationships, call/data flows, candidate file discovery, and blast-radius analysis.
|
|
25
|
+
- After CodeGraph establishes the relevant scope, use LSP when detected for exact definitions, references, types, diagnostics, code actions, and safe renames.
|
|
26
|
+
- Use detected AST tooling for bounded structural queries and previewable rewrites when that is safer than text editing.
|
|
27
|
+
- Treat source returned by CodeGraph as read. Do not re-run grep, ripgrep, glob, or a file-by-file crawl to verify it.
|
|
28
|
+
- A direct file read is allowed only after CodeGraph identifies the precise file or symbol and an edit/hash-aware tool, compiler error, test failure, or exact-line verification needs the bytes.
|
|
29
|
+
- Git status, Git diff, test output, build metadata, documentation, configuration, generated artifacts, and non-code text are not source discovery and may use their normal tools.
|
|
30
|
+
- If CodeGraph does not support or cannot index the relevant source, stop structural discovery and report the exact limitation. LSP may still answer an exact symbol question when its language server is healthy; ask before falling back to grep/glob for source code.
|
|
31
|
+
|
|
32
|
+
## Change loop
|
|
33
|
+
|
|
34
|
+
Before an edit, use `impact` or the blast-radius result when shared behavior may change. After edits, honor the CodeGraph staleness/sync signal, then use `affected` to choose tests where relevant. Record the graph status and important paths in the Auto Mode evidence ledger.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: session-lessons
|
|
3
|
+
description: Close an Auto Mode session by extracting verified, reusable lessons into Markdown exactly once. Use immediately before final completion or when `/auto-close` is invoked; do not use repeatedly during the same session.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Session Lessons
|
|
7
|
+
|
|
8
|
+
Find the active Auto Mode ledger. If `lessons.md` already contains `run_count: 1`, report that lessons are already complete and do not rewrite it.
|
|
9
|
+
|
|
10
|
+
Otherwise:
|
|
11
|
+
|
|
12
|
+
1. Read `session.md`, `plan.md`, `decisions.md`, the authoritative plan, and verification/review evidence.
|
|
13
|
+
2. Separate observed evidence from guesses. Do not turn routine steps into durable lessons.
|
|
14
|
+
3. Create `lessons.md` with YAML frontmatter:
|
|
15
|
+
|
|
16
|
+
```yaml
|
|
17
|
+
---
|
|
18
|
+
run_count: 1
|
|
19
|
+
session_status: completed
|
|
20
|
+
---
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
4. Record only these useful sections:
|
|
24
|
+
- Outcome and evidence.
|
|
25
|
+
- What worked and should be repeated.
|
|
26
|
+
- What failed or surprised us.
|
|
27
|
+
- Reusable lesson or guardrail.
|
|
28
|
+
- Remaining unknowns or follow-up.
|
|
29
|
+
5. Update `session.md` to `Lessons: complete`. Set the session status to `completed` only if the requested outcome is genuinely complete.
|
|
30
|
+
6. When native `learn` or Hindsight `retain` is available and the recorded context policy permits it, save only the verified reusable guardrail and material decision summary. The Markdown lesson remains the durable session record even if memory retention fails.
|
|
31
|
+
|
|
32
|
+
When Compound Engineering is the primary spine and the result contains a non-obvious repository learning, `ce-compound` may be used as the learning engine before writing this record. Do not invoke it for routine work just to satisfy ceremony. For every other case, this skill itself is the required once-per-session lesson step.
|
|
33
|
+
|
|
34
|
+
Never include secrets or unnecessary employer/client information in the lessons file.
|