@anhlp/alp-core 0.0.0-beta.1

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 (144) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +7 -0
  3. package/README.md +7 -0
  4. package/dist/adapter.d.ts +20 -0
  5. package/dist/adapter.js +30 -0
  6. package/dist/atomic.d.ts +2 -0
  7. package/dist/atomic.js +28 -0
  8. package/dist/backup.d.ts +27 -0
  9. package/dist/backup.js +582 -0
  10. package/dist/beads.d.ts +65 -0
  11. package/dist/beads.js +213 -0
  12. package/dist/delegation.d.ts +2 -0
  13. package/dist/delegation.js +32 -0
  14. package/dist/errors.d.ts +4 -0
  15. package/dist/errors.js +11 -0
  16. package/dist/formulas.d.ts +25 -0
  17. package/dist/formulas.js +201 -0
  18. package/dist/hook-run.d.ts +44 -0
  19. package/dist/hook-run.js +60 -0
  20. package/dist/hooks.d.ts +35 -0
  21. package/dist/hooks.js +30 -0
  22. package/dist/index.d.ts +30 -0
  23. package/dist/index.js +63 -0
  24. package/dist/init.d.ts +30 -0
  25. package/dist/init.js +88 -0
  26. package/dist/library-edit.d.ts +90 -0
  27. package/dist/library-edit.js +315 -0
  28. package/dist/library.d.ts +28 -0
  29. package/dist/library.js +108 -0
  30. package/dist/log.d.ts +37 -0
  31. package/dist/log.js +156 -0
  32. package/dist/migrations.d.ts +9 -0
  33. package/dist/migrations.js +95 -0
  34. package/dist/models.d.ts +11 -0
  35. package/dist/models.js +44 -0
  36. package/dist/permissions.d.ts +14 -0
  37. package/dist/permissions.js +229 -0
  38. package/dist/profiles.d.ts +27 -0
  39. package/dist/profiles.js +122 -0
  40. package/dist/promptsafe.d.ts +1 -0
  41. package/dist/promptsafe.js +13 -0
  42. package/dist/providers.d.ts +90 -0
  43. package/dist/providers.js +101 -0
  44. package/dist/resolver.d.ts +41 -0
  45. package/dist/resolver.js +240 -0
  46. package/dist/safe-path.d.ts +2 -0
  47. package/dist/safe-path.js +24 -0
  48. package/dist/shell.d.ts +16 -0
  49. package/dist/shell.js +22 -0
  50. package/dist/state-schema.d.ts +9 -0
  51. package/dist/state-schema.js +54 -0
  52. package/dist/task-rows.d.ts +47 -0
  53. package/dist/task-rows.js +45 -0
  54. package/dist/tasks.d.ts +128 -0
  55. package/dist/tasks.js +835 -0
  56. package/dist/teams.d.ts +69 -0
  57. package/dist/teams.js +159 -0
  58. package/dist/template-path.d.ts +2 -0
  59. package/dist/template-path.js +10 -0
  60. package/dist/trust.d.ts +8 -0
  61. package/dist/trust.js +47 -0
  62. package/dist/types.d.ts +51 -0
  63. package/dist/upgrade.d.ts +10 -0
  64. package/dist/upgrade.js +200 -0
  65. package/dist/user-settings.d.ts +6 -0
  66. package/dist/user-settings.js +72 -0
  67. package/dist/validation.d.ts +17 -0
  68. package/dist/validation.js +295 -0
  69. package/dist/verify.d.ts +15 -0
  70. package/dist/verify.js +123 -0
  71. package/dist/workflow.d.ts +14 -0
  72. package/dist/workflow.js +24 -0
  73. package/package.json +309 -0
  74. package/src/adapter.d.ts +20 -0
  75. package/src/adapter.js +29 -0
  76. package/src/atomic.d.ts +2 -0
  77. package/src/atomic.js +28 -0
  78. package/src/backup.d.ts +27 -0
  79. package/src/backup.js +570 -0
  80. package/src/beads.js +236 -0
  81. package/src/delegation.js +28 -0
  82. package/src/errors.js +7 -0
  83. package/src/formulas.d.ts +25 -0
  84. package/src/formulas.js +202 -0
  85. package/src/hook-run.js +57 -0
  86. package/src/hooks.js +36 -0
  87. package/src/index.js +31 -0
  88. package/src/init.js +92 -0
  89. package/src/library-edit.js +346 -0
  90. package/src/library.js +117 -0
  91. package/src/log.d.ts +37 -0
  92. package/src/log.js +177 -0
  93. package/src/migrations.d.ts +9 -0
  94. package/src/migrations.js +111 -0
  95. package/src/models.js +45 -0
  96. package/src/permissions.d.ts +14 -0
  97. package/src/permissions.js +242 -0
  98. package/src/profiles.js +139 -0
  99. package/src/promptsafe.d.ts +1 -0
  100. package/src/promptsafe.js +19 -0
  101. package/src/providers.js +122 -0
  102. package/src/resolver.js +238 -0
  103. package/src/safe-path.js +20 -0
  104. package/src/shell.js +28 -0
  105. package/src/state-schema.d.ts +9 -0
  106. package/src/state-schema.js +60 -0
  107. package/src/task-rows.js +44 -0
  108. package/src/tasks.d.ts +128 -0
  109. package/src/tasks.js +881 -0
  110. package/src/teams.js +170 -0
  111. package/src/template-path.js +8 -0
  112. package/src/trust.js +59 -0
  113. package/src/types.d.ts +51 -0
  114. package/src/upgrade.js +195 -0
  115. package/src/user-settings.d.ts +6 -0
  116. package/src/user-settings.js +76 -0
  117. package/src/validation.d.ts +17 -0
  118. package/src/validation.js +302 -0
  119. package/src/verify.d.ts +15 -0
  120. package/src/verify.js +127 -0
  121. package/src/workflow.js +28 -0
  122. package/templates/ALP.md +52 -0
  123. package/templates/agents/lead/AGENT.md +90 -0
  124. package/templates/agents/main/AGENT.md +150 -0
  125. package/templates/agents/oracle/AGENT.md +44 -0
  126. package/templates/agents/peer/AGENT.md +55 -0
  127. package/templates/agents/reviewer/AGENT.md +80 -0
  128. package/templates/agents/supervisor/AGENT.md +72 -0
  129. package/templates/providers/antigravity.json +6 -0
  130. package/templates/providers/opencode.json +7 -0
  131. package/templates/role-skills.json +8 -0
  132. package/templates/skills/bug-loop/SKILL.md +44 -0
  133. package/templates/skills/bug-loop/references/test-proof.md +25 -0
  134. package/templates/skills/goal-griller/SKILL.md +49 -0
  135. package/templates/skills/prompt-leverage/SKILL.md +37 -0
  136. package/templates/skills/prompt-leverage/references/brief-template.md +27 -0
  137. package/templates/skills/sequence-execution-plan/SKILL.md +42 -0
  138. package/templates/skills/sequence-execution-plan/references/plan-template.md +22 -0
  139. package/templates/skills/smart-commits/SKILL.md +40 -0
  140. package/templates/skills/xia/SKILL.md +42 -0
  141. package/templates/teams/cafe/HOUSE_RULES.md +1 -0
  142. package/templates/teams/cafe/team.json +15 -0
  143. package/templates/teams/pho/HOUSE_RULES.md +1 -0
  144. package/templates/teams/pho/team.json +14 -0
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: sequence-execution-plan
3
+ description: Order multiple ALP work items by real dependencies, verification, and writer ownership. Use when Main or Lead coordinates several outcomes or must replan after a blocker, changed premise, or rejection.
4
+ ---
5
+
6
+ # Order executable work
7
+
8
+ Use the task contract and available evidence. Planning authority comes from the
9
+ current assignment: main coordinates the overall outcome; lead plans technical
10
+ execution within its assigned scope. A peer reports dependencies instead of
11
+ reassigning ownership or widening the plan.
12
+
13
+ Separate urgency from dependency order. A lower-priority prerequisite may need to
14
+ run first, but it does not close the higher-priority outcome. A mitigation reduces
15
+ current impact; it is not proof of a durable fix.
16
+
17
+ Build small work items that each deliver observable progress. Keep implementation
18
+ and its direct verification together. Split when an unresolved decision blocks one
19
+ part, separate outcomes need independent acceptance, or a resource/human wait would
20
+ stall unrelated work. Do not impose a fixed task count on a simple change.
21
+
22
+ For each item identify the result, owner, owned/excluded paths, true prerequisites,
23
+ verification seam, completion evidence, and current state. Distinguish necessary
24
+ foundations from optional improvements and speculative future abstractions.
25
+
26
+ Arrange Now, Next, and Later using causal explanations: which prerequisite blocks
27
+ which outcome, which check validates it, and which decision opens the next branch.
28
+ Read [the plan format](references/plan-template.md) when a durable multi-item plan
29
+ helps. Use the project's existing plan location; do not create unrelated ignore
30
+ rules or a new planning hierarchy just to satisfy this skill.
31
+
32
+ Current Paseo delegation is sequential: each parent waits for one child's result.
33
+ Do not promise parallel workers or live upstream mailboxes. A shared checkout has
34
+ one writer at a time; main intervention requires ownership to be released first.
35
+ Allocate ports, scratch paths, and other exclusive resources if the assignment uses
36
+ them. Separate worktrees alone do not isolate ports or a shared database.
37
+
38
+ Replan when evidence changes a premise, a dependency blocks work, the user changes
39
+ scope, or repeated rejection reveals that the assignment needs restructuring.
40
+ Update the facts and constraints before issuing a revised brief. Preserve unfinished
41
+ acceptance criteria when merging items. Candidate remains candidate until the
42
+ responsible reviewer has evaluated the actual evidence.
@@ -0,0 +1,22 @@
1
+ # Proportional plan format
2
+
3
+ Use the relevant fields; a plan is a decision aid, not a form-completion exercise.
4
+
5
+ ```text
6
+ Outcome and acceptance evidence:
7
+ User constraints and their sources:
8
+ Current facts / technical assumptions:
9
+
10
+ ID | Result | Owner | Owned/excluded scope | Prerequisites | Verification | State
11
+
12
+ Now:
13
+ Next (and what unlocks it):
14
+ Later:
15
+ Writer/resource allocation:
16
+ Open decisions and blockers:
17
+ Replan reason, when applicable:
18
+ ```
19
+
20
+ States can be ready, blocked, running, candidate, accepted, or rejected. An item is
21
+ accepted based on artifacts and verification; a successful process exit is not an
22
+ acceptance criterion by itself. Omit branch/SHA fields in non-Git projects.
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: smart-commits
3
+ description: Package existing owned changes into focused local Git commits with verification evidence. Use when commits are requested or part of the assigned handoff; do not activate merely because a file was edited.
4
+ ---
5
+
6
+ # Package the authorized changes
7
+
8
+ Confirm this is a Git repository and that local commits belong to the requested
9
+ deliverable. A non-Git task returns file artifacts; do not initialize Git merely to
10
+ produce a SHA. A read-only task cannot commit. Existing user authorization remains
11
+ valid; the skill adds no confirmation gate or permission to push.
12
+
13
+ Inspect the root, branch, status, unresolved merges, staged paths, and staged/unstaged
14
+ diffs with Git commands. Verify any supplied base revision. Preserve work outside
15
+ the assignment. If unrelated staged changes would enter the commit, stop packaging
16
+ and report the conflict without resetting or unstaging someone else's work.
17
+
18
+ Group changes by behavior and intent. Keep implementation and its direct tests
19
+ together where useful. Read each included diff and stage only the owned paths or
20
+ hunks. Avoid whole-tree staging in a shared checkout. Do not add unrelated fixes or
21
+ formatting to make a commit easier.
22
+
23
+ Run the relevant checks from the project/brief, reusing recent results when still
24
+ applicable. State failures and omissions accurately. If hooks may cause external
25
+ side effects, inspect their configured behavior before invoking them and stay within
26
+ the task's authorization. Do not bypass hooks or protections to get a green commit.
27
+
28
+ Create focused messages explaining the change and its purpose, following the
29
+ repository's convention. Check commit success before reading the candidate SHA.
30
+ Verify that the candidate contains only the intended scope and that the base
31
+ relationship is valid when a base was supplied. A failed commit produces no new
32
+ candidate, and an already-clean tree needs no empty commit.
33
+
34
+ Do not rewrite a candidate already handed off for review. Corrections should be
35
+ new commits unless rewriting was specifically agreed. Push requires existing explicit
36
+ authorization for the intended remote/branch; a configured remote does not provide it.
37
+
38
+ Return root, branch, actual base/candidate SHAs, commit summary, owned scope, checks
39
+ and results, remaining work, and push status. Lead/main still review the artifact;
40
+ the writer does not self-accept its work.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: xia
3
+ description: Research an unfamiliar implementation, reuse opportunity, or version-sensitive integration using local artifacts and primary sources. Return an evidence-backed recommendation before implementation; do not expand the assigned scope.
4
+ ---
5
+
6
+ # Research before building
7
+
8
+ Start with a named question that affects a decision. Use a short local inspection
9
+ when the relevant seam is clear; broaden to upstream sources only when the question
10
+ requires it. Research is read-only with respect to project artifacts. Temporary
11
+ experiments require an available isolated scratch location and appropriate authority.
12
+
13
+ 1. Establish the actual stack from manifests, lockfiles, configuration, and commands.
14
+ Read ALP.md and relevant project guidance. Do not infer a stack from folder names.
15
+ 2. Search nearby code, tests, configuration, scripts, and docs for existing behavior
16
+ and reusable parts. Record the scope searched before saying something is absent.
17
+ 3. For external behavior, inspect primary upstream source/examples and official
18
+ documentation matching the installed version. Distinguish current guidance from
19
+ the version this project actually uses.
20
+ 4. Compare viable approaches only where the choice matters. Prefer an existing
21
+ local capability, then a supported dependency capability, then a small adaptation.
22
+ Explain what evidence would change the recommendation.
23
+
24
+ Label significant findings by evidence type:
25
+
26
+ - Local: file path, command output, test, or repository revision.
27
+ - Upstream: repository URL and revision when available.
28
+ - Docs: official source and applicable version.
29
+ - Inference: a conclusion drawn from the cited evidence, with uncertainty stated.
30
+
31
+ If browsing is unavailable, return the local findings and the unresolved external
32
+ question. Do not invent a source or claim version compatibility without evidence.
33
+ Research does not authorize installing dependencies, editing code, or deploying.
34
+
35
+ Return the question, findings/sources, reuse candidates, recommendation, alternatives
36
+ if material, unknowns, and the next decision. Include actual inspection commands and
37
+ results in the handoff. A peer returns this to lead; lead returns unresolved scope
38
+ decisions to main. Main can decide technical matters within the user's authorization.
39
+
40
+ Use available synchronous delegation for a separate research assignment only when
41
+ helpful. Do not assume a Scout role or parallel session exists; research is a peer
42
+ disposition. An agent can inspect evidence itself without spawning another agent.
@@ -0,0 +1 @@
1
+ In Phở (pho), main implements or directly delegates to peer; do not create lead. In Cafe (cafe), main supervises lead; lead may implement or delegate to peer. The technical coordinator chooses each peer's model and effort. Use oracle for significant uncertainty; use reviewer for logic changes and risky changes, not mandatory for typo/format fixes. Advisors return only to their requesting coordinator.
@@ -0,0 +1,15 @@
1
+ {
2
+ "label": "Cafe",
3
+ "description": "Main supervises lead, who implements or delegates to peer; a supervisor reviews the process.",
4
+ "main": "main",
5
+ "members": {
6
+ "main": { "model": "claude:claude-opus-5-5", "thinking": "high" },
7
+ "lead": { "role": "lead" },
8
+ "peer": { "role": "peer" },
9
+ "oracle": { "role": "advisor" },
10
+ "reviewer": { "role": "reviewer" }
11
+ },
12
+ "delegation": { "main": ["lead", "oracle", "reviewer"], "lead": ["peer", "oracle", "reviewer"] },
13
+ "maxPeers": 2,
14
+ "supervisor": { "agent": "supervisor", "model": "claude:claude-sonnet-5", "thinking": "medium" }
15
+ }
@@ -0,0 +1 @@
1
+ In Phở (pho), main implements or directly delegates to peer; do not create lead. In Cafe (cafe), main supervises lead; lead may implement or delegate to peer. The technical coordinator chooses each peer's model and effort. Use oracle for significant uncertainty; use reviewer for logic changes and risky changes, not mandatory for typo/format fixes. Advisors return only to their requesting coordinator.
@@ -0,0 +1,14 @@
1
+ {
2
+ "label": "Phở",
3
+ "description": "Main implements or delegates to peer; a supervisor reviews the process.",
4
+ "main": "main",
5
+ "members": {
6
+ "main": { "model": "claude:claude-opus-5-5", "thinking": "high" },
7
+ "peer": { "role": "peer" },
8
+ "oracle": { "role": "advisor" },
9
+ "reviewer": { "role": "reviewer" }
10
+ },
11
+ "delegation": { "main": ["peer", "oracle", "reviewer"] },
12
+ "maxPeers": 2,
13
+ "supervisor": { "agent": "supervisor", "model": "claude:claude-sonnet-5", "thinking": "medium" }
14
+ }